summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/dbestfit-3.3/mytest.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pdbox/dbestfit-3.3/mytest.c')
-rw-r--r--apps/plugins/pdbox/dbestfit-3.3/mytest.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/apps/plugins/pdbox/dbestfit-3.3/mytest.c b/apps/plugins/pdbox/dbestfit-3.3/mytest.c
deleted file mode 100644
index 80407dee00..0000000000
--- a/apps/plugins/pdbox/dbestfit-3.3/mytest.c
+++ /dev/null
@@ -1,69 +0,0 @@
1#include <stdio.h>
2#include <stdlib.h>
3
4#include "bmalloc.h"
5
6int main(int argc, char **argv)
7{
8 void *pointers[5];
9 int i;
10 void *area;
11
12 for(i=0; i<5; i++)
13 pointers[i] = malloc(8000);
14
15 if(argc>1) {
16 switch(argv[1][0]) {
17 case '1':
18 for(i=0; i<5; i++) {
19 add_pool(pointers[i], 4000);
20 add_pool((char *)pointers[i]+4000, 4000);
21 }
22 break;
23 case '2':
24 area = malloc(20000);
25 add_pool(area, 3000);
26 add_pool((char *)area+6000, 3000);
27 add_pool((char *)area+3000, 3000);
28 add_pool((char *)area+12000, 3000);
29 add_pool((char *)area+9000, 3000);
30 break;
31 case '3':
32 {
33 void *ptr[10];
34 area = malloc(20000);
35 add_pool(area, 20000);
36
37 printf(" ** TEST USAGE\n");
38 for(i=0; i<9; i++)
39 ptr[i]=bmalloc(200);
40 print_lists();
41 for(i=0; i<9; i++)
42 bfree(ptr[i]);
43 printf(" ** END OF TEST USAGE\n");
44 }
45
46 break;
47 case '4':
48 {
49 void *ptr[10];
50 area = malloc(20000);
51 add_pool(area, 20000);
52
53 ptr[0]=bmalloc(4080);
54 print_lists();
55 bfree(ptr[0]);
56 printf(" ** END OF TEST USAGE\n");
57 }
58
59 break;
60 }
61 }
62 else
63 for(i=4; i>=0; i--)
64 add_pool(pointers[i], 8000-i*100);
65
66 print_lists();
67
68 return 0;
69}