summaryrefslogtreecommitdiff
path: root/src/tests/edje/edje_test_text.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:09 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:10 -0500
commit6326e18b3fb2a4757f8ffa22be5d55a75da23049 (patch)
tree31d586b52638aa0d0b1c759869a8e3368c9daf5d /src/tests/edje/edje_test_text.c
parent7924660d54500285d3844bfa384394c683825cd9 (diff)
efl.file: improve api a bit
Summary: the previous implementation/api had a number of issues: * "file" property contained both "file" and "key" values - also performed file loading operation * "load_error" property which was specific to image objects * no methods for controlling file loading/unloading this patch attempts the following changes: * split "file" property into "file" and "key" properties - also remove "key" from existing "mmap" property * remove "load_error" * directly return error codes from operations * add "load" and "unload" methods for directly controlling load state * add implicit file loading if file/mmap is set during construction * rewrite all efl.file implementations to move file loading into load() method * rewrite all usage of efl.file api based on these changes * add C extension functions to mimic previous behavior ref T7577 Reviewers: segfaultxavi, bu5hm4n, cedric Reviewed By: segfaultxavi Subscribers: vitor.sousa, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7577 Differential Revision: https://phab.enlightenment.org/D8018
Diffstat (limited to 'src/tests/edje/edje_test_text.c')
-rw-r--r--src/tests/edje/edje_test_text.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/tests/edje/edje_test_text.c b/src/tests/edje/edje_test_text.c
index 96b33b5605..86e1aaf06d 100644
--- a/src/tests/edje/edje_test_text.c
+++ b/src/tests/edje/edje_test_text.c
@@ -123,8 +123,9 @@ START_TEST(edje_test_text_ellipsis)
123 123
124 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 124 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
125 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 125 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
126 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 126 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
127 fail_if(efl_file_load_error_get(layout)); 127 efl_file_key_set(layout, "test");
128 ck_assert(!efl_file_load(layout));
128 129
129 efl_text_ellipsis_set(efl_part(layout, "text"), 1.0); 130 efl_text_ellipsis_set(efl_part(layout, "text"), 1.0);
130 131
@@ -141,8 +142,9 @@ START_TEST(edje_test_text_wrap)
141 142
142 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 143 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
143 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 144 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
144 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 145 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
145 fail_if(efl_file_load_error_get(layout)); 146 efl_file_key_set(layout, "test");
147 ck_assert(!efl_file_load(layout));
146 148
147 efl_text_wrap_set(efl_part(layout, "text"), EFL_TEXT_FORMAT_WRAP_WORD); 149 efl_text_wrap_set(efl_part(layout, "text"), EFL_TEXT_FORMAT_WRAP_WORD);
148 150
@@ -159,8 +161,9 @@ START_TEST(edje_test_text_font)
159 161
160 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 162 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
161 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 163 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
162 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 164 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
163 fail_if(efl_file_load_error_get(layout)); 165 efl_file_key_set(layout, "test");
166 ck_assert(!efl_file_load(layout));
164 167
165 efl_text_font_set(efl_part(layout, "text"), "Sans", 14); 168 efl_text_font_set(efl_part(layout, "text"), "Sans", 14);
166 169
@@ -177,8 +180,9 @@ START_TEST(edje_test_text_color)
177 180
178 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 181 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
179 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 182 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
180 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 183 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
181 fail_if(efl_file_load_error_get(layout)); 184 efl_file_key_set(layout, "test");
185 ck_assert(!efl_file_load(layout));
182 186
183 efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 255, 255); 187 efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 255, 255);
184 188
@@ -315,13 +319,15 @@ START_TEST(edje_test_text_part)
315 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 319 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
316 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 320 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
317 321
318 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 322 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
319 fail_if(efl_file_load_error_get(layout)); 323 efl_file_key_set(layout, "test");
324 ck_assert(!efl_file_load(layout));
320 _basic_check(layout, EINA_TRUE); 325 _basic_check(layout, EINA_TRUE);
321 326
322 // Load again and check persistance 327 // Load again and check persistance
323 efl_file_set(layout, test_layout_get("test_text.edj"), "test2"); 328 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
324 fail_if(efl_file_load_error_get(layout)); 329 efl_file_key_set(layout, "test2");
330 ck_assert(!efl_file_load(layout));
325 _basic_check(layout, EINA_FALSE); 331 _basic_check(layout, EINA_FALSE);
326 332
327 evas_free(evas); 333 evas_free(evas);