Wrote basic makefile, wrote tests, and then fixed them

This commit is contained in:
Dan Hirsch 2012-04-29 01:45:52 +01:00
parent 7adae0da7c
commit faab7b7cf8
11 changed files with 137 additions and 11 deletions

17
src/test_suite.h Normal file
View file

@ -0,0 +1,17 @@
#ifndef HAMMER_TEST_SUITE__H
#define HAMMER_TEST_SUITE__H
// Equivalent to g_assert_*, but not using g_assert...
#define g_check_cmpint(n1, op, n2) { \
typeof (n1) _n1 = (n1); \
typeof (n2) _n2 = (n2); \
if (!(_n1 op _n2)) { \
g_test_message("Check failed: (%s): (%d %s %d)", \
#n1 " " #op " " #n2, \
_n1, #op, _n2); \
g_test_fail(); \
} \
}
#endif // #ifndef HAMMER_TEST_SUITE__H