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:
Pietro Gagliardi 2019-06-16 20:34:56 -04:00
parent aa7da7b647
commit 517791f04e
4 changed files with 24 additions and 1 deletions

View File

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

View File

@ -215,6 +215,6 @@ static const struct checkErrorCase casesAfterOSVtable[] = {
testingTest(ControlErrors)
{
checkProgrammerErrors(t, casesBeforeOSVtable);
// OS vtable sizes are tested per-OS
checkProgrammerErrors(t, controlOSVtableCases);
checkProgrammerErrors(t, casesAfterOSVtable);
}

View File

@ -16,8 +16,11 @@ if libui_OS == 'windows'
'controls_windows.c',
]
elif libui_OS == 'darwin'
add_languages('objcpp',
required: true)
libui_test_sources += [
'controls_darwin.m',
'controls_darwin_errors.mm',
]
else
libui_test_sources += [

View File

@ -57,6 +57,9 @@ extern size_t testImplDataSize(void);
extern uint32_t testControlType;
extern uint32_t testControlType2;
// controls_errors.cpp
extern const struct checkErrorCase controlOSVtableCases[];
#ifdef __cplusplus
}
#endif