Build sdi/library by default.
[AROS.git] / test / exec / allocxxx.c
blob32c8951c92518ef589a731d03a7ab2be3d636262
1 #include <proto/exec.h>
3 #include <stdio.h>
4 #include <string.h>
5 #include "test.h"
7 APTR pool = NULL;
8 APTR poolclear = NULL;
10 #define ALLOCTEST(cmd) \
11 mem = cmd; \
12 TEST((mem == NULL)) \
14 #define FREETEST(cmd) \
15 cmd; \
16 TEST((TRUE)) \
18 int main(int argc, char **argv)
20 APTR mem = NULL;
21 pool = CreatePool(MEMF_ANY, 16384, 8192);
22 poolclear = CreatePool(MEMF_ANY|MEMF_CLEAR, 16384, 8192);
24 /* Behavior validated with OS3.x, OS4.x and MorphOS */
26 ALLOCTEST(AllocMem(0, MEMF_ANY))
27 ALLOCTEST(AllocMem(0, MEMF_ANY | MEMF_CLEAR))
28 FREETEST(FreeMem(NULL, 0))
31 ALLOCTEST(AllocVec(0, MEMF_ANY))
32 ALLOCTEST(AllocVec(0, MEMF_ANY | MEMF_CLEAR))
33 FREETEST(FreeVec(NULL))
36 ALLOCTEST(AllocPooled(pool, 0))
37 ALLOCTEST(AllocPooled(poolclear, 0))
38 FREETEST(FreePooled(pool, NULL, 0))
41 ALLOCTEST(AllocVecPooled(pool, 0))
42 ALLOCTEST(AllocVecPooled(poolclear, 0))
43 FREETEST(FreeVecPooled(pool, NULL))
45 cleanup();
47 return 0;
50 void cleanup()
52 DeletePool(pool);
53 DeletePool(poolclear);