BIND 10 trac1954, updated. a5171dfc73c99aaa7d8191d309d9808dca19b49b [1954] Fix for build errors on FreeBSD - compare vector values one by one

BIND 10 source code commits bind10-changes at lists.isc.org
Mon May 21 15:45:02 UTC 2012


The branch, trac1954 has been updated
       via  a5171dfc73c99aaa7d8191d309d9808dca19b49b (commit)
      from  6fb56baf17fbb2d8e666bfd7c16138f2a3ae5a44 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a5171dfc73c99aaa7d8191d309d9808dca19b49b
Author: Marcin Siodelski <marcin at isc.org>
Date:   Mon May 21 17:44:49 2012 +0200

    [1954] Fix for build errors on FreeBSD - compare vector values one by one

-----------------------------------------------------------------------

Summary of changes:
 .../perfdhcp/tests/command_options_unittest.cc     |   21 ++++++++++++++++---
 1 files changed, 17 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/tests/command_options_unittest.cc b/tests/tools/perfdhcp/tests/command_options_unittest.cc
index bb33af4..4ea6900 100644
--- a/tests/tools/perfdhcp/tests/command_options_unittest.cc
+++ b/tests/tools/perfdhcp/tests/command_options_unittest.cc
@@ -176,10 +176,23 @@ TEST_F(CommandOptionsTest, Base) {
     process("perfdhcp -6 -b MAC=10::20::30::40::50::60 -l ethx -b duiD=1AB7F5670901FF");
     uint8_t mac[6] = {0x10, 0x20, 0x30, 0x40, 0x50, 0x60 };
     uint8_t duid[7] = { 0x1A, 0xB7, 0xF5, 0x67, 0x09, 0x01, 0xFF };
-    std::vector<uint8_t> v1(mac, mac + 6);
-    std::vector<uint8_t> v2(duid, duid + 7);
-    EXPECT_EQ(v1, getMacPrefix());
-    EXPECT_EQ(v2, getDuidPrefix());
+
+    // We will be iterating through vector's elements
+    // because attempt to compare vectors directly  with
+    // EXPECT_EQ fails on FreeBSD
+
+    // Test Mac
+    std::vector<uint8_t> v1 = getMacPrefix();
+    ASSERT_EQ(6, v1.size());
+    for (int i = 0; i < v1.size(); i++) {
+        EXPECT_EQ(mac[i], v1[i]);
+    }
+    // Test DUID
+    std::vector<uint8_t> v2 = getDuidPrefix();
+    ASSERT_EQ(sizeof(duid) / sizeof(uint8_t), v2.size());
+    for (int i = 0; i < v1.size(); i++) {
+        EXPECT_EQ(duid[i], v2[i]);
+    }
 }
 
 TEST_F(CommandOptionsTest, DropTime) {



More information about the bind10-changes mailing list