Add tests for cipher_migrate

This commit is contained in:
Nick Parker 2013-08-12 15:09:11 -05:00
parent f844a5dfc3
commit dce806aae5
1 changed files with 41 additions and 0 deletions

View File

@ -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