提交 70bc623b 编写于 作者: M Michal Privoznik

viralloc: Export virAllocTest*

If users build with --enable-test-oom configure option,
they get this error saying, virAllocTest* functions are
not defined within tests/testutils.c.
上级 c5f28d01
......@@ -993,6 +993,10 @@ virSecurityManagerVerify;
# util/viralloc.h
virAlloc;
virAllocN;
virAllocTestCount;
virAllocTestHook;
virAllocTestInit;
virAllocTestOOM;
virAllocVar;
virDeleteElementsN;
virExpandN;
......
......@@ -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
......
......@@ -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_ */
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册