BIND 10 trac992, updated. d6e33479365c8f8f62ef2b9aa5548efe6b194601 [992] Cosmetic changes (a follow-up to 1361)

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Dec 13 14:28:20 UTC 2011


The branch, trac992 has been updated
       via  d6e33479365c8f8f62ef2b9aa5548efe6b194601 (commit)
      from  64546f4f97bf4032f7b97f768649ba1024503fc0 (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 d6e33479365c8f8f62ef2b9aa5548efe6b194601
Author: Tomek Mrugalski <tomasz at isc.org>
Date:   Tue Dec 13 15:14:25 2011 +0100

    [992] Cosmetic changes (a follow-up to 1361)

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

Summary of changes:
 src/lib/dhcp/tests/iface_mgr_unittest.cc |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/tests/iface_mgr_unittest.cc b/src/lib/dhcp/tests/iface_mgr_unittest.cc
index f713ac5..92e5e3d 100644
--- a/src/lib/dhcp/tests/iface_mgr_unittest.cc
+++ b/src/lib/dhcp/tests/iface_mgr_unittest.cc
@@ -30,7 +30,8 @@ using namespace isc::asiolink;
 using namespace isc::dhcp;
 
 // name of loopback interface detection
-char LOOPBACK[32] = "lo";
+const size_t buf_size = 32;
+char LOOPBACK[buf_size] = "lo";
 
 namespace {
 const char* const INTERFACE_FILE = TEST_DATA_BUILDDIR "/interfaces.txt";
@@ -70,16 +71,16 @@ TEST_F(IfaceMgrTest, loDetect) {
     // poor man's interface detection
     // it will go away as soon as proper interface detection
     // is implemented
-    if (if_nametoindex("lo")>0) {
+    if (if_nametoindex("lo") > 0) {
         cout << "This is Linux, using lo as loopback." << endl;
-        sprintf(LOOPBACK, "lo");
-    } else if (if_nametoindex("lo0")>0) {
+        snprintf(LOOPBACK, buf_size - 1, "lo");
+    } else if (if_nametoindex("lo0") > 0) {
         cout << "This is BSD, using lo0 as loopback." << endl;
-        sprintf(LOOPBACK, "lo0");
+        snprintf(LOOPBACK, buf_size - 1, "lo0");
     } else {
         cout << "Failed to detect loopback interface. Neither "
-             << "lo or lo0 worked. I give up." << endl;
-        ASSERT_TRUE(false);
+             << "lo nor lo0 worked. I give up." << endl;
+        FAIL();
     }
 }
 




More information about the bind10-changes mailing list