diff --git a/test/controls_errors.cpp b/test/controls_errors.cpp index 9dfdd4cd..27dd1ab9 100644 --- a/test/controls_errors.cpp +++ b/test/controls_errors.cpp @@ -1,7 +1,7 @@ // 11 june 2019 #include "test.h" -static const struct checkErrorCase cases[] = { +static const struct checkErrorCase casesBeforeOSVtable[] = { { "uiRegisterControlType() with NULL name", [](void) { @@ -47,11 +47,79 @@ static const struct checkErrorCase cases[] = { }, "uiRegisterControlType(): invalid null pointer for uiControlOSVtable", }, - // OS vtable sizes are tested per-OS + { NULL, NULL, NULL }, +}; + +static const struct checkErrorCase casesAfterOSVtable[] = { + { + "uiCheckControlType() with a NULL pointer", + [](void) { + uiCheckControlType(NULL, uiControlType()); + }, + "TODO", + }, + { + "uiCheckControlType() with non-control", + [](void) { + static char buf[] = "this is not a uiControl"; + + uiCheckControlType(buf, uiControlType()); + }, + "TODO", + }, + { + "uiCheckControlType() with a control with an unknown type", + [](void) { + // TODO + }, + "TODO", + }, + { + "uiCheckControlType() asking for an unknown control type", + [](void) { + // TODO + }, + "TODO", + }, + { + "uiCheckControlType() with a type mismatch", + [](void) { + // TODO + }, + "TODO", + }, + + { + "uiNewControl() with uiControlType()", + [](void) { + uiNewControl(uiControlType(), NULL); + }, + "TODO", + }, + { + "uiNewControl() with an unknown control type", + [](void) { + uiNewControl(5, NULL); + }, + "TODO", + }, + // TODO have Init() fail + + // TODO uiControlFree() + + { + "uiControlImplData() with a NULL uiControl", + [](void) { + uiControlImplData(NULL); + }, + "TODO", + }, { NULL, NULL, NULL }, }; testingTest(ControlErrors) { - checkProgrammerErrors(t, cases); + checkProgrammerErrors(t, casesBeforeOSVtable); + // OS vtable sizes are tested per-OS + checkProgrammerErrors(t, casesAfterOSVtable); }