Stubbed out most of the other uiControl errors to test.

This commit is contained in:
Pietro Gagliardi 2019-06-16 10:20:21 -04:00
parent 3e96dafe44
commit 0bc347dd62
1 changed files with 71 additions and 3 deletions

View File

@ -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);
}