[librsvg: 11/29] Test rsvg_pixbuf_from_file_at_zoom_with_max()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 11/29] Test rsvg_pixbuf_from_file_at_zoom_with_max()
- Date: Tue, 6 Feb 2018 21:05:00 +0000 (UTC)
commit a6a847b8264b96540f8f1a2f15b9e1f48093beba
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Feb 6 10:14:46 2018 -0600
Test rsvg_pixbuf_from_file_at_zoom_with_max()
tests/api.c | 47 ++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 42 insertions(+), 5 deletions(-)
---
diff --git a/tests/api.c b/tests/api.c
index 0bc6550..61245b9 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_with_max
rsvg_handle_get_title
rsvg_handle_get_desc
rsvg_handle_get_metadata
@@ -78,6 +77,9 @@ get_test_filename () {
#define MAX_WIDTH 10
#define MAX_HEIGHT 40
+#define MAX_ZOOMED_WIDTH 20
+#define MAX_ZOOMED_HEIGHT 120
+
#define EXAMPLE_ONE_ID "one"
#define EXAMPLE_TWO_ID "two"
@@ -115,6 +117,15 @@ pixbuf_from_file_at_max_size (const char *filename, GError **error)
return rsvg_pixbuf_from_file_at_max_size (filename, MAX_WIDTH, MAX_HEIGHT, error);
}
+static GdkPixbuf *
+pixbuf_from_file_at_zoom_with_max (const char *filename, GError **error)
+{
+ return rsvg_pixbuf_from_file_at_zoom_with_max (filename,
+ XZOOM, YZOOM,
+ MAX_ZOOMED_WIDTH, MAX_ZOOMED_HEIGHT,
+ error);
+}
+
typedef GdkPixbuf *(* PixbufCreateFn) (const char *filename, GError **error);
typedef struct {
@@ -125,10 +136,36 @@ typedef struct {
} PixbufTest;
static const PixbufTest pixbuf_tests[] = {
- { "/api/pixbuf_from_file", pixbuf_from_file, EXAMPLE_WIDTH, EXAMPLE_HEIGHT },
- { "/api/pixbuf_from_file_at_zoom", pixbuf_from_file_at_zoom, EXAMPLE_WIDTH * XZOOM,
EXAMPLE_HEIGHT * YZOOM },
- { "/api/pixbuf_from_file_at_size", pixbuf_from_file_at_size, EXAMPLE_WIDTH * XZOOM,
EXAMPLE_HEIGHT * YZOOM },
- { "/api/pixbuf_from_file_at_max_size", pixbuf_from_file_at_max_size, MAX_WIDTH, MAX_HEIGHT },
+ {
+ "/api/pixbuf_from_file",
+ pixbuf_from_file,
+ EXAMPLE_WIDTH,
+ EXAMPLE_HEIGHT
+ },
+ {
+ "/api/pixbuf_from_file_at_zoom",
+ pixbuf_from_file_at_zoom,
+ EXAMPLE_WIDTH * XZOOM,
+ EXAMPLE_HEIGHT * YZOOM
+ },
+ {
+ "/api/pixbuf_from_file_at_size",
+ pixbuf_from_file_at_size,
+ EXAMPLE_WIDTH * XZOOM,
+ EXAMPLE_HEIGHT * YZOOM
+ },
+ {
+ "/api/pixbuf_from_file_at_max_size",
+ pixbuf_from_file_at_max_size,
+ MAX_WIDTH,
+ MAX_HEIGHT
+ },
+ {
+ "/api/pixbuf_from_file_at_zoom_with_max",
+ pixbuf_from_file_at_zoom_with_max,
+ MAX_ZOOMED_WIDTH,
+ MAX_ZOOMED_HEIGHT
+ },
};
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]