test.h (954B)
1 #define TEST_H 2 3 #include <inttypes.h> 4 #include <pthread.h> 5 #include <stdarg.h> 6 #include <stdbool.h> 7 #include <stdio.h> 8 #include <stdlib.h> 9 #include <string.h> 10 11 #include "../src/nissy.h" 12 #include "../src/arch/arch.h" 13 #include "../src/solvers/tables_types_macros.h" 14 #include "../src/solvers/h48/coordinate_macros.h" 15 #include "../src/solvers/h48/map_types_macros.h" 16 #include "../src/solvers/h48/gendata_types_macros.h" 17 18 #define STRLENMAX 10000 19 20 /* Basic functions used in most tests */ 21 cube_t solvedcube(void); 22 bool iserror(cube_t); 23 bool isconsistent(cube_t); 24 bool issolvable(cube_t); 25 bool issolved(cube_t); 26 cube_t readcube(char *, char *); 27 int64_t writecube(char *, cube_t, uint64_t, char *); 28 29 /* Test function to be implemented by all tests */ 30 void run(void); 31 32 void log_stderr(const char *str, ...) 33 { 34 va_list args; 35 36 va_start(args, str); 37 vfprintf(stderr, str, args); 38 va_end(args); 39 } 40 41 int main(void) { 42 nissy_setlogger(log_stderr); 43 run(); 44 return 0; 45 }