Started writing the macOS control errors file. We have a meson problem now... it's not respecting cpp_std for Objective-C++.
This commit is contained in:
parent
aa7da7b647
commit
517791f04e
|
@ -0,0 +1,17 @@
|
||||||
|
// 16 june 2019
|
||||||
|
#import "test_darwin.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 },
|
||||||
|
};
|
|
@ -215,6 +215,6 @@ static const struct checkErrorCase casesAfterOSVtable[] = {
|
||||||
testingTest(ControlErrors)
|
testingTest(ControlErrors)
|
||||||
{
|
{
|
||||||
checkProgrammerErrors(t, casesBeforeOSVtable);
|
checkProgrammerErrors(t, casesBeforeOSVtable);
|
||||||
// OS vtable sizes are tested per-OS
|
checkProgrammerErrors(t, controlOSVtableCases);
|
||||||
checkProgrammerErrors(t, casesAfterOSVtable);
|
checkProgrammerErrors(t, casesAfterOSVtable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,11 @@ if libui_OS == 'windows'
|
||||||
'controls_windows.c',
|
'controls_windows.c',
|
||||||
]
|
]
|
||||||
elif libui_OS == 'darwin'
|
elif libui_OS == 'darwin'
|
||||||
|
add_languages('objcpp',
|
||||||
|
required: true)
|
||||||
libui_test_sources += [
|
libui_test_sources += [
|
||||||
'controls_darwin.m',
|
'controls_darwin.m',
|
||||||
|
'controls_darwin_errors.mm',
|
||||||
]
|
]
|
||||||
else
|
else
|
||||||
libui_test_sources += [
|
libui_test_sources += [
|
||||||
|
|
|
@ -57,6 +57,9 @@ extern size_t testImplDataSize(void);
|
||||||
extern uint32_t testControlType;
|
extern uint32_t testControlType;
|
||||||
extern uint32_t testControlType2;
|
extern uint32_t testControlType2;
|
||||||
|
|
||||||
|
// controls_errors.cpp
|
||||||
|
extern const struct checkErrorCase controlOSVtableCases[];
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue