diff --git a/test/initmain.c b/test/initmain.c index 831274ce..e6e83388 100644 --- a/test/initmain.c +++ b/test/initmain.c @@ -52,6 +52,7 @@ TODO if I remove the uiQuit() from this test on Windows, I will occasionally get === RUN TestQueueMain_DifferentThread ../test/initmain.c:161: uiMain() timed out (5s) --- FAIL: TestQueueMain_DifferentThread (4.9989539s) +TODO see if this is still relevant */ static void queued(void *data) { @@ -111,7 +112,6 @@ static void queueOrder(struct testParams *p) uiQueueMain(done, NULL); } -// TODO also actually handle file and line again static void checkOrderFull(const char *file, long line, uint32_t flag) { int i; @@ -120,12 +120,12 @@ static void checkOrderFull(const char *file, long line, uint32_t flag) return; for (i = 1; i < 6; i++) if (flag == orders[i].result) { - TestErrorf("wrong order:" diff("%" PRIu32 " (%s)"), + TestErrorfFull(file, line, "wrong order:" diff("%" PRIu32 " (%s)"), flag, orders[i].order, orders[0].result, orders[0].order); return; } - TestErrorf("wrong result:" diff("%" PRIu32 " (%s)"), + TestErrorfFull(file, line, "wrong result:" diff("%" PRIu32 " (%s)"), flag, "unknown order", orders[0].result, orders[0].order); } diff --git a/test/test.h b/test/test.h index e1e95db2..2097531f 100644 --- a/test/test.h +++ b/test/test.h @@ -71,13 +71,20 @@ extern void TestSkipNow(void); #define TestLogf(...) \ (testingprivLogfFullThen(stdout, NULL, __FILE__, __LINE__, __VA_ARGS__)) +#define TestLogfFull(f, n, ...) \ + (testingprivLogfFullThen(stdout, NULL, f, n, __VA_ARGS__)) #define TestErrorf(...) \ (testingprivLogfFullThen(stderr, TestFail, __FILE__, __LINE__, __VA_ARGS__)) +#define TestErrorfFull(f, n, ...) \ + (testingprivLogfFullThen(stderr, TestFail, f, n, __VA_ARGS__)) #define TestFatalf(...) \ (testingprivLogfFullThen(stderr, TestFailNow, __FILE__, __LINE__, __VA_ARGS__)) +#define TestFatalfFull(f, n, ...) \ + (testingprivLogfFullThen(stderr, TestFailNow, f, n, __VA_ARGS__)) // TODO remember if this needs to go to stdout or to stderr #define TestSkipf(...) \ (testingprivLogfFullThen(stderr, TestSkipNow, __FILE__, __LINE__, __VA_ARGS__)) +// TODO TestSkipfFull (after resolving above TODO) extern void testingprivRegisterTest(const char *name, void (*f)(void)); #include "../sharedbits/printfwarn_header.h"