[gtk/image-loading: 14/14] Add tests for the jpeg loader




commit 2254071a69711c5efba9be536cba85e6ecafaa31
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 f0103f3df3..b18e1b577a 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 ();
 
@@ -115,6 +118,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]