Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed ordered tests in "CorruptedDatabaseTest"
Fixed "testOpenVersion0DatabaseVerifyStreamAccessed": "CorruptedDatabaseTest.kt:103" calls "RoomDatabase.compileStatement", which contains two calls to "writableDatabase" that were not previously accounted for. Fixed "testOpenDatabaseWithRecovery": The assertion in "CorruptedDatabaseTest.kt:129" is called by "PatchedCallback.onCreate" in "DatabaseOpenHelperFactory.kt:61", which is called by "FrameworkSQLiteOpenHelper.OpenHelper.innerGetDatabase". "PatchedCallback.onCreate" then calls "DatabaseCallback.onCreate", which then throws the "UnsupportedOperationException" ("DatabaseModule.kt:137") expected by the assertion in "CorruptedDatabaseTest.kt:123". However, it was not previously taken into account that "FrameworkSQLiteOpenHelper.OpenHelper.innerGetDatabase" discards the first thrown exception and tries again, which results in a second call to "PatchedCallback.onCreate" and therefore a second call to the assertion in "CorruptedDatabaseTest.kt:129" before the assertion in "CorruptedDatabaseTest.kt:123" is reached.
- Loading branch information