aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-02-03 16:08:40 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-02-03 16:08:40 +0100
commitbdd1874f172438453c80f6b1cfcbd7ebbc31f02b (patch)
tree4c9fc8bbcaf32a2e48a16d9ed7d12d7355231664
parent55d344ab963703ac91fb09e7e985395887a08dd6 (diff)
tests,keyfiles: add dummy test to avoid -Wunused-function warnings
If none of the plugins enabled in the build has custom keyfiles, the common_test() method would be unused. Avoid this just by adding a new dummy test which is always available in the keyfiles tester.
-rw-r--r--plugins/tests/test-keyfiles.c12
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);