Eo composite objs: Add a test for the recent comp obj fix.

This adds a fragile test for cedric's fix from commit
3550c38080.

It assumes that all the added 64 functions are in order and that each
eo_op chain is 32 in length. As long as those don't change, this should
be a decent test.
This commit is contained in:
Tom Hacohen 2014-10-28 16:19:30 +00:00
parent 2cd728373c
commit 805db9c9ed
3 changed files with 210 additions and 0 deletions

View File

@ -37,9 +37,21 @@ main(int argc, char *argv[])
fail_if(!eo_isa(obj, SIMPLE_CLASS));
int a = 0;
cb_called = EINA_FALSE;
eo_do(obj, simple_a_set(1));
fail_if(!cb_called);
/* Test functions from all across the chain. */
cb_called = EINA_FALSE;
eo_do(obj, simple_a_set1(1));
fail_if(!cb_called);
cb_called = EINA_FALSE;
eo_do(obj, simple_a_set15(1));
fail_if(!cb_called);
cb_called = EINA_FALSE;
eo_do(obj, simple_a_set32(1));
fail_if(!cb_called);
eo_do(obj, a = simple_a_get());
fail_if(a != 1);

View File

@ -30,7 +30,140 @@ _a_get(Eo *obj EINA_UNUSED, void *class_data)
EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a);
EAPI EO_FUNC_BODY(simple_a_get, int, 0);
EAPI EO_VOID_FUNC_BODYV(simple_a_set1, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set2, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set3, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set4, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set5, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set6, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set7, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set8, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set9, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set10, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set11, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set12, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set13, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set14, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set15, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set16, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set17, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set18, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set19, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set20, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set21, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set22, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set23, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set24, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set25, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set26, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set27, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set28, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set29, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set30, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set31, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_set32, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get1, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get2, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get3, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get4, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get5, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get6, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get7, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get8, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get9, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get10, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get11, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get12, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get13, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get14, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get15, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get16, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get17, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get18, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get19, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get20, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get21, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get22, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get23, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get24, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get25, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get26, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get27, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get28, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get29, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get30, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get31, EO_FUNC_CALL(a), int a);
EAPI EO_VOID_FUNC_BODYV(simple_a_get32, EO_FUNC_CALL(a), int a);
/* XXX: This is fragile, and emulates many IDs in order to go to the next
* op id chain (assuming chain size is as it is at the moment, 32).
* This is needed in order to properly test some edge cases (see commit message
* for more info). */
static Eo_Op_Description op_descs[] = {
EO_OP_FUNC(simple_a_set1, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set2, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set3, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set4, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set5, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set6, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set7, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set8, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set9, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set10, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set11, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set12, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set13, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set14, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set15, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set16, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set17, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set18, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set19, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set20, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set21, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set22, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set23, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set24, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set25, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set26, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set27, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set28, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set29, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set30, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set31, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_set32, _a_set, "Littering the ids"),
EO_OP_FUNC(simple_a_get1, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get2, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get3, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get4, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get5, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get6, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get7, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get8, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get9, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get10, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get11, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get12, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get13, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get14, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get15, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get16, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get17, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get18, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get19, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get20, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get21, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get22, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get23, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get24, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get25, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get26, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get27, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get28, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get29, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get30, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get31, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_get32, _a_get, "Littering the ids"),
EO_OP_FUNC(simple_a_set, _a_set, "Set property A"),
EO_OP_FUNC(simple_a_get, _a_get, "Get property A"),
EO_OP_SENTINEL

View File

@ -9,6 +9,71 @@ typedef struct
EAPI void simple_a_set(int a);
EAPI int simple_a_get(void);
EAPI void simple_a_set1(int a);
EAPI void simple_a_set2(int a);
EAPI void simple_a_set3(int a);
EAPI void simple_a_set4(int a);
EAPI void simple_a_set5(int a);
EAPI void simple_a_set6(int a);
EAPI void simple_a_set7(int a);
EAPI void simple_a_set8(int a);
EAPI void simple_a_set9(int a);
EAPI void simple_a_set10(int a);
EAPI void simple_a_set11(int a);
EAPI void simple_a_set12(int a);
EAPI void simple_a_set13(int a);
EAPI void simple_a_set14(int a);
EAPI void simple_a_set15(int a);
EAPI void simple_a_set16(int a);
EAPI void simple_a_set17(int a);
EAPI void simple_a_set18(int a);
EAPI void simple_a_set19(int a);
EAPI void simple_a_set20(int a);
EAPI void simple_a_set21(int a);
EAPI void simple_a_set22(int a);
EAPI void simple_a_set23(int a);
EAPI void simple_a_set24(int a);
EAPI void simple_a_set25(int a);
EAPI void simple_a_set26(int a);
EAPI void simple_a_set27(int a);
EAPI void simple_a_set28(int a);
EAPI void simple_a_set29(int a);
EAPI void simple_a_set30(int a);
EAPI void simple_a_set31(int a);
EAPI void simple_a_set32(int a);
EAPI void simple_a_get1(int a);
EAPI void simple_a_get2(int a);
EAPI void simple_a_get3(int a);
EAPI void simple_a_get4(int a);
EAPI void simple_a_get5(int a);
EAPI void simple_a_get6(int a);
EAPI void simple_a_get7(int a);
EAPI void simple_a_get8(int a);
EAPI void simple_a_get9(int a);
EAPI void simple_a_get10(int a);
EAPI void simple_a_get11(int a);
EAPI void simple_a_get12(int a);
EAPI void simple_a_get13(int a);
EAPI void simple_a_get14(int a);
EAPI void simple_a_get15(int a);
EAPI void simple_a_get16(int a);
EAPI void simple_a_get17(int a);
EAPI void simple_a_get18(int a);
EAPI void simple_a_get19(int a);
EAPI void simple_a_get20(int a);
EAPI void simple_a_get21(int a);
EAPI void simple_a_get22(int a);
EAPI void simple_a_get23(int a);
EAPI void simple_a_get24(int a);
EAPI void simple_a_get25(int a);
EAPI void simple_a_get26(int a);
EAPI void simple_a_get27(int a);
EAPI void simple_a_get28(int a);
EAPI void simple_a_get29(int a);
EAPI void simple_a_get30(int a);
EAPI void simple_a_get31(int a);
EAPI void simple_a_get32(int a);
extern const Eo_Event_Description _EV_A_CHANGED;
#define EV_A_CHANGED (&(_EV_A_CHANGED))