Deduplicated the common defer functions.
This commit is contained in:
parent
f3b0dc16ab
commit
d54f23c0cc
|
@ -160,16 +160,6 @@ static void runGlobalSubtests(testingT *t, void *data)
|
|||
testingTRun(t, "Nonglobal", runArgsSubtests, data);
|
||||
}
|
||||
|
||||
static void deferFree(testingT *t, void *data)
|
||||
{
|
||||
free(data);
|
||||
}
|
||||
|
||||
static void deferEventFree(testingT *t, void *data)
|
||||
{
|
||||
uiEventFree((uiEvent *) data);
|
||||
}
|
||||
|
||||
static void deferUnregisterHandler(testingT *t, void *data)
|
||||
{
|
||||
unregisterHandler((struct handler *) data);
|
||||
|
|
|
@ -6,12 +6,6 @@ static void dummyHandler(void *sender, void *args, void *data)
|
|||
// do nothing
|
||||
}
|
||||
|
||||
// TODO deduplicate this with events.c
|
||||
static void deferEventFree(testingT *t, void *data)
|
||||
{
|
||||
uiEventFree((uiEvent *) data);
|
||||
}
|
||||
|
||||
struct checkEventErrorsParams {
|
||||
uiEvent *globalEvent;
|
||||
uiEvent *nonglobalEvent;
|
||||
|
|
10
test/main.c
10
test/main.c
|
@ -6,6 +6,16 @@ void timeoutMain(void *data)
|
|||
uiMain();
|
||||
}
|
||||
|
||||
void deferFree(testingT *t, void *data)
|
||||
{
|
||||
free(data);
|
||||
}
|
||||
|
||||
void deferEventFree(testingT *t, void *data)
|
||||
{
|
||||
uiEventFree((uiEvent *) data);
|
||||
}
|
||||
|
||||
static void runSetORingResults(testingSet *set, const struct testingOptions *options, bool *anyRun, bool *anyFailed)
|
||||
{
|
||||
bool ar, af;
|
||||
|
|
|
@ -29,6 +29,8 @@ extern void timeoutMain(void *data);
|
|||
testingTErrorf(t, "uiMain() timed out (%s)", timeoutstr); \
|
||||
} \
|
||||
}
|
||||
extern void deferFree(testingT *t, void *data);
|
||||
extern void deferEventFree(testingT *t, void *data);
|
||||
|
||||
// init.c
|
||||
extern testingSet *beforeTests;
|
||||
|
|
Loading…
Reference in New Issue