tests,udev-rules: add dummy test to avoid -Wunused-function warnings

If none of the plugins enabled in the build has custom udev rules, the
common_test() method would be unused. Avoid this just by adding a new
dummy test which is always available in the udev rules tester.
This commit is contained in:
Aleksander Morgado
2020-02-02 11:33:13 +01:00
parent a8fd33ebaa
commit 55d344ab96
+12
View File
@@ -35,6 +35,9 @@ common_test (const gchar *plugindir)
GArray *rules;
GError *error = NULL;
if (!plugindir)
return;
rules = mm_kernel_device_generic_rules_load (plugindir, &error);
g_assert_no_error (error);
g_assert (rules);
@@ -43,6 +46,14 @@ common_test (const gchar *plugindir)
g_array_unref (rules);
}
/* Dummy test to avoid compiler warning about common_test() being unused
* when none of the plugins enabled in build have custom udev rules. */
static void
test_dummy (void)
{
common_test (NULL);
}
/************************************************************/
#if defined ENABLE_PLUGIN_HUAWEI
@@ -176,6 +187,7 @@ int main (int argc, char **argv)
setlocale (LC_ALL, "");
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/MM/test-udev-rules/dummy", test_dummy);
#if defined ENABLE_PLUGIN_HUAWEI
g_test_add_func ("/MM/test-udev-rules/huawei", test_huawei);