Eo: add a regression test for broken callback comparison.

This bug was fixed in d889da6b12, 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.
This commit is contained in:
Tom Hacohen 2015-09-29 09:14:32 +01:00
parent 08d88d805c
commit ab6d7b44df
4 changed files with 12 additions and 2 deletions

View File

@ -51,7 +51,7 @@ extern "C" {
* @ingroup Ecore_Buffer_Queue_Group
*
* This group of functions is applied to an Ecore_Buffer_Provider object.
* Ecore_Buffer_Provider provides Ecore_Buffer to Ecore_Buffer_Consumer(usually
* Ecore_Buffer_Provider provides Ecore_Buffer to Ecore_Buffer_Consumer(usally
* different process or thread from Ecore_Buffer_Provider).
* Ecore_Buffer_Provider should creates Ecore_Buffer as a provider.
*/
@ -353,7 +353,7 @@ EAPI void ecore_buffer_provider_free(Ecore_Buffer_Provider
*
* This function gives you drawable buffer and inform you the state of Queue.
* Each return value of enumeration has meaning as below.
* @li ECORE_BUFFER_RETURN_ERROR, means error occurred.
* @li ECORE_BUFFER_RETURN_ERROR, means error occured.
* @li ECORE_BUFFER_RETURN_SUCCESS, means success to dequeue, therefore ret_buf is valid.
* @li ECORE_BUFFER_RETURN_EMPTY, means queue is empty, not available slot in Queue.
* in other words, there is no free drawable buffer in Queue.

View File

@ -10,6 +10,9 @@
EAPI const Eo_Event_Description _EV_A_CHANGED =
EO_EVENT_DESCRIPTION("a,changed");
EAPI const Eo_Event_Description _EV_A_CHANGED2 =
EO_EVENT_DESCRIPTION("a,changed");
static void
_a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
{

View File

@ -18,6 +18,9 @@ EAPI Eo *simple_part_get(const char *name);
extern const Eo_Event_Description _EV_A_CHANGED;
#define EV_A_CHANGED (&(_EV_A_CHANGED))
extern const Eo_Event_Description _EV_A_CHANGED2;
#define EV_A_CHANGED2 (&(_EV_A_CHANGED2))
#define SIMPLE_CLASS simple_class_get()
const Eo_Class *simple_class_get(void);

View File

@ -134,11 +134,15 @@ START_TEST(eo_signals)
/* Call Eo event with legacy and non-legacy callbacks. */
_eo_signals_cb_current = 0;
eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED2, -1000, _eo_signals_a_changed_never, (void *) 1));
eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, -100, _eo_signals_a_changed_cb, (void *) 1));
eo_do(obj, eo_event_callback_add(a_desc, _eo_signals_a_changed_cb2, NULL));
eo_do(obj, simple_a_set(1));
ck_assert_int_eq(_eo_signals_cb_flag, 0x3);
/* We don't need this one anymore. */
eo_do(obj, eo_event_callback_del(EV_A_CHANGED2, _eo_signals_a_changed_never, (void *) 1));
/* Call legacy event with legacy and non-legacy callbacks. */
int a = 3;
_eo_signals_cb_current = 0;