/*!@file \brief IR Driver \details This is a testing driver for the IR system of APC. \author Jordan Lavatai \date Aug 2016 ----------------------------------------------------------------------------*/ /* Standard */ #include //print #include #include //lib errors /* Internal */ extern //scanner.c int scanner_init(void); extern void scanner_quit(void); /* Ansi Term Colors */ #define RED "\x1b[31m" #define GREEN "\x1b[32m" #define YELLOW "\x1b[33m" #define BLUE "\x1b[34m" #define MAGENTA "\x1b[35m" #define CYAN "\x1b[36m" #define CLRC "\x1b[0m" //clear current color int main(void); int test_init(void); int main #define $($)#$ #define PRINTFAIL(U) printf(RED $(U) " FAILED\n" CLRC) #define PRINTPASS(U) printf(GREEN $(U) " PASSED\n" CLRC) #define PRINTINFO(S) printf(YELLOW S CLRC) #define RUN_UNIT(U,T) \ do { \ PRINTINFO(T); \ if (U()) \ PRINTFAIL(U); \ PRINTPASS(U); \ } while (0) () { RUN_UNIT(test_init,"Initializing\n"); return 0; } int test_init #define TESTS 50 () { static int n = 0; printf("Init Run %-2i\n",n+1); if (scanner_init()) { perror("scanner init"); return -1; } scanner_quit(); return (++n < TESTS) ? test_init() : scanner_init(); }