summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2016-06-22 19:16:10 -0300
committerVitor Sousa <vitorsousasilva@gmail.com>2016-07-05 19:40:21 -0300
commit62e0d181a97fbba842e1c29f34333f7c42217b40 (patch)
tree7d08ffc32e3846f4df77df0eae5a36e1d3b8c864
parent83e498d1ab666408882c02940123d7cb5ae6e0d3 (diff)
elementary: add test for Elm.Layout model connectdevs/felipealmeida/model_eina_container
-rw-r--r--src/tests/elementary/elm_test_layout.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_layout.c b/src/tests/elementary/elm_test_layout.c
index 6fcb5b43f6..2ce53e402c 100644
--- a/src/tests/elementary/elm_test_layout.c
+++ b/src/tests/elementary/elm_test_layout.c
@@ -87,9 +87,45 @@ START_TEST(elm_layout_edje_attach)
87} 87}
88END_TEST 88END_TEST
89 89
90START_TEST(elm_layout_model_connect)
91{
92 char buf[PATH_MAX];
93 Evas_Object *win, *ly;
94 Efl_Model_Item *model;
95 Eina_Value v;
96 const char *part_text;
97 const char text_value[] = "A random string for elm_layout_model_connect test";
98
99 elm_init(1, NULL);
100 win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
101
102 ly = eo_add(ELM_LAYOUT_CLASS, win);
103 snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
104 elm_layout_file_set(ly, buf, "layout");
105 evas_object_show(ly);
106
107 model = eo_add(EFL_MODEL_ITEM_CLASS, win);
108 ck_assert(!!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
109 ck_assert(!!eina_value_set(&v, text_value));
110 efl_model_property_set(model, "text_property", &v, NULL);
111
112 efl_ui_model_connect(ly, "text", "text_property");
113 efl_ui_view_model_set(ly, model);
114
115 ecore_main_loop_iterate_may_block(EINA_TRUE);
116
117 part_text = elm_layout_text_get(ly, "text");
118
119 ck_assert_str_eq(part_text, text_value);
120
121 elm_shutdown();
122}
123END_TEST
124
90void elm_test_layout(TCase *tc) 125void elm_test_layout(TCase *tc)
91{ 126{
92 tcase_add_test(tc, elm_atspi_role_get); 127 tcase_add_test(tc, elm_atspi_role_get);
93 tcase_add_test(tc, elm_layout_swallows); 128 tcase_add_test(tc, elm_layout_swallows);
94 tcase_add_test(tc, elm_layout_edje_attach); 129 tcase_add_test(tc, elm_layout_edje_attach);
130 tcase_add_test(tc, elm_layout_model_connect);
95} 131}