diff --git a/test/cases/test_charset.c b/test/cases/test_charset.c index 117f0603..619c793d 100644 --- a/test/cases/test_charset.c +++ b/test/cases/test_charset.c @@ -16,12 +16,14 @@ void test_charset(void) TRUE); #ifdef _WIN32 len = LCUI_DecodeString(wcs, "简体中文", 64, ENCODING_ANSI); - it_b("test decode ansi string", - len == 4 && wcscmp(wcs, L"简体中文") == 0, TRUE); + test_msg("test decode ansi string ... (%s)", + len == 4 && wcscmp(wcs, L"简体中文") == 0 ? "true" : "false"); len = LCUI_EncodeString(str, L"简体中文", 64, ENCODING_ANSI); - it_b("test encode unicode string to ansi", - len == strlen("简体中文") && strcmp(str, "简体中文") == 0, TRUE); + test_msg("test encode unicode string to ansi ... (%s)", + len == strlen("简体中文") && strcmp(str, "简体中文") == 0 + ? "true" + : "false"); #else len = LCUI_DecodeUTF8String(wcs, "简体中文", 64); it_b("test decode utf-8 string", diff --git a/test/cases/test_mainloop.c b/test/cases/test_mainloop.c index 26784449..0cf2d0d1 100644 --- a/test/cases/test_mainloop.c +++ b/test/cases/test_mainloop.c @@ -46,10 +46,10 @@ static void ObserverThread(void *arg) int i; LCUI_BOOL *exited = arg; - for (i = 0; i < 10 && !*exited; ++i) { + for (i = 0; i < 20 && !*exited; ++i) { LCUI_MSleep(100); } - it_b("main loop should exit within 1000ms", *exited, TRUE); + it_b("main loop should exit within 2000ms", *exited, TRUE); if (!*exited) { exit(-print_test_result()); return; diff --git a/test/lib/ctest/include/ctest.h b/test/lib/ctest/include/ctest.h index 3ace8701..f5fa2ed2 100644 --- a/test/lib/ctest/include/ctest.h +++ b/test/lib/ctest/include/ctest.h @@ -6,6 +6,8 @@ void describe(const char *name, void (*func)()); +int test_msg(const char *fmt, ...); + void it_i(const char *name, int actual, int expected); void it_b(const char *name, int actual, int expected); diff --git a/test/lib/ctest/src/ctest.c b/test/lib/ctest/src/ctest.c index 196c5699..ed992154 100644 --- a/test/lib/ctest/src/ctest.c +++ b/test/lib/ctest/src/ctest.c @@ -21,7 +21,7 @@ static size_t tests_total = 0; static int test_msg_indent = 0; static int64_t test_start_time = 0; -static int test_msg(const char *fmt, ...) +int test_msg(const char *fmt, ...) { int ret; char str[1024];