Browse Source

[1845] only do rollbackFailure test for older sqlite3 lib

test is a noop for versions 3007011+
Jelte Jansen 13 years ago
parent
commit
8a33648413
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/lib/datasrc/tests/sqlite3_accessor_unittest.cc

+ 6 - 2
src/lib/datasrc/tests/sqlite3_accessor_unittest.cc

@@ -771,18 +771,22 @@ TEST_F(SQLite3Update, rollback) {
     checkRecords(*accessor, zone_id, "foo.bar.example.com.", expected_stored);
 }
 
-// TODO: ticket #1845
-TEST_F(SQLite3Update,  DISABLED_rollbackFailure) {
+TEST_F(SQLite3Update,  rollbackFailure) {
     // This test emulates a rare scenario of making rollback attempt fail.
     // The iterator is paused in the middle of getting records, which prevents
     // the rollback operation at the end of the test.
 
+    // Since SQLite3 version 3.7.11, rollbacks do not fail on pending
+    // transactions anymore, making this test fail (and moot). So
+    // we'll only try on older versions
+#if SQLITE_VERSION_NUMBER < 3007011
     string columns[DatabaseAccessor::COLUMN_COUNT];
     iterator = accessor->getRecords("example.com.", zone_id);
     EXPECT_TRUE(iterator->getNext(columns));
 
     accessor->startUpdateZone("example.com.", true);
     EXPECT_THROW(accessor->rollback(), DataSourceError);
+#endif
 }
 
 TEST_F(SQLite3Update, commitConflict) {