summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bin/dhcp6/tests/dhcp6_srv_unittest.cc9
-rw-r--r--src/bin/dhcp6/tests/dhcp6_test_utils.cc6
-rw-r--r--src/bin/dhcp6/tests/infrequest_unittest.cc12
-rw-r--r--src/bin/dhcp6/tests/sarr_unittest.cc18
4 files changed, 30 insertions, 15 deletions
diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
index 60c9df3233..e8062b43ac 100644
--- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
+++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
@@ -2593,9 +2593,12 @@ TEST_F(Dhcpv6SrvTest, receiveParseFailedStat) {
ObservationPtr pkt6_rcvd = mgr.getObservation("pkt6-received");
ObservationPtr parse_fail = mgr.getObservation("pkt6-parse-failed");
ObservationPtr recv_drop = mgr.getObservation("pkt6-receive-drop");
- EXPECT_TRUE(pkt6_rcvd);
- EXPECT_TRUE(parse_fail);
- EXPECT_TRUE(recv_drop);
+ ASSERT_TRUE(pkt6_rcvd);
+ ASSERT_TRUE(parse_fail);
+ ASSERT_TRUE(recv_drop);
+ EXPECT_EQ(0, pkt6_rcvd->getInteger().first);
+ EXPECT_EQ(0, parse_fail->getInteger().first);
+ EXPECT_EQ(0, recv_drop->getInteger().first);
// Simulate that we have received that traffic
srv.fakeReceive(pkt);
diff --git a/src/bin/dhcp6/tests/dhcp6_test_utils.cc b/src/bin/dhcp6/tests/dhcp6_test_utils.cc
index 7210a288b1..eef9b61efc 100644
--- a/src/bin/dhcp6/tests/dhcp6_test_utils.cc
+++ b/src/bin/dhcp6/tests/dhcp6_test_utils.cc
@@ -773,8 +773,10 @@ Dhcpv6SrvTest::testReceiveStats(uint8_t pkt_type, const std::string& stat_name)
// Check that the tested statistics is initially set to 0
ObservationPtr pkt6_rcvd = mgr.getObservation("pkt6-received");
ObservationPtr tested_stat = mgr.getObservation(stat_name);
- EXPECT_TRUE(pkt6_rcvd);
- EXPECT_TRUE(tested_stat);
+ ASSERT_TRUE(pkt6_rcvd);
+ ASSERT_TRUE(tested_stat);
+ EXPECT_EQ(0, pkt6_rcvd->getInteger().first);
+ EXPECT_EQ(0, tested_stat->getInteger().first);
// Simulate that we have received that traffic
srv.fakeReceive(pkt);
diff --git a/src/bin/dhcp6/tests/infrequest_unittest.cc b/src/bin/dhcp6/tests/infrequest_unittest.cc
index 4a3334611e..efcef61fc7 100644
--- a/src/bin/dhcp6/tests/infrequest_unittest.cc
+++ b/src/bin/dhcp6/tests/infrequest_unittest.cc
@@ -323,10 +323,14 @@ TEST_F(InfRequestTest, infRequestStats) {
ObservationPtr pkt6_infreq_rcvd = mgr.getObservation("pkt6-infrequest-received");
ObservationPtr pkt6_reply_sent = mgr.getObservation("pkt6-reply-sent");
ObservationPtr pkt6_sent = mgr.getObservation("pkt6-sent");
- EXPECT_TRUE(pkt6_rcvd);
- EXPECT_TRUE(pkt6_infreq_rcvd);
- EXPECT_TRUE(pkt6_reply_sent);
- EXPECT_TRUE(pkt6_sent);
+ ASSERT_TRUE(pkt6_rcvd);
+ ASSERT_TRUE(pkt6_infreq_rcvd);
+ ASSERT_TRUE(pkt6_reply_sent);
+ ASSERT_TRUE(pkt6_sent);
+ EXPECT_EQ(0, pkt6_rcvd->getInteger().first);
+ EXPECT_EQ(0, pkt6_infreq_rcvd->getInteger().first);
+ EXPECT_EQ(0, pkt6_reply_sent->getInteger().first);
+ EXPECT_EQ(0, pkt6_sent->getInteger().first);
// Perform 2-way exchange (Inf-request/reply)
client.requestOption(D6O_NAME_SERVERS);
diff --git a/src/bin/dhcp6/tests/sarr_unittest.cc b/src/bin/dhcp6/tests/sarr_unittest.cc
index 98a0c0ec3d..9a7cf16beb 100644
--- a/src/bin/dhcp6/tests/sarr_unittest.cc
+++ b/src/bin/dhcp6/tests/sarr_unittest.cc
@@ -501,12 +501,18 @@ TEST_F(SARRTest, sarrStats) {
ObservationPtr pkt6_request_rcvd = mgr.getObservation("pkt6-request-received");
ObservationPtr pkt6_reply_sent = mgr.getObservation("pkt6-reply-sent");
ObservationPtr pkt6_sent = mgr.getObservation("pkt6-sent");
- EXPECT_TRUE(pkt6_rcvd);
- EXPECT_TRUE(pkt6_solicit_rcvd);
- EXPECT_TRUE(pkt6_adv_sent);
- EXPECT_TRUE(pkt6_request_rcvd);
- EXPECT_TRUE(pkt6_reply_sent);
- EXPECT_TRUE(pkt6_sent);
+ ASSERT_TRUE(pkt6_rcvd);
+ ASSERT_TRUE(pkt6_solicit_rcvd);
+ ASSERT_TRUE(pkt6_adv_sent);
+ ASSERT_TRUE(pkt6_request_rcvd);
+ ASSERT_TRUE(pkt6_reply_sent);
+ ASSERT_TRUE(pkt6_sent);
+ EXPECT_EQ(0, pkt6_rcvd->getInteger().first);
+ EXPECT_EQ(0, pkt6_solicit_rcvd->getInteger().first);
+ EXPECT_EQ(0, pkt6_adv_sent->getInteger().first);
+ EXPECT_EQ(0, pkt6_request_rcvd->getInteger().first);
+ EXPECT_EQ(0, pkt6_reply_sent->getInteger().first);
+ EXPECT_EQ(0, pkt6_sent->getInteger().first);
// Perform 4-way exchange.
ASSERT_NO_THROW(client.doSARR());