@@ -1891,7 +1891,7 @@ TEST_F(Dhcpv4SrvTest, DiscoverCache) {
18911891 OptionUint32Ptr opt = boost::dynamic_pointer_cast<
18921892 OptionUint32>(offer->getOption (DHO_DHCP_LEASE_TIME));
18931893 ASSERT_TRUE (opt);
1894- EXPECT_EQ_MARGIN (subnet_->getValid () - delta, opt->getValue (), 1 );
1894+ EXPECT_NEAR (subnet_->getValid () - delta, opt->getValue (), 1 );
18951895
18961896 // Check address
18971897 EXPECT_EQ (addr, offer->getYiaddr ());
@@ -2072,7 +2072,7 @@ TEST_F(Dhcpv4SrvTest, RenewBasic) {
20722072 int32_t cltt = static_cast <int32_t >(l->cltt_ );
20732073 int32_t expected = static_cast <int32_t >(time (NULL ));
20742074 // Equality or difference by 1 between cltt and expected is ok.
2075- EXPECT_EQ_MARGIN (cltt, expected, 1 );
2075+ EXPECT_NEAR (cltt, expected, 1 );
20762076
20772077 Lease4Ptr lease = LeaseMgrFactory::instance ().getLease4 (addr);
20782078 EXPECT_TRUE (LeaseMgrFactory::instance ().deleteLease (lease));
@@ -2195,7 +2195,7 @@ TEST_F(Dhcpv4SrvTest, RenewDefaultLifetime) {
21952195 int32_t cltt = static_cast <int32_t >(c.l ->cltt_ );
21962196 int32_t expected = static_cast <int32_t >(time (NULL ));
21972197 // Equality or difference by 1 between cltt and expected is ok.
2198- EXPECT_EQ_MARGIN (cltt, expected, 1 );
2198+ EXPECT_NEAR (cltt, expected, 1 );
21992199
22002200 Lease4Ptr lease = LeaseMgrFactory::instance ().getLease4 (c.addr );
22012201 EXPECT_TRUE (LeaseMgrFactory::instance ().deleteLease (lease));
@@ -2241,7 +2241,7 @@ TEST_F(Dhcpv4SrvTest, RenewHintLifetime) {
22412241 int32_t cltt = static_cast <int32_t >(c.l ->cltt_ );
22422242 int32_t expected = static_cast <int32_t >(time (NULL ));
22432243 // Equality or difference by 1 between cltt and expected is ok.
2244- EXPECT_EQ_MARGIN (cltt, expected, 1 );
2244+ EXPECT_NEAR (cltt, expected, 1 );
22452245
22462246 Lease4Ptr lease = LeaseMgrFactory::instance ().getLease4 (c.addr );
22472247 EXPECT_TRUE (LeaseMgrFactory::instance ().deleteLease (lease));
@@ -2287,7 +2287,7 @@ TEST_F(Dhcpv4SrvTest, RenewMinLifetime) {
22872287 int32_t cltt = static_cast <int32_t >(c.l ->cltt_ );
22882288 int32_t expected = static_cast <int32_t >(time (NULL ));
22892289 // Equality or difference by 1 between cltt and expected is ok.
2290- EXPECT_EQ_MARGIN (cltt, expected, 1 );
2290+ EXPECT_NEAR (cltt, expected, 1 );
22912291
22922292 Lease4Ptr lease = LeaseMgrFactory::instance ().getLease4 (c.addr );
22932293 EXPECT_TRUE (LeaseMgrFactory::instance ().deleteLease (lease));
@@ -2332,7 +2332,7 @@ TEST_F(Dhcpv4SrvTest, RenewMaxLifetime) {
23322332 int32_t cltt = static_cast <int32_t >(c.l ->cltt_ );
23332333 int32_t expected = static_cast <int32_t >(time (NULL ));
23342334 // Equality or difference by 1 between cltt and expected is ok.
2335- EXPECT_EQ_MARGIN (cltt, expected, 1 );
2335+ EXPECT_NEAR (cltt, expected, 1 );
23362336
23372337 Lease4Ptr lease = LeaseMgrFactory::instance ().getLease4 (c.addr );
23382338 EXPECT_TRUE (LeaseMgrFactory::instance ().deleteLease (lease));
@@ -2400,7 +2400,7 @@ TEST_F(Dhcpv4SrvTest, RenewCache) {
24002400 OptionUint32Ptr opt = boost::dynamic_pointer_cast<
24012401 OptionUint32>(ack->getOption (DHO_DHCP_LEASE_TIME));
24022402 ASSERT_TRUE (opt);
2403- EXPECT_EQ_MARGIN (subnet_->getValid () - delta, opt->getValue (), 1 );
2403+ EXPECT_NEAR (subnet_->getValid () - delta, opt->getValue (), 1 );
24042404
24052405 // Check address
24062406 EXPECT_EQ (addr, ack->getYiaddr ());
0 commit comments