Browse Source

[1068] avoid using ASSERT_EQ in a constructor. ASSERT_EQ is not appropriate
since it would have to have a return value, and even any xxx_EQ doesn't
make much sense because this is not actually what we are trying to test.
I choise to simply let it fail (should it ever happens); we should be able
to know by seeing some of the subsequent tests fail.

JINMEI Tatuya 13 years ago
parent
commit
ad91831c93
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/lib/datasrc/tests/sqlite3_accessor_unittest.cc

+ 4 - 3
src/lib/datasrc/tests/sqlite3_accessor_unittest.cc

@@ -299,9 +299,10 @@ const char* const deleted_data[] = {
 class SQLite3Update : public SQLite3AccessorTest {
 protected:
     SQLite3Update() {
-        ASSERT_EQ(0, system(INSTALL_PROG " " TEST_DATA_DIR
-                            "/test.sqlite3 "
-                            TEST_DATA_BUILDDIR "/test.sqlite3.copied"));
+        // Note: if "installing" the test file fails some of the subsequent
+        // tests will fail and we should be able to notice that.
+        system(INSTALL_PROG " " TEST_DATA_DIR
+               "/test.sqlite3 " TEST_DATA_BUILDDIR "/test.sqlite3.copied");
         initAccessor(TEST_DATA_BUILDDIR "/test.sqlite3.copied", RRClass::IN());
         zone_id = accessor->getZone(Name("example.com")).second;
         another_accessor.reset(new SQLite3Accessor(