1 #ifndef H_TESTOASTERROR
2 #define H_TESTOASTERROR
3 
4 #include <stdint.h>
5 #include <stdbool.h>
6 
7 // main structure
8 struct testoasterror
9 {
10 	// this is a test library so we handle all weird cases
11 	bool testing;
12 
13 	// test results for one function
14 	bool* results;
15 	bool* results_cur;
16 	bool* results_end;
17 
18 	// whether the function made too much tests for the results array
19 	bool failoverflow; // <3
20 	// execution fail
21 	bool failexec;
22 
23 	// test functions
24 	void (**funcs)(struct testoasterror*);
25 	uint16_t funcs_index;
26 	uint16_t funcs_count;
27 };
28 
29 // testoasterror can be static if you want it to (:
30 void testoasterror_init(
31 	struct testoasterror* test,
32 	bool* results,
33 	uint8_t max,
34 	void (**funcs)(struct testoasterror*),
35 	uint16_t count);
36 bool testoasterror_run(struct testoasterror* test);
37 bool testoasterror(struct testoasterror* test, bool expr);
38 void testoasterror_count(struct testoasterror* test, uint16_t count);
39 void testoasterror_fail(struct testoasterror* test);
40 
41 #endif
42