mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
Add tests for the tiff loader
This commit is contained in:
parent
f925e12e1d
commit
945c2531ac
BIN
testsuite/gdk/image-data/image.tiff
Normal file
BIN
testsuite/gdk/image-data/image.tiff
Normal file
Binary file not shown.
@ -1,5 +1,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gdk/loaders/gdkpngprivate.h"
|
||||
#include "gdk/loaders/gdktiffprivate.h"
|
||||
|
||||
static void
|
||||
assert_texture_equal (GdkTexture *t1,
|
||||
@ -47,6 +48,8 @@ test_load_image (gconstpointer data)
|
||||
|
||||
if (g_str_has_suffix (filename, ".png"))
|
||||
texture = gdk_load_png (bytes, &error);
|
||||
else if (g_str_has_suffix (filename, ".tiff"))
|
||||
texture = gdk_load_tiff (bytes, &error);
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
@ -81,6 +84,8 @@ test_save_image (gconstpointer test_data)
|
||||
|
||||
if (g_str_has_suffix (filename, ".png"))
|
||||
bytes = gdk_save_png (texture);
|
||||
else if (g_str_has_suffix (filename, ".tiff"))
|
||||
bytes = gdk_save_tiff (texture);
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
@ -112,7 +117,9 @@ main (int argc, char *argv[])
|
||||
(g_test_init) (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_data_func ("/image/load/png", "image.png", test_load_image);
|
||||
g_test_add_data_func ("/image/load/tiff", "image.tiff", test_load_image);
|
||||
g_test_add_data_func ("/image/save/png", "image.png", test_save_image);
|
||||
g_test_add_data_func ("/image/save/tiff", "image.tiff", test_save_image);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user