Browse Source

[master] Avoid EXPECT_EQ(true/false, ...) for EXPECT_TRUE/FALSE

Francis Dupont 7 years ago
parent
commit
749fd31899

+ 3 - 1
src/hooks/dhcp/lease_cmds/lease_cmds.cc

@@ -205,7 +205,9 @@ public:
 
 int
 LeaseCmdsImpl::leaseAddHandler(CalloutHandle& handle) {
-    bool v4;
+    // Arbitrary defaulting to DHCPv4 or with other words extractCommand
+    // below is not expected to throw...
+    bool v4 = true;
     string txt = "malformed command";
     try {
         extractCommand(handle);

+ 2 - 2
src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc

@@ -590,8 +590,8 @@ TEST_F(LeaseCmdsTest, Lease4Add) {
     ASSERT_TRUE(l->hwaddr_);
     EXPECT_EQ("1a:1b:1c:1d:1e:1f", l->hwaddr_->toText(false));
     EXPECT_EQ(3, l->valid_lft_); // taken from subnet configuration
-    EXPECT_EQ(false, l->fqdn_fwd_);
-    EXPECT_EQ(false, l->fqdn_rev_);
+    EXPECT_FALSE(l->fqdn_fwd_);
+    EXPECT_FALSE(l->fqdn_rev_);
     EXPECT_EQ("", l->hostname_);
 
     // Test execution is fast. The cltt should be set to now. In some rare