[librsvg: 22/29] Test rsvg_handle_new_from_gfile_sync()



commit 3491e54b8d2f9f65b65fd6acd5ed7578f98a4c0d
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Feb 6 13:35:48 2018 -0600

    Test rsvg_handle_new_from_gfile_sync()

 tests/api.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/tests/api.c b/tests/api.c
index b8d4bf9..3cbd6ea 100644
--- a/tests/api.c
+++ b/tests/api.c
@@ -21,7 +21,6 @@ rsvg_handle_set_base_uri
 rsvg_handle_set_size_callback
 rsvg_handle_has_sub
 rsvg_handle_internal_set_testing
-rsvg_handle_new_from_gfile_sync
 rsvg_handle_new_with_flags
 rsvg_handle_new_from_stream_sync
 rsvg_handle_render_cairo
@@ -286,6 +285,27 @@ handle_new_from_data (void)
     g_free (data);
 }
 
+static void
+handle_new_from_gfile_sync (void)
+{
+    char *filename = get_test_filename ("dpi.svg");
+    GError *error = NULL;
+    GFile *file = g_file_new_for_path (filename);
+    g_assert (file != NULL);
+
+    g_free (filename);
+
+    RsvgHandle *handle = rsvg_handle_new_from_gfile_sync (file,
+                                                          RSVG_HANDLE_FLAGS_NONE,
+                                                          NULL,
+                                                          &error);
+
+    g_assert (handle != NULL);
+    g_assert (error == NULL);
+
+    g_object_unref (handle);
+    g_object_unref (file);
+}
 int
 main (int argc, char **argv)
 {
@@ -304,6 +324,7 @@ main (int argc, char **argv)
     g_test_add_func ("/api/auto_generated", auto_generated);
     g_test_add_func ("/api/handle_write_close_free", handle_write_close_free);
     g_test_add_func ("/api/handle_new_from_data", handle_new_from_data);
+    g_test_add_func ("/api/handle_new_from_gfile_sync", handle_new_from_gfile_sync);
 
     return g_test_run ();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]