[librsvg: 5/29] Test rsvg_pixbuf_from_file_at_zoom()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 5/29] Test rsvg_pixbuf_from_file_at_zoom()
- Date: Tue, 6 Feb 2018 21:04:30 +0000 (UTC)
commit 16d1bfadd02c6ecbb6e8d7f42a0cf25710809c47
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Feb 6 09:38:12 2018 -0600
Test rsvg_pixbuf_from_file_at_zoom()
tests/api.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/tests/api.c b/tests/api.c
index 80d174c..8b94b27 100644
--- a/tests/api.c
+++ b/tests/api.c
@@ -41,7 +41,6 @@ rsvg_set_default_dpi
rsvg_set_default_dpi_x_y
rsvg_handle_set_dpi
rsvg_handle_set_dpi_x_y
-rsvg_pixbuf_from_file_at_zoom
rsvg_pixbuf_from_file_at_size
rsvg_pixbuf_from_file_at_max_size
rsvg_pixbuf_from_file_at_zoom_with_max
@@ -104,6 +103,22 @@ pixbuf_from_file (void)
g_object_unref (pixbuf);
}
+static void
+pixbuf_from_file_at_zoom (void)
+{
+ char *filename = get_test_filename ();
+ GError *error = NULL;
+ GdkPixbuf *pixbuf = rsvg_pixbuf_from_file_at_zoom (filename, 2.0, 3.0, &error);
+ g_free (filename);
+
+ g_assert (pixbuf != NULL);
+ g_assert (error == NULL);
+ g_assert (gdk_pixbuf_get_width (pixbuf) == EXAMPLE_WIDTH * 2.0);
+ g_assert (gdk_pixbuf_get_height (pixbuf) == EXAMPLE_HEIGHT * 3.0);
+
+ g_object_unref (pixbuf);
+}
+
int
main (int argc, char **argv)
{
@@ -111,6 +126,7 @@ main (int argc, char **argv)
g_test_add_func ("/api/handle_has_gtype", handle_has_gtype);
g_test_add_func ("/api/pixbuf_from_file", pixbuf_from_file);
+ g_test_add_func ("/api/pixbuf_from_file_at_zoom", pixbuf_from_file_at_zoom);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]