summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-06-27 17:49:56 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-06-27 17:50:23 +0100
commita23ff7b5aba6d2899b9cc688429e48ed3c586ec1 (patch)
tree97f7fa3838ca409de4a66716891f03b98d542b71 /src
parent3e5ff22ab95fb72715b3c844b437e8a15067c36d (diff)
edje_test: Make test_layout_get() configurable
This will help when we want to test different edj files Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/tests/edje/edje_test_edje.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 3524a17d44..d7d36597c0 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -39,19 +39,23 @@ START_TEST(edje_test_edje_load)
39END_TEST 39END_TEST
40 40
41static const char * 41static const char *
42test_layout_get(void) 42test_layout_get(const char *name)
43{ 43{
44 const char filename[PATH_MAX];
45
46 snprintf(filename, PATH_MAX, TESTS_BUILD_DIR"/data/%s", name);
47
44 static int is_local = -1; 48 static int is_local = -1;
45 if (is_local == -1) 49 if (is_local == -1)
46 { 50 {
47 struct stat st; 51 struct stat st;
48 is_local = (stat(TESTS_BUILD_DIR"/data/test_layout.edj", &st) == 0); 52 is_local = (stat(filename, &st) == 0);
49 } 53 }
50 54
51 if (is_local) 55 if (!is_local)
52 return TESTS_BUILD_DIR"/data/test_layout.edj"; 56 snprintf(filename, PATH_MAX, PACKAGE_DATA_DIR"/data/%s", name);
53 else 57
54 return PACKAGE_DATA_DIR"/data/test_layout.edj"; 58 return filename;
55} 59}
56 60
57START_TEST(edje_test_load_simple_layout) 61START_TEST(edje_test_load_simple_layout)
@@ -60,7 +64,7 @@ START_TEST(edje_test_load_simple_layout)
60 Evas_Object *obj; 64 Evas_Object *obj;
61 65
62 obj = edje_object_add(evas); 66 obj = edje_object_add(evas);
63 fail_unless(edje_object_file_set(obj, test_layout_get(), "test_group")); 67 fail_unless(edje_object_file_set(obj, test_layout_get("test_layout.edj"), "test_group"));
64 68
65 fail_if(edje_object_part_exists(obj, "unexistant_part")); 69 fail_if(edje_object_part_exists(obj, "unexistant_part"));
66 fail_unless(edje_object_part_exists(obj, "background")); 70 fail_unless(edje_object_part_exists(obj, "background"));