diff options
author | Hans-Christoph Steiner <hans@eds.org> | 2014-10-16 22:51:43 -0400 |
---|---|---|
committer | Hans-Christoph Steiner <hans@eds.org> | 2014-10-16 22:51:43 -0400 |
commit | 9f67c0520ea0d5f11a190197cdf746c512db4ce4 (patch) | |
tree | c88a33f01f20a3d13a09594f114fffacebd0d1a4 /test/crash8.test | |
parent | ee20336e9c78d2e3782c8d096b9ab4f6ca8ce95f (diff) | |
parent | 569c6676a6ddb0ff73821d7693b5e18ddef809b9 (diff) |
Merge tag 'upstream/3.2.0'
Upstream version 3.2.0
# gpg: Signature made Thu 16 Oct 2014 10:51:39 PM EDT using RSA key ID 374BBE81
# gpg: Good signature from "Hans-Christoph Steiner <hans@guardianproject.info>"
# gpg: aka "Hans-Christoph Steiner <hans@eds.org>"
# gpg: aka "Hans-Christoph Steiner <hans@at.or.at>"
# gpg: aka "[jpeg image of size 5408]"
Diffstat (limited to 'test/crash8.test')
-rw-r--r-- | test/crash8.test | 116 |
1 files changed, 61 insertions, 55 deletions
diff --git a/test/crash8.test b/test/crash8.test index 8bc2586..930834a 100644 --- a/test/crash8.test +++ b/test/crash8.test @@ -341,62 +341,68 @@ ifcapable pragma { } {jkl} } -for {set i 1} {$i < 10} {incr i} { - catch { db close } - forcedelete test.db test.db-journal - sqlite3 db test.db - do_test crash8-5.$i.1 { - execsql { - CREATE TABLE t1(x PRIMARY KEY); - INSERT INTO t1 VALUES(randomblob(900)); - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ - } - crashsql -file test.db -delay [expr ($::i%2) + 1] { - PRAGMA cache_size = 10; - BEGIN; - UPDATE t1 SET x = randomblob(900); - ROLLBACK; - INSERT INTO t1 VALUES(randomblob(900)); - } - execsql { PRAGMA integrity_check } - } {ok} +# +# Since the following tests (crash8-5.*) rely upon being able +# to copy a file while open, they will not work on Windows. +# +if {$::tcl_platform(platform)=="unix"} { + for {set i 1} {$i < 10} {incr i} { + catch { db close } + forcedelete test.db test.db-journal + sqlite3 db test.db + do_test crash8-5.$i.1 { + execsql { + CREATE TABLE t1(x PRIMARY KEY); + INSERT INTO t1 VALUES(randomblob(900)); + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ + } + crashsql -file test.db -delay [expr ($::i%2) + 1] { + PRAGMA cache_size = 10; + BEGIN; + UPDATE t1 SET x = randomblob(900); + ROLLBACK; + INSERT INTO t1 VALUES(randomblob(900)); + } + execsql { PRAGMA integrity_check } + } {ok} - catch { db close } - forcedelete test.db test.db-journal - sqlite3 db test.db - do_test crash8-5.$i.2 { - execsql { - PRAGMA cache_size = 10; - CREATE TABLE t1(x PRIMARY KEY); - INSERT INTO t1 VALUES(randomblob(900)); - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ - BEGIN; - UPDATE t1 SET x = randomblob(900); - } - forcedelete testX.db testX.db-journal testX.db-wal - forcecopy test.db testX.db - forcecopy test.db-journal testX.db-journal - db close - - crashsql -file test.db -delay [expr ($::i%2) + 1] { - SELECT * FROM sqlite_master; - INSERT INTO t1 VALUES(randomblob(900)); - } - - sqlite3 db2 testX.db - execsql { PRAGMA integrity_check } db2 - } {ok} + catch { db close } + forcedelete test.db test.db-journal + sqlite3 db test.db + do_test crash8-5.$i.2 { + execsql { + PRAGMA cache_size = 10; + CREATE TABLE t1(x PRIMARY KEY); + INSERT INTO t1 VALUES(randomblob(900)); + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ + BEGIN; + UPDATE t1 SET x = randomblob(900); + } + forcedelete testX.db testX.db-journal testX.db-wal + forcecopy test.db testX.db + forcecopy test.db-journal testX.db-journal + db close + + crashsql -file test.db -delay [expr ($::i%2) + 1] { + SELECT * FROM sqlite_master; + INSERT INTO t1 VALUES(randomblob(900)); + } + + sqlite3 db2 testX.db + execsql { PRAGMA integrity_check } db2 + } {ok} + } + catch {db2 close} } -catch {db2 close} finish_test |