summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-11 13:38:35 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-09-11 13:38:35 -0400
commit52e39f71fa56b90b0f99c46304ecfc87cc018a26 (patch)
tree5e5729d967bcbb2fc7eff7e81b628491863d26f1 /src/tests
parent599d7f80dbed43a90c6e92bc3b2b62c6ff2c263b (diff)
tests/edje: reduce chances of cascading test failures in non-forked mode
Summary: move evas_free() into the global shutdown fixture to ensure that edje_shutdown actually does call internal shutdown methods since evas_free() will not be reached if it is at the end of a failing test Depends on D9878 Reviewers: cedric Reviewed By: cedric Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9879
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/edje/edje_suite.c5
-rw-r--r--src/tests/edje/edje_test_container.c4
-rw-r--r--src/tests/edje/edje_test_edje.c8
-rw-r--r--src/tests/edje/edje_test_features.c7
-rw-r--r--src/tests/edje/edje_test_signal.c4
-rw-r--r--src/tests/edje/edje_test_swallow.c5
-rw-r--r--src/tests/edje/edje_test_text.c7
7 files changed, 4 insertions, 36 deletions
diff --git a/src/tests/edje/edje_suite.c b/src/tests/edje/edje_suite.c
index 18eb8856fb..80104b0e0b 100644
--- a/src/tests/edje/edje_suite.c
+++ b/src/tests/edje/edje_suite.c
@@ -29,10 +29,11 @@ test_layout_get(const char *name)
29 return filename; 29 return filename;
30} 30}
31 31
32static Evas *evas = NULL;
33
32Evas * 34Evas *
33_setup_evas(void) 35_setup_evas(void)
34{ 36{
35 Evas *evas;
36 Evas_Engine_Info *einfo; 37 Evas_Engine_Info *einfo;
37 38
38 evas = evas_new(); 39 evas = evas_new();
@@ -55,6 +56,8 @@ SUITE_INIT(edje)
55 56
56SUITE_SHUTDOWN(edje) 57SUITE_SHUTDOWN(edje)
57{ 58{
59 if (evas) evas_free(evas);
60 evas = NULL;
58 ck_assert_int_eq(edje_shutdown(), 0); 61 ck_assert_int_eq(edje_shutdown(), 0);
59 ck_assert_int_eq(ecore_evas_shutdown(), 0); 62 ck_assert_int_eq(ecore_evas_shutdown(), 0);
60} 63}
diff --git a/src/tests/edje/edje_test_container.c b/src/tests/edje/edje_test_container.c
index 1ddeb86985..cfdee2ed68 100644
--- a/src/tests/edje/edje_test_container.c
+++ b/src/tests/edje/edje_test_container.c
@@ -51,7 +51,6 @@ EFL_START_TEST(edje_test_box)
51 } 51 }
52 eina_iterator_free(it); 52 eina_iterator_free(it);
53 53
54 evas_free(evas);
55} 54}
56EFL_END_TEST 55EFL_END_TEST
57 56
@@ -111,7 +110,6 @@ EFL_START_TEST(edje_test_box_eoapi)
111 efl_pack_clear(efl_part(obj, "box")); 110 efl_pack_clear(efl_part(obj, "box"));
112 fail_if(efl_content_count(efl_part(obj, "box")) != 0); 111 fail_if(efl_content_count(efl_part(obj, "box")) != 0);
113 112
114 evas_free(evas);
115} 113}
116EFL_END_TEST 114EFL_END_TEST
117 115
@@ -186,7 +184,6 @@ EFL_START_TEST(edje_test_table)
186 fail_if(strcmp(txt, buf) != 0); 184 fail_if(strcmp(txt, buf) != 0);
187 } 185 }
188 186
189 evas_free(evas);
190} 187}
191EFL_END_TEST 188EFL_END_TEST
192 189
@@ -269,7 +266,6 @@ EFL_START_TEST(edje_test_table_eoapi)
269 fail_if(efl_content_count(proxy) != 4); 266 fail_if(efl_content_count(proxy) != 4);
270 efl_del(proxy); 267 efl_del(proxy);
271 268
272 evas_free(evas);
273} 269}
274EFL_END_TEST 270EFL_END_TEST
275 271
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 7f0f3b6f08..17eb7d5d4c 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -28,7 +28,6 @@ EFL_START_TEST(edje_test_edje_load)
28 error = edje_object_load_error_get(obj); 28 error = edje_object_load_error_get(obj);
29 fail_if(error != EDJE_LOAD_ERROR_DOES_NOT_EXIST); 29 fail_if(error != EDJE_LOAD_ERROR_DOES_NOT_EXIST);
30 30
31 evas_free(evas);
32} 31}
33EFL_END_TEST 32EFL_END_TEST
34 33
@@ -89,7 +88,6 @@ EFL_START_TEST(edje_test_load_simple_layout)
89 fail_unless(edje_object_part_exists(obj, "background")); 88 fail_unless(edje_object_part_exists(obj, "background"));
90 89
91 90
92 evas_free(evas);
93} 91}
94EFL_END_TEST 92EFL_END_TEST
95 93
@@ -118,7 +116,6 @@ EFL_START_TEST(edje_test_simple_layout_geometry)
118 evas_object_color_get(bg, &r, &g, &b, &a); 116 evas_object_color_get(bg, &r, &g, &b, &a);
119 fail_if(r != 255 || g != 255 || b != 255 || a != 255); 117 fail_if(r != 255 || g != 255 || b != 255 || a != 255);
120 118
121 evas_free(evas);
122} 119}
123EFL_END_TEST 120EFL_END_TEST
124 121
@@ -166,7 +163,6 @@ EFL_START_TEST(edje_test_complex_layout)
166 fail_if(x != 5 || y != 500+2); 163 fail_if(x != 5 || y != 500+2);
167 fail_if(w != 1000-5-5 + 1 || h != 500-5-2 + 1); 164 fail_if(w != 1000-5-5 + 1 || h != 500-5-2 + 1);
168 165
169 evas_free(evas);
170} 166}
171EFL_END_TEST 167EFL_END_TEST
172 168
@@ -189,7 +185,6 @@ EFL_START_TEST(edje_test_calculate_parens)
189 edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h); 185 edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h);
190 fail_if(x != 0 || y != 0 || w != 100 || h != 100); 186 fail_if(x != 0 || y != 0 || w != 100 || h != 100);
191 187
192 evas_free(evas);
193} 188}
194EFL_END_TEST 189EFL_END_TEST
195 190
@@ -232,7 +227,6 @@ EFL_START_TEST(edje_test_access)
232 } 227 }
233 fail_if(i != 2); 228 fail_if(i != 2);
234 229
235 evas_free(evas);
236} 230}
237EFL_END_TEST 231EFL_END_TEST
238 232
@@ -246,7 +240,6 @@ EFL_START_TEST(edje_test_combine_keywords)
246 obj = edje_object_add(evas); 240 obj = edje_object_add(evas);
247 fail_unless(edje_object_file_set(obj, test_layout_get("test_combine_keywords.edj"), "test_group")); 241 fail_unless(edje_object_file_set(obj, test_layout_get("test_combine_keywords.edj"), "test_group"));
248 242
249 evas_free(evas);
250} 243}
251EFL_END_TEST 244EFL_END_TEST
252 245
@@ -277,7 +270,6 @@ EFL_START_TEST(edje_test_part_caching)
277 270
278 } 271 }
279 272
280 evas_free(evas);
281} 273}
282EFL_END_TEST 274EFL_END_TEST
283 275
diff --git a/src/tests/edje/edje_test_features.c b/src/tests/edje/edje_test_features.c
index 4b6ddb8900..894e27332f 100644
--- a/src/tests/edje/edje_test_features.c
+++ b/src/tests/edje/edje_test_features.c
@@ -55,7 +55,6 @@ EFL_START_TEST(edje_test_masking)
55 clip2 = efl_canvas_object_clipper_get(sub); 55 clip2 = efl_canvas_object_clipper_get(sub);
56 fail_if(clip != clip2); 56 fail_if(clip != clip2);
57 57
58 evas_free(evas);
59} 58}
60EFL_END_TEST 59EFL_END_TEST
61 60
@@ -104,7 +103,6 @@ EFL_START_TEST(edje_test_filters)
104 103
105 // TODO: Verify properly that the filter runs well 104 // TODO: Verify properly that the filter runs well
106 105
107 evas_free(evas);
108} 106}
109EFL_END_TEST 107EFL_END_TEST
110 108
@@ -130,7 +128,6 @@ EFL_START_TEST(edje_test_snapshot)
130 128
131 // TODO: Verify that evas snapshot actually works (and has a filter) 129 // TODO: Verify that evas snapshot actually works (and has a filter)
132 130
133 evas_free(evas);
134} 131}
135EFL_END_TEST 132EFL_END_TEST
136 133
@@ -184,14 +181,11 @@ EFL_START_TEST(edje_test_size_class)
184 b = edje_object_size_class_get(obj, "rect_size", &minw, &minh, NULL, NULL); 181 b = edje_object_size_class_get(obj, "rect_size", &minw, &minh, NULL, NULL);
185 fail_if(!b || minw != 150 || minh != 150); 182 fail_if(!b || minw != 150 || minh != 150);
186 183
187 evas_free(evas);
188} 184}
189EFL_END_TEST 185EFL_END_TEST
190 186
191EFL_START_TEST(edje_test_color_class) 187EFL_START_TEST(edje_test_color_class)
192{ 188{
193 Evas *evas = _setup_evas();
194
195 Eina_File *f; 189 Eina_File *f;
196 Eina_Iterator *it; 190 Eina_Iterator *it;
197 Edje_Color_Class *itcc, *cc = NULL; 191 Edje_Color_Class *itcc, *cc = NULL;
@@ -219,7 +213,6 @@ EFL_START_TEST(edje_test_color_class)
219 eina_file_close(f); 213 eina_file_close(f);
220 free(filename); 214 free(filename);
221 215
222 evas_free(evas);
223} 216}
224EFL_END_TEST 217EFL_END_TEST
225 218
diff --git a/src/tests/edje/edje_test_signal.c b/src/tests/edje/edje_test_signal.c
index 20240a421f..553be69abe 100644
--- a/src/tests/edje/edje_test_signal.c
+++ b/src/tests/edje/edje_test_signal.c
@@ -92,7 +92,6 @@ EFL_START_TEST(edje_test_message_send_legacy)
92 92
93 evas_object_del(obj); 93 evas_object_del(obj);
94 94
95 evas_free(evas);
96} 95}
97EFL_END_TEST 96EFL_END_TEST
98 97
@@ -151,7 +150,6 @@ EFL_START_TEST(edje_test_message_send_eo)
151 150
152 efl_del(obj); 151 efl_del(obj);
153 152
154 evas_free(evas);
155} 153}
156EFL_END_TEST 154EFL_END_TEST
157 155
@@ -185,7 +183,6 @@ EFL_START_TEST(edje_test_signals)
185 183
186 efl_del(obj); 184 efl_del(obj);
187 185
188 evas_free(evas);
189} 186}
190EFL_END_TEST 187EFL_END_TEST
191 188
@@ -229,7 +226,6 @@ EFL_START_TEST(edje_test_signal_callback_del_full)
229 226
230 efl_del(obj); 227 efl_del(obj);
231 228
232 evas_free(evas);
233} 229}
234EFL_END_TEST 230EFL_END_TEST
235 231
diff --git a/src/tests/edje/edje_test_swallow.c b/src/tests/edje/edje_test_swallow.c
index b8f13cf7ec..a0e5b4eb96 100644
--- a/src/tests/edje/edje_test_swallow.c
+++ b/src/tests/edje/edje_test_swallow.c
@@ -40,7 +40,6 @@ EFL_START_TEST(edje_test_swallows)
40 /* o1 is deleted at this point. */ 40 /* o1 is deleted at this point. */
41 ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1)); 41 ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
42 42
43 evas_free(evas);
44} 43}
45EFL_END_TEST 44EFL_END_TEST
46 45
@@ -60,7 +59,6 @@ EFL_START_TEST(edje_test_swallows_lifetime)
60 evas_object_del(ly); 59 evas_object_del(ly);
61 fail_if(!efl_parent_get(o1)); 60 fail_if(!efl_parent_get(o1));
62 61
63 evas_free(evas);
64} 62}
65EFL_END_TEST 63EFL_END_TEST
66 64
@@ -88,7 +86,6 @@ EFL_START_TEST(edje_test_swallows_invalidate)
88 evas_object_del(ly); 86 evas_object_del(ly);
89 fail_if(!efl_parent_get(o1)); 87 fail_if(!efl_parent_get(o1));
90 88
91 evas_free(evas);
92} 89}
93EFL_END_TEST 90EFL_END_TEST
94 91
@@ -119,7 +116,6 @@ EFL_START_TEST(edje_test_swallows_eoapi)
119 /* o1 is deleted at this point. */ 116 /* o1 is deleted at this point. */
120 ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1)); 117 ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
121 118
122 evas_free(evas);
123} 119}
124EFL_END_TEST 120EFL_END_TEST
125 121
@@ -153,7 +149,6 @@ EFL_START_TEST(edje_test_swallows_container_api)
153 eina_array_free(arr); 149 eina_array_free(arr);
154 } 150 }
155 151
156 evas_free(evas);
157} 152}
158EFL_END_TEST 153EFL_END_TEST
159 154
diff --git a/src/tests/edje/edje_test_text.c b/src/tests/edje/edje_test_text.c
index 86e1aaf06d..45ef800ca4 100644
--- a/src/tests/edje/edje_test_text.c
+++ b/src/tests/edje/edje_test_text.c
@@ -88,7 +88,6 @@ EFL_START_TEST(edje_test_text_cursor)
88 new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN); 88 new_pos = edje_object_part_text_cursor_pos_get(obj, "text", EDJE_CURSOR_MAIN);
89 ck_assert_int_eq(old_pos, new_pos); 89 ck_assert_int_eq(old_pos, new_pos);
90 90
91 evas_free(evas);
92} 91}
93EFL_END_TEST 92EFL_END_TEST
94 93
@@ -110,7 +109,6 @@ EFL_START_TEST(edje_test_textblock)
110 txt = edje_object_part_text_get(obj, "text"); 109 txt = edje_object_part_text_get(obj, "text");
111 fail_if(!txt || strcmp(txt, buf)); 110 fail_if(!txt || strcmp(txt, buf));
112 111
113 evas_free(evas);
114} 112}
115EFL_END_TEST 113EFL_END_TEST
116 114
@@ -129,7 +127,6 @@ START_TEST(edje_test_text_ellipsis)
129 127
130 efl_text_ellipsis_set(efl_part(layout, "text"), 1.0); 128 efl_text_ellipsis_set(efl_part(layout, "text"), 1.0);
131 129
132 evas_free(evas);
133} 130}
134END_TEST 131END_TEST
135 132
@@ -148,7 +145,6 @@ START_TEST(edje_test_text_wrap)
148 145
149 efl_text_wrap_set(efl_part(layout, "text"), EFL_TEXT_FORMAT_WRAP_WORD); 146 efl_text_wrap_set(efl_part(layout, "text"), EFL_TEXT_FORMAT_WRAP_WORD);
150 147
151 evas_free(evas);
152} 148}
153END_TEST 149END_TEST
154 150
@@ -167,7 +163,6 @@ START_TEST(edje_test_text_font)
167 163
168 efl_text_font_set(efl_part(layout, "text"), "Sans", 14); 164 efl_text_font_set(efl_part(layout, "text"), "Sans", 14);
169 165
170 evas_free(evas);
171} 166}
172END_TEST 167END_TEST
173 168
@@ -186,7 +181,6 @@ START_TEST(edje_test_text_color)
186 181
187 efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 255, 255); 182 efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 255, 255);
188 183
189 evas_free(evas);
190} 184}
191END_TEST 185END_TEST
192 186
@@ -330,7 +324,6 @@ START_TEST(edje_test_text_part)
330 ck_assert(!efl_file_load(layout)); 324 ck_assert(!efl_file_load(layout));
331 _basic_check(layout, EINA_FALSE); 325 _basic_check(layout, EINA_FALSE);
332 326
333 evas_free(evas);
334} 327}
335END_TEST 328END_TEST
336 329