OLD | NEW |
1 # 2007 January 17 | 1 # 2007 January 17 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. | 3 # The author disclaims copyright to this source code. |
4 # | 4 # |
5 #************************************************************************* | 5 #************************************************************************* |
6 # This file implements regression tests for SQLite fts3 library. The | 6 # This file implements regression tests for SQLite fts3 library. The |
7 # focus here is testing handling of UPDATE when using UTF-16-encoded | 7 # focus here is testing handling of UPDATE when using UTF-16-encoded |
8 # databases. | 8 # databases. |
9 # | 9 # |
10 # $Id: fts3ai.test,v 1.1 2007/08/20 17:38:42 shess Exp $ | 10 # $Id: fts3ai.test,v 1.1 2007/08/20 17:38:42 shess Exp $ |
11 # | 11 # |
12 | 12 |
13 set testdir [file dirname $argv0] | 13 set testdir [file dirname $argv0] |
14 source $testdir/tester.tcl | 14 source $testdir/tester.tcl |
15 | 15 |
16 # If SQLITE_ENABLE_FTS3 is defined, omit this file. | 16 # If SQLITE_ENABLE_FTS3 is defined, omit this file. |
17 ifcapable !fts3 { | 17 ifcapable !fts3 { |
18 finish_test | 18 finish_test |
19 return | 19 return |
20 } | 20 } |
21 | 21 |
| 22 ifcapable !utf16 { |
| 23 finish_test |
| 24 return |
| 25 } |
| 26 |
22 # Return the UTF-16 representation of the supplied UTF-8 string $str. | 27 # Return the UTF-16 representation of the supplied UTF-8 string $str. |
23 # If $nt is true, append two 0x00 bytes as a nul terminator. | 28 # If $nt is true, append two 0x00 bytes as a nul terminator. |
24 # NOTE(shess) Copied from capi3.test. | 29 # NOTE(shess) Copied from capi3.test. |
25 proc utf16 {str {nt 1}} { | 30 proc utf16 {str {nt 1}} { |
26 set r [encoding convertto unicode $str] | 31 set r [encoding convertto unicode $str] |
27 if {$nt} { | 32 if {$nt} { |
28 append r "\x00\x00" | 33 append r "\x00\x00" |
29 } | 34 } |
30 return $r | 35 return $r |
31 } | 36 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 sqlite3_step $STMT | 83 sqlite3_step $STMT |
79 sqlite3_finalize $STMT | 84 sqlite3_finalize $STMT |
80 set sql "UPDATE t1 SET content = 'cinq' WHERE rowid = 5" | 85 set sql "UPDATE t1 SET content = 'cinq' WHERE rowid = 5" |
81 set STMT [sqlite3_prepare $DB $sql -1 TAIL] | 86 set STMT [sqlite3_prepare $DB $sql -1 TAIL] |
82 sqlite3_step $STMT | 87 sqlite3_step $STMT |
83 sqlite3_finalize $STMT | 88 sqlite3_finalize $STMT |
84 execsql {SELECT content FROM t1 WHERE rowid = 5} | 89 execsql {SELECT content FROM t1 WHERE rowid = 5} |
85 } {cinq} | 90 } {cinq} |
86 | 91 |
87 finish_test | 92 finish_test |
OLD | NEW |