diff --git a/test/controls_darwin_errors.m b/test/controls_darwin_errors.m new file mode 100644 index 00000000..6d68dfb9 --- /dev/null +++ b/test/controls_darwin_errors.m @@ -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 }, +}; diff --git a/test/controls_darwin_errors.mm b/test/controls_darwin_errors.mm deleted file mode 100644 index da95adbb..00000000 --- a/test/controls_darwin_errors.mm +++ /dev/null @@ -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 }, -}; diff --git a/test/meson.build b/test/meson.build index 4412881b..457dfe41 100644 --- a/test/meson.build +++ b/test/meson.build @@ -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 += [