1: # 2010 January 12
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: # Tests for the secure_delete pragma.
13: #
14:
15: set testdir [file dirname $argv0]
16: source $testdir/tester.tcl
17:
18: unset -nocomplain DEFAULT_SECDEL
19: set DEFAULT_SECDEL 0
20: ifcapable secure_delete {
21: set DEFAULT_SECDEL 1
22: }
23:
24:
25: do_test securedel-1.0 {
26: db eval {PRAGMA secure_delete;}
27: } $DEFAULT_SECDEL
28:
29: forcedelete test2.db test2.db-journal
30: do_test securedel-1.1 {
31: db eval {
32: ATTACH 'test2.db' AS db2;
33: PRAGMA main.secure_delete=ON;
34: PRAGMA db2.secure_delete;
35: }
36: } [list 1 $DEFAULT_SECDEL]
37: do_test securedel-1.2 {
38: db eval {
39: PRAGMA main.secure_delete=OFF;
40: PRAGMA db2.secure_delete;
41: }
42: } [list 0 $DEFAULT_SECDEL]
43: do_test securedel-1.3 {
44: db eval {
45: PRAGMA secure_delete=OFF;
46: PRAGMA db2.secure_delete;
47: }
48: } {0 0}
49: do_test securedel-1.4 {
50: breakpoint
51: db eval {
52: PRAGMA secure_delete=ON;
53: PRAGMA db2.secure_delete;
54: }
55: } {1 1}
56:
57: do_test securedel-2.1 {
58: db eval {
59: DETACH db2;
60: ATTACH 'test2.db' AS db2;
61: PRAGMA db2.secure_delete;
62: }
63: } 1
64: do_test securedel-2.2 {
65: db eval {
66: DETACH db2;
67: PRAGMA main.secure_delete=OFF;
68: ATTACH 'test2.db' AS db2;
69: PRAGMA db2.secure_delete;
70: }
71: } {0 0}
72:
73: finish_test
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>