Browse Source

[master] fix build with clang

by splitting up test helper inclusion files
Jelte Jansen 14 years ago
parent
commit
4f992e158c

+ 40 - 0
src/lib/cache/tests/cache_test_messagefromfile.h

@@ -0,0 +1,40 @@
+// Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+// $Id$
+#include <vector>
+#include <dns/tests/unittest_util.h>
+#include <dns/buffer.h>
+#include <dns/message.h>
+
+using namespace isc;
+using namespace isc::dns;
+
+namespace {
+
+/// \brief Reads a Message from a data file
+///
+/// \param message Message to put the read data in
+/// \param datafile The file to read from
+void
+messageFromFile(Message& message, const char* datafile) {
+    std::vector<unsigned char> data;
+    UnitTestUtil::readWireData(datafile, data);
+
+    InputBuffer buffer(&data[0], data.size());
+    message.fromWire(buffer);
+}
+
+}   // namespace
+

+ 0 - 13
src/lib/cache/tests/cache_test_util.h

@@ -23,19 +23,6 @@ using namespace isc::dns;
 
 namespace {
 
-/// \brief Reads a Message from a data file
-///
-/// \param message Message to put the read data in
-/// \param datafile The file to read from
-void
-messageFromFile(Message& message, const char* datafile) {
-    std::vector<unsigned char> data;
-    UnitTestUtil::readWireData(datafile, data);
-
-    InputBuffer buffer(&data[0], data.size());
-    message.fromWire(buffer);
-}
-
 /// \brief Counts the number of rrsets in the given section
 ///
 /// \param msg The message to count in

+ 1 - 1
src/lib/cache/tests/local_zone_data_unittest.cc

@@ -19,7 +19,7 @@
 #include <cache/local_zone_data.h>
 #include <dns/rrset.h>
 #include <dns/rrttl.h>
-#include "cache_test_util.h"
+#include "cache_test_messagefromfile.h"
 
 using namespace isc::cache;
 using namespace isc::dns;

+ 1 - 1
src/lib/cache/tests/message_cache_unittest.cc

@@ -21,7 +21,7 @@
 #include "../message_cache.h"
 #include "../rrset_cache.h"
 #include "../resolver_cache.h"
-#include "cache_test_util.h"
+#include "cache_test_messagefromfile.h"
 
 using namespace isc::cache;
 using namespace isc;

+ 2 - 1
src/lib/cache/tests/message_entry_unittest.cc

@@ -22,7 +22,8 @@
 #include "../message_entry.h"
 #include "../rrset_cache.h"
 #include "../resolver_cache.h"
-#include "cache_test_util.h"
+#include "cache_test_messagefromfile.h"
+#include "cache_test_sectioncount.h"
 
 using namespace isc::cache;
 using namespace isc;

+ 1 - 1
src/lib/cache/tests/resolver_cache_unittest.cc

@@ -18,7 +18,7 @@
 #include <gtest/gtest.h>
 #include <dns/rrset.h>
 #include "resolver_cache.h"
-#include "cache_test_util.h"
+#include "cache_test_messagefromfile.h"
 
 using namespace isc::cache;
 using namespace isc::dns;