Slight refactoring of the controls test. One more thing to do for now.
This commit is contained in:
parent
c1ca78c46e
commit
f3b0dc16ab
|
@ -17,12 +17,18 @@ static void testVtableFree(uiControl *c, void *implData)
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
static void createTestVtable(uiControlVtable *vtable)
|
uiControlVtable *allocVtableFull(testingT *t, const char *file, long line)
|
||||||
{
|
{
|
||||||
memset(vtable, 0, sizeof (uiControlVtable));
|
uiControlVtable *v;
|
||||||
vtable->Size = sizeof (uiControlVtable);
|
|
||||||
vtable->Init = testVtableInit;
|
v = (uiControlVtable *) malloc(sizeof (uiControlVtable));
|
||||||
vtable->Free = testVtableFree;
|
if (v == NULL)
|
||||||
|
testingTFatalfFull(t, file, line, "memory exhausted allocating uiControlVtable");
|
||||||
|
memset(v, 0, sizeof (uiControlVtable));
|
||||||
|
v->Size = sizeof (uiControlVtable);
|
||||||
|
v->Init = testVtableInit;
|
||||||
|
v->Free = testVtableFree;
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct checkControlErrorsParams {
|
struct checkControlErrorsParams {
|
||||||
|
|
|
@ -39,5 +39,7 @@ extern void checkProgrammerErrorFull(testingT *t, const char *file, long line, c
|
||||||
#define checkProgrammerErrorInThread(t, name, f, data, msgWant) checkProgrammerErrorFull(t, __FILE__, __LINE__, name, f, data, msgWant, true)
|
#define checkProgrammerErrorInThread(t, name, f, data, msgWant) checkProgrammerErrorFull(t, __FILE__, __LINE__, name, f, data, msgWant, true)
|
||||||
|
|
||||||
// controls.c
|
// controls.c
|
||||||
|
extern uiControlVtable *allocVtableFull(testingT *t, const char *file, long line);
|
||||||
|
#define allocVtable(t) allocVtableFull(t, __FILE__, __LINE__)
|
||||||
extern uiControlOSVtable *allocOSVtableFull(testingT *t, const char *file, long line);
|
extern uiControlOSVtable *allocOSVtableFull(testingT *t, const char *file, long line);
|
||||||
#define allocOSVtable(t) allocOSVtableFull(t, __FILE__, __LINE__)
|
#define allocOSVtable(t) allocOSVtableFull(t, __FILE__, __LINE__)
|
||||||
|
|
Loading…
Reference in New Issue