1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 00:01:33 -08:00
emacs/mps/code/poolncv.c
Richard Brooksby 3d5e2ca85f Adding hopenames back into the master sources, so that they can be included in the union sources along with the id keywords.
This was achieved by partially undoing changelist 24817, including an accidental corruption of eventgen.pl.

Copied from Perforce
 Change: 24877
 ServerID: perforce.ravenbrook.com
2001-12-06 18:14:02 +00:00

50 lines
1 KiB
C

/* impl.c.poolncv: NULL POOL COVERAGE TEST
*
* $Id$
* $HopeName: MMsrc!poolncv.c(trunk.9) $
* 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;
}