Summary:
It was mistankely swapping regular and inlist structs when registering
after parsing, causing functions like eolian_state_structs_by_file_get
to return wrong data, breaking C# bindings.
Also added a simple test.
Reviewers: q66, bu5hm4n, zmike, cedric, felipealmeida, segfaultxavi
Reviewed By: segfaultxavi
Subscribers: segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8047
{
EOLIAN_OBJECT_ADD(unit, tp->base.name, tp, structs);
}
- Eina_Hash *sh = is_inlist ? unit->state->staging.structs_f
- : unit->state->staging.inlists_f;
+ Eina_Hash *sh = is_inlist ? unit->state->staging.inlists_f
+ : unit->state->staging.structs_f;
eina_hash_set(sh, tp->base.file, eina_list_append
((Eina_List*)eina_hash_find(sh, tp->base.file), tp));
database_object_add(unit, &tp->base);
const Eolian_Unit *unit;
const char *type_name;
const char *file;
+ Eina_Iterator *structs;
Eolian_State *eos = eolian_state_new();
fail_if(!(class = eolian_unit_class_by_name_get(unit, "Struct")));
fail_if(!eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD));
+ fail_if(!(structs = eolian_state_structs_by_file_get(eos, "struct.eo")));
+ eina_iterator_free(structs);
+
/* named struct */
fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Named")));
fail_if(!(type_name = eolian_typedecl_short_name_get(tdl)));