Started writing the uiControl error tests.
This commit is contained in:
parent
6903bebe7d
commit
28a5cd543a
|
@ -24,17 +24,23 @@ static void testVtableTestMethod(uiControl *c, void *implData)
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
static void createTestVtables(uiControlVtable *vtable, uiControlOSVtable **osVtable)
|
static void createTestVtable(uiControlVtable *vtable)
|
||||||
{
|
{
|
||||||
memset(&vtable, 0, sizeof (uiControlVtable));
|
memset(&vtable, 0, sizeof (uiControlVtable));
|
||||||
vtable.Size = sizeof (uiControlVtable);
|
vtable.Size = sizeof (uiControlVtable);
|
||||||
vtable.Init = testVtableInit;
|
vtable.Init = testVtableInit;
|
||||||
vtable.Free = testVtableFree;
|
vtable.Free = testVtableFree;
|
||||||
memset(&osVtable, 0, sizeof (struct testOSVtable));
|
|
||||||
osVtable.Size = sizeof (struct testOSVtable);
|
|
||||||
osVtable.TestMethod = testVtableTestMethod;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO namePlaceholder == "name"
|
||||||
|
struct checkControlErrorsParams {
|
||||||
|
const char *namePlaceholder;
|
||||||
|
uiControlVtable *vtablePlaceholder;
|
||||||
|
uiControlOSVtable *osVtablePlaceholder;
|
||||||
|
size_t implDataSizePlaceholder;
|
||||||
|
uiControlVtable *badSizeVtable;
|
||||||
|
};
|
||||||
|
|
||||||
testingTest(ControlErrors)
|
testingTest(ControlErrors)
|
||||||
{
|
{
|
||||||
uiControlVtable vtablePlacheolder, vtableBadSize;
|
uiControlVtable vtablePlacheolder, vtableBadSize;
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
// 11 june 2019
|
||||||
|
|
||||||
|
checkErrorCase(uiRegisterControlType(NULL, p->vtablePlaceholder, p->osVtablePlaceholder, p->implDataSizePlaceholder),
|
||||||
|
"TODO")
|
||||||
|
checkErrorCase(uiRegisterControlType(p->namePlaceholder, NULL, p->osVtablePlaceholder, p->implDataSizePlaceholder),
|
||||||
|
"TODO")
|
||||||
|
checkErrorCase(uiRegisterControlType(p->namePlaceholder, p->badVtableSize, p->osVtablePlaceholder, p->implDataSizePlaceholder),
|
||||||
|
"TODO");
|
||||||
|
// TODO individual methods
|
||||||
|
checkErrorCase(uiRegisterControlType(p->namePlaceholder, p->vtablePlaceholder, NULL, p->implDataSizePlaceholder),
|
||||||
|
"TODO");
|
||||||
|
// OS vtable sizes are tested per-OS
|
Loading…
Reference in New Issue