Workaround for now. I should have specified in the bug that I overlooked it because my version of clang seems to use C99 for Objective-C by default, but not for Objective-C++. I'll do that when I'm next online. Anyway, now to write uiControl functionality tests.

This commit is contained in:
Pietro Gagliardi 2019-06-16 21:26:05 -04:00
parent 517791f04e
commit a907353c9c
3 changed files with 23 additions and 20 deletions

View File

@ -0,0 +1,22 @@
// 16 june 2019
#import "test_darwin.h"
// TODO move this back to C++ once https://github.com/mesonbuild/meson/issues/5495 is resolved
static void doRCTWrongSizeTest(void)
{
uiControlOSVtable vtable;
memset(&vtable, 0, sizeof (uiControlOSVtable));
vtable.Size = 1;
uiRegisterControlType("name", testVtable(), &vtable, 0);
}
const struct checkErrorCase controlOSVtableCases[] = {
{
"uiRegisterControlType() with OS vtable with wrong size",
doRCTWrongSizeTest,
"uiRegisterControlType(): wrong size 1 for uiControlOSVtable",
},
{ NULL, NULL, NULL },
};

View File

@ -1,17 +0,0 @@
// 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

@ -16,11 +16,9 @@ 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',
'controls_darwin_errors.m',
]
else
libui_test_sources += [