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

Unified Diff: third_party/sqlite/src/test/corrupt2.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/corrupt.test ('k') | third_party/sqlite/src/test/corrupt3.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/corrupt2.test
diff --git a/third_party/sqlite/src/test/corrupt2.test b/third_party/sqlite/src/test/corrupt2.test
index bdbc0165f47ceaf16b8115155e12fafcd13638fd..805a6148f0b4d8e48d0eb99b7475dde1bd140d55 100644
--- a/third_party/sqlite/src/test/corrupt2.test
+++ b/third_party/sqlite/src/test/corrupt2.test
@@ -23,6 +23,10 @@ source $testdir/tester.tcl
#
do_not_use_codec
+# These tests deal with corrupt database files
+#
+database_may_be_corrupt
+
set presql ""
catch { set presql "$::G(perm:presql);" }
unset -nocomplain ::G(perm:presql)
@@ -41,9 +45,9 @@ do_test corrupt2-1.1 {
do_test corrupt2-1.2 {
# Corrupt the 16 byte magic string at the start of the file
- file delete -force corrupt.db
- file delete -force corrupt.db-journal
- copy_file test.db corrupt.db
+ forcedelete corrupt.db
+ forcedelete corrupt.db-journal
+ forcecopy test.db corrupt.db
set f [open corrupt.db RDWR]
seek $f 8 start
puts $f blah
@@ -60,9 +64,9 @@ do_test corrupt2-1.3 {
db2 close
# Corrupt the page-size (bytes 16 and 17 of page 1).
- file delete -force corrupt.db
- file delete -force corrupt.db-journal
- copy_file test.db corrupt.db
+ forcedelete corrupt.db
+ forcedelete corrupt.db-journal
+ forcecopy test.db corrupt.db
set f [open corrupt.db RDWR]
fconfigure $f -encoding binary
seek $f 16 start
@@ -80,9 +84,9 @@ do_test corrupt2-1.4 {
db2 close
# Corrupt the free-block list on page 1.
- file delete -force corrupt.db
- file delete -force corrupt.db-journal
- copy_file test.db corrupt.db
+ forcedelete corrupt.db
+ forcedelete corrupt.db-journal
+ forcecopy test.db corrupt.db
set f [open corrupt.db RDWR]
fconfigure $f -encoding binary
seek $f 101 start
@@ -100,9 +104,9 @@ do_test corrupt2-1.5 {
db2 close
# Corrupt the free-block list on page 1.
- file delete -force corrupt.db
- file delete -force corrupt.db-journal
- copy_file test.db corrupt.db
+ forcedelete corrupt.db
+ forcedelete corrupt.db-journal
+ forcecopy test.db corrupt.db
set f [open corrupt.db RDWR]
fconfigure $f -encoding binary
seek $f 101 start
@@ -123,9 +127,9 @@ db2 close
# Corrupt a database by having 2 indices of the same name:
do_test corrupt2-2.1 {
- file delete -force corrupt.db
- file delete -force corrupt.db-journal
- copy_file test.db corrupt.db
+ forcedelete corrupt.db
+ forcedelete corrupt.db-journal
+ forcecopy test.db corrupt.db
sqlite3 db2 corrupt.db
execsql "
@@ -150,8 +154,8 @@ do_test corrupt2-2.1 {
db2 close
do_test corrupt2-3.1 {
- file delete -force corrupt.db
- file delete -force corrupt.db-journal
+ forcedelete corrupt.db
+ forcedelete corrupt.db-journal
sqlite3 db2 corrupt.db
execsql "
@@ -200,8 +204,8 @@ db2 close
unset -nocomplain result
do_test corrupt2-5.1 {
- file delete -force corrupt.db
- file delete -force corrupt.db-journal
+ forcedelete corrupt.db
+ forcedelete corrupt.db-journal
sqlite3 db2 corrupt.db
execsql "
@@ -257,8 +261,8 @@ proc corruption_test {args} {
array set A $args
catch {db close}
- file delete -force corrupt.db
- file delete -force corrupt.db-journal
+ forcedelete corrupt.db
+ forcedelete corrupt.db-journal
sqlite3 db corrupt.db
db eval $::presql
« no previous file with comments | « third_party/sqlite/src/test/corrupt.test ('k') | third_party/sqlite/src/test/corrupt3.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698