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

Unified Diff: third_party/sqlite/src/test/corruptE.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/corruptD.test ('k') | third_party/sqlite/src/test/corruptF.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/corruptE.test
diff --git a/third_party/sqlite/src/test/corruptE.test b/third_party/sqlite/src/test/corruptE.test
index a47adba1f18ad9dcd0188aadf2a636ac8646f618..4d5b5db3d680134abb8731b88e14d43ca8fe1564 100644
--- a/third_party/sqlite/src/test/corruptE.test
+++ b/third_party/sqlite/src/test/corruptE.test
@@ -16,8 +16,6 @@
#
# $Id: corruptE.test,v 1.14 2009/07/11 06:55:34 danielk1977 Exp $
-catch {file delete -force test.db test.db-journal test.bu}
-
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -26,6 +24,10 @@ source $testdir/tester.tcl
#
do_not_use_codec
+# These tests deal with corrupt database files
+#
+database_may_be_corrupt
+
# Do not run the tests in this file if ENABLE_OVERSIZE_CELL_CHECK is on.
#
ifcapable oversize_cell_check {
@@ -51,7 +53,7 @@ do_test corruptE-1.1 {
INSERT OR IGNORE INTO t1 SELECT x*17,y FROM t1;
INSERT OR IGNORE INTO t1 SELECT x*19,y FROM t1;
CREATE INDEX t1i1 ON t1(x);
- CREATE TABLE t2 AS SELECT x,2 as y FROM t1 WHERE rowid%5!=0;
+ CREATE TABLE t2 AS SELECT x,2 as y FROM t1 WHERE rowid%5!=0 ORDER BY rowid;
COMMIT;
}
} {}
@@ -60,23 +62,17 @@ ifcapable {integrityck} {
integrity_check corruptE-1.2
}
-# Copy file $from into $to
-#
-proc copy_file {from to} {
- file copy -force $from $to
-}
-
# Setup for the tests. Make a backup copy of the good database in test.bu.
#
db close
-copy_file test.db test.bu
+forcecopy test.db test.bu
sqlite3 db test.db
set fsize [file size test.db]
do_test corruptE-2.1 {
db close
- copy_file test.bu test.db
+ forcecopy test.bu test.db
# insert corrupt byte(s)
hexio_write test.db 2041 [format %02x 0x2e]
@@ -92,7 +88,7 @@ do_test corruptE-2.1 {
do_test corruptE-2.2 {
db close
- copy_file test.bu test.db
+ forcecopy test.bu test.db
# insert corrupt byte(s)
hexio_write test.db 2047 [format %02x 0x84]
@@ -108,7 +104,7 @@ do_test corruptE-2.2 {
do_test corruptE-2.3 {
db close
- copy_file test.bu test.db
+ forcecopy test.bu test.db
# insert corrupt byte(s)
hexio_write test.db 7420 [format %02x 0xa8]
@@ -124,7 +120,7 @@ do_test corruptE-2.3 {
do_test corruptE-2.4 {
db close
- copy_file test.bu test.db
+ forcecopy test.bu test.db
# insert corrupt byte(s)
hexio_write test.db 10233 [format %02x 0xd0]
@@ -165,7 +161,7 @@ set tc 1
foreach test $tests {
do_test corruptE-3.$tc {
db close
- copy_file test.bu test.db
+ forcecopy test.bu test.db
# insert corrupt byte(s)
hexio_write test.db [lindex $test 0] [format %02x [lindex $test 1]]
« no previous file with comments | « third_party/sqlite/src/test/corruptD.test ('k') | third_party/sqlite/src/test/corruptF.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698