]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1845] only do rollbackFailure test for older sqlite3 lib
authorJelte Jansen <jelte@isc.org>
Wed, 4 Apr 2012 12:35:46 +0000 (14:35 +0200)
committerJelte Jansen <jelte@isc.org>
Wed, 4 Apr 2012 12:43:34 +0000 (14:43 +0200)
test is a noop for versions 3007011+

src/lib/datasrc/tests/sqlite3_accessor_unittest.cc

index 46b1411af31decaf5970e36f6ae8b875161cd807..fe6ddbcbfc8eac28ae137a6d85cc970b8e57037a 100644 (file)
@@ -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) {