summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2014-10-22 14:14:26 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-10-22 14:15:32 +0200
commit5c8a8a51ce6e9f0505de298783d8ba496943cf6a (patch)
tree3ba4283a85c123abcdd5cf49ca16a59b72d96b70
parent2a9272333f730ac3d5b437b65dcd804a169c2ed3 (diff)
downloadefl-5c8a8a51ce6e9f0505de298783d8ba496943cf6a.tar.gz
evas: tests only for extension compiled in.
-rw-r--r--src/tests/evas/evas_test_image.c82
-rw-r--r--src/tests/evas/images/Pic4-jpeg.pngbin0 -> 303802 bytes
-rw-r--r--src/tests/evas/images/Pic4-tgv.pngbin0 -> 104160 bytes
-rw-r--r--src/tests/evas/images/Pic4.jpegbin0 -> 55595 bytes
-rw-r--r--src/tests/evas/images/Pic4.tgvbin0 -> 33917 bytes
5 files changed, 54 insertions, 28 deletions
diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c
index b8ae289b77..157041c3f7 100644
--- a/src/tests/evas/evas_test_image.c
+++ b/src/tests/evas/evas_test_image.c
@@ -2,6 +2,8 @@
# include "config.h"
#endif
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
@@ -11,6 +13,41 @@
#define TESTS_IMG_DIR TESTS_SRC_DIR"/images"
+static const char *exts[] = {
+ "png"
+#ifdef BUILD_LOADER_TGA
+ ,"tga"
+#endif
+#ifdef BUILD_LOADER_WBMP
+ ,"wbmp"
+#endif
+ // FIXME: Seems like XPM support is currently broken
+#if 0
+#ifdef BUILD_LOADER_XPM
+ ,"xpm"
+#endif
+#endif
+#ifdef BUILD_LOADER_BMP
+ ,"bmp"
+#endif
+#ifdef BUILD_LOADER_GIF
+ ,"gif"
+#endif
+#ifdef BUILD_LOADER_PSD
+ ,"psd"
+#endif
+#ifdef BUILD_LOADER_WEBP
+ ,"webp"
+#endif
+#ifdef BUILD_LOADER_JPEG
+ ,"jpeg"
+ ,"jpg"
+#endif
+#ifdef BUILD_LOADER_TGV
+ ,"tgv"
+#endif
+};
+
#if 0
static const char *
_test_image_get(const char *name)
@@ -35,8 +72,20 @@ START_TEST(evas_object_image_loader)
it = eina_file_direct_ls(TESTS_IMG_DIR);
EINA_ITERATOR_FOREACH(it, file)
{
+ Eina_Bool found = EINA_FALSE;
+ unsigned int i;
int w, h;
+ for (i = 0; i < (sizeof (exts) / sizeof (exts[0])); i++)
+ if (!strcasecmp(file->path + file->path_length - strlen(exts[i]),
+ exts[i]))
+ {
+ found = EINA_TRUE;
+ break;
+ }
+
+ if (!found) continue;
+
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);
@@ -298,34 +347,6 @@ START_TEST(evas_object_image_all_loader_data)
Evas *e = _setup_evas();
Evas_Object *obj, *ref;
Eina_Strbuf *str;
-
- const char *exts[] = {
- "png"
-#ifdef BUILD_LOADER_TGA
- ,"tga"
-#endif
-#ifdef BUILD_LOADER_WBMP
- ,"wbmp"
-#endif
- // FIXME: Seems like XPM support is currently broken
-#if 0
-#ifdef BUILD_LOADER_XPM
- ,"xpm"
-#endif
-#endif
-#ifdef BUILD_LOADER_BMP
- ,"bmp"
-#endif
-#ifdef BUILD_LOADER_GIF
- ,"gif"
-#endif
-#ifdef BUILD_LOADER_PSD
- ,"psd"
-#endif
-#ifdef BUILD_LOADER_WEBP
- ,"webp"
-#endif
- };
unsigned int i;
obj = evas_object_image_add(e);
@@ -334,11 +355,16 @@ START_TEST(evas_object_image_all_loader_data)
for (i = 0; i < sizeof (exts) / sizeof (exts[0]); i++)
{
+ struct stat st;
int w, h, r_w, r_h;
const uint32_t *d, *r_d;
+ fprintf(stderr, "testing '%s'\n", exts[i]);
eina_strbuf_append_printf(str, "%s/Pic4-%s.png", TESTS_IMG_DIR, exts[i]);
+
+ if (stat(eina_strbuf_string_get(str), &st) != 0) continue;
+
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);
diff --git a/src/tests/evas/images/Pic4-jpeg.png b/src/tests/evas/images/Pic4-jpeg.png
new file mode 100644
index 0000000000..51120585d0
--- /dev/null
+++ b/src/tests/evas/images/Pic4-jpeg.png
Binary files differ
diff --git a/src/tests/evas/images/Pic4-tgv.png b/src/tests/evas/images/Pic4-tgv.png
new file mode 100644
index 0000000000..957ca0ef1b
--- /dev/null
+++ b/src/tests/evas/images/Pic4-tgv.png
Binary files differ
diff --git a/src/tests/evas/images/Pic4.jpeg b/src/tests/evas/images/Pic4.jpeg
new file mode 100644
index 0000000000..ca077ed7a0
--- /dev/null
+++ b/src/tests/evas/images/Pic4.jpeg
Binary files differ
diff --git a/src/tests/evas/images/Pic4.tgv b/src/tests/evas/images/Pic4.tgv
new file mode 100644
index 0000000000..4adf4434c9
--- /dev/null
+++ b/src/tests/evas/images/Pic4.tgv
Binary files differ