github.com/jdgcs/sqlite3@v1.12.1-0.20210908114423-bc5f96e4dd51/testdata/tcl/pragmafault.test (about) 1 # 2010 June 15 2 # 3 # The author disclaims copyright to this source code. In place of 4 # a legal notice, here is a blessing: 5 # 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. 9 # 10 #*********************************************************************** 11 # 12 13 set testdir [file dirname $argv0] 14 source $testdir/tester.tcl 15 source $testdir/lock_common.tcl 16 source $testdir/malloc_common.tcl 17 set testprefix pragmafault 18 19 db close 20 sqlite3 db test.db 21 sqlite3_db_config_lookaside db 0 0 0 22 do_execsql_test 1.0 { 23 CREATE TABLE t1(a, b, CHECK(a!=b)); 24 INSERT INTO t1 VALUES(1, 2); 25 INSERT INTO t1 VALUES(3, 4); 26 } 27 faultsim_save_and_close 28 29 do_faultsim_test 1 -prep { 30 faultsim_restore_and_reopen 31 } -body { 32 catchsql { PRAGMA integrity_check } 33 set {} 0 34 } -test { 35 faultsim_test_result {0 0} 36 } 37 38 39 finish_test