WIP conversion to while loop
This commit is contained in:
@@ -121,7 +121,7 @@ static void ptest_signal(int sig) {
|
||||
assert_err_num++;
|
||||
strcat(assert_err, assert_err_buff);
|
||||
|
||||
pt_color(RED); printf("Failed! \n\n%s\n", assert_err); pt_color(WHITE);
|
||||
pt_color(WHITE); pt_color(RED); printf("Failed! \n\n%s\n", assert_err); pt_color(WHITE);
|
||||
|
||||
printf(" | Stopping Execution.\n");
|
||||
fflush(stdout);
|
||||
@@ -147,11 +147,13 @@ static void pt_title_case(char* output, const char* input) {
|
||||
}
|
||||
|
||||
if (space && output[i] >= 'a' && output[i] <= 'z') {
|
||||
space = 0;
|
||||
output[i] = output[i] - 32;
|
||||
continue;
|
||||
}
|
||||
|
||||
space = 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -4,7 +4,10 @@
|
||||
#include <string.h>
|
||||
|
||||
#define PT_SUITE(name) void name(void)
|
||||
#define PT_TEST(name) auto void name(void); pt_add_test(name, #name, __func__); void name(void)
|
||||
|
||||
#define PT_FUNC(name) static void name(void)
|
||||
#define PT_REG(name) pt_add_test(name, #name, __func__)
|
||||
#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__)
|
||||
|
@@ -26,6 +26,7 @@ void test_regex_basic(void) {
|
||||
PT_ASSERT(mpc_match(re2, "abc", "abc", string_eq, free, string_print));
|
||||
PT_ASSERT(mpc_match(re2, "abcabab", "abcabab", string_eq, free, string_print));
|
||||
PT_ASSERT(mpc_match(re2, "abcababd", "abcabab", string_eq, free, string_print));
|
||||
PT_ASSERT(mpc_match(re5, "abck", "", string_eq, free, string_print));
|
||||
|
||||
mpc_delete(re0);
|
||||
mpc_delete(re1);
|
||||
|
Reference in New Issue
Block a user