]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2168] Remove UnitTestUtil::matchWireData()
authorMukund Sivaraman <muks@isc.org>
Wed, 15 Jan 2014 05:19:16 +0000 (10:49 +0530)
committerMukund Sivaraman <muks@isc.org>
Wed, 15 Jan 2014 05:19:16 +0000 (10:49 +0530)
src/lib/dns/tests/unittest_util.cc
src/lib/dns/tests/unittest_util.h

index 66d49a8af4e0774e38ccabae055b1d34d32c9299..bf4c8cbf3386b7a562f1c908477ff53e8f715e4d 100644 (file)
@@ -131,33 +131,6 @@ UnitTestUtil::readWireData(const string& datastr,
     } while (!iss.eof());
 }
 
-::testing::AssertionResult
-UnitTestUtil::matchWireData(const char*, const char*, const char*, const char*,
-                            const void* data1, size_t len1,
-                            const void* data2, size_t len2)
-{
-    ::testing::Message msg;
-    size_t cmplen = min(len1, len2);
-
-    for (size_t i = 0; i < cmplen; i++) {
-        int ch1 = static_cast<const uint8_t*>(data1)[i];
-        int ch2 = static_cast<const uint8_t*>(data2)[i];
-        if (ch1 != ch2) {
-            msg << "Wire data mismatch at " << i << "th byte\n"
-                << "  Actual: " << ch1 << "\n"
-                << "Expected: " << ch2 << "\n";
-            return (::testing::AssertionFailure(msg));
-        }
-    }
-    if (len1 != len2) {
-        msg << "Wire data mismatch in length:\n"
-            << "  Actual: " << len1 << "\n"
-            << "Expected: " << len2 << "\n";
-        return (::testing::AssertionFailure(msg));
-    }
-    return (::testing::AssertionSuccess());
-}
-
 ::testing::AssertionResult
 UnitTestUtil::matchName(const char*, const char*,
                         const isc::dns::Name& name1,
index f50df14ab26b1601c283d855be8b1361e7e11d24..1d65f8d8bc508542941d075720453eb135c6a1fa 100644 (file)
@@ -45,28 +45,6 @@ public:
     static void readWireData(const std::string& datastr,
                              std::vector<unsigned char>& data);
 
-    ///
-    /// Compare len1 bytes of data1 with len2 bytes of data2 as binary data.
-    ///
-    /// If they don't match report the point of mismatch in the google test
-    /// format.  This method is expected to be used from the EXPECT_PRED_FORMAT4
-    /// macro of google test as follows:
-    /// \code EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
-    ///                           actual_data, actual_data_len,
-    ///                           expected_data, expected_data_len); \endcode
-    /// Parameters from dataexp1 to lenexp2 are passed via the macro but will
-    /// be ignored by this method.
-    /// Note: newer versions of google test supports the direct use of
-    /// AssertionResult with the EXPECT_TRUE macro, which would be more
-    /// intuitive, but to be as compatible as possible we use the more primitive
-    /// macro, i.e., EXPECT_PRED_FORMAT4.
-    ///
-    static ::testing::AssertionResult
-    matchWireData(const char* dataexp1, const char* lenexp1,
-                  const char* dataexp2, const char* lenexp2,
-                  const void* data1, size_t len1,
-                  const void* data2, size_t len2);
-
     ///
     /// Compare two names.
     ///