summaryrefslogtreecommitdiff
path: root/test/walpersist.test
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2012-03-30 20:42:12 -0400
committerHans-Christoph Steiner <hans@eds.org>2012-03-30 20:42:12 -0400
commit7bb481fda9ecb134804b49c2ce77ca28f7eea583 (patch)
tree31b520b9914d3e2453968abe375f2c102772c3dc /test/walpersist.test
Imported Upstream version 2.0.3
Diffstat (limited to 'test/walpersist.test')
-rw-r--r--test/walpersist.test73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/walpersist.test b/test/walpersist.test
new file mode 100644
index 0000000..175dcbf
--- /dev/null
+++ b/test/walpersist.test
@@ -0,0 +1,73 @@
+# 2011 July 26
+#
+# 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 tests for using WAL with persistent WAL file mode.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/lock_common.tcl
+set ::testprefix walpersist
+
+ifcapable !wal {
+ finish_test
+ return
+}
+
+do_test walpersist-1.0 {
+ db eval {
+ PRAGMA journal_mode=WAL;
+ CREATE TABLE t1(a);
+ INSERT INTO t1 VALUES(randomblob(5000));
+ }
+ file exists test.db-wal
+} {1}
+do_test walpersist-1.1 {
+ file exists test.db-shm
+} {1}
+do_test walpersist-1.2 {
+ db close
+ list [file exists test.db] [file exists test.db-wal] [file exists test.db-shm]
+} {1 0 0}
+do_test walpersist-1.3 {
+ sqlite3 db test.db
+ db eval {SELECT length(a) FROM t1}
+} {5000}
+do_test walpersist-1.4 {
+ list [file exists test.db] [file exists test.db-wal] [file exists test.db-shm]
+} {1 1 1}
+do_test walpersist-1.5 {
+ file_control_persist_wal db -1
+} {0 0}
+do_test walpersist-1.6 {
+ file_control_persist_wal db 1
+} {0 1}
+do_test walpersist-1.7 {
+ file_control_persist_wal db -1
+} {0 1}
+do_test walpersist-1.8 {
+ file_control_persist_wal db 0
+} {0 0}
+do_test walpersist-1.9 {
+ file_control_persist_wal db -1
+} {0 0}
+do_test walpersist-1.10 {
+ file_control_persist_wal db 1
+} {0 1}
+do_test walpersist-1.11 {
+ db close
+ list [file exists test.db] [file exists test.db-wal] [file exists test.db-shm]
+} {1 1 1}
+
+
+
+
+finish_test