And with Unix.
This commit is contained in:
parent
e73c3363ec
commit
de5205d594
|
@ -0,0 +1,25 @@
|
|||
// 10 june 2019
|
||||
#include "test_unix.h"
|
||||
|
||||
static const uiControlOSVtable osVtable = {
|
||||
.Size = sizeof (uiControlOSVtable),
|
||||
};
|
||||
|
||||
const uiControlOSVtable *testOSVtable(void)
|
||||
{
|
||||
return &osVtable;
|
||||
}
|
||||
|
||||
Test(WrongControlOSVtableSizeIsProgrammerError)
|
||||
{
|
||||
uiControlVtable vtable;
|
||||
uiControlOSVtable osvt;
|
||||
void *ctx;
|
||||
|
||||
testControlLoadNopVtable(&vtable);
|
||||
ctx = beginCheckProgrammerError("uiRegisterControlType(): wrong size 1 for uiControlOSVtable");
|
||||
memset(&osvt, 0, sizeof (uiControlOSVtable));
|
||||
osvt.Size = 1;
|
||||
uiRegisterControlType("name", &vtable, &osvt, 0);
|
||||
endCheckProgrammerError(ctx);
|
||||
}
|
|
@ -17,6 +17,10 @@ elif libui_OS == 'darwin'
|
|||
libui_test_sources += files([
|
||||
'controls_darwin.m',
|
||||
])
|
||||
else
|
||||
libui_test_sources += files([
|
||||
'controls_unix.c',
|
||||
])
|
||||
endif
|
||||
|
||||
libui_test_sources_without_cases = [
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
// 10 june 2019
|
||||
#include "test_unix.h"
|
||||
|
||||
static const uiControlOSVtable vtable = {
|
||||
.Size = sizeof (uiControlOSVtable),
|
||||
};
|
||||
|
||||
const uiControlOSVtable *testOSVtable(void)
|
||||
{
|
||||
return &vtable;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
// 16 june 2019
|
||||
#include "test_unix.h"
|
||||
|
||||
const struct checkErrorCase controlOSVtableCases[] = {
|
||||
{
|
||||
"uiRegisterControlType() with OS vtable with wrong size",
|
||||
[](void) {
|
||||
uiControlOSVtable vtable;
|
||||
|
||||
memset(&vtable, 0, sizeof (uiControlOSVtable));
|
||||
vtable.Size = 1;
|
||||
uiRegisterControlType("name", testVtable(), &vtable, 0);
|
||||
},
|
||||
"uiRegisterControlType(): wrong size 1 for uiControlOSVtable",
|
||||
},
|
||||
{ NULL, NULL, NULL },
|
||||
};
|
Loading…
Reference in New Issue