[librsvg: 49/53] test-utils: remove unused function to add a directory recursively
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 49/53] test-utils: remove unused function to add a directory recursively
- Date: Fri, 23 Oct 2020 02:19:08 +0000 (UTC)
commit 98e36bf0c26e0e5fba0386a44656e196504958fd
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Oct 22 19:50:05 2020 -0500
test-utils: remove unused function to add a directory recursively
tests/test-utils.c | 75 ------------------------------------------------------
tests/test-utils.h | 6 -----
2 files changed, 81 deletions(-)
---
diff --git a/tests/test-utils.c b/tests/test-utils.c
index 7715f096..9a666946 100644
--- a/tests/test-utils.c
+++ b/tests/test-utils.c
@@ -235,81 +235,6 @@ test_utils_get_test_data_path (void)
return data_path;
}
-static int
-compare_files (gconstpointer a, gconstpointer b)
-{
- char *uri1 = g_file_get_uri (G_FILE(a));
- char *uri2 = g_file_get_uri (G_FILE(b));
-
- int result = strcmp (uri1, uri2);
-
- g_free (uri1);
- g_free (uri2);
-
- return result;
-}
-
-void
-test_utils_add_test_for_all_files (const gchar *prefix,
- GFile *base,
- GFile *file,
- GTestDataFunc test_func,
- AddTestFunc add_test_func)
-{
- GFileEnumerator *enumerator;
- GFileInfo *info;
- GList *l, *files = NULL;
- GError *error = NULL;
-
- if (g_file_query_file_type (file, 0, NULL) != G_FILE_TYPE_DIRECTORY)
- {
- gchar *test_path;
- gchar *relative_path;
-
- if (base)
- relative_path = g_file_get_relative_path (base, file);
- else
- relative_path = g_file_get_path (file);
-
- test_path = g_strconcat (prefix, "/", relative_path, NULL);
- g_free (relative_path);
-
- g_test_add_data_func_full (test_path, g_object_ref (file), test_func, g_object_unref);
-
- g_free (test_path);
-
- return;
- }
-
- enumerator = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &error);
- g_assert_no_error (error);
-
- while ((info = g_file_enumerator_next_file (enumerator, NULL, &error)))
- {
- GFile *next_file = g_file_get_child (file, g_file_info_get_name (info));
-
- if (add_test_func == NULL || add_test_func (next_file))
- {
- files = g_list_prepend (files, g_object_ref (next_file));
- }
-
- g_object_unref (next_file);
- g_object_unref (info);
- }
-
- g_assert_no_error (error);
- g_object_unref (enumerator);
-
- files = g_list_sort (files, compare_files);
-
- for (l = files; l; l = l->next)
- {
- test_utils_add_test_for_all_files (prefix, base, l->data, test_func, add_test_func);
- }
-
- g_list_free_full (files, g_object_unref);
-}
-
#ifdef HAVE_PANGOFT2
static FcConfig *
create_font_config_for_testing (void)
diff --git a/tests/test-utils.h b/tests/test-utils.h
index 394f78c1..d71af69d 100644
--- a/tests/test-utils.h
+++ b/tests/test-utils.h
@@ -26,12 +26,6 @@ typedef gboolean (* AddTestFunc) (GFile *file);
const gchar *test_utils_get_test_data_path (void);
-void test_utils_add_test_for_all_files (const gchar *prefix,
- GFile *base,
- GFile *file,
- GTestDataFunc test_func,
- AddTestFunc add_test_func);
-
void test_utils_print_dependency_versions (void);
void test_utils_setup_font_map (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]