From 084c28f0bb3969aaa09078c278f08f83e389eda2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 14 Aug 2018 13:04:00 -0700 Subject: [core] recreate offline database when it is deleted out from under our feet --- test/storage/offline_database.test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/storage/offline_database.test.cpp') diff --git a/test/storage/offline_database.test.cpp b/test/storage/offline_database.test.cpp index a1fd2ea619..346cd6da80 100644 --- a/test/storage/offline_database.test.cpp +++ b/test/storage/offline_database.test.cpp @@ -32,7 +32,7 @@ static FixtureLog::Message error(ResultCode code, const char* message) { return { EventSeverity::Error, Event::Database, static_cast(code), message }; } -static FixtureLog::Message warning(ResultCode code, const char* message) { +static __attribute__((unused)) FixtureLog::Message warning(ResultCode code, const char* message) { return { EventSeverity::Warning, Event::Database, static_cast(code), message }; } @@ -232,7 +232,7 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(Invalid)) { // Checking two possibilities for the error string because it apparently changes between SQLite versions. EXPECT_EQ(1u, log.count(error(ResultCode::NotADB, "Can't open database: file is encrypted or is not a database"), true) + log.count(error(ResultCode::NotADB, "Can't open database: file is not a database"), true)); - EXPECT_EQ(1u, log.count(warning(static_cast(-1), "Removing existing incompatible offline database"))); + EXPECT_EQ(1u, log.count({ EventSeverity::Warning, Event::Database, -1, "Removing existing incompatible offline database" })); // Now try inserting and reading back to make sure we have a valid database. for (const auto& res : { fixture::resource, fixture::tile }) { @@ -977,7 +977,7 @@ TEST(OfflineDatabase, CorruptDatabaseOnOpen) { // This database is corrupt in a way that will prevent opening the database. OfflineDatabase db(filename); EXPECT_EQ(1u, log.count(error(ResultCode::Corrupt, "Can't open database: database disk image is malformed"), true)); - EXPECT_EQ(1u, log.count(warning(static_cast(-1), "Removing existing incompatible offline database"))); + EXPECT_EQ(1u, log.count({ EventSeverity::Warning, Event::Database, -1, "Removing existing incompatible offline database" })); EXPECT_EQ(0u, log.uncheckedCount()); // Now try inserting and reading back to make sure we have a valid database. @@ -1007,7 +1007,7 @@ TEST(OfflineDatabase, CorruptDatabaseOnQuery) { // The first request fails because the database is corrupt and has to be recreated. EXPECT_EQ(nullopt, db.get(fixture::tile)); EXPECT_EQ(1u, log.count(error(ResultCode::Corrupt, "Can't read resource: database disk image is malformed"), true)); - EXPECT_EQ(1u, log.count(warning(static_cast(-1), "Removing existing incompatible offline database"))); + EXPECT_EQ(1u, log.count({ EventSeverity::Warning, Event::Database, -1, "Removing existing incompatible offline database" })); EXPECT_EQ(0u, log.uncheckedCount()); // Now try inserting and reading back to make sure we have a valid database. -- cgit v1.2.1