mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
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.
This commit is contained in:
parent
c5f28d0117
commit
70bc623b58
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user