Skip to content

Commit 8be1404

Browse files
committed
add additional test for decrypt error
1 parent 29950f2 commit 8be1404

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

test/sqlcipher-codecerror.test

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,31 @@ do_test codec-error-journal-wal-transaction {
141141
db close
142142
file delete -force test.db
143143

144+
do_test codec-error-journal-wal-read {
145+
codec-test-setup
146+
147+
sqlite_orig db test.db
148+
149+
catchsql {
150+
PRAGMA key = 'testkey';
151+
SELECT count(*) FROM sqlite_master;
152+
PRAGMA cipher_fail_next_decrypt = 1;
153+
UPDATE t1 SET b = 'fail' WHERE a = 5000;
154+
}
155+
156+
db close
157+
sqlite_orig db test.db
158+
159+
execsql {
160+
PRAGMA cipher_fail_next_decrypt = 0;
161+
PRAGMA key = 'testkey';
162+
PRAGMA cipher_integrity_check;
163+
PRAGMA integrity_check;
164+
SELECT b FROM t1 where a = 5000;
165+
}
166+
167+
} {ok ok {value 5000}}
168+
db close
169+
file delete -force test.db
170+
144171
finish_test

0 commit comments

Comments
 (0)