]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Corrected Lease6 logical operator unit tests fail intermittently.
authorThomas Markwalder <tmark@isc.org>
Tue, 30 Jul 2013 11:47:55 +0000 (07:47 -0400)
committerThomas Markwalder <tmark@isc.org>
Tue, 30 Jul 2013 11:47:55 +0000 (07:47 -0400)
Equality operator tests were reliant on two Lease6 structs, constructed
back to back to have the same value for cltt_, which gets its value from
time(NULL).  Corrected this by simple assignment to ensure they are always
equal as the test expects.

src/lib/dhcpsrv/tests/lease_mgr_unittest.cc

index 124301adef5ebfa72be870a2c260baeec5bebd45..d5535ae53f988487a1ef6d00c303823df83053cd 100644 (file)
@@ -487,6 +487,10 @@ TEST(Lease6, OperatorEquals) {
                                subnet_id);
     Lease6 lease2(Lease6::LEASE_IA_NA, addr, duid, iaid, 100, 200, 50, 80,
                                subnet_id);
+
+    // cltt_ constructs with time(NULL), make sure they are always equal
+    lease1.cltt_ = lease2.cltt_;
+
     EXPECT_TRUE(lease1 == lease2);
     EXPECT_FALSE(lease1 != lease2);