[gtk/test-coverage: 1/7] gdk: Improve test coverage
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/test-coverage: 1/7] gdk: Improve test coverage
- Date: Sat, 16 Jul 2022 13:44:04 +0000 (UTC)
commit 882c805b53d1dcdd4f9b96099414dcf50b2f7cc3
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jul 15 22:49:42 2022 -0400
gdk: Improve test coverage
testsuite/gdk/image-data/image-cmyk.jpeg | Bin 0 -> 8635 bytes
testsuite/gdk/image-data/image-gray.jpeg | Bin 0 -> 7323 bytes
testsuite/gdk/image-data/image-gray.png | Bin 0 -> 7089 bytes
testsuite/gdk/image-data/image-palette.png | Bin 0 -> 7743 bytes
testsuite/gdk/image-data/image-tile.tiff | Bin 0 -> 266631 bytes
testsuite/gdk/image-data/image-unassoc.tiff | Bin 0 -> 8575 bytes
testsuite/gdk/image.c | 13 ++++++++++++-
7 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/testsuite/gdk/image-data/image-cmyk.jpeg b/testsuite/gdk/image-data/image-cmyk.jpeg
new file mode 100644
index 0000000000..89537b2e61
Binary files /dev/null and b/testsuite/gdk/image-data/image-cmyk.jpeg differ
diff --git a/testsuite/gdk/image-data/image-gray.jpeg b/testsuite/gdk/image-data/image-gray.jpeg
new file mode 100644
index 0000000000..8db0afd988
Binary files /dev/null and b/testsuite/gdk/image-data/image-gray.jpeg differ
diff --git a/testsuite/gdk/image-data/image-gray.png b/testsuite/gdk/image-data/image-gray.png
new file mode 100644
index 0000000000..d23d060242
Binary files /dev/null and b/testsuite/gdk/image-data/image-gray.png differ
diff --git a/testsuite/gdk/image-data/image-palette.png b/testsuite/gdk/image-data/image-palette.png
new file mode 100644
index 0000000000..e70ffe3c90
Binary files /dev/null and b/testsuite/gdk/image-data/image-palette.png differ
diff --git a/testsuite/gdk/image-data/image-tile.tiff b/testsuite/gdk/image-data/image-tile.tiff
new file mode 100644
index 0000000000..78cc5d5a54
Binary files /dev/null and b/testsuite/gdk/image-data/image-tile.tiff differ
diff --git a/testsuite/gdk/image-data/image-unassoc.tiff b/testsuite/gdk/image-data/image-unassoc.tiff
new file mode 100644
index 0000000000..097721901c
Binary files /dev/null and b/testsuite/gdk/image-data/image-unassoc.tiff differ
diff --git a/testsuite/gdk/image.c b/testsuite/gdk/image.c
index 57a0c112c2..1bfdcf001e 100644
--- a/testsuite/gdk/image.c
+++ b/testsuite/gdk/image.c
@@ -89,6 +89,8 @@ test_save_image (gconstpointer test_data)
bytes = gdk_save_png (texture);
else if (g_str_has_suffix (filename, ".tiff"))
bytes = gdk_save_tiff (texture);
+ else if (g_str_has_suffix (filename, ".jpeg"))
+ bytes = gdk_save_jpeg (texture);
else
g_assert_not_reached ();
@@ -104,7 +106,9 @@ test_save_image (gconstpointer test_data)
texture2 = gdk_texture_new_from_file (file2, &error);
g_assert_no_error (error);
- assert_texture_equal (texture, texture2);
+
+ if (!g_str_has_suffix (filename, ".jpeg"))
+ assert_texture_equal (texture, texture2);
g_bytes_unref (bytes);
g_object_unref (texture2);
@@ -120,10 +124,17 @@ 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/png2", "image-gray.png", test_load_image);
+ g_test_add_data_func ("/image/load/png3", "image-palette.png", test_load_image);
g_test_add_data_func ("/image/load/tiff", "image.tiff", test_load_image);
+ g_test_add_data_func ("/image/load/tiff2", "image-unassoc.tiff", test_load_image);
+ g_test_add_data_func ("/image/load/tiff3", "image-tile.tiff", test_load_image);
g_test_add_data_func ("/image/load/jpeg", "image.jpeg", test_load_image);
+ g_test_add_data_func ("/image/load/jpeg2", "image-cmyk.jpeg", test_load_image);
+ g_test_add_data_func ("/image/load/jpeg3", "image-gray.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);
+ g_test_add_data_func ("/image/save/jpeg", "image.jpeg", test_save_image);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]