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 #***********************************************************************
12 # This file implements regression tests for SQLite library. The
13 # focus of this file is testing the effects of a failure in
14 # sqlite3_initialize().
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
20 if {[db eval {SELECT sqlite_compileoption_used('THREADSAFE=0')}]} {
27 foreach {t failed rc started} {
28 1.1 {} SQLITE_OK {mutex mem pcache}
29 1.2 {mutex} SQLITE_ERROR {}
30 1.3 {mem} SQLITE_ERROR {mutex}
31 1.4 {pcache} SQLITE_ERROR {mutex mem}
34 eval init_wrapper_install $failed
58 init_wrapper_uninstall
62 source $testdir/malloc_common.tcl
64 do_malloc_test init-2 -tclprep {
68 set rc [sqlite3_initialize]
69 if {[string match "SQLITE*NOMEM" $rc]} {error "out of memory"}
71 set zRepeat "transient"
72 if {$::iRepeat} {set zRepeat "persistent"}
73 do_test init-2.$zRepeat.$::n.x {
77 init_wrapper_uninstall
81 autoinstall_test_functions