Finished reintegrating test/noinitwrongthread.c. That was easy!

This commit is contained in:
Pietro Gagliardi 2020-05-10 14:57:03 -04:00
parent 21a0550076
commit 5d17ee6e70
3 changed files with 7 additions and 10 deletions

View File

@ -54,7 +54,7 @@ libui_testlist_h = custom_target(
command: [python, libui_testlist_py, 'header', '@OUTPUT@', '@INPUT@']) command: [python, libui_testlist_py, 'header', '@OUTPUT@', '@INPUT@'])
libui_testlist_c = custom_target( libui_testlist_c = custom_target(
'testlist.c', 'testlist.c',
input: libui_test_sources, input: libui_test_sources + libui_allcalls_headers,
output: ['testlist.c'], output: ['testlist.c'],
command: [python, libui_testlist_py, 'source', '@OUTPUT@', '@INPUT@']) command: [python, libui_testlist_py, 'source', '@OUTPUT@', '@INPUT@'])

View File

@ -1,16 +1,13 @@
// 28 may 2019 // 28 may 2019
#include "test.h" #include "test.h"
#include "thread.h"
if match is not None:
f = match.group(1)
casenames.append('TestCallOnWrongThreadIsProgrammerError_' + f)
// TODO rename to FunctionsFailBeforeInit? // TODO rename to FunctionsFailBeforeInit?
#define allcallsCase(f, ...) \ #define allcallsCase(f, ...) \
TestNoInit(CallBeforeInitIsProgrammerError_ ## f) \ TestNoInit(CallBeforeInitIsProgrammerError_ ## f) \
{ \ { \
void *ctx; \ void *ctx; \
ctx = beginCheckProgrammerError("atteTODOmpt to call " #f "() before uiInit()"); \ ctx = beginCheckProgrammerError("attempt to call " #f "() before uiInit()"); \
f(__VA_ARGS__); \ f(__VA_ARGS__); \
endCheckProgrammerError(ctx); \ endCheckProgrammerError(ctx); \
} }
@ -21,7 +18,7 @@ TestNoInit(CallBeforeInitIsProgrammerError_uiQueueMain)
{ {
void *ctx; void *ctx;
ctx = beginCheckProgrammerError("atteTODOmpt to call uiQueueMain() before uiInit()"); ctx = beginCheckProgrammerError("attempt to call uiQueueMain() before uiInit()");
uiQueueMain(NULL, NULL); uiQueueMain(NULL, NULL);
endCheckProgrammerError(ctx); endCheckProgrammerError(ctx);
} }
@ -37,7 +34,7 @@ TestNoInit(CallBeforeInitIsProgrammerError_uiQueueMain)
threadThread *thread; \ threadThread *thread; \
threadSysError err; \ threadSysError err; \
void *ctx; \ void *ctx; \
ctx = beginCheckProgrammerError("atteTODOmpt to call " #f "() on a thread other than the GUI thread"); \ ctx = beginCheckProgrammerError("attempt to call " #f "() on a thread other than the GUI thread"); \
err = threadNewThread(threadTest ## f, NULL, &thread); \ err = threadNewThread(threadTest ## f, NULL, &thread); \
if (err != 0) \ if (err != 0) \
TestFatalf("error creating thread: " threadSysErrorFmt, threadSysErrorFmtArg(err)); \ TestFatalf("error creating thread: " threadSysErrorFmt, threadSysErrorFmtArg(err)); \

View File

@ -159,8 +159,8 @@ def main():
if match is not None: if match is not None:
f = match.group(1) f = match.group(1)
# noinitwrongthread.c # noinitwrongthread.c
casenames.append('TestCallBeforeInitIsProgrammerError_' + f) casenames.append('CallBeforeInitIsProgrammerError_' + f)
casenames.append('TestCallOnWrongThreadIsProgrammerError_' + f) casenames.append('CallOnWrongThreadIsProgrammerError_' + f)
cmd.run(sorted(casenames)) cmd.run(sorted(casenames))
main() main()