diff --git a/test/crypto.test b/test/crypto.test index 0238cb7..822e4c7 100644 --- a/test/crypto.test +++ b/test/crypto.test @@ -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