]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix warning with OOM testing is disabled
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 29 May 2008 19:41:40 +0000 (19:41 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 29 May 2008 19:41:40 +0000 (19:41 +0000)
ChangeLog
tests/testutils.c

index 530af890cefea6a64974b96a0b67e9b4e6fd0515..3f143e57447dbaa21890ae7d6761728fb131fc20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu May 29 15:41:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
+
+       * tests/testutils.c: Fix warning when OOM testing is disabled
+
 Thu May 29 15:25:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
 
        * configure.in, scripts/*: Remove all coverage helper scripts
index 6eea4981ff8a769a7d0b2e079d399f98dc2988d9..d998d1fdf489c24a1064fb3dc94b49166985bc48 100644 (file)
@@ -287,15 +287,17 @@ int virtTestDifference(FILE *stream,
     return 0;
 }
 
+#if TEST_OOM
 static void
 virtTestErrorFuncQuiet(void *data ATTRIBUTE_UNUSED,
                        virErrorPtr err ATTRIBUTE_UNUSED)
 { }
+#endif
 
+#if TEST_OOM_TRACE
 static void
 virtTestErrorHook(int n, void *data ATTRIBUTE_UNUSED)
 {
-#if TEST_OOM_TRACE
     void *trace[30];
     int ntrace = ARRAY_CARDINALITY(trace);
     int i;
@@ -311,8 +313,8 @@ virtTestErrorHook(int n, void *data ATTRIBUTE_UNUSED)
         }
         free(symbols);
     }
-#endif
 }
+#endif
 
 
 int virtTestMain(int argc,
@@ -352,9 +354,10 @@ int virtTestMain(int argc,
     if (ret != EXIT_SUCCESS)
         return EXIT_FAILURE;
 
+#if TEST_OOM_TRACE
     if (testDebug)
         virAllocTestHook(virtTestErrorHook, NULL);
-
+#endif
 
     if (testOOM) {
         /* Makes next test runs quiet... */