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

Unified Diff: third_party/sqlite/src/test/corruptC.test

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/corruptB.test ('k') | third_party/sqlite/src/test/corruptD.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/corruptC.test
diff --git a/third_party/sqlite/src/test/corruptC.test b/third_party/sqlite/src/test/corruptC.test
index aff7b4a0afa19c4a5e334445bbac7ed6a5e9e7b1..05804263884a661648fb2208ca3b6e7dea1c3bc0 100644
--- a/third_party/sqlite/src/test/corruptC.test
+++ b/third_party/sqlite/src/test/corruptC.test
@@ -22,6 +22,11 @@ catch {file delete -force test.db test.db-journal test.bu}
set testdir [file dirname $argv0]
source $testdir/tester.tcl
+# Do not use a codec for tests in this file, as the database file is
+# manipulated directly using tcl scripts (using the [hexio_write] command).
+#
+do_not_use_codec
+
# Construct a compact, dense database for testing.
#
do_test corruptC-1.1 {
@@ -67,7 +72,7 @@ sqlite3 db test.db
set fsize [file size test.db]
# Set a quasi-random random seed.
-if {[info exists SOAKTEST]} {
+if {[info exists ::G(issoak)]} {
# If we are doing SOAK tests, we want a different
# random seed for each run. Ideally we would like
# to use [clock clicks] or something like that here.
@@ -276,6 +281,17 @@ do_test corruptC-2.14 {
catchsql {DELETE FROM t1 WHERE rowid = (SELECT max(rowid) FROM t1)}
} {1 {database disk image is malformed}}
+# At one point this particular corrupt database was causing a buffer
+# overread. Which caused a crash in a run of all.test once.
+#
+do_test corruptC-2.15 {
+ db close
+ copy_file test.bu test.db
+ hexio_write test.db 986 b9
+ sqlite3 db test.db
+ catchsql {SELECT count(*) FROM sqlite_master;}
+} {1 {malformed database schema (t1i1) - no such table: main.t1}}
+
#
# Now test for a series of quasi-random seeds.
# We loop over the entire file size and touch
« no previous file with comments | « third_party/sqlite/src/test/corruptB.test ('k') | third_party/sqlite/src/test/corruptD.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698