summaryrefslogtreecommitdiff
path: root/src/tests/evas/evas_test_image.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2014-03-14 16:00:57 +0900
committerCedric BAIL <cedric.bail@free.fr>2014-04-01 22:00:14 +0900
commit52a36461b8c47099cc9a59e9b4182d8ba79d349e (patch)
tree4e6b36ef47076c4e00b406b695b5a9186b935080 /src/tests/evas/evas_test_image.c
parenta086a4f089138ddaf1f14602328def619e9df202 (diff)
evas: add infrastructure and basic tests for loading image.
Diffstat (limited to 'src/tests/evas/evas_test_image.c')
-rw-r--r--src/tests/evas/evas_test_image.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c
new file mode 100644
index 0000000000..c07ac26a58
--- /dev/null
+++ b/src/tests/evas/evas_test_image.c
@@ -0,0 +1,53 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <unistd.h>
6#include <stdio.h>
7
8#include "evas_suite.h"
9#include "Evas.h"
10#include "evas_tests_helpers.h"
11
12static const char *
13_test_image_get(const char *name)
14{
15 static char filename[PATH_MAX];
16
17 snprintf(filename, PATH_MAX, TESTS_SRC_DIR"/images/%s", name);
18
19 return filename;
20}
21
22START_TEST(evas_object_image_loader)
23{
24 Evas *e = _setup_evas();
25 Evas_Object *o;
26 Eina_Iterator *it;
27 const Eina_File_Direct_Info *file;
28
29 o = evas_object_image_add(e);
30
31 it = eina_file_direct_ls(TESTS_SRC_DIR"/images/");
32 EINA_ITERATOR_FOREACH(it, file)
33 {
34 int w, h;
35
36 evas_object_image_file_set(o, file->path, NULL);
37 fail_if(evas_object_image_load_error_get(o) != EVAS_LOAD_ERROR_NONE);
38 evas_object_image_size_get(o, &w, &h);
39 fail_if(w == 0 || h == 0);
40 }
41 eina_iterator_free(it);
42
43 evas_object_del(o);
44
45 evas_free(e);
46 evas_shutdown();
47}
48END_TEST
49
50void evas_test_image_object(TCase *tc)
51{
52 tcase_add_test(tc, evas_object_image_loader);
53}