8000 Add tests for cipher_migrate · codeguru85/sqlcipher@dce806a · GitHub
[go: up one dir, main page]

Skip to content

Commit dce806a

Browse files
Add tests for cipher_migrate
1 parent f844a5d commit dce806a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

test/crypto.test

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,4 +1959,45 @@ if_built_with_commoncrypto verify-default-cipher {
19591959
db close
19601960
file delete -force test.db
19611961

1962+
do_test migrate-1.1.8-database-to-3x-format {
1963+
file delete -force test.db-migrated
1964+
file delete -force test.db
1965+
file copy -force sqlcipher-1.1.8-testkey.db test.db
1966+
sqlite_orig db test.db
1967+
execsql {
1968+
PRAGMA key = 'testkey';
1969+
PRAGMA cipher_migrate;
1970+
}
1971+
db close
1972+
1973+
sqlite_orig db test.db
1974+
execsql {
1975+
PRAGMA key = 'testkey';
1976+
SELECT count(*) FROM sqlite_master;
1977+
}
1978+
} {1}
1979+
db close
1980+
file delete -force test.db
1981+
file delete -force test.db-migrated
1982+
1983+
do_test migrate-2-0-le-database-to-3x-format {
1984+
file delete -force test.db
1985+
file copy -force sqlcipher-2.0-le-testkey.db test.db
1986+
sqlite_orig db test.db
1987+
execsql {
1988+
PRAGMA key = 'testkey';
1989+
PRAGMA cipher_migrate;
1990+
}
1991+
db close
1992+
1993+
sqlite_orig db test.db
1994+
execsql {
1995+
PRAGMA key = 'testkey';
1996+
SELECT count(*) FROM sqlite_master;
1997+
}
1998+
} {1}
1999+
db close
2000+
file delete -force test.db
2001+
file delete -force test.db-migrated
2002+
19622003
finish_test

0 commit comments

Comments
 (0)
0