diff options
Diffstat (limited to 'plugins/tests')
-rw-r--r-- | plugins/tests/test-keyfiles.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/tests/test-keyfiles.c b/plugins/tests/test-keyfiles.c index 89ecbb30..35ec4b46 100644 --- a/plugins/tests/test-keyfiles.c +++ b/plugins/tests/test-keyfiles.c @@ -34,6 +34,9 @@ common_test (const gchar *keyfile_path) GError *error = NULL; gboolean ret; + if (!keyfile_path) + return; + keyfile = g_key_file_new (); ret = g_key_file_load_from_file (keyfile, keyfile_path, G_KEY_FILE_NONE, &error); g_assert_no_error (error); @@ -41,6 +44,14 @@ common_test (const gchar *keyfile_path) g_key_file_unref (keyfile); } +/* Dummy test to avoid compiler warning about common_test() being unused + * when none of the plugins enabled in build have custom key files. */ +static void +test_dummy (void) +{ + common_test (NULL); +} + /************************************************************/ #if defined ENABLE_PLUGIN_FOXCONN @@ -78,6 +89,7 @@ int main (int argc, char **argv) setlocale (LC_ALL, ""); g_test_init (&argc, &argv, NULL); + g_test_add_func ("/MM/test-keyfiles/dummy", test_dummy); #if defined ENABLE_PLUGIN_FOXCONN g_test_add_func ("/MM/test-keyfiles/foxconn/t77w968", test_foxconn_t77w968); |