diff --git a/src/libei-device.c b/src/libei-device.c index f30f5ec..3e75da1 100644 --- a/src/libei-device.c +++ b/src/libei-device.c @@ -281,19 +281,21 @@ test_device_context(const MunitParameter params[], void *user_data) return MUNIT_OK; } +#define TEST(_func) \ + { .name = #_func, .test = _func } static MunitTest ei_device_tests[] = { - { "/new", test_device_new, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}, - { "/ids", test_device_ids, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}, - { "/ref", test_device_ref_unref, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}, - { "/capability", test_device_cap, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}, - { "/context", test_device_context, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}, + TEST(test_device_new), + TEST(test_device_ids), + TEST(test_device_ref_unref), + TEST(test_device_cap), + TEST(test_device_context), { NULL }, }; static const MunitSuite libei_device_suite __attribute__((used)) __attribute__((section("test_section"))) = { - "/device", + "/device/", ei_device_tests, NULL, 1, diff --git a/src/libei.c b/src/libei.c index 035b652..1ed3550 100644 --- a/src/libei.c +++ b/src/libei.c @@ -858,9 +858,12 @@ test_configure_name(const MunitParameter params[], void *user_data) return MUNIT_OK; } +#define TEST(_func) \ + { .name = #_func, .test = _func } + static MunitTest ei_tests[] = { - { "/init_unref", test_init_unref, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}, - { "/name", test_configure_name, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}, + TEST(test_init_unref), + TEST(test_configure_name), { NULL }, };