Browse Source

[1186] Fix problems when compiling with gcc 4.4.5

Stephen Morris 13 years ago
parent
commit
a91fbbe990

+ 9 - 9
src/lib/dhcp/tests/libdhcp_unittest.cc

@@ -92,46 +92,46 @@ TEST_F(LibDhcpTest, unpackOptions6) {
     EXPECT_EQ(options.size(), 5); // there should be 5 options
 
     isc::dhcp::Option::Option6Collection::const_iterator x = options.find(12);
-    ASSERT_NE(x, options.end()); // option 1 should exist
+    ASSERT_FALSE(x == options.end()); // option 1 should exist
     EXPECT_EQ(12, x->second->getType());  // this should be option 12
     ASSERT_EQ(9, x->second->len()); // it should be of length 9
     EXPECT_EQ(0, memcmp(x->second->getData(), packed+4, 5)); // data len=5
 
     x = options.find(13);
-    ASSERT_NE(x, options.end()); // option 13 should exist
+    ASSERT_FALSE(x == options.end()); // option 13 should exist
     EXPECT_EQ(13, x->second->getType());  // this should be option 13
     ASSERT_EQ(7, x->second->len()); // it should be of length 7
     EXPECT_EQ(0, memcmp(x->second->getData(), packed+13, 3)); // data len=3
 
     x = options.find(14);
-    ASSERT_NE(x, options.end()); // option 3 should exist
+    ASSERT_FALSE(x == options.end()); // option 3 should exist
     EXPECT_EQ(14, x->second->getType());  // this should be option 14
     ASSERT_EQ(6, x->second->len()); // it should be of length 6
     EXPECT_EQ(0, memcmp(x->second->getData(), packed+20, 2)); // data len=2
 
     x = options.find(256);
-    ASSERT_NE(x, options.end()); // option 256 should exist
+    ASSERT_FALSE(x == options.end()); // option 256 should exist
     EXPECT_EQ(256, x->second->getType());  // this should be option 256
     ASSERT_EQ(8, x->second->len()); // it should be of length 7
     EXPECT_EQ(0, memcmp(x->second->getData(), packed+26, 4)); // data len=4
 
     x = options.find(257);
-    ASSERT_NE(x, options.end()); // option 257 should exist
+    ASSERT_FALSE(x == options.end()); // option 257 should exist
     EXPECT_EQ(257, x->second->getType());  // this should be option 257
     ASSERT_EQ(5, x->second->len()); // it should be of length 5
     EXPECT_EQ(0, memcmp(x->second->getData(), packed+34, 1)); // data len=1
 
     x = options.find(0);
-    EXPECT_EQ(x, options.end()); // option 0 not found
+    EXPECT_TRUE(x == options.end()); // option 0 not found
 
     x = options.find(1); // 1 is htons(256) on little endians. Worth checking
-    EXPECT_EQ(x, options.end()); // option 1 not found
+    EXPECT_TRUE(x == options.end()); // option 1 not found
 
     x = options.find(2);
-    EXPECT_EQ(x, options.end()); // option 2 not found
+    EXPECT_TRUE(x == options.end()); // option 2 not found
 
     x = options.find(32000);
-    EXPECT_EQ(x, options.end()); // option 32000 not found
+    EXPECT_TRUE(x == options.end()); // option 32000 not found
 }
 
 }

+ 1 - 1
src/lib/dhcp/tests/option6_iaaddr_unittest.cc

@@ -76,7 +76,7 @@ TEST_F(Option6IAAddrTest, basic) {
     // 4 bytes header + 4 bytes content
     EXPECT_EQ("2001:db8:1::dead:beef", opt->getAddress().toText());
     EXPECT_EQ(1000, opt->getPreferred());
-    EXPECT_EQ(3000000000, opt->getValid());
+    EXPECT_EQ(3000000000U, opt->getValid());
 
     EXPECT_EQ(D6O_IAADDR, opt->getType());