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




commit 13f4e50d606cd4b5aecb4d7ed11cfee47ef77ac9
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]