3 \details This is a testing driver for the IR system of APC.
6 ----------------------------------------------------------------------------*/
8 #include <stdio.h> //print
9 #include <stdlib.h> //itoa
10 #include <errno.h> //lib errors
20 /* Ansi Term Colors */
21 #define RED "\x1b[31m"
22 #define GREEN "\x1b[32m"
23 #define YELLOW "\x1b[33m"
24 #define BLUE "\x1b[34m"
25 #define MAGENTA "\x1b[35m"
26 #define CYAN "\x1b[36m"
27 #define CLRC "\x1b[0m" //clear current color
33 int test_ir_densedir(void);
39 #define PRINTFAIL(U) printf(RED $(U) "FAILED\n" CLRC)
40 #define PRINTPASS(U) printf(GREEN $(U) "PASS\n" CLRC)
41 #define PRINTINFO(S) printf(YELLOW S CLRC)
42 #define RUN_UNIT(U,T) \
49 { RUN_UNIT(test_init
,"Initializing\n");
50 RUN_UNIT(test_mem
,"Memtest\n");
51 RUN_UNIT(test_ir
,"Testing IR API\n");
60 printf("Init Run %-2i\n",n
+1);
66 return (++n
< TESTS
) ? test_init() : ir_init();
81 /* Test for 64*64 dense directories */
86 #define SSTRLEN(S) (sizeof(S)/sizeof(S[0]))
91 { static char dbuf
[256] = "DEEP";
92 static char wbuf
[256] = "WIDE";
93 static int depth
= -1;
94 static int width
= -1;
95 static char *dnum
= dbuf
+ SSTRLEN(dbuf
) - 1;
96 static char *wnum
= wbuf
+ SSTRLEN(wbuf
) - 1;
98 while (++depth
< DISTANCE
)
99 { itoa(depth
,dnum
,10);
101 while (++width
< DISTANCE
)
102 { itoa(width
,wnum
,10);