3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this file is testing the SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 source $testdir/lock_common.tcl
19 source $testdir/malloc_common.tcl
20 source $testdir/wal_common.tcl
21 ifcapable !wal {finish_test ; return }
22 if {[permutation]=="journaltest" || [permutation]=="inmemory_journal"} {
30 PRAGMA auto_vacuum=OFF;
31 PRAGMA page_size = 1024;
32 PRAGMA journal_mode = wal;
33 CREATE TABLE c1(x, y, z);
34 INSERT INTO c1 VALUES(1, 2, 3);
37 do_test 1.1 { file exists test.db-wal } 1
38 do_test 1.2 { file size test.db-wal } [wal_file_size 3 1024]
39 do_test 1.3 { db close } {}
40 do_test 1.4 { file exists test.db-wal } 0
44 INSERT INTO c1 VALUES(4, 5, 6);
45 INSERT INTO c1 VALUES(7, 8, 9);
47 do_test 1.6 { file exists test.db-wal } 1
48 do_test 1.7 { sqlite3_db_config db NO_CKPT_ON_CLOSE 1 } {1}
49 do_test 1.8 { file size test.db-wal } [wal_file_size 2 1024]
50 do_test 1.9 { db close } {}
51 do_test 1.10 { file exists test.db-wal } 1
52 do_test 1.11 { file size test.db-wal } [wal_file_size 2 1024]
55 do_execsql_test 1.12 {
59 do_execsql_test 1.13 { PRAGMA main.journal_mode } {wal}
60 do_test 1.14 { sqlite3_db_config db NO_CKPT_ON_CLOSE 1 } {1}
61 do_execsql_test 1.14 { PRAGMA main.journal_mode = delete } {delete}
62 do_test 1.15 { file exists test.db-wal } {0}