Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: third_party/sqlite/src/test/enc4.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/enc3.test ('k') | third_party/sqlite/src/test/eqp.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2010 Sept 29 1 # 2010 Sept 29
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
(...skipping 25 matching lines...) Expand all
36 # vals 36 # vals
37 set vals [list\ 37 set vals [list\
38 "922337203685477580792233720368547758079223372036854775807"\ 38 "922337203685477580792233720368547758079223372036854775807"\
39 "100000000000000000000000000000000000000000000000000000000"\ 39 "100000000000000000000000000000000000000000000000000000000"\
40 "1.0000000000000000000000000000000000000000000000000000000"\ 40 "1.0000000000000000000000000000000000000000000000000000000"\
41 ] 41 ]
42 42
43 set i 1 43 set i 1
44 foreach enc $encodings { 44 foreach enc $encodings {
45 45
46 file delete -force test.db 46 forcedelete test.db
47 sqlite3 db test.db 47 sqlite3 db test.db
48 db eval "PRAGMA encoding = \"$enc\"" 48 db eval "PRAGMA encoding = \"$enc\""
49 49
50 do_test enc4-$i.1 { 50 do_test enc4-$i.1 {
51 db eval {PRAGMA encoding} 51 db eval {PRAGMA encoding}
52 } $enc 52 } $enc
53 53
54 set j 1 54 set j 1
55 foreach init $inits { 55 foreach init $inits {
56 56
57 do_test enc4-$i.$j.2 { 57 do_test enc4-$i.$j.2 {
58 set S [sqlite3_prepare_v2 db "SELECT $init+?" -1 dummy] 58 set S [sqlite3_prepare_v2 db "SELECT $init+?" -1 dummy]
59 sqlite3_expired $S 59 sqlite3_expired $S
60 } {0} 60 } {0}
61 61
62 set k 1 62 set k 1
63 foreach val $vals { 63 foreach val $vals {
64 for {set x 1} {$x<18} {incr x} { 64 for {set x 1} {$x<16} {incr x} {
65 set part [expr $init + [string range $val 0 [expr $x-1]]] 65 set part [expr $init + [string range $val 0 [expr $x-1]]]
66 regsub {e\+0} $part {e+} part
67 regsub {^1e} $part {1.0e} part
68 66
69 do_test enc4-$i.$j.$k.3.$x { 67 do_realnum_test enc4-$i.$j.$k.3.$x {
70 sqlite3_reset $S 68 sqlite3_reset $S
71 sqlite3_bind_text $S 1 $val $x 69 sqlite3_bind_text $S 1 $val $x
72 sqlite3_step $S 70 sqlite3_step $S
73 sqlite3_column_text $S 0 71 sqlite3_column_text $S 0
74 } [list $part] 72 } [list $part]
75 73
76 do_test enc4-$i.$j.$k.4.$x { 74 do_realnum_test enc4-$i.$j.$k.4.$x {
77 sqlite3_reset $S 75 sqlite3_reset $S
78 sqlite3_bind_text16 $S 1 [encoding convertto unicode $val] [expr $x*2] 76 sqlite3_bind_text16 $S 1 [encoding convertto unicode $val] [expr $x*2]
79 sqlite3_step $S 77 sqlite3_step $S
80 sqlite3_column_text $S 0 78 sqlite3_column_text $S 0
81 } [list $part] 79 } [list $part]
82 } 80 }
83 81
84 incr k 82 incr k
85 } 83 }
86 84
87 do_test enc4-$i.$j.5 { 85 do_test enc4-$i.$j.5 {
88 sqlite3_finalize $S 86 sqlite3_finalize $S
89 } {SQLITE_OK} 87 } {SQLITE_OK}
90 88
91 incr j 89 incr j
92 } 90 }
93 91
94 db close 92 db close
95 incr i 93 incr i
96 } 94 }
97 95
98 file delete -force test.db 96 forcedelete test.db
99 sqlite3 db test.db 97 sqlite3 db test.db
100 98
101 do_test enc4-4.1 { 99 do_test enc4-4.1 {
102 db eval "select 1+1." 100 db eval "select 1+1."
103 } {2.0} 101 } {2.0}
104 102
105 do_test enc4-4.2.1 { 103 do_test enc4-4.2.1 {
106 set S [sqlite3_prepare_v2 db "SELECT 1+1." -1 dummy] 104 set S [sqlite3_prepare_v2 db "SELECT 1+1." -1 dummy]
107 sqlite3_step $S 105 sqlite3_step $S
108 sqlite3_column_text $S 0 106 sqlite3_column_text $S 0
(...skipping 21 matching lines...) Expand all
130 sqlite3_column_text $S 0 128 sqlite3_column_text $S 0
131 } {2.0} 129 } {2.0}
132 130
133 do_test enc4-4.4.2 { 131 do_test enc4-4.4.2 {
134 sqlite3_finalize $S 132 sqlite3_finalize $S
135 } {SQLITE_OK} 133 } {SQLITE_OK}
136 134
137 db close 135 db close
138 136
139 finish_test 137 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/enc3.test ('k') | third_party/sqlite/src/test/eqp.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698