File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/java/net/zetetic/tests Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,13 @@ public boolean execute(SQLiteDatabase null_database_ignored) {
3737
3838 SQLiteDatabase database = SQLiteDatabase .openOrCreateDatabase (unencryptedDatabase , "" , null );
3939
40- // NOTE: database not expected to be null, but check:
40+ // NOTE: database not expected to be null, but double- check:
4141 if (database == null ) {
4242 Log .e (TAG , "ERROR: got null database object" );
4343 return false ;
4444 }
4545
46+ // *Should* have been recovered:
4647 Cursor cursor = database .rawQuery ("select * from sqlite_master;" , null );
4748
4849 if (cursor == null ) {
@@ -64,7 +65,11 @@ public boolean execute(SQLiteDatabase null_database_ignored) {
6465 Log .v (TAG , "Caught SQLiteDatabaseCorruptException as expected OK" );
6566 }
6667
67- database .close ();
68+ // *Expected* to be closed now
69+ if (database .isOpen ()) {
70+ Log .e (TAG , "NOT EXPECTED: database is still open" );
71+ return false ;
72+ }
6873
6974 return true ;
7075 } catch (Exception ex ) {
You can’t perform that action at this time.
0 commit comments