changed t/Makefile.am.
enhanced the test macros
This commit is contained in:
parent
1456f8fc79
commit
ac79225bb4
@ -4,6 +4,7 @@ AM_CFLAGS = $(PTHREAD_CFLAGS)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(abs_builddir) \
|
||||
-I$(abs_builddir)../lib \
|
||||
-I$(abs_srcdir) \
|
||||
-I$(abs_srcdir)/../lib \
|
||||
-I$(includedir)
|
||||
|
15
moo/t/t.h
15
moo/t/t.h
@ -3,8 +3,19 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define T_ASSERT_FAIL1(msg1) printf("FAILURE in %s[%d] - %s\n", __func__, (int)__LINE__, msg1)
|
||||
#define T_ASSERT_FAIL2(msg1,msg2) printf("FAILURE in %s[%d] - %s - %s\n", __func__, (int)__LINE__, msg1, msg2)
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__>=199901L)
|
||||
# define T_ASSERT_FAIL1(msg1) printf("FAILURE in %s[%d] - %s\n", __func__,
|
||||
(int)__LINE__, msg1)
|
||||
# define T_ASSERT_FAIL2(msg1,msg2) printf("FAILURE in %s[%d] - %s - %s\n",
|
||||
__func__, (int)__LINE__, msg1, msg2)
|
||||
#else
|
||||
# define T_ASSERT_FAIL1(msg1) printf("FAILURE in %s[%d] - %s\n", __FILE__,
|
||||
(int)__LINE__, msg1)
|
||||
# define T_ASSERT_FAIL2(msg1,msg2) printf("FAILURE in %s[%d] - %s - %s\n",
|
||||
__FILE__, (int)__LINE__, msg1, msg2)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define T_ASSERT1(test,msg1) do { if (!(test)) { T_ASSERT_FAIL1(msg1); goto oops; } } while(0)
|
||||
#define T_ASSERT2(test,msg1,msg2) do { if (!(test)) { T_ASSERT_FAIL2(msg1,msg2); goto oops; } } while(0)
|
||||
|
Loading…
Reference in New Issue
Block a user