diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/auth/tests/auth_srv_unittest.cc | 25 | ||||
-rw-r--r-- | 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 9a58692772..dbbd0a4136 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 48e5a31e88..623d731b8e 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. - - } |