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.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user