]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3053] Additional review comments
authorThomas Markwalder <tmark@isc.org>
Fri, 15 Sep 2023 14:09:07 +0000 (10:09 -0400)
committerThomas Markwalder <tmark@isc.org>
Fri, 15 Sep 2023 14:34:28 +0000 (14:34 +0000)
src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc
    add use of SKIP_IF

src/lib/testutils/gtest_utils.h
    fixed typo

src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc
src/lib/testutils/gtest_utils.h

index e9506a729b297b3d630d669a4af9d48d9befa87f..ffae89787cc07e74bce2302bb534ff9ed9f7a055 100644 (file)
@@ -1069,33 +1069,21 @@ TEST_F(PgSqlGenericBackendTest, leaseCount) {
 // Verifies that v4 class lease counts are correctly adjusted
 // when leases have class lists.
 TEST_F(PgSqlLeaseMgrTest, classLeaseCount4) {
-    if (!LeaseMgrFactory::instance().isJsonSupported()) {
-        std::cout << "Skipped test because of lack of JSON support in the database." << std::endl;
-        return;
-    }
-
+    SKIP_IF(!LeaseMgrFactory::instance().isJsonSupported());
     testClassLeaseCount4();
 }
 
 // Verifies that v6 IA_NA class lease counts are correctly adjusted
 // when leases have class lists.
 TEST_F(PgSqlLeaseMgrTest, classLeaseCount6_NA) {
-    if (!LeaseMgrFactory::instance().isJsonSupported()) {
-        std::cout << "Skipped test because of lack of JSON support in the database." << std::endl;
-        return;
-    }
-
+    SKIP_IF(!LeaseMgrFactory::instance().isJsonSupported());
     testClassLeaseCount6(Lease::TYPE_NA);
 }
 
 // Verifies that v6 IA_PD class lease counts are correctly adjusted
 // when leases have class lists.
 TEST_F(PgSqlLeaseMgrTest, classLeaseCount6_PD) {
-    if (!LeaseMgrFactory::instance().isJsonSupported()) {
-        std::cout << "Skipped test because of lack of JSON support in the database." << std::endl;
-        return;
-    }
-
+    SKIP_IF(!LeaseMgrFactory::instance().isJsonSupported());
     testClassLeaseCount6(Lease::TYPE_PD);
 }
 
index 15a6f35cbc58250dfd3659257ba48748cf485041..66a88fa28272768fba5ee4f80a0d17599d545993 100644 (file)
@@ -92,7 +92,7 @@ namespace test {
 /// if the given expression is true.  This works around the lack of
 /// GTEST_SKIP prior to googletest 1.10.
 ///
-/// @note  This macro cannot be used in ::testingL:Test::SetUp()
+/// @note  This macro cannot be used in ::testing::Test::SetUp()
 /// to skip tests (unless running with googletest 1.10 or later).
 /// It must be used directly within the body of each unit test.
 ///
@@ -103,7 +103,7 @@ namespace test {
     if (expression) { \
         const auto info = ::testing::UnitTest::GetInstance()->current_test_info(); \
         std::cerr << "SKIPPING: " << info->test_case_name() << ":" << info->name() \
-                  << ":" << #expression << " is true" << std::endl; \
+                  << ": '" << #expression << "' is true" << std::endl; \
         return; \
     } \
 }
@@ -113,7 +113,7 @@ namespace test {
     if (expression) { \
         const auto info = ::testing::UnitTest::GetInstance()->current_test_info(); \
         GTEST_SKIP() << "SKIPPING: " << info->test_case_name() << ":" << info->name() \
-                  << ":" << #expression << " is true"; \
+                  << ": '" << #expression << "' is true"; \
     } \
 }
 #endif