Add tests for cipher_migrate
This commit is contained in:
parent
f844a5dfc3
commit
dce806aae5
|
@ -1959,4 +1959,45 @@ if_built_with_commoncrypto verify-default-cipher {
|
|||
db close
|
||||
file delete -force test.db
|
||||
|
||||
do_test migrate-1.1.8-database-to-3x-format {
|
||||
file delete -force test.db-migrated
|
||||
file delete -force test.db
|
||||
file copy -force sqlcipher-1.1.8-testkey.db test.db
|
||||
sqlite_orig db test.db
|
||||
execsql {
|
||||
PRAGMA key = 'testkey';
|
||||
PRAGMA cipher_migrate;
|
||||
}
|
||||
db close
|
||||
|
||||
sqlite_orig db test.db
|
||||
execsql {
|
||||
PRAGMA key = 'testkey';
|
||||
SELECT count(*) FROM sqlite_master;
|
||||
}
|
||||
} {1}
|
||||
db close
|
||||
file delete -force test.db
|
||||
file delete -force test.db-migrated
|
||||
|
||||
do_test migrate-2-0-le-database-to-3x-format {
|
||||
file delete -force test.db
|
||||
file copy -force sqlcipher-2.0-le-testkey.db test.db
|
||||
sqlite_orig db test.db
|
||||
execsql {
|
||||
PRAGMA key = 'testkey';
|
||||
PRAGMA cipher_migrate;
|
||||
}
|
||||
db close
|
||||
|
||||
sqlite_orig db test.db
|
||||
execsql {
|
||||
PRAGMA key = 'testkey';
|
||||
SELECT count(*) FROM sqlite_master;
|
||||
}
|
||||
} {1}
|
||||
db close
|
||||
file delete -force test.db
|
||||
file delete -force test.db-migrated
|
||||
|
||||
finish_test
|
||||
|
|
Loading…
Reference in New Issue