Reintegrated the Windows control tests. We may be close to getting rid of zNEW_test!
This commit is contained in:
parent
22bcf088e9
commit
e73c3363ec
|
@ -0,0 +1,25 @@
|
|||
// 10 june 2019
|
||||
#include "test_windows.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);
|
||||
}
|
|
@ -9,7 +9,11 @@ libui_test_sources = files([
|
|||
libui_allcalls_headers = files([
|
||||
'allcalls.h',
|
||||
])
|
||||
if libui_OS == 'darwin'
|
||||
if libui_OS == 'windows'
|
||||
libui_test_sources += files([
|
||||
'controls_windows.c',
|
||||
])
|
||||
elif libui_OS == 'darwin'
|
||||
libui_test_sources += files([
|
||||
'controls_darwin.m',
|
||||
])
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
// 10 june 2019
|
||||
#include "test_windows.h"
|
||||
|
||||
static const uiControlOSVtable vtable = {
|
||||
.Size = sizeof (uiControlOSVtable),
|
||||
};
|
||||
|
||||
const uiControlOSVtable *testOSVtable(void)
|
||||
{
|
||||
return &vtable;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
// 16 june 2019
|
||||
#include "test_windows.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