Browse Source

[2836] make tests safer when USE_SHARED_MEMORY is undefined.

- explicitly include config.h in these tests
- move helper function only used with USE_SHARED_MEMORY inside the ifdef block
JINMEI Tatuya 12 years ago
parent
commit
d35ac0a1d9

+ 2 - 0
src/bin/auth/tests/datasrc_clients_builder_unittest.cc

@@ -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>

+ 2 - 0
src/lib/datasrc/tests/client_list_unittest.cc

@@ -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>

+ 3 - 1
src/lib/datasrc/tests/memory/segment_object_holder_unittest.cc

@@ -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);

+ 2 - 0
src/lib/datasrc/tests/memory/zone_data_updater_unittest.cc

@@ -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>