summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_image.c56
-rw-r--r--src/tests/evas/images/Light-50.pngbin0 -> 2126963 bytes
-rw-r--r--src/tests/evas/images/Pic1-10.pngbin0 -> 106031 bytes
-rw-r--r--src/tests/evas/images/Pic1-10.tgvbin37271 -> 32621 bytes
-rw-r--r--src/tests/evas/images/Pic1-100.pngbin0 -> 108787 bytes
-rw-r--r--src/tests/evas/images/Pic1-100.tgvbin36412 -> 33570 bytes
-rw-r--r--src/tests/evas/images/Pic1-50.pngbin0 -> 107705 bytes
-rw-r--r--src/tests/evas/images/Pic1-50.tgvbin39077 -> 33054 bytes
-rw-r--r--src/tests/evas/images/Pic4-10.pngbin0 -> 102899 bytes
-rw-r--r--src/tests/evas/images/Pic4-10.tgvbin38143 -> 33474 bytes
-rw-r--r--src/tests/evas/images/Pic4-100.pngbin0 -> 104891 bytes
-rw-r--r--src/tests/evas/images/Pic4-100.tgvbin37466 -> 34166 bytes
-rw-r--r--src/tests/evas/images/Pic4-50.pngbin0 -> 104160 bytes
-rw-r--r--src/tests/evas/images/Pic4-50.tgvbin39903 -> 33917 bytes
-rw-r--r--src/tests/evas/images/Train-10.pngbin0 -> 1543224 bytes
-rw-r--r--src/tests/evas/images/Train-10.tgvbin885810 -> 697498 bytes
16 files changed, 56 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c
index c0dc6f408a..849682c8ba 100644
--- a/src/tests/evas/evas_test_image.c
+++ b/src/tests/evas/evas_test_image.c
@@ -238,8 +238,64 @@ START_TEST(evas_object_image_loader_orientation)
}
END_TEST
+START_TEST(evas_object_image_loader_data)
+{
+ Evas *e = _setup_evas();
+ Evas_Object *obj, *ref;
+ Eina_Strbuf *str;
+
+ const char *files[] = {
+ "Light-50",
+ "Pic1-10",
+ "Pic1-100",
+ "Pic1-50",
+ "Pic4-10",
+ "Pic4-100",
+ "Pic4-50",
+ "Train-10"
+ };
+ unsigned int i;
+
+ obj = evas_object_image_add(e);
+ ref = evas_object_image_add(e);
+ str = eina_strbuf_new();
+
+ for (i = 0; i < sizeof (files) / sizeof (files[0]); i++)
+ {
+ int w, h, r_w, r_h;
+ const uint32_t *d, *r_d;
+
+ eina_strbuf_append_printf(str, "%s/%s.tgv", TESTS_IMG_DIR, files[i]);
+ evas_object_image_file_set(obj, eina_strbuf_string_get(str), NULL);
+ fail_if(evas_object_image_load_error_get(obj) != EVAS_LOAD_ERROR_NONE);
+ evas_object_image_size_get(obj, &w, &h);
+ d = evas_object_image_data_get(obj, EINA_FALSE);
+
+ eina_strbuf_reset(str);
+
+ eina_strbuf_append_printf(str, "%s/%s.png", TESTS_IMG_DIR, files[i]);
+ evas_object_image_file_set(ref, eina_strbuf_string_get(str), NULL);
+ fail_if(evas_object_image_load_error_get(ref) != EVAS_LOAD_ERROR_NONE);
+ evas_object_image_size_get(ref, &r_w, &r_h);
+ r_d = evas_object_image_data_get(ref, EINA_FALSE);
+
+ eina_strbuf_reset(str);
+
+ fail_if(w != r_w || h != r_h);
+ fail_if(memcmp(d, r_d, w * h * 4));
+ }
+
+ evas_object_del(obj);
+ evas_object_del(ref);
+
+ evas_free(e);
+ evas_shutdown();
+}
+END_TEST
+
void evas_test_image_object(TCase *tc)
{
tcase_add_test(tc, evas_object_image_loader);
tcase_add_test(tc, evas_object_image_loader_orientation);
+ tcase_add_test(tc, evas_object_image_loader_data);
}
diff --git a/src/tests/evas/images/Light-50.png b/src/tests/evas/images/Light-50.png
new file mode 100644
index 0000000000..efc1d6f8b2
--- /dev/null
+++ b/src/tests/evas/images/Light-50.png
Binary files differ
diff --git a/src/tests/evas/images/Pic1-10.png b/src/tests/evas/images/Pic1-10.png
new file mode 100644
index 0000000000..b68340f1df
--- /dev/null
+++ b/src/tests/evas/images/Pic1-10.png
Binary files differ
diff --git a/src/tests/evas/images/Pic1-10.tgv b/src/tests/evas/images/Pic1-10.tgv
index 13d1cc9f0e..6b44e11825 100644
--- a/src/tests/evas/images/Pic1-10.tgv
+++ b/src/tests/evas/images/Pic1-10.tgv
Binary files differ
diff --git a/src/tests/evas/images/Pic1-100.png b/src/tests/evas/images/Pic1-100.png
new file mode 100644
index 0000000000..27f2ecc0e9
--- /dev/null
+++ b/src/tests/evas/images/Pic1-100.png
Binary files differ
diff --git a/src/tests/evas/images/Pic1-100.tgv b/src/tests/evas/images/Pic1-100.tgv
index 3f7886bdb1..8ec1cbf55c 100644
--- a/src/tests/evas/images/Pic1-100.tgv
+++ b/src/tests/evas/images/Pic1-100.tgv
Binary files differ
diff --git a/src/tests/evas/images/Pic1-50.png b/src/tests/evas/images/Pic1-50.png
new file mode 100644
index 0000000000..3affe502dd
--- /dev/null
+++ b/src/tests/evas/images/Pic1-50.png
Binary files differ
diff --git a/src/tests/evas/images/Pic1-50.tgv b/src/tests/evas/images/Pic1-50.tgv
index 0e25b2884b..69948fe4c2 100644
--- a/src/tests/evas/images/Pic1-50.tgv
+++ b/src/tests/evas/images/Pic1-50.tgv
Binary files differ
diff --git a/src/tests/evas/images/Pic4-10.png b/src/tests/evas/images/Pic4-10.png
new file mode 100644
index 0000000000..59edd438d5
--- /dev/null
+++ b/src/tests/evas/images/Pic4-10.png
Binary files differ
diff --git a/src/tests/evas/images/Pic4-10.tgv b/src/tests/evas/images/Pic4-10.tgv
index 2680f16014..d0e3642531 100644
--- a/src/tests/evas/images/Pic4-10.tgv
+++ b/src/tests/evas/images/Pic4-10.tgv
Binary files differ
diff --git a/src/tests/evas/images/Pic4-100.png b/src/tests/evas/images/Pic4-100.png
new file mode 100644
index 0000000000..df0229f5dc
--- /dev/null
+++ b/src/tests/evas/images/Pic4-100.png
Binary files differ
diff --git a/src/tests/evas/images/Pic4-100.tgv b/src/tests/evas/images/Pic4-100.tgv
index 9797b3a9b9..d41e9bab41 100644
--- a/src/tests/evas/images/Pic4-100.tgv
+++ b/src/tests/evas/images/Pic4-100.tgv
Binary files differ
diff --git a/src/tests/evas/images/Pic4-50.png b/src/tests/evas/images/Pic4-50.png
new file mode 100644
index 0000000000..957ca0ef1b
--- /dev/null
+++ b/src/tests/evas/images/Pic4-50.png
Binary files differ
diff --git a/src/tests/evas/images/Pic4-50.tgv b/src/tests/evas/images/Pic4-50.tgv
index 415bd1a8bc..4adf4434c9 100644
--- a/src/tests/evas/images/Pic4-50.tgv
+++ b/src/tests/evas/images/Pic4-50.tgv
Binary files differ
diff --git a/src/tests/evas/images/Train-10.png b/src/tests/evas/images/Train-10.png
new file mode 100644
index 0000000000..f898b58788
--- /dev/null
+++ b/src/tests/evas/images/Train-10.png
Binary files differ
diff --git a/src/tests/evas/images/Train-10.tgv b/src/tests/evas/images/Train-10.tgv
index 7a656272c4..f79898c05a 100644
--- a/src/tests/evas/images/Train-10.tgv
+++ b/src/tests/evas/images/Train-10.tgv
Binary files differ