Change gfx.hidd API -:
[AROS.git] / test / exec / allocxxx.c
blob5ad5ce97840ba23811e768231476384d479e04f9
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/exec.h>
8 #include <stdio.h>
9 #include <string.h>
10 #include "test.h"
12 APTR pool = NULL;
13 APTR poolclear = NULL;
15 #define ALLOCTEST(cmd) \
16 mem = cmd; \
17 TEST((mem == NULL)) \
19 #define FREETEST(cmd) \
20 cmd; \
21 TEST((TRUE)) \
23 int main(int argc, char **argv)
25 APTR mem = NULL;
26 pool = CreatePool(MEMF_ANY, 16384, 8192);
27 poolclear = CreatePool(MEMF_ANY|MEMF_CLEAR, 16384, 8192);
29 /* Behavior validated with OS3.x, OS4.x and MorphOS */
31 ALLOCTEST(AllocMem(0, MEMF_ANY))
32 ALLOCTEST(AllocMem(0, MEMF_ANY | MEMF_CLEAR))
33 FREETEST(FreeMem(NULL, 0))
36 ALLOCTEST(AllocVec(0, MEMF_ANY))
37 ALLOCTEST(AllocVec(0, MEMF_ANY | MEMF_CLEAR))
38 FREETEST(FreeVec(NULL))
41 ALLOCTEST(AllocPooled(pool, 0))
42 ALLOCTEST(AllocPooled(poolclear, 0))
43 FREETEST(FreePooled(pool, NULL, 0))
46 ALLOCTEST(AllocVecPooled(pool, 0))
47 ALLOCTEST(AllocVecPooled(poolclear, 0))
48 FREETEST(FreeVecPooled(pool, NULL))
50 cleanup();
52 return 0;
55 void cleanup()
57 DeletePool(pool);
58 DeletePool(poolclear);