Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: sql/recovery_unittest.cc

Issue 1657593005: [sql] Prevent recovery against a closed database. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Detect API mis-use. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sql/recovery.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/recovery_unittest.cc
diff --git a/sql/recovery_unittest.cc b/sql/recovery_unittest.cc
index f964eb9c05173b343df67d3f448c67f821b32678..11f2a87380862cccfcd59478392d52bb387dbfca 100644
--- a/sql/recovery_unittest.cc
+++ b/sql/recovery_unittest.cc
@@ -103,6 +103,17 @@ TEST_F(SQLRecoveryTest, RecoverBasic) {
EXPECT_TRUE(db().is_open());
ASSERT_EQ("", GetSchema(&db()));
+ // Attempting to recover a previously-recovered handle fails early.
+ {
+ scoped_ptr<sql::Recovery> recovery = sql::Recovery::Begin(&db(), db_path());
+ ASSERT_TRUE(recovery.get());
+ recovery.reset();
+
+ recovery = sql::Recovery::Begin(&db(), db_path());
+ ASSERT_FALSE(recovery.get());
Ryan Hamilton 2016/02/02 05:00:06 Presumably, this test failed or crashed with the o
+ }
+ ASSERT_TRUE(Reopen());
+
// Recreate the database.
ASSERT_TRUE(db().Execute(kCreateSql));
ASSERT_TRUE(db().Execute(kInsertSql));
« no previous file with comments | « sql/recovery.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698