]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2836] make tests safer when USE_SHARED_MEMORY is undefined.
authorJINMEI Tatuya <jinmei@isc.org>
Wed, 15 May 2013 16:40:07 +0000 (09:40 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Wed, 15 May 2013 16:40:07 +0000 (09:40 -0700)
- explicitly include config.h in these tests
- move helper function only used with USE_SHARED_MEMORY inside the ifdef block

src/bin/auth/tests/datasrc_clients_builder_unittest.cc
src/lib/datasrc/tests/client_list_unittest.cc
src/lib/datasrc/tests/memory/segment_object_holder_unittest.cc
src/lib/datasrc/tests/memory/zone_data_updater_unittest.cc

index 5a24b301364ddd0bec5af896d435e640ab0684f4..8aa223bdb9384e6ddb749f94478a9f1f28834b99 100644 (file)
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <util/unittests/check_valgrind.h>
 
 #include <dns/name.h>
index 745654cf5c143815f77d3172be348d4074ee1c90..f57aa30834ae240360492c382de7411cc2b5d0a8 100644 (file)
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <datasrc/client_list.h>
 #include <datasrc/client.h>
 #include <datasrc/cache_config.h>
index f0134e8f757e4ccfa56eeba1227ba64ba4592f1d..73aa18bd54656cbd3809dd03b8ea40786e3a7830 100644 (file)
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <util/memory_segment_local.h>
 #include <util/memory_segment_mapped.h>
 
@@ -83,6 +85,7 @@ TEST(SegmentObjectHolderTest, destroyNotSet) {
     EXPECT_TRUE(sgmt.allMemoryDeallocated());
 }
 
+#ifdef USE_SHARED_MEMORY
 // Keep allocating bigger and bigger chunks of data until the allocation
 // fails with growing the segment.
 void
@@ -103,7 +106,6 @@ allocateUntilGrows(MemorySegment& segment, size_t& current_size) {
 
 // Check that the segment thing releases stuff even in case it throws
 // SegmentGrown exception and the thing moves address
-#ifdef USE_SHARED_MEMORY
 TEST(SegmentObjectHolderTest, grow) {
     MemorySegmentMapped segment(mapped_file,
                                 isc::util::MemorySegmentMapped::CREATE_ONLY);
index aed66c155a97c43bdc4fc9dd8e1bd2e57ef8548f..f3e814af5e77509948140b63af10f306fdfb9380 100644 (file)
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <datasrc/memory/zone_data_updater.h>
 #include <datasrc/memory/rdataset.h>
 #include <datasrc/memory/zone_data.h>