nmtst: drop details argument from add-test helper
authorThomas Haller <thaller@redhat.com>
Tue, 9 Feb 2016 11:15:49 +0000 (12:15 +0100)
committerThomas Haller <thaller@redhat.com>
Tue, 9 Feb 2016 23:15:41 +0000 (00:15 +0100)
shared/nm-test-utils.h

index 19030c5..b6bc332 100644 (file)
@@ -656,14 +656,13 @@ typedef void (*NmtstTestDataRelease) (const NmtstTestData *test_data);
 
 struct _NmtstTestData {
        const char *testpath;
-       const char *detail;
        NmtstTestDataRelease fcn_release;
        gsize n_args;
        gpointer args[1];
 };
 
 inline static void
-_nmtst_test_data_unpack_detail (const NmtstTestData *test_data, const char **detail, gsize n_args, ...)
+_nmtst_test_data_unpack (const NmtstTestData *test_data, gsize n_args, ...)
 {
        gsize i;
        va_list ap;
@@ -672,9 +671,6 @@ _nmtst_test_data_unpack_detail (const NmtstTestData *test_data, const char **det
        g_assert (test_data);
        g_assert_cmpint (n_args, ==, test_data->n_args);
 
-       if (detail)
-               *detail = test_data->detail;
-
        va_start (ap, n_args);
        for (i = 0; i < n_args; i++) {
                p = va_arg (ap, gpointer *);
@@ -684,8 +680,7 @@ _nmtst_test_data_unpack_detail (const NmtstTestData *test_data, const char **det
        }
        va_end (ap);
 }
-#define nmtst_test_data_unpack_detail(test_data, detail, ...) _nmtst_test_data_unpack_detail(test_data, detail, NM_NARG (__VA_ARGS__), ##__VA_ARGS__)
-#define nmtst_test_data_unpack(test_data, ...)                nmtst_test_data_unpack_detail(test_data, NULL, ##__VA_ARGS__)
+#define nmtst_test_data_unpack(test_data, ...) _nmtst_test_data_unpack(test_data, NM_NARG (__VA_ARGS__), ##__VA_ARGS__)
 
 inline static void
 _nmtst_test_data_free (gpointer data)
@@ -698,12 +693,11 @@ _nmtst_test_data_free (gpointer data)
                test_data->fcn_release (test_data);
 
        g_free ((gpointer) test_data->testpath);
-       g_free ((gpointer) test_data->detail);
        g_free (test_data);
 }
 
 inline static void
-_nmtst_add_test_func_full (const char *testpath, const char *detail, GTestDataFunc test_func, NmtstTestDataRelease fcn_release, gsize n_args, ...)
+_nmtst_add_test_func_full (const char *testpath, GTestDataFunc test_func, NmtstTestDataRelease fcn_release, gsize n_args, ...)
 {
        gsize i;
        NmtstTestData *data;
@@ -712,7 +706,6 @@ _nmtst_add_test_func_full (const char *testpath, const char *detail, GTestDataFu
        data = g_malloc (G_STRUCT_OFFSET (NmtstTestData, args) + sizeof (gpointer) * (n_args + 1));
 
        data->testpath = g_strdup (testpath);
-       data->detail = g_strdup (detail);
        data->fcn_release = fcn_release;
        data->n_args = n_args;
        va_start (ap, n_args);
@@ -726,8 +719,8 @@ _nmtst_add_test_func_full (const char *testpath, const char *detail, GTestDataFu
                                   test_func,
                                   _nmtst_test_data_free);
 }
-#define nmtst_add_test_func_full(testpath, detail, test_func, fcn_release, ...) _nmtst_add_test_func_full(testpath, detail, test_func, fcn_release, NM_NARG (__VA_ARGS__), ##__VA_ARGS__)
-#define nmtst_add_test_func(testpath, detail, test_func, ...) nmtst_add_test_func_full(testpath, detail, test_func, NULL, ##__VA_ARGS__)
+#define nmtst_add_test_func_full(testpath, test_func, fcn_release, ...) _nmtst_add_test_func_full(testpath, test_func, fcn_release, NM_NARG (__VA_ARGS__), ##__VA_ARGS__)
+#define nmtst_add_test_func(testpath, test_func, ...) nmtst_add_test_func_full(testpath, test_func, NULL, ##__VA_ARGS__)
 
 /*****************************************************************************/