[gtk/image-loading: 15/15] Add tests for the jpeg loader
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/image-loading: 15/15] Add tests for the jpeg loader
- Date: Mon, 13 Sep 2021 18:35:32 +0000 (UTC)
commit c898f8eacfef6d2b5e0f227260a940821549c1ac
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 11 23:28:06 2021 -0400
Add tests for the jpeg loader
testsuite/gdk/image-data/image.jpeg | Bin 0 -> 8397 bytes
testsuite/gdk/image.c | 4 ++++
2 files changed, 4 insertions(+)
---
diff --git a/testsuite/gdk/image-data/image.jpeg b/testsuite/gdk/image-data/image.jpeg
new file mode 100644
index 0000000000..53ebb349bc
Binary files /dev/null and b/testsuite/gdk/image-data/image.jpeg differ
diff --git a/testsuite/gdk/image.c b/testsuite/gdk/image.c
index ceae44df67..57a0c112c2 100644
--- a/testsuite/gdk/image.c
+++ b/testsuite/gdk/image.c
@@ -1,6 +1,7 @@
#include <gtk/gtk.h>
#include "gdk/loaders/gdkpngprivate.h"
#include "gdk/loaders/gdktiffprivate.h"
+#include "gdk/loaders/gdkjpegprivate.h"
static void
assert_texture_equal (GdkTexture *t1,
@@ -50,6 +51,8 @@ test_load_image (gconstpointer data)
texture = gdk_load_png (bytes, &error);
else if (g_str_has_suffix (filename, ".tiff"))
texture = gdk_load_tiff (bytes, &error);
+ else if (g_str_has_suffix (filename, ".jpeg"))
+ texture = gdk_load_jpeg (bytes, &error);
else
g_assert_not_reached ();
@@ -118,6 +121,7 @@ main (int argc, char *argv[])
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/load/jpeg", "image.jpeg", 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]