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

Unified Diff: third_party/sqlite/src/ext/rbu/rbufault3.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 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/ext/rbu/rbudor.test ('k') | third_party/sqlite/src/ext/rbu/rbufault4.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/ext/rbu/rbufault3.test
diff --git a/third_party/sqlite/src/ext/rbu/rbufault3.test b/third_party/sqlite/src/ext/rbu/rbufault3.test
new file mode 100644
index 0000000000000000000000000000000000000000..e72eb14f7d3aa764bb70879f69664ebb8cbfbd51
--- /dev/null
+++ b/third_party/sqlite/src/ext/rbu/rbufault3.test
@@ -0,0 +1,98 @@
+# 2016 April 20
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# This file contains fault injection tests for RBU vacuum operations.
+#
+
+source [file join [file dirname [info script]] rbu_common.tcl]
+source $testdir/malloc_common.tcl
+set ::testprefix rbufault3
+
+foreach {fault errlist} {
+ oom-* {
+ {1 SQLITE_NOMEM}
+ {1 SQLITE_IOERR_NOMEM}
+ {1 {SQLITE_NOMEM - out of memory}}
+ }
+
+ ioerr-* {
+ {1 {SQLITE_IOERR - disk I/O error}}
+ {1 SQLITE_IOERR}
+ {1 SQLITE_IOERR_WRITE}
+ {1 SQLITE_IOERR_FSYNC}
+ {1 SQLITE_IOERR_READ}
+ {1 {SQLITE_IOERR - unable to open database: test.db2}}
+ {1 {SQLITE_ERROR - unable to open database: test.db2}}
+ {1 {SQLITE_ERROR - SQL logic error or missing database}}
+ }
+
+ cantopen* {
+ {1 {SQLITE_CANTOPEN - unable to open database: test.db2}}
+ {1 {SQLITE_CANTOPEN - unable to open database: test.db2}}
+ {1 {SQLITE_CANTOPEN - unable to open database file}}
+ {1 SQLITE_CANTOPEN}
+ }
+
+} {
+
+ reset_db
+ do_execsql_test 0 {
+ CREATE TABLE target(x UNIQUE, y, z, PRIMARY KEY(y));
+ INSERT INTO target VALUES(1, 2, 3);
+ INSERT INTO target VALUES(4, 5, 6);
+ INSERT INTO target VALUES(7, 8, 9);
+ CREATE INDEX i1 ON target(z);
+ }
+ faultsim_save_and_close
+
+ do_faultsim_test 1 -faults $fault -prep {
+ faultsim_restore_and_reopen
+ forcedelete test.db2
+ } -body {
+ sqlite3rbu_vacuum rbu test.db test.db2
+ while {[rbu step]=="SQLITE_OK"} {}
+ rbu close
+ } -test {
+ eval [list faultsim_test_result {0 SQLITE_DONE} {*}$::errlist]
+ }
+
+ do_faultsim_test 2 -faults $fault -prep {
+ faultsim_restore_and_reopen
+ forcedelete test.db2
+ } -body {
+ sqlite3rbu_vacuum rbu test.db test.db2
+ rbu step
+ rbu close
+ } -test {
+ eval [list faultsim_test_result {0 SQLITE_OK} {*}$::errlist]
+ }
+
+ forcedelete test.db2
+ sqlite3rbu_vacuum rbu test.db test.db2
+ rbu step
+ rbu close
+ faultsim_save_and_close
+
+ do_faultsim_test 3 -faults $fault -prep {
+ faultsim_restore_and_reopen
+ forcedelete test.db2
+ } -body {
+ sqlite3rbu_vacuum rbu test.db test.db2
+ rbu step
+ rbu close
+ } -test {
+ eval [list faultsim_test_result {0 SQLITE_OK} {*}$::errlist]
+ }
+
+}
+
+finish_test
+
« no previous file with comments | « third_party/sqlite/src/ext/rbu/rbudor.test ('k') | third_party/sqlite/src/ext/rbu/rbufault4.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698