summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWander Lairson Costa <wander.lairson@gmail.com>2020-11-04 18:25:37 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-11-04 18:56:37 +0000
commitfc949660f70f99fe97e63de65b1b67377d16c6da (patch)
treeb4a77e9a085662c26fff476ab5fa1abeb1bb3b47 /src
parent888e1e74012a4d17bb56ef3d2be2dd6d635c449b (diff)
eo_test_general.c: Make eo_signals tests pass on Windows
Summary: EFL_CALLBACKS_ARRAY_DEFINE reorders the callbacks according to efl_callbacks_cmp. efl_callbacks_cmp compares the address of the desc field, which depends on the memory layout generated by the linker. To make the test run deterministically, we define the array of callbacks manually. Reviewers: vtorri, felipealmeida, raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers, jptiz, felipealmeida Tags: #efl Differential Revision: https://phab.enlightenment.org/D12043
Diffstat (limited to 'src')
-rw-r--r--src/tests/eo/suite/eo_test_general.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index ae026a27f4..7bdb0e170b 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -199,11 +199,26 @@ _eo_signals_cb_added_deled(void *data EINA_UNUSED, const Efl_Event *event)
199 fail_if(callback_array->func != _eo_signals_cb_added_deled); 199 fail_if(callback_array->func != _eo_signals_cb_added_deled);
200} 200}
201 201
202EFL_CALLBACKS_ARRAY_DEFINE(_eo_signals_callbacks, 202// We don't use the EFL_CALLBACKS_ARRAY_DEFINE macro because
203{ EV_A_CHANGED, _eo_signals_a_changed_cb }, 203// we need the callbacks be called in a specific order
204{ EV_A_CHANGED, _eo_signals_a_changed_cb2 }, 204static Efl_Callback_Array_Item *
205{ EV_A_CHANGED, _eo_signals_a_changed_never }, 205_eo_signals_callbacks(void)
206{ EFL_EVENT_DEL, _eo_signals_efl_del_cb }); 206{
207 static Efl_Callback_Array_Item items[] =
208 {
209 { EV_A_CHANGED, _eo_signals_a_changed_cb },
210 { EV_A_CHANGED, _eo_signals_a_changed_cb2 },
211 { EV_A_CHANGED, _eo_signals_a_changed_never },
212 { 0, _eo_signals_efl_del_cb },
213 { 0, 0 },
214 };
215
216 // On Windows, because _EFL_EVENT_DEL is a symbol exported
217 // from the DLL, we can't assign from a context expression
218 items[3].desc = EFL_EVENT_DEL;
219
220 return items;
221}
207 222
208EFL_START_TEST(eo_signals) 223EFL_START_TEST(eo_signals)
209{ 224{