From 6a8dc2e3f96fdee22db64256165b945ecc16bfda Mon Sep 17 00:00:00 2001 From: Daniel Holden Date: Tue, 10 Mar 2015 10:50:29 +0000 Subject: [PATCH] Fixed ptest compile errors --- tests/ptest.c | 8 ++++---- tests/ptest.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/ptest.c b/tests/ptest.c index de2d534..f5ffc8d 100644 --- a/tests/ptest.c +++ b/tests/ptest.c @@ -44,7 +44,7 @@ enum { LIGHT_YELLOW = 14, LIGHT_WHITE = 15, - DEFAULT = 16, + DEFAULT = 16 }; #ifdef _WIN32 @@ -106,8 +106,7 @@ static char assert_err[MAX_ERROR]; static char assert_err_buff[MAX_ERROR]; static int assert_err_num = 0; -void pt_assert_run( - int result, const char* expr, const char* func, const char* file, int line) { +void pt_assert_run(int result, const char* expr, const char* file, int line) { num_asserts++; test_passing = test_passing && result; @@ -139,6 +138,7 @@ static void ptest_signal(int sig) { case SIGSEGV: sprintf(assert_err_buff, " %i. Segmentation Fault\n", assert_err_num+1); break; + default: break; } assert_err_num++; @@ -240,7 +240,7 @@ static char current_suite[MAX_NAME]; int pt_run(void) { - unsigned int i; + int i; double total; test_t test; diff --git a/tests/ptest.h b/tests/ptest.h index 8c436cd..43ca3b5 100644 --- a/tests/ptest.h +++ b/tests/ptest.h @@ -6,13 +6,13 @@ #define PT_SUITE(name) void name(void) #define PT_FUNC(name) static void name(void) -#define PT_REG(name) pt_add_test(name, #name, __func__) +#define PT_REG(name) pt_add_test(name, #name) #define PT_TEST(name) auto void name(void); PT_REG(name); void name(void) -#define PT_ASSERT(expr) pt_assert_run((int)(expr), #expr, __func__, __FILE__, __LINE__) -#define PT_ASSERT_STR_EQ(fst, snd) pt_assert_run(strcmp(fst, snd) == 0, "strcmp( " #fst ", " #snd " ) == 0", __func__, __FILE__, __LINE__) +#define PT_ASSERT(expr) pt_assert_run((int)(expr), #expr, __FILE__, __LINE__) +#define PT_ASSERT_STR_EQ(fst, snd) pt_assert_run(strcmp(fst, snd) == 0, "strcmp( " #fst ", " #snd " ) == 0", __FILE__, __LINE__) -void pt_assert_run(int result, const char* expr, const char* func, const char* file, int line); +void pt_assert_run(int result, const char* expr, const char* file, int line); void pt_add_test(void (*func)(void), const char* name, const char* suite); void pt_add_suite(void (*func)(void));