evas: add infrastructure and basic tests for loading image.
authorCedric BAIL <cedric.bail@samsung.com>
Fri, 14 Mar 2014 07:00:57 +0000 (16:00 +0900)
committerCedric BAIL <cedric.bail@free.fr>
Tue, 1 Apr 2014 13:00:14 +0000 (22:00 +0900)
24 files changed:
src/Makefile_Evas.am
src/tests/evas/evas_suite.c
src/tests/evas/evas_suite.h
src/tests/evas/evas_test_image.c [new file with mode: 0644]
src/tests/evas/images/HM7Y9233-50.tgv [new file with mode: 0644]
src/tests/evas/images/HM7Y9233.jpg [new file with mode: 0644]
src/tests/evas/images/Light-50.tgv [new file with mode: 0644]
src/tests/evas/images/Light.jpg [new file with mode: 0644]
src/tests/evas/images/Pic1-10.tgv [new file with mode: 0644]
src/tests/evas/images/Pic1-100.tgv [new file with mode: 0644]
src/tests/evas/images/Pic1-50.tgv [new file with mode: 0644]
src/tests/evas/images/Pic1.png [new file with mode: 0644]
src/tests/evas/images/Pic4-10.tgv [new file with mode: 0644]
src/tests/evas/images/Pic4-100.tgv [new file with mode: 0644]
src/tests/evas/images/Pic4-50.tgv [new file with mode: 0644]
src/tests/evas/images/Pic4.png [new file with mode: 0644]
src/tests/evas/images/Sunrise-100.tgv [new file with mode: 0644]
src/tests/evas/images/Temple-10.tgv [new file with mode: 0644]
src/tests/evas/images/Temple.jpg [new file with mode: 0644]
src/tests/evas/images/Temple3-10.tgv [new file with mode: 0644]
src/tests/evas/images/Temple3.jpg [new file with mode: 0644]
src/tests/evas/images/Train-10.tgv [new file with mode: 0644]
src/tests/evas/images/Train.jpg [new file with mode: 0644]
src/tests/evas/images/mars_rover_panorama_half-size.jpg [new file with mode: 0644]

index 18ac68f..540d08d 100644 (file)
@@ -1804,6 +1804,7 @@ tests/evas/evas_test_text.c \
 tests/evas/evas_test_callbacks.c \
 tests/evas/evas_test_render_engines.c \
 tests/evas/evas_test_filters.c \
+tests/evas/evas_test_image.c \
 tests/evas/evas_tests_helpers.h \
 tests/evas/evas_suite.h
 
@@ -1819,4 +1820,24 @@ tests_evas_evas_suite_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@
 endif
 
 EXTRA_DIST += \
-tests/evas/TestFont.eet
+tests/evas/TestFont.eet \
+HM7Y9233-50.tgv \
+HM7Y9233.jpg \
+Light-50.tgv \
+Light.jpg \
+Pic1-10.tgv \
+Pic1-100.tgv \
+Pic1-50.tgv \
+Pic1.png \
+Pic4-10.tgv \
+Pic4-100.tgv \
+Pic4-50.tgv \
+Pic4.png \
+Sunrise-100.tgv \
+Temple-10.tgv \
+Temple.jpg \
+Temple3-10.tgv \
+Temple3.jpg \
+Train-10.tgv \
+Train.jpg \
+mars_rover_panorama_half-size.jpg
index a0ceee9..23657f5 100644 (file)
@@ -25,6 +25,7 @@ static const Evas_Test_Case etc[] = {
   { "Callbacks", evas_test_callbacks },
   { "Render Engines", evas_test_render_engines },
   { "Filters", evas_test_filters },
+  { "Images", evas_test_image_object },
   { NULL, NULL }
 };
 
index c7b62f4..be9a75b 100644 (file)
@@ -10,6 +10,6 @@ void evas_test_text(TCase *tc);
 void evas_test_callbacks(TCase *tc);
 void evas_test_render_engines(TCase *tc);
 void evas_test_filters(TCase *tc);
-
+void evas_test_image_object(TCase *tc);
 
 #endif /* _EVAS_SUITE_H */
diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c
new file mode 100644 (file)
index 0000000..c07ac26
--- /dev/null
@@ -0,0 +1,53 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <unistd.h>
+#include <stdio.h>
+
+#include "evas_suite.h"
+#include "Evas.h"
+#include "evas_tests_helpers.h"
+
+static const char *
+_test_image_get(const char *name)
+{
+   static char filename[PATH_MAX];
+
+   snprintf(filename, PATH_MAX, TESTS_SRC_DIR"/images/%s", name);
+
+   return filename;
+}
+
+START_TEST(evas_object_image_loader)
+{
+   Evas *e = _setup_evas();
+   Evas_Object *o;
+   Eina_Iterator *it;
+   const Eina_File_Direct_Info *file;
+
+   o = evas_object_image_add(e);
+
+   it = eina_file_direct_ls(TESTS_SRC_DIR"/images/");
+   EINA_ITERATOR_FOREACH(it, file)
+     {
+        int w, h;
+
+        evas_object_image_file_set(o, file->path, NULL);
+        fail_if(evas_object_image_load_error_get(o) != EVAS_LOAD_ERROR_NONE);
+        evas_object_image_size_get(o, &w, &h);
+        fail_if(w == 0 || h == 0);
+     }
+   eina_iterator_free(it);
+
+   evas_object_del(o);
+
+   evas_free(e);
+   evas_shutdown();
+}
+END_TEST
+
+void evas_test_image_object(TCase *tc)
+{
+   tcase_add_test(tc, evas_object_image_loader);
+}
diff --git a/src/tests/evas/images/HM7Y9233-50.tgv b/src/tests/evas/images/HM7Y9233-50.tgv
new file mode 100644 (file)
index 0000000..b486534
Binary files /dev/null and b/src/tests/evas/images/HM7Y9233-50.tgv differ
diff --git a/src/tests/evas/images/HM7Y9233.jpg b/src/tests/evas/images/HM7Y9233.jpg
new file mode 100644 (file)
index 0000000..4111663
Binary files /dev/null and b/src/tests/evas/images/HM7Y9233.jpg differ
diff --git a/src/tests/evas/images/Light-50.tgv b/src/tests/evas/images/Light-50.tgv
new file mode 100644 (file)
index 0000000..2bc0cef
Binary files /dev/null and b/src/tests/evas/images/Light-50.tgv differ
diff --git a/src/tests/evas/images/Light.jpg b/src/tests/evas/images/Light.jpg
new file mode 100644 (file)
index 0000000..5658a4b
Binary files /dev/null and b/src/tests/evas/images/Light.jpg differ
diff --git a/src/tests/evas/images/Pic1-10.tgv b/src/tests/evas/images/Pic1-10.tgv
new file mode 100644 (file)
index 0000000..13d1cc9
Binary files /dev/null and b/src/tests/evas/images/Pic1-10.tgv differ
diff --git a/src/tests/evas/images/Pic1-100.tgv b/src/tests/evas/images/Pic1-100.tgv
new file mode 100644 (file)
index 0000000..3f7886b
Binary files /dev/null and b/src/tests/evas/images/Pic1-100.tgv differ
diff --git a/src/tests/evas/images/Pic1-50.tgv b/src/tests/evas/images/Pic1-50.tgv
new file mode 100644 (file)
index 0000000..0e25b28
Binary files /dev/null and b/src/tests/evas/images/Pic1-50.tgv differ
diff --git a/src/tests/evas/images/Pic1.png b/src/tests/evas/images/Pic1.png
new file mode 100644 (file)
index 0000000..e7565eb
Binary files /dev/null and b/src/tests/evas/images/Pic1.png differ
diff --git a/src/tests/evas/images/Pic4-10.tgv b/src/tests/evas/images/Pic4-10.tgv
new file mode 100644 (file)
index 0000000..2680f16
Binary files /dev/null and b/src/tests/evas/images/Pic4-10.tgv differ
diff --git a/src/tests/evas/images/Pic4-100.tgv b/src/tests/evas/images/Pic4-100.tgv
new file mode 100644 (file)
index 0000000..9797b3a
Binary files /dev/null and b/src/tests/evas/images/Pic4-100.tgv differ
diff --git a/src/tests/evas/images/Pic4-50.tgv b/src/tests/evas/images/Pic4-50.tgv
new file mode 100644 (file)
index 0000000..415bd1a
Binary files /dev/null and b/src/tests/evas/images/Pic4-50.tgv differ
diff --git a/src/tests/evas/images/Pic4.png b/src/tests/evas/images/Pic4.png
new file mode 100644 (file)
index 0000000..82e14db
Binary files /dev/null and b/src/tests/evas/images/Pic4.png differ
diff --git a/src/tests/evas/images/Sunrise-100.tgv b/src/tests/evas/images/Sunrise-100.tgv
new file mode 100644 (file)
index 0000000..ca28e20
Binary files /dev/null and b/src/tests/evas/images/Sunrise-100.tgv differ
diff --git a/src/tests/evas/images/Temple-10.tgv b/src/tests/evas/images/Temple-10.tgv
new file mode 100644 (file)
index 0000000..1cb519d
Binary files /dev/null and b/src/tests/evas/images/Temple-10.tgv differ
diff --git a/src/tests/evas/images/Temple.jpg b/src/tests/evas/images/Temple.jpg
new file mode 100644 (file)
index 0000000..46e6ee4
Binary files /dev/null and b/src/tests/evas/images/Temple.jpg differ
diff --git a/src/tests/evas/images/Temple3-10.tgv b/src/tests/evas/images/Temple3-10.tgv
new file mode 100644 (file)
index 0000000..3ac3999
Binary files /dev/null and b/src/tests/evas/images/Temple3-10.tgv differ
diff --git a/src/tests/evas/images/Temple3.jpg b/src/tests/evas/images/Temple3.jpg
new file mode 100644 (file)
index 0000000..159dfbd
Binary files /dev/null and b/src/tests/evas/images/Temple3.jpg differ
diff --git a/src/tests/evas/images/Train-10.tgv b/src/tests/evas/images/Train-10.tgv
new file mode 100644 (file)
index 0000000..7a65627
Binary files /dev/null and b/src/tests/evas/images/Train-10.tgv differ
diff --git a/src/tests/evas/images/Train.jpg b/src/tests/evas/images/Train.jpg
new file mode 100644 (file)
index 0000000..eeb9a11
Binary files /dev/null and b/src/tests/evas/images/Train.jpg differ
diff --git a/src/tests/evas/images/mars_rover_panorama_half-size.jpg b/src/tests/evas/images/mars_rover_panorama_half-size.jpg
new file mode 100644 (file)
index 0000000..79c7688
Binary files /dev/null and b/src/tests/evas/images/mars_rover_panorama_half-size.jpg differ