1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 14:30:43 -08:00
emacs/mps/code/poolncv.c
Richard Brooksby c0bb4cd3cd Removing hopenames from the master sources.
This change will be integrated but ignored (-ay) to the gg-epcore/union sources, so that they retain HopeNames.

Copied from Perforce
 Change: 24911
 ServerID: perforce.ravenbrook.com
2001-12-07 13:19:25 +00:00

49 lines
993 B
C

/* impl.c.poolncv: NULL POOL COVERAGE TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited.
*/
#include "mpm.h"
#include "pooln.h"
#include "mpsavm.h"
#include "testlib.h"
static Bool testit(ArenaClass class, ...)
{
Bool eflag = FALSE;
Arena arena;
Pool pool;
Res res;
Addr p;
va_list args;
va_start(args, class);
die(ArenaCreateV(&arena, class, args), "ArenaCreate");
va_end(args);
die(PoolCreate(&pool, arena, PoolClassN()), "PoolNCreate");
res = PoolAlloc(&p, pool, 1, /* withReservoirPermit */ FALSE);
if(res == ResOK) {
fprintf(stderr,
"Error: Unexpectedly succeeded in"
"allocating block from PoolN\n");
eflag = TRUE;
}
PoolDestroy(pool);
ArenaDestroy(arena);
return eflag;
}
int main(void)
{
if(testit((ArenaClass)mps_arena_class_vm(), (Size)200000)) {
fprintf(stderr, "Conclusion: Defects found.\n");
} else {
fprintf(stderr, "Conclusion: Failed to find any defects.\n");
}
return 0;
}