File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,38 @@ do_test hmac-tamper-resistence {
155155db close
156156file delete -force test.db
157157
158+ # test that integrity checks work on a pristine
159+ # newly created database
160+ do_test integrity-check-clean-database {
161+ sqlite_orig db test.db
162+
163+ execsql {
164+ PRAGMA key = 'testkey';
165+ CREATE table t1(a,b);
166+ BEGIN;
167+ }
168+
169+ for {set i 1} {$i<=10000} {incr i} {
170+ execsql "INSERT INTO t1 VALUES($i,'value $i');"
171+ }
172+
173+ execsql {
174+ COMMIT;
175+ }
176+
177+ db close
178+
179+ sqlite_orig db test.db
180+ execsql {
181+ PRAGMA key = 'testkey';
182+ PRAGMA integrity_check;
183+ PRAGMA cipher_integrity_check;
184+ }
185+
186+ } {ok {} {}}
187+ db close
188+ file delete -force test.db
189+
158190# try cipher_integrity_check on an in-memory database
159191# which should fail because the file doesn't exist
160192do_test memory-integrity-check-should-fail {
You can’t perform that action at this time.
0 commit comments