BIND 10 trac2168, updated. f56a2d4422bfa6b6e6372926f15e4d776cef367e [2168] Fix more unittests

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Jan 15 05:34:43 UTC 2014


The branch, trac2168 has been updated
       via  f56a2d4422bfa6b6e6372926f15e4d776cef367e (commit)
      from  8f422c21d3ea53c7f30bfd1548036331558bbf7d (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 f56a2d4422bfa6b6e6372926f15e4d776cef367e
Author: Mukund Sivaraman <muks at isc.org>
Date:   Wed Jan 15 10:53:39 2014 +0530

    [2168] Fix more unittests

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

Summary of changes:
 src/bin/auth/tests/auth_srv_unittest.cc           |   25 ++++++++++-----------
 src/lib/resolve/tests/recursive_query_unittest.cc |   11 +++++----
 2 files changed, 17 insertions(+), 19 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc
index 9a58692..dbbd0a4 100644
--- a/src/bin/auth/tests/auth_srv_unittest.cc
+++ b/src/bin/auth/tests/auth_srv_unittest.cc
@@ -44,6 +44,7 @@
 
 #include <util/unittests/mock_socketsession.h>
 #include <dns/tests/unittest_util.h>
+#include <util/unittests/wiredata.h>
 #include <testutils/dnsmessage_test.h>
 #include <testutils/srv_test.h>
 #include <testutils/mockups.h>
@@ -82,8 +83,9 @@ using namespace isc::testutils;
 using namespace isc::server_common::portconfig;
 using namespace isc::auth::unittest;
 using isc::UnitTestUtil;
-using boost::scoped_ptr;
 using isc::auth::statistics::Counters;
+using isc::util::unittests::matchWireData;
+using boost::scoped_ptr;
 
 namespace {
 const char* const CONFIG_TESTDB =
@@ -1072,10 +1074,9 @@ TEST_F(AuthSrvTest, builtInQueryViaDNSServer) {
                                      response_message, response_obuffer);
 
     createBuiltinVersionResponse(default_qid, response_data);
-    EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
-                        response_obuffer->getData(),
-                        response_obuffer->getLength(),
-                        &response_data[0], response_data.size());
+    matchWireData(&response_data[0], response_data.size(),
+                  response_obuffer->getData(),
+                  response_obuffer->getLength());
 
     // After it has been run, the message should be cleared
     EXPECT_EQ(0, parse_message->getRRCount(Message::SECTION_QUESTION));
@@ -1095,10 +1096,9 @@ TEST_F(AuthSrvTest, builtInQuery) {
     server.processMessage(*io_message, *parse_message, *response_obuffer,
                           &dnsserv);
     createBuiltinVersionResponse(default_qid, response_data);
-    EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
-                        response_obuffer->getData(),
-                        response_obuffer->getLength(),
-                        &response_data[0], response_data.size());
+    matchWireData(&response_data[0], response_data.size(),
+                  response_obuffer->getData(),
+                  response_obuffer->getLength());
     checkAllRcodeCountersZeroExcept(Rcode::NOERROR(), 1);
 }
 
@@ -1114,10 +1114,9 @@ TEST_F(AuthSrvTest, iqueryViaDNSServer) {
 
     UnitTestUtil::readWireData("iquery_response_fromWire.wire",
                                response_data);
-    EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
-                        response_obuffer->getData(),
-                        response_obuffer->getLength(),
-                        &response_data[0], response_data.size());
+    matchWireData(&response_data[0], response_data.size(),
+                  response_obuffer->getData(),
+                  response_obuffer->getLength());
 }
 
 // Install a Sqlite3 data source with testing data.
diff --git a/src/lib/resolve/tests/recursive_query_unittest.cc b/src/lib/resolve/tests/recursive_query_unittest.cc
index 48e5a31..623d731 100644
--- a/src/lib/resolve/tests/recursive_query_unittest.cc
+++ b/src/lib/resolve/tests/recursive_query_unittest.cc
@@ -31,6 +31,7 @@
 #include <exceptions/exceptions.h>
 
 #include <dns/tests/unittest_util.h>
+#include <util/unittests/wiredata.h>
 #include <dns/rcode.h>
 
 #include <util/buffer.h>
@@ -57,12 +58,13 @@
 #include <asiolink/io_message.h>
 #include <asiolink/io_error.h>
 
-using isc::UnitTestUtil;
 using namespace std;
 using namespace isc::asiodns;
 using namespace isc::asiolink;
 using namespace isc::dns;
 using namespace isc::util;
+using isc::UnitTestUtil;
+using isc::util::unittests::matchWireData;
 using boost::scoped_ptr;
 
 namespace isc {
@@ -361,9 +363,8 @@ protected:
         const size_t expected_datasize =
             protocol == IPPROTO_UDP ? sizeof(test_data) :
             sizeof(test_data) - 2;
-        EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, &callback_data_[0],
-                            callback_data_.size(),
-                            expected_data, expected_datasize);
+        matchWireData(expected_data, expected_datasize,
+                      &callback_data_[0], callback_data_.size());
     }
 
 protected:
@@ -1004,6 +1005,4 @@ TEST_F(RecursiveQueryTest, CachedNS) {
 // TODO: add tests that check whether the cache is updated on succesfull
 // responses, and not updated on failures.
 
-
-
 }



More information about the bind10-changes mailing list