Chromium Code Reviews

Side by Side Diff: third_party/sqlite/src/test/ioerr.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, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « third_party/sqlite/src/test/io.test ('k') | third_party/sqlite/src/test/ioerr2.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 # 2001 October 12 1 # 2001 October 12
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 165 matching lines...)
176 do_ioerr_test ioerr-7 -tclprep { 176 do_ioerr_test ioerr-7 -tclprep {
177 db close 177 db close
178 sqlite3 db2 test2.db 178 sqlite3 db2 test2.db
179 db2 eval { 179 db2 eval {
180 PRAGMA synchronous = 0; 180 PRAGMA synchronous = 0;
181 CREATE TABLE t1(a, b); 181 CREATE TABLE t1(a, b);
182 INSERT INTO t1 VALUES(1, 2); 182 INSERT INTO t1 VALUES(1, 2);
183 BEGIN; 183 BEGIN;
184 INSERT INTO t1 VALUES(3, 4); 184 INSERT INTO t1 VALUES(3, 4);
185 } 185 }
186 copy_file test2.db test.db 186 forcecopy test2.db test.db
187 copy_file test2.db-journal test.db-journal 187 forcecopy test2.db-journal test.db-journal
188 db2 close 188 db2 close
189 } -tclbody { 189 } -tclbody {
190 sqlite3 db test.db 190 sqlite3 db test.db
191 db eval { 191 db eval {
192 SELECT * FROM t1; 192 SELECT * FROM t1;
193 } 193 }
194 } -exclude 1 194 } -exclude 1
195 } 195 }
196 196
197 # For test coverage: Cause an I/O failure while trying to read a 197 # For test coverage: Cause an I/O failure while trying to read a
(...skipping 14 matching lines...)
212 # For test coverage: Cause an IO error whilst reading the master-journal 212 # For test coverage: Cause an IO error whilst reading the master-journal
213 # name from a journal file. 213 # name from a journal file.
214 if {$tcl_platform(platform)=="unix"} { 214 if {$tcl_platform(platform)=="unix"} {
215 do_ioerr_test ioerr-9 -ckrefcount true -tclprep { 215 do_ioerr_test ioerr-9 -ckrefcount true -tclprep {
216 execsql { 216 execsql {
217 CREATE TABLE t1(a,b,c); 217 CREATE TABLE t1(a,b,c);
218 INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2); 218 INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2);
219 BEGIN; 219 BEGIN;
220 INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2); 220 INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2);
221 } 221 }
222 copy_file test.db-journal test2.db-journal 222 forcecopy test.db-journal test2.db-journal
223 execsql { 223 execsql {
224 COMMIT; 224 COMMIT;
225 } 225 }
226 copy_file test2.db-journal test.db-journal 226 forcecopy test2.db-journal test.db-journal
227 set f [open test.db-journal a] 227 set f [open test.db-journal a]
228 fconfigure $f -encoding binary 228 fconfigure $f -encoding binary
229 puts -nonewline $f "hello" 229 puts -nonewline $f "hello"
230 puts -nonewline $f "\x00\x00\x00\x05\x01\x02\x03\x04" 230 puts -nonewline $f "\x00\x00\x00\x05\x01\x02\x03\x04"
231 puts -nonewline $f "\xd9\xd5\x05\xf9\x20\xa1\x63\xd7" 231 puts -nonewline $f "\xd9\xd5\x05\xf9\x20\xa1\x63\xd7"
232 close $f 232 close $f
233 } -sqlbody { 233 } -sqlbody {
234 SELECT a FROM t1; 234 SELECT a FROM t1;
235 } 235 }
236 } 236 }
(...skipping 14 matching lines...)
251 } -tclbody { 251 } -tclbody {
252 252
253 catch {execsql { 253 catch {execsql {
254 BEGIN; 254 BEGIN;
255 INSERT INTO t1 VALUES('abc', 123); 255 INSERT INTO t1 VALUES('abc', 123);
256 INSERT INTO t1 VALUES('def', 123); 256 INSERT INTO t1 VALUES('def', 123);
257 INSERT INTO t1 VALUES('ghi', 123); 257 INSERT INTO t1 VALUES('ghi', 123);
258 INSERT INTO t1 SELECT (a+500)%900, 'good string' FROM t1; 258 INSERT INTO t1 SELECT (a+500)%900, 'good string' FROM t1;
259 }} msg 259 }} msg
260 260
261 if {$msg != "column a is not unique"} { 261 if {$msg != "UNIQUE constraint failed: t1.a"} {
262 error $msg 262 error $msg
263 } 263 }
264 } 264 }
265 265
266 # Assertion fault bug reported by alex dimitrov. 266 # Assertion fault bug reported by alex dimitrov.
267 # 267 #
268 do_ioerr_test ioerr-11 -ckrefcount true -erc 1 -sqlprep { 268 do_ioerr_test ioerr-11 -ckrefcount true -erc 1 -sqlprep {
269 CREATE TABLE A(Id INTEGER, Name TEXT); 269 CREATE TABLE A(Id INTEGER, Name TEXT);
270 INSERT INTO A(Id, Name) VALUES(1, 'Name'); 270 INSERT INTO A(Id, Name) VALUES(1, 'Name');
271 } -sqlbody { 271 } -sqlbody {
(...skipping 184 matching lines...)
456 PRAGMA cache_size = 10; 456 PRAGMA cache_size = 10;
457 BEGIN; 457 BEGIN;
458 DELETE FROM t1 WHERE rowid IN (10,11,12) ; 458 DELETE FROM t1 WHERE rowid IN (10,11,12) ;
459 } -sqlbody { 459 } -sqlbody {
460 PRAGMA incremental_vacuum(10); 460 PRAGMA incremental_vacuum(10);
461 COMMIT; 461 COMMIT;
462 } 462 }
463 } 463 }
464 464
465 finish_test 465 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/io.test ('k') | third_party/sqlite/src/test/ioerr2.test » ('j') | no next file with comments »

Powered by Google App Engine