Skip to content

Commit 9ef4eec

Browse files
Adjust sqlite3_test_control_pending_byte to test larger files
- Bump records in 1.1.8 db to increase file size to 1 MB.
1 parent fc2fcff commit 9ef4eec

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

sqlcipher-1.1.8-testkey.db

988 KB
Binary file not shown.

test/crypto.test

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ file delete -force test4.db
4242

4343
set testdir [file dirname $argv0]
4444
source $testdir/tester.tcl
45+
set old_pending_byte [sqlite3_test_control_pending_byte 0x40000000]
4546

4647
# If the library is not compiled with has_codec support then
4748
# skip all tests in this file.
@@ -932,17 +933,18 @@ file delete -force test.db
932933

933934
# open a 1.1.8 database using the new code, HMAC disabled
934935
do_test open-1.1.8-database {
935-
sqlite_orig db sqlcipher-1.1.8-testkey.db
936+
file copy -force sqlcipher-1.1.8-testkey.db test.db
937+
sqlite_orig db test.db
936938
execsql {
937939
PRAGMA key = 'testkey';
938-
PRAGMA cipher_use_hmac = OFF;
940+
PRAGMA cipher_use_hmac = off;
939941
PRAGMA kdf_iter = 4000;
940942
SELECT count(*) FROM t1;
941-
SELECT * FROM t1;
943+
SELECT distinct * FROM t1;
942944
}
943-
} {4 1 1 one one 1 2 one two}
945+
} {75709 1 1 one one 1 2 one two 1 2}
944946
db close
945-
947+
file delete -force test.db
946948

947949
# open a 1.1.8 database without hmac, then copy the data
948950
do_test attach-and-copy-1.1.8 {
@@ -963,9 +965,9 @@ do_test attach-and-copy-1.1.8 {
963965
execsql {
964966
PRAGMA key = 'testkey-hmac';
965967
SELECT count(*) FROM t1;
966-
SELECT * FROM t1;
968+
SELECT distinct * FROM t1;
967969
}
968-
} {4 1 1 one one 1 2 one two}
970+
} {75709 1 1 one one 1 2 one two 1 2}
969971
db close
970972
file delete -force test.db
971973

@@ -1426,7 +1428,7 @@ do_test default-hmac-kdf-attach {
14261428
PRAGMA cipher_default_use_hmac = ON;
14271429
PRAGMA cipher_default_kdf_iter = 64000;
14281430
}
1429-
} {4 4}
1431+
} {75709 75709}
14301432
db close
14311433
file delete -force test.db
14321434

@@ -1469,7 +1471,7 @@ do_test change-default-hmac-kdf-attach {
14691471
PRAGMA cipher_default_use_hmac = ON;
14701472
PRAGMA cipher_default_kdf_iter = 64000;
14711473
}
1472-
} {1 4}
1474+
} {1 75709}
14731475
db close
14741476
file delete -force test.db
14751477

@@ -2112,4 +2114,5 @@ db close
21122114
file delete -force test.db
21132115
file delete -force new.db
21142116

2117+
sqlite3_test_control_pending_byte $old_pending_byte
21152118
finish_test

0 commit comments

Comments
 (0)