]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
viralloc: Export virAllocTest*
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 22 Mar 2013 09:18:48 +0000 (10:18 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 22 Mar 2013 11:45:14 +0000 (12:45 +0100)
If users build with --enable-test-oom configure option,
they get this error saying, virAllocTest* functions are
not defined within tests/testutils.c.

src/libvirt_private.syms
src/util/viralloc.c
src/util/viralloc.h
tests/testutils.c

index 9529265503c0af905086ac083bb5a8a61247f02a..f241ec4e2f8f4d1d4ea9b9863f8ee70978f23815 100644 (file)
@@ -993,6 +993,10 @@ virSecurityManagerVerify;
 # util/viralloc.h
 virAlloc;
 virAllocN;
+virAllocTestCount;
+virAllocTestHook;
+virAllocTestInit;
+virAllocTestOOM;
 virAllocVar;
 virDeleteElementsN;
 virExpandN;
index 807de04f758ebfad3ce70493d827be31c8749215..342b0eb4d863b5d1eaa78f8be8b68fa8fd3ffcba 100644 (file)
@@ -74,6 +74,30 @@ static int virAllocTestFail(void)
     testMallocNext++;
     return fail;
 }
+
+#else
+
+void virAllocTestOOM(int n ATTRIBUTE_UNUSED,
+                     int m ATTRIBUTE_UNUSED)
+{
+    /* nada */
+}
+
+int virAllocTestCount(void)
+{
+    return 0;
+}
+
+void virAllocTestInit(void)
+{
+    /* nada */
+}
+
+void virAllocTestHook(void (*func)(int, void*) ATTRIBUTE_UNUSED,
+                      void *data ATTRIBUTE_UNUSED)
+{
+    /* nada */
+}
 #endif
 
 
index 6f46d0b4e171800a5f1f1f3a292172658fffce59..7be7f82d57b2c2ce662f980739c8f6fb216ed4f2 100644 (file)
@@ -376,15 +376,8 @@ void virFree(void *ptrptr) ATTRIBUTE_NONNULL(1);
 #  define VIR_FREE(ptr) virFree((void *) &(ptr))
 # endif
 
-
-
-# if TEST_OOM
 void virAllocTestInit(void);
 int virAllocTestCount(void);
 void virAllocTestOOM(int n, int m);
 void virAllocTestHook(void (*func)(int, void*), void *data);
-# endif
-
-
-
 #endif /* __VIR_MEMORY_H_ */
index ea46c095cb82d34fe5b93de9a70e60064904df47..0fb69ec928f7b1393deb9385b994daa53eae54ad 100644 (file)
@@ -697,7 +697,7 @@ int virtTestMain(int argc,
             if (worker) {
                 _exit(ret);
             } else {
-                int i, status;
+                int i;
                 for (i = 0 ; i < mp ; i++) {
                     if (virProcessWait(workers[i], NULL) < 0)
                         ret = EXIT_FAILURE;