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 # Tests for the secure_delete pragma.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
18 unset -nocomplain DEFAULT_SECDEL
20 ifcapable secure_delete {
25 do_test securedel-1.0 {
26 db eval {PRAGMA secure_delete;}
29 forcedelete test2.db test2.db-journal
30 do_test securedel-1.1 {
32 ATTACH 'test2.db' AS db2;
33 PRAGMA main.secure_delete=ON;
34 PRAGMA db2.secure_delete;
36 } [list 1 $DEFAULT_SECDEL]
37 do_test securedel-1.2 {
39 PRAGMA main.secure_delete=OFF;
40 PRAGMA db2.secure_delete;
42 } [list 0 $DEFAULT_SECDEL]
43 do_test securedel-1.3 {
45 PRAGMA secure_delete=OFF;
46 PRAGMA db2.secure_delete;
49 do_test securedel-1.4 {
51 PRAGMA secure_delete=ON;
52 PRAGMA db2.secure_delete;
55 do_test securedel-1.5 {
57 PRAGMA secure_delete=FAST;
58 PRAGMA db2.secure_delete;
61 do_test securedel-1.6 {
63 PRAGMA secure_delete=ON;
64 PRAGMA db2.secure_delete;
67 do_test securedel-1.7 {
69 PRAGMA main.secure_delete=FAST;
70 PRAGMA db2.secure_delete;
73 do_test securedel-1.8 {
75 PRAGMA main.secure_delete=ON;
76 PRAGMA db2.secure_delete;
80 do_test securedel-2.1 {
83 ATTACH 'test2.db' AS db2;
84 PRAGMA db2.secure_delete;
87 do_test securedel-2.2 {
90 PRAGMA main.secure_delete=OFF;
91 ATTACH 'test2.db' AS db2;
92 PRAGMA db2.secure_delete;