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@'])
libui_testlist_c = custom_target(
'testlist.c',
input: libui_test_sources,
input: libui_test_sources + libui_allcalls_headers,
output: ['testlist.c'],
command: [python, libui_testlist_py, 'source', '@OUTPUT@', '@INPUT@'])

View File

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

View File

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