Commit 7bcfafaf authored by Razvan Becheriu's avatar Razvan Becheriu

[#1069] fix crashing unittests on no op database actions

parent 47830cb0
......@@ -1782,9 +1782,9 @@ GenericLeaseMgrTest::testGetLeases6Duid() {
Lease6Collection returned3 = lmptr_->getLeases6(*(lease3->duid_));
//verify if the returned lease mathces
EXPECT_EQ(returned1.size(), 1);
EXPECT_EQ(returned2.size(), 1);
EXPECT_EQ(returned3.size(), 1);
ASSERT_EQ(returned1.size(), 1);
ASSERT_EQ(returned2.size(), 1);
ASSERT_EQ(returned3.size(), 1);
//verify that the returned lease are same
EXPECT_TRUE(returned1[0]->addr_ == lease1->addr_);
......
......@@ -26,6 +26,8 @@ detailCompareLease(const Lease4Ptr& first, const Lease4Ptr& second) {
// odd things happen when they are different: the EXPECT_EQ macro appears to
// call the operator uint32_t() function, which causes an exception to be
// thrown for IPv6 addresses.
ASSERT_TRUE(first);
ASSERT_TRUE(second);
EXPECT_EQ(first->addr_, second->addr_);
// We need to compare the actual HWAddr objects, not pointers
......@@ -66,6 +68,8 @@ detailCompareLease(const Lease4Ptr& first, const Lease4Ptr& second) {
void
detailCompareLease(const Lease6Ptr& first, const Lease6Ptr& second) {
ASSERT_TRUE(first);
ASSERT_TRUE(second);
EXPECT_EQ(first->type_, second->type_);
// Compare address strings. Comparison of address objects is not used, as
......
......@@ -209,6 +209,8 @@ HostDataSourceUtils::compareDuids(const ConstHostPtr& host1,
void
HostDataSourceUtils::compareHosts(const ConstHostPtr& host1,
const ConstHostPtr& host2) {
ASSERT_TRUE(host1);
ASSERT_TRUE(host2);
// Let's compare HW addresses and expect match.
compareHwaddrs(host1, host2, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment