]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2348] fix portable compilation issue
authorAndrei Pavel <andrei@isc.org>
Tue, 22 Nov 2022 07:33:12 +0000 (09:33 +0200)
committerAndrei Pavel <andrei@isc.org>
Tue, 22 Nov 2022 08:21:22 +0000 (10:21 +0200)
 allocation_state_unittest.cc:35:5:   required from here
 /usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: error: no match for ‘operator==’ (operand types are ‘const boost::date_time::special_values’ and ‘const boost::posix_time::ptime’)
    if (lhs == rhs) {
        ~~~~^~~~~~

src/lib/dhcpsrv/tests/allocation_state_unittest.cc

index 21ddcfd0583b1b33d5fbac0220d6b1ea9367cb20..157d3e2be2730eea5d963da6d673cbb96d283692 100644 (file)
@@ -32,10 +32,10 @@ public:
 // Tests initialization of the SubnetAllocationState.
 TEST(SubnetAllocationState, constructor) {
     SubnetAllocationState state;
-    EXPECT_EQ(neg_infin, state.getLastAllocatedTime(Lease::TYPE_V4));
-    EXPECT_EQ(neg_infin, state.getLastAllocatedTime(Lease::TYPE_NA));
-    EXPECT_EQ(neg_infin, state.getLastAllocatedTime(Lease::TYPE_TA));
-    EXPECT_EQ(neg_infin, state.getLastAllocatedTime(Lease::TYPE_PD));
+    EXPECT_TRUE(state.getLastAllocatedTime(Lease::TYPE_V4).is_neg_infinity());
+    EXPECT_TRUE(state.getLastAllocatedTime(Lease::TYPE_NA).is_neg_infinity());
+    EXPECT_TRUE(state.getLastAllocatedTime(Lease::TYPE_TA).is_neg_infinity());
+    EXPECT_TRUE(state.getLastAllocatedTime(Lease::TYPE_PD).is_neg_infinity());
 }
 
 // Tests that the explicitly initialized allocation time can be retrieved