summaryrefslogtreecommitdiff
path: root/src/tests/edje
diff options
context:
space:
mode:
authorNikolay Lopatka <n.lopatka@samsung.com>2013-03-13 15:23:23 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-03-13 16:47:53 +0900
commit3e07236148f8032f476c5928f9ef59487b11529a (patch)
tree56c975a044bc93103968d3f0485020f693b7c6d2 /src/tests/edje
parent488ea9ec82a2f28d8af4b0e2dac6c4797b4cea28 (diff)
Edje: Add test for edje_object_file_set.
Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
Diffstat (limited to 'src/tests/edje')
-rw-r--r--src/tests/edje/data/test_layout.edc24
-rw-r--r--src/tests/edje/edje_test_edje.c35
2 files changed, 58 insertions, 1 deletions
diff --git a/src/tests/edje/data/test_layout.edc b/src/tests/edje/data/test_layout.edc
new file mode 100644
index 0000000000..fe6ea011a6
--- /dev/null
+++ b/src/tests/edje/data/test_layout.edc
@@ -0,0 +1,24 @@
1collections {
2 group {
3 name: "test_group";
4
5 parts {
6 part {
7 name: "background";
8 type: RECT;
9 mouse_events: 0;
10
11 description {
12 state: "default" 0.0;
13 color: 255 255 255 255;
14
15 rel1 {
16 relative: 0.0 0.0;
17 }
18 rel2 {
19 relative: 1.0 1.0;
20 }
21 }
22 }
23 }
24}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index a15c8273da..c02419c446 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -38,8 +38,41 @@ START_TEST(edje_test_edje_load)
38} 38}
39END_TEST 39END_TEST
40 40
41void edje_test_edje(TCase *tc) 41static const char *
42test_layout_get(void)
43{
44 static int is_local = -1;
45 if (is_local == -1)
46 {
47 struct stat st;
48 is_local = (stat(PACKAGE_BUILD_DIR"/src/tests/edje/data/test_layout.edj", &st) == 0);
49 }
50
51 if (is_local)
52 return PACKAGE_BUILD_DIR"/src/tests/edje/data/test_layout.edj";
53 else
54 return PACKAGE_DATA_DIR"/data/test_layout.edj";
55}
56
57START_TEST(edje_test_load_simple_layout)
42{ 58{
59 Evas *evas = EDJE_TEST_INIT_EVAS();
60 Evas_Object *obj;
61
62 obj = edje_object_add(evas);
63 fail_unless(edje_object_file_set(obj, test_layout_get(), "test_group"));
64
65 fail_if(edje_object_part_exists(obj, "unexistant_part"));
66 fail_unless(edje_object_part_exists(obj, "background"));
67
68
69 EDJE_TEST_FREE_EVAS();
70}
71END_TEST
72
73void edje_test_edje(TCase *tc)
74{
43 tcase_add_test(tc, edje_test_edje_init); 75 tcase_add_test(tc, edje_test_edje_init);
76 tcase_add_test(tc,edje_test_load_simple_layout);
44 tcase_add_test(tc, edje_test_edje_load); 77 tcase_add_test(tc, edje_test_edje_load);
45} 78}