summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-09-29 09:14:32 +0100
committerTom Hacohen <tom@stosb.com>2015-09-29 09:17:48 +0100
commitab6d7b44dfada31a2faa45455b00215959a0708e (patch)
tree9fda099074d1712e8e1b9aae7df65234d4271541 /src
parent08d88d805cc8a0df65071aa2e9f55d312abb0a87 (diff)
Eo: add a regression test for broken callback comparison.
This bug was fixed in d889da6b12e6123073edb54d766c9af1fc6db822, but it was too late at night to start hacking on extracting a regression test and adding it to the suite, so adding it now. This test makes sure that we only fallback to string comparison with legacy events.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_buffer/Ecore_Buffer_Queue.h4
-rw-r--r--src/tests/eo/suite/eo_test_class_simple.c3
-rw-r--r--src/tests/eo/suite/eo_test_class_simple.h3
-rw-r--r--src/tests/eo/suite/eo_test_general.c4
4 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/ecore_buffer/Ecore_Buffer_Queue.h b/src/lib/ecore_buffer/Ecore_Buffer_Queue.h
index 4bc79ae609..81dad17976 100644
--- a/src/lib/ecore_buffer/Ecore_Buffer_Queue.h
+++ b/src/lib/ecore_buffer/Ecore_Buffer_Queue.h
@@ -51,7 +51,7 @@ extern "C" {
51 * @ingroup Ecore_Buffer_Queue_Group 51 * @ingroup Ecore_Buffer_Queue_Group
52 * 52 *
53 * This group of functions is applied to an Ecore_Buffer_Provider object. 53 * This group of functions is applied to an Ecore_Buffer_Provider object.
54 * Ecore_Buffer_Provider provides Ecore_Buffer to Ecore_Buffer_Consumer(usually 54 * Ecore_Buffer_Provider provides Ecore_Buffer to Ecore_Buffer_Consumer(usally
55 * different process or thread from Ecore_Buffer_Provider). 55 * different process or thread from Ecore_Buffer_Provider).
56 * Ecore_Buffer_Provider should creates Ecore_Buffer as a provider. 56 * Ecore_Buffer_Provider should creates Ecore_Buffer as a provider.
57 */ 57 */
@@ -353,7 +353,7 @@ EAPI void ecore_buffer_provider_free(Ecore_Buffer_Provider
353 * 353 *
354 * This function gives you drawable buffer and inform you the state of Queue. 354 * This function gives you drawable buffer and inform you the state of Queue.
355 * Each return value of enumeration has meaning as below. 355 * Each return value of enumeration has meaning as below.
356 * @li ECORE_BUFFER_RETURN_ERROR, means error occurred. 356 * @li ECORE_BUFFER_RETURN_ERROR, means error occured.
357 * @li ECORE_BUFFER_RETURN_SUCCESS, means success to dequeue, therefore ret_buf is valid. 357 * @li ECORE_BUFFER_RETURN_SUCCESS, means success to dequeue, therefore ret_buf is valid.
358 * @li ECORE_BUFFER_RETURN_EMPTY, means queue is empty, not available slot in Queue. 358 * @li ECORE_BUFFER_RETURN_EMPTY, means queue is empty, not available slot in Queue.
359 * in other words, there is no free drawable buffer in Queue. 359 * in other words, there is no free drawable buffer in Queue.
diff --git a/src/tests/eo/suite/eo_test_class_simple.c b/src/tests/eo/suite/eo_test_class_simple.c
index 8e75eed5c3..cb4cb72c98 100644
--- a/src/tests/eo/suite/eo_test_class_simple.c
+++ b/src/tests/eo/suite/eo_test_class_simple.c
@@ -10,6 +10,9 @@
10EAPI const Eo_Event_Description _EV_A_CHANGED = 10EAPI const Eo_Event_Description _EV_A_CHANGED =
11 EO_EVENT_DESCRIPTION("a,changed"); 11 EO_EVENT_DESCRIPTION("a,changed");
12 12
13EAPI const Eo_Event_Description _EV_A_CHANGED2 =
14 EO_EVENT_DESCRIPTION("a,changed");
15
13static void 16static void
14_a_set(Eo *obj EINA_UNUSED, void *class_data, int a) 17_a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
15{ 18{
diff --git a/src/tests/eo/suite/eo_test_class_simple.h b/src/tests/eo/suite/eo_test_class_simple.h
index 2fce591372..8fbb46efff 100644
--- a/src/tests/eo/suite/eo_test_class_simple.h
+++ b/src/tests/eo/suite/eo_test_class_simple.h
@@ -18,6 +18,9 @@ EAPI Eo *simple_part_get(const char *name);
18extern const Eo_Event_Description _EV_A_CHANGED; 18extern const Eo_Event_Description _EV_A_CHANGED;
19#define EV_A_CHANGED (&(_EV_A_CHANGED)) 19#define EV_A_CHANGED (&(_EV_A_CHANGED))
20 20
21extern const Eo_Event_Description _EV_A_CHANGED2;
22#define EV_A_CHANGED2 (&(_EV_A_CHANGED2))
23
21#define SIMPLE_CLASS simple_class_get() 24#define SIMPLE_CLASS simple_class_get()
22const Eo_Class *simple_class_get(void); 25const Eo_Class *simple_class_get(void);
23 26
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index b483a808b1..d8f929131c 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -134,11 +134,15 @@ START_TEST(eo_signals)
134 134
135 /* Call Eo event with legacy and non-legacy callbacks. */ 135 /* Call Eo event with legacy and non-legacy callbacks. */
136 _eo_signals_cb_current = 0; 136 _eo_signals_cb_current = 0;
137 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED2, -1000, _eo_signals_a_changed_never, (void *) 1));
137 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, -100, _eo_signals_a_changed_cb, (void *) 1)); 138 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, -100, _eo_signals_a_changed_cb, (void *) 1));
138 eo_do(obj, eo_event_callback_add(a_desc, _eo_signals_a_changed_cb2, NULL)); 139 eo_do(obj, eo_event_callback_add(a_desc, _eo_signals_a_changed_cb2, NULL));
139 eo_do(obj, simple_a_set(1)); 140 eo_do(obj, simple_a_set(1));
140 ck_assert_int_eq(_eo_signals_cb_flag, 0x3); 141 ck_assert_int_eq(_eo_signals_cb_flag, 0x3);
141 142
143 /* We don't need this one anymore. */
144 eo_do(obj, eo_event_callback_del(EV_A_CHANGED2, _eo_signals_a_changed_never, (void *) 1));
145
142 /* Call legacy event with legacy and non-legacy callbacks. */ 146 /* Call legacy event with legacy and non-legacy callbacks. */
143 int a = 3; 147 int a = 3;
144 _eo_signals_cb_current = 0; 148 _eo_signals_cb_current = 0;