eolian: initial conversion of C gen and tests to new type APIs
This commit is contained in:
parent
8514c1846f
commit
cb42da514b
|
@ -42,10 +42,10 @@ _generate_ref(const char *refn, Eina_Strbuf *wbuf, Eina_Bool use_legacy)
|
|||
|
||||
Eina_Stringshare *bname = eina_stringshare_add_length(refn, sfx - refn);
|
||||
|
||||
const Eolian_Type *tp = eolian_type_struct_get_by_name(bname);
|
||||
const Eolian_Typedecl *tp = eolian_typedecl_struct_get_by_name(bname);
|
||||
if (tp)
|
||||
{
|
||||
if (!eolian_type_struct_field_get(tp, sfx + 1))
|
||||
if (!eolian_typedecl_struct_field_get(tp, sfx + 1))
|
||||
{
|
||||
eina_stringshare_del(bname);
|
||||
goto noref;
|
||||
|
@ -56,17 +56,17 @@ _generate_ref(const char *refn, Eina_Strbuf *wbuf, Eina_Bool use_legacy)
|
|||
return;
|
||||
}
|
||||
|
||||
tp = eolian_type_enum_get_by_name(bname);
|
||||
tp = eolian_typedecl_enum_get_by_name(bname);
|
||||
if (tp)
|
||||
{
|
||||
const Eolian_Enum_Type_Field *efl = eolian_type_enum_field_get(tp, sfx + 1);
|
||||
const Eolian_Enum_Type_Field *efl = eolian_typedecl_enum_field_get(tp, sfx + 1);
|
||||
if (!efl)
|
||||
{
|
||||
eina_stringshare_del(bname);
|
||||
goto noref;
|
||||
}
|
||||
_generate_ref(bname, wbuf, use_legacy);
|
||||
Eina_Stringshare *str = eolian_type_enum_field_c_name_get(efl);
|
||||
Eina_Stringshare *str = eolian_typedecl_enum_field_c_name_get(efl);
|
||||
eina_strbuf_append_char(wbuf, '.');
|
||||
eina_strbuf_append(wbuf, str);
|
||||
eina_stringshare_del(str);
|
||||
|
|
|
@ -12,16 +12,16 @@
|
|||
#include "common_funcs.h"
|
||||
|
||||
static char *
|
||||
_concat_name(const Eolian_Type *tp)
|
||||
_concat_name(const Eolian_Typedecl *tp)
|
||||
{
|
||||
const char *name;
|
||||
char *str = NULL;
|
||||
Eina_Strbuf *buf = eina_strbuf_new();
|
||||
Eina_Iterator *itr = eolian_type_namespaces_get(tp);
|
||||
Eina_Iterator *itr = eolian_typedecl_namespaces_get(tp);
|
||||
EINA_ITERATOR_FOREACH(itr, name)
|
||||
if (name) eina_strbuf_append_printf(buf, "%s_", name);
|
||||
eina_iterator_free(itr);
|
||||
name = eolian_type_name_get(tp);
|
||||
name = eolian_typedecl_name_get(tp);
|
||||
if (name) eina_strbuf_append_printf(buf, "%s", name);
|
||||
if (eina_strbuf_length_get(buf))
|
||||
{
|
||||
|
@ -34,51 +34,51 @@ _concat_name(const Eolian_Type *tp)
|
|||
}
|
||||
|
||||
static Eina_Strbuf *
|
||||
_type_generate(const Eolian_Type *tp, Eina_Bool full, Eina_Bool use_legacy)
|
||||
_type_generate(const Eolian_Typedecl *tp, Eina_Bool full, Eina_Bool use_legacy)
|
||||
{
|
||||
char *grp = strdup(eolian_type_full_name_get(tp));
|
||||
char *grp = strdup(eolian_typedecl_full_name_get(tp));
|
||||
char *p = strrchr(grp, '.');
|
||||
if (p) *p = '\0';
|
||||
Eina_Strbuf *buf = docs_generate_full(eolian_type_documentation_get(tp),
|
||||
Eina_Strbuf *buf = docs_generate_full(eolian_typedecl_documentation_get(tp),
|
||||
grp, 0, use_legacy);
|
||||
free(grp);
|
||||
if (!buf) buf = eina_strbuf_new();
|
||||
else eina_strbuf_append_char(buf, '\n');
|
||||
Eolian_Type_Type tp_type = eolian_type_type_get(tp);
|
||||
Eolian_Typedecl_Type tp_type = eolian_typedecl_type_get(tp);
|
||||
switch(tp_type)
|
||||
{
|
||||
case EOLIAN_TYPE_ALIAS:
|
||||
case EOLIAN_TYPEDECL_ALIAS:
|
||||
{
|
||||
char *name = _concat_name(tp);
|
||||
Eina_Stringshare *c_type = eolian_type_c_type_named_get(
|
||||
eolian_type_base_type_get(tp), name);
|
||||
eolian_typedecl_base_type_get(tp), name);
|
||||
eina_strbuf_append_printf(buf, "typedef %s", c_type);
|
||||
eina_stringshare_del(c_type);
|
||||
free(name);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_TYPE_STRUCT:
|
||||
case EOLIAN_TYPE_STRUCT_OPAQUE:
|
||||
case EOLIAN_TYPEDECL_STRUCT:
|
||||
case EOLIAN_TYPEDECL_STRUCT_OPAQUE:
|
||||
{
|
||||
const Eolian_Struct_Type_Field *member;
|
||||
char *name = _concat_name(tp);
|
||||
if (tp_type == EOLIAN_TYPE_STRUCT_OPAQUE || !full)
|
||||
if (tp_type == EOLIAN_TYPEDECL_STRUCT_OPAQUE || !full)
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "typedef struct _%s %s", name, name);
|
||||
free(name);
|
||||
break;
|
||||
}
|
||||
eina_strbuf_append_printf(buf, "typedef struct _%s\n{\n", name);
|
||||
Eina_Iterator *members = eolian_type_struct_fields_get(tp);
|
||||
Eina_Iterator *members = eolian_typedecl_struct_fields_get(tp);
|
||||
EINA_ITERATOR_FOREACH(members, member)
|
||||
{
|
||||
const Eolian_Type *type = eolian_type_struct_field_type_get(member);
|
||||
const Eolian_Type *type = eolian_typedecl_struct_field_type_get(member);
|
||||
Eina_Stringshare *c_type = eolian_type_c_type_get(type);
|
||||
eina_strbuf_append_printf(buf, " %s%s%s;",
|
||||
c_type, strchr(c_type, '*')?"":" ",
|
||||
eolian_type_struct_field_name_get(member));
|
||||
eolian_typedecl_struct_field_name_get(member));
|
||||
const Eolian_Documentation *fdoc
|
||||
= eolian_type_struct_field_documentation_get(member);
|
||||
= eolian_typedecl_struct_field_documentation_get(member);
|
||||
if (fdoc)
|
||||
{
|
||||
const char *nl = strrchr(eina_strbuf_string_get(buf), '\n');
|
||||
|
@ -98,7 +98,7 @@ _type_generate(const Eolian_Type *tp, Eina_Bool full, Eina_Bool use_legacy)
|
|||
free(name);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_TYPE_ENUM:
|
||||
case EOLIAN_TYPEDECL_ENUM:
|
||||
{
|
||||
const Eolian_Enum_Type_Field *member;
|
||||
char *name;
|
||||
|
@ -107,18 +107,18 @@ _type_generate(const Eolian_Type *tp, Eina_Bool full, Eina_Bool use_legacy)
|
|||
name = _concat_name(tp);
|
||||
char *pre = NULL;
|
||||
eina_strbuf_append_printf(buf, "typedef enum\n{\n");
|
||||
if (eolian_type_enum_legacy_prefix_get(tp))
|
||||
pre = strdup(eolian_type_enum_legacy_prefix_get(tp));
|
||||
if (eolian_typedecl_enum_legacy_prefix_get(tp))
|
||||
pre = strdup(eolian_typedecl_enum_legacy_prefix_get(tp));
|
||||
else
|
||||
pre = strdup(name);
|
||||
eina_str_toupper(&pre);
|
||||
Eina_Iterator *members = eolian_type_enum_fields_get(tp);
|
||||
Eina_Iterator *members = eolian_typedecl_enum_fields_get(tp);
|
||||
Eina_Bool next = eina_iterator_next(members, (void**)&member);
|
||||
Eina_Strbuf *membuf = eina_strbuf_new();
|
||||
while (next)
|
||||
{
|
||||
const Eolian_Expression *value = eolian_type_enum_field_value_get(member, EINA_FALSE);
|
||||
char *memb_u = strdup(eolian_type_enum_field_name_get(member));
|
||||
const Eolian_Expression *value = eolian_typedecl_enum_field_value_get(member, EINA_FALSE);
|
||||
char *memb_u = strdup(eolian_typedecl_enum_field_name_get(member));
|
||||
eina_str_toupper(&memb_u);
|
||||
eina_strbuf_reset(membuf);
|
||||
eina_strbuf_append(membuf, pre);
|
||||
|
@ -141,7 +141,7 @@ _type_generate(const Eolian_Type *tp, Eina_Bool full, Eina_Bool use_legacy)
|
|||
eina_stringshare_del(lit);
|
||||
}
|
||||
const Eolian_Documentation *fdoc
|
||||
= eolian_type_enum_field_documentation_get(member);
|
||||
= eolian_typedecl_enum_field_documentation_get(member);
|
||||
next = eina_iterator_next(members, (void**)&member);
|
||||
if (next)
|
||||
eina_strbuf_append(buf, ",");
|
||||
|
@ -191,13 +191,13 @@ types_header_generate(const char *eo_filename, Eina_Strbuf *buf, Eina_Bool full,
|
|||
if (dt == EOLIAN_DECL_ENUM && !full)
|
||||
continue;
|
||||
|
||||
const Eolian_Type *tp = eolian_declaration_data_type_get(decl);
|
||||
if (!tp || eolian_type_is_extern(tp))
|
||||
const Eolian_Typedecl *tp = eolian_declaration_data_type_get(decl);
|
||||
if (!tp || eolian_typedecl_is_extern(tp))
|
||||
continue;
|
||||
|
||||
if (eolian_type_type_get(tp) == EOLIAN_TYPE_ALIAS)
|
||||
if (eolian_typedecl_type_get(tp) == EOLIAN_TYPEDECL_ALIAS)
|
||||
{
|
||||
const Eolian_Type *btp = eolian_type_base_type_get(tp);
|
||||
const Eolian_Type *btp = eolian_typedecl_base_type_get(tp);
|
||||
if (eolian_type_type_get(btp) == EOLIAN_TYPE_UNDEFINED)
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -1543,6 +1543,7 @@ EAPI Eina_Stringshare *eolian_typedecl_file_get(const Eolian_Typedecl *tp);
|
|||
*/
|
||||
EAPI const Eolian_Type *eolian_type_base_type_get(const Eolian_Type *tp);
|
||||
EAPI const Eolian_Type *eolian_typedecl_base_type_get(const Eolian_Typedecl *tp);
|
||||
EAPI const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get the lowest base type of an alias stack.
|
||||
|
@ -2049,7 +2050,7 @@ EAPI const Eolian_Class *eolian_declaration_class_get(const Eolian_Declaration *
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI const Eolian_Type *eolian_declaration_data_type_get(const Eolian_Declaration *decl);
|
||||
EAPI const Eolian_Typedecl *eolian_declaration_data_type_get(const Eolian_Declaration *decl);
|
||||
|
||||
/*
|
||||
* @brief Get the variable of a variable (constant, global) declaration.
|
||||
|
|
|
@ -95,36 +95,40 @@ void
|
|||
database_type_add(Eolian_Type *def)
|
||||
{
|
||||
def->decl = _typedecl_add(def);
|
||||
def->decl->type = EOLIAN_TYPEDECL_ALIAS;
|
||||
eina_hash_set(_aliases, def->full_name, def);
|
||||
eina_hash_set(_aliasesf, def->base.file, eina_list_append
|
||||
((Eina_List*)eina_hash_find(_aliasesf, def->base.file), def));
|
||||
eina_hash_set(_aliasesd, def->base.file, eina_list_append
|
||||
((Eina_List*)eina_hash_find(_aliasesd, def->base.file), def->decl));
|
||||
database_decl_add(def->full_name, EOLIAN_DECL_ALIAS, def->base.file, def);
|
||||
database_decl_add(def->full_name, EOLIAN_DECL_ALIAS, def->base.file, def->decl);
|
||||
}
|
||||
|
||||
void
|
||||
database_struct_add(Eolian_Type *tp)
|
||||
{
|
||||
tp->decl = _typedecl_add(tp);
|
||||
tp->decl->type = (tp->type == EOLIAN_TYPE_STRUCT_OPAQUE) ? EOLIAN_TYPEDECL_STRUCT_OPAQUE
|
||||
: EOLIAN_TYPEDECL_STRUCT;
|
||||
eina_hash_set(_structs, tp->full_name, tp);
|
||||
eina_hash_set(_structsf, tp->base.file, eina_list_append
|
||||
((Eina_List*)eina_hash_find(_structsf, tp->base.file), tp));
|
||||
eina_hash_set(_structsd, tp->base.file, eina_list_append
|
||||
((Eina_List*)eina_hash_find(_structsd, tp->base.file), tp->decl));
|
||||
database_decl_add(tp->full_name, EOLIAN_DECL_STRUCT, tp->base.file, tp);
|
||||
database_decl_add(tp->full_name, EOLIAN_DECL_STRUCT, tp->base.file, tp->decl);
|
||||
}
|
||||
|
||||
void
|
||||
database_enum_add(Eolian_Type *tp)
|
||||
{
|
||||
tp->decl = _typedecl_add(tp);
|
||||
tp->decl->type = EOLIAN_TYPEDECL_ENUM;
|
||||
eina_hash_set(_enums, tp->full_name, tp);
|
||||
eina_hash_set(_enumsf, tp->base.file, eina_list_append
|
||||
((Eina_List*)eina_hash_find(_enumsf, tp->base.file), tp));
|
||||
eina_hash_set(_enumsd, tp->base.file, eina_list_append
|
||||
((Eina_List*)eina_hash_find(_enumsd, tp->base.file), tp->decl));
|
||||
database_decl_add(tp->full_name, EOLIAN_DECL_ENUM, tp->base.file, tp);
|
||||
database_decl_add(tp->full_name, EOLIAN_DECL_ENUM, tp->base.file, tp->decl);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -372,13 +372,33 @@ eolian_type_base_type_get(const Eolian_Type *tp)
|
|||
Eolian_Declaration *decl = eina_hash_find(_decls, tp->full_name);
|
||||
if (decl && decl->type != EOLIAN_DECL_CLASS
|
||||
&& decl->type != EOLIAN_DECL_VAR)
|
||||
return decl->data;
|
||||
return ((const Eolian_Typedecl *)decl->data)->parent;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
return tp->base_type;
|
||||
}
|
||||
|
||||
EAPI const Eolian_Typedecl *
|
||||
eolian_type_typedecl_get(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
if (eolian_type_type_get(tp) != EOLIAN_TYPE_REGULAR)
|
||||
return NULL;
|
||||
/* try looking up if it belongs to a struct, enum or an alias... otherwise
|
||||
* return NULL, but first check for builtins
|
||||
*/
|
||||
int kw = eo_lexer_keyword_str_to_id(tp->full_name);
|
||||
if (!kw || kw < KW_byte || kw >= KW_true)
|
||||
{
|
||||
Eolian_Declaration *decl = eina_hash_find(_decls, tp->full_name);
|
||||
if (decl && decl->type != EOLIAN_DECL_CLASS
|
||||
&& decl->type != EOLIAN_DECL_VAR)
|
||||
return decl->data;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI const Eolian_Type *
|
||||
eolian_typedecl_base_type_get(const Eolian_Typedecl *tp)
|
||||
{
|
||||
|
|
|
@ -165,14 +165,14 @@ eolian_declaration_class_get(const Eolian_Declaration *decl)
|
|||
return (const Eolian_Class *)decl->data;
|
||||
}
|
||||
|
||||
EAPI const Eolian_Type *
|
||||
EAPI const Eolian_Typedecl *
|
||||
eolian_declaration_data_type_get(const Eolian_Declaration *decl)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(decl, NULL);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(decl->type == EOLIAN_DECL_ALIAS ||
|
||||
decl->type == EOLIAN_DECL_STRUCT ||
|
||||
decl->type == EOLIAN_DECL_ENUM, NULL);
|
||||
return (const Eolian_Type *)decl->data;
|
||||
return (const Eolian_Typedecl *)decl->data;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -346,7 +346,8 @@ END_TEST
|
|||
|
||||
START_TEST(eolian_typedef)
|
||||
{
|
||||
const Eolian_Type *atype = NULL, *type = NULL;
|
||||
const Eolian_Type *type = NULL;
|
||||
const Eolian_Typedecl *tdl = NULL;
|
||||
const char *type_name = NULL;
|
||||
Eina_Iterator *iter = NULL;
|
||||
const Eolian_Class *class;
|
||||
|
@ -361,14 +362,14 @@ START_TEST(eolian_typedef)
|
|||
fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
|
||||
|
||||
/* Basic type */
|
||||
fail_if(!(atype = eolian_type_alias_get_by_name("Evas.Coord")));
|
||||
fail_if(eolian_type_type_get(atype) != EOLIAN_TYPE_ALIAS);
|
||||
fail_if(!(type_name = eolian_type_name_get(atype)));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Evas.Coord")));
|
||||
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ALIAS);
|
||||
fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
|
||||
fail_if(strcmp(type_name, "Coord"));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(atype)));
|
||||
fail_if(!(type_name = eolian_typedecl_c_type_get(tdl)));
|
||||
fail_if(strcmp(type_name, "typedef int Evas_Coord"));
|
||||
eina_stringshare_del(type_name);
|
||||
fail_if(!(type = eolian_type_base_type_get(atype)));
|
||||
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
|
||||
fail_if(!(type_name = eolian_type_name_get(type)));
|
||||
fail_if(eolian_type_is_own(type));
|
||||
fail_if(eolian_type_is_const(type));
|
||||
|
@ -376,19 +377,19 @@ START_TEST(eolian_typedef)
|
|||
fail_if(strcmp(type_name, "int"));
|
||||
|
||||
/* File */
|
||||
fail_if(!(file = eolian_type_file_get(atype)));
|
||||
fail_if(!(file = eolian_typedecl_file_get(tdl)));
|
||||
fail_if(strcmp(file, "typedef.eo"));
|
||||
|
||||
/* Lowest alias base */
|
||||
fail_if(!(atype = eolian_type_alias_get_by_name("Evas.Coord3")));
|
||||
fail_if(!(atype = eolian_type_aliased_base_get(atype)));
|
||||
fail_if(strcmp(eolian_type_name_get(atype), "int"));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Evas.Coord3")));
|
||||
fail_if(!(type = eolian_typedecl_aliased_base_get(tdl)));
|
||||
fail_if(strcmp(eolian_type_name_get(type), "int"));
|
||||
|
||||
/* Complex type */
|
||||
fail_if(!(atype = eolian_type_alias_get_by_name("List_Objects")));
|
||||
fail_if(!(type_name = eolian_type_name_get(atype)));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("List_Objects")));
|
||||
fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
|
||||
fail_if(strcmp(type_name, "List_Objects"));
|
||||
fail_if(!(type = eolian_type_base_type_get(atype)));
|
||||
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type)));
|
||||
fail_if(!eolian_type_is_own(type));
|
||||
fail_if(strcmp(type_name, "Eina_List *"));
|
||||
|
@ -403,21 +404,21 @@ START_TEST(eolian_typedef)
|
|||
eina_iterator_free(iter);
|
||||
|
||||
/* List */
|
||||
fail_if(!(iter = eolian_type_aliases_get_by_file("typedef.eo")));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&atype));
|
||||
fail_if(!(type_name = eolian_type_name_get(atype)));
|
||||
fail_if(!(iter = eolian_typedecl_aliases_get_by_file("typedef.eo")));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&tdl));
|
||||
fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
|
||||
fail_if(strcmp(type_name, "Coord"));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&atype));
|
||||
fail_if(!(type_name = eolian_type_name_get(atype)));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&tdl));
|
||||
fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
|
||||
fail_if(strcmp(type_name, "List_Objects"));
|
||||
/* coord2 and coord3, skip */
|
||||
fail_if(!eina_iterator_next(iter, (void**)&atype));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&atype));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&tdl));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&tdl));
|
||||
/* not generated extern, skip */
|
||||
fail_if(!eina_iterator_next(iter, (void**)&atype));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&tdl));
|
||||
/* not generated undefined type, skip */
|
||||
fail_if(!eina_iterator_next(iter, (void**)&atype));
|
||||
fail_if(eina_iterator_next(iter, (void**)&atype));
|
||||
fail_if(!eina_iterator_next(iter, (void**)&tdl));
|
||||
fail_if(eina_iterator_next(iter, (void**)&tdl));
|
||||
|
||||
eolian_shutdown();
|
||||
}
|
||||
|
@ -664,6 +665,7 @@ START_TEST(eolian_struct)
|
|||
{
|
||||
const Eolian_Struct_Type_Field *field = NULL;
|
||||
const Eolian_Type *type = NULL, *ftype = NULL;
|
||||
const Eolian_Typedecl *tdl = NULL;
|
||||
const Eolian_Class *class;
|
||||
const Eolian_Function *func;
|
||||
const char *type_name;
|
||||
|
@ -679,42 +681,40 @@ START_TEST(eolian_struct)
|
|||
fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
|
||||
|
||||
/* named struct */
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Named")));
|
||||
fail_if(!(type_name = eolian_type_name_get(type)));
|
||||
fail_if(!(file = eolian_type_file_get(type)));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_STRUCT);
|
||||
fail_if(eolian_type_is_own(type));
|
||||
fail_if(eolian_type_is_const(type));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Named")));
|
||||
fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
|
||||
fail_if(!(file = eolian_typedecl_file_get(tdl)));
|
||||
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
|
||||
fail_if(strcmp(type_name, "Named"));
|
||||
fail_if(strcmp(file, "struct.eo"));
|
||||
fail_if(!(field = eolian_type_struct_field_get(type, "field")));
|
||||
fail_if(!(ftype = eolian_type_struct_field_type_get(field)));
|
||||
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
|
||||
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
|
||||
fail_if(!(type_name = eolian_type_name_get(ftype)));
|
||||
fail_if(strcmp(type_name, "int"));
|
||||
fail_if(!(field = eolian_type_struct_field_get(type, "something")));
|
||||
fail_if(!(ftype = eolian_type_struct_field_type_get(field)));
|
||||
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something")));
|
||||
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(ftype)));
|
||||
fail_if(strcmp(type_name, "const char *"));
|
||||
eina_stringshare_del(type_name);
|
||||
|
||||
/* referencing */
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Another")));
|
||||
fail_if(!(type_name = eolian_type_name_get(type)));
|
||||
fail_if(!(file = eolian_type_file_get(type)));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_STRUCT);
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Another")));
|
||||
fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
|
||||
fail_if(!(file = eolian_typedecl_file_get(tdl)));
|
||||
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
|
||||
fail_if(strcmp(type_name, "Another"));
|
||||
fail_if(strcmp(file, "struct.eo"));
|
||||
fail_if(!(field = eolian_type_struct_field_get(type, "field")));
|
||||
fail_if(!(ftype = eolian_type_struct_field_type_get(field)));
|
||||
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
|
||||
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
|
||||
fail_if(!(type_name = eolian_type_name_get(ftype)));
|
||||
fail_if(strcmp(type_name, "Named"));
|
||||
fail_if(eolian_type_type_get(ftype) != EOLIAN_TYPE_REGULAR);
|
||||
fail_if(eolian_type_type_get(eolian_type_base_type_get(ftype))
|
||||
!= EOLIAN_TYPE_STRUCT);
|
||||
fail_if(eolian_typedecl_type_get(eolian_type_typedecl_get(ftype))
|
||||
!= EOLIAN_TYPEDECL_STRUCT);
|
||||
|
||||
/* opaque struct */
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Opaque")));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_STRUCT_OPAQUE);
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Opaque")));
|
||||
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT_OPAQUE);
|
||||
|
||||
/* use in function */
|
||||
fail_if(!(func = eolian_class_function_get_by_name(class, "bar", EOLIAN_METHOD)));
|
||||
|
@ -722,8 +722,8 @@ START_TEST(eolian_struct)
|
|||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_POINTER);
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_REGULAR);
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_STRUCT);
|
||||
fail_if(!(tdl = eolian_type_typedecl_get(type)));
|
||||
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
|
||||
|
||||
eolian_shutdown();
|
||||
}
|
||||
|
@ -731,7 +731,7 @@ END_TEST
|
|||
|
||||
START_TEST(eolian_extern)
|
||||
{
|
||||
const Eolian_Type *type = NULL;
|
||||
const Eolian_Typedecl *tdl = NULL;
|
||||
const Eolian_Class *class;
|
||||
|
||||
eolian_init();
|
||||
|
@ -744,20 +744,20 @@ START_TEST(eolian_extern)
|
|||
fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
|
||||
|
||||
/* regular type */
|
||||
fail_if(!(type = eolian_type_alias_get_by_name("Foo")));
|
||||
fail_if(eolian_type_is_extern(type));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Foo")));
|
||||
fail_if(eolian_typedecl_is_extern(tdl));
|
||||
|
||||
/* extern type */
|
||||
fail_if(!(type = eolian_type_alias_get_by_name("Evas.Coord")));
|
||||
fail_if(!eolian_type_is_extern(type));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Evas.Coord")));
|
||||
fail_if(!eolian_typedecl_is_extern(tdl));
|
||||
|
||||
/* regular struct */
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("X")));
|
||||
fail_if(eolian_type_is_extern(type));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("X")));
|
||||
fail_if(eolian_typedecl_is_extern(tdl));
|
||||
|
||||
/* extern struct */
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Y")));
|
||||
fail_if(!eolian_type_is_extern(type));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Y")));
|
||||
fail_if(!eolian_typedecl_is_extern(tdl));
|
||||
|
||||
eolian_shutdown();
|
||||
}
|
||||
|
@ -831,6 +831,7 @@ START_TEST(eolian_enum)
|
|||
{
|
||||
const Eolian_Enum_Type_Field *field = NULL;
|
||||
const Eolian_Variable *var = NULL;
|
||||
const Eolian_Typedecl *tdl = NULL;
|
||||
const Eolian_Type *type = NULL;
|
||||
const Eolian_Class *class;
|
||||
const Eolian_Expression *exp;
|
||||
|
@ -847,60 +848,60 @@ START_TEST(eolian_enum)
|
|||
fail_if(!(class = eolian_class_get_by_name("Enum")));
|
||||
fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
|
||||
|
||||
fail_if(!(type = eolian_type_enum_get_by_name("Foo")));
|
||||
fail_if(!(tdl = eolian_typedecl_enum_get_by_name("Foo")));
|
||||
|
||||
fail_if(!(field = eolian_type_enum_field_get(type, "first")));
|
||||
fail_if(!(exp = eolian_type_enum_field_value_get(field, EINA_FALSE)));
|
||||
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "first")));
|
||||
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
|
||||
v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
|
||||
fail_if(v.type != EOLIAN_EXPR_INT);
|
||||
fail_if(v.value.i != 0);
|
||||
|
||||
fail_if(!(field = eolian_type_enum_field_get(type, "bar")));
|
||||
fail_if(eolian_type_enum_field_value_get(field, EINA_FALSE));
|
||||
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "bar")));
|
||||
fail_if(eolian_typedecl_enum_field_value_get(field, EINA_FALSE));
|
||||
|
||||
fail_if(!(field = eolian_type_enum_field_get(type, "baz")));
|
||||
fail_if(!(exp = eolian_type_enum_field_value_get(field, EINA_FALSE)));
|
||||
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "baz")));
|
||||
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
|
||||
v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
|
||||
fail_if(v.type != EOLIAN_EXPR_INT);
|
||||
fail_if(v.value.i != 15);
|
||||
|
||||
fail_if(!(type = eolian_type_enum_get_by_name("Bar")));
|
||||
fail_if(strcmp(eolian_type_enum_legacy_prefix_get(type), "test"));
|
||||
fail_if(!(tdl = eolian_typedecl_enum_get_by_name("Bar")));
|
||||
fail_if(strcmp(eolian_typedecl_enum_legacy_prefix_get(tdl), "test"));
|
||||
|
||||
fail_if(!(field = eolian_type_enum_field_get(type, "foo")));
|
||||
fail_if(!(exp = eolian_type_enum_field_value_get(field, EINA_FALSE)));
|
||||
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "foo")));
|
||||
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
|
||||
v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
|
||||
fail_if(v.type != EOLIAN_EXPR_INT);
|
||||
fail_if(v.value.i != 15);
|
||||
|
||||
cname = eolian_type_enum_field_c_name_get(field);
|
||||
cname = eolian_typedecl_enum_field_c_name_get(field);
|
||||
fail_if(strcmp(cname, "TEST_FOO"));
|
||||
eina_stringshare_del(cname);
|
||||
|
||||
fail_if(!(type = eolian_type_enum_get_by_name("Baz")));
|
||||
fail_if(!(tdl = eolian_typedecl_enum_get_by_name("Baz")));
|
||||
|
||||
fail_if(!(field = eolian_type_enum_field_get(type, "flag1")));
|
||||
fail_if(!(exp = eolian_type_enum_field_value_get(field, EINA_FALSE)));
|
||||
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag1")));
|
||||
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
|
||||
v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
|
||||
fail_if(v.type != EOLIAN_EXPR_INT);
|
||||
fail_if(v.value.i != (1 << 0));
|
||||
|
||||
fail_if(!(field = eolian_type_enum_field_get(type, "flag2")));
|
||||
fail_if(!(exp = eolian_type_enum_field_value_get(field, EINA_FALSE)));
|
||||
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag2")));
|
||||
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
|
||||
v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
|
||||
fail_if(v.type != EOLIAN_EXPR_INT);
|
||||
fail_if(v.value.i != (1 << 1));
|
||||
|
||||
fail_if(!(field = eolian_type_enum_field_get(type, "flag3")));
|
||||
fail_if(!(exp = eolian_type_enum_field_value_get(field, EINA_FALSE)));
|
||||
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag3")));
|
||||
fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
|
||||
v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
|
||||
fail_if(v.type != EOLIAN_EXPR_INT);
|
||||
fail_if(v.value.i != (1 << 2));
|
||||
|
||||
fail_if(!(type = eolian_type_enum_get_by_name("Name.Spaced")));
|
||||
fail_if(!(field = eolian_type_enum_field_get(type, "pants")));
|
||||
fail_if(!(tdl = eolian_typedecl_enum_get_by_name("Name.Spaced")));
|
||||
fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "pants")));
|
||||
|
||||
cname = eolian_type_enum_field_c_name_get(field);
|
||||
cname = eolian_typedecl_enum_field_c_name_get(field);
|
||||
fail_if(strcmp(cname, "NAME_SPACED_PANTS"));
|
||||
eina_stringshare_del(cname);
|
||||
|
||||
|
@ -963,6 +964,7 @@ END_TEST
|
|||
START_TEST(eolian_free_func)
|
||||
{
|
||||
const Eolian_Class *class;
|
||||
const Eolian_Typedecl *tdl;
|
||||
const Eolian_Type *type;
|
||||
|
||||
eolian_init();
|
||||
|
@ -975,29 +977,29 @@ START_TEST(eolian_free_func)
|
|||
fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
|
||||
|
||||
/* regular struct */
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Named1")));
|
||||
fail_if(eolian_type_free_func_get(type));
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Named2")));
|
||||
fail_if(strcmp(eolian_type_free_func_get(type), "test_free"));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Named1")));
|
||||
fail_if(eolian_typedecl_free_func_get(tdl));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Named2")));
|
||||
fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "test_free"));
|
||||
|
||||
/* typedef */
|
||||
fail_if(!(type = eolian_type_alias_get_by_name("Typedef1")));
|
||||
fail_if(eolian_type_free_func_get(type));
|
||||
fail_if(!(type = eolian_type_alias_get_by_name("Typedef2")));
|
||||
fail_if(strcmp(eolian_type_free_func_get(type), "def_free"));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Typedef1")));
|
||||
fail_if(eolian_typedecl_free_func_get(tdl));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Typedef2")));
|
||||
fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "def_free"));
|
||||
|
||||
/* opaque struct */
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Opaque1")));
|
||||
fail_if(eolian_type_free_func_get(type));
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Opaque2")));
|
||||
fail_if(strcmp(eolian_type_free_func_get(type), "opaque_free"));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Opaque1")));
|
||||
fail_if(eolian_typedecl_free_func_get(tdl));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Opaque2")));
|
||||
fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "opaque_free"));
|
||||
|
||||
/* pointer */
|
||||
fail_if(!(type = eolian_type_alias_get_by_name("Pointer1")));
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Pointer1")));
|
||||
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
|
||||
fail_if(eolian_type_free_func_get(type));
|
||||
fail_if(!(type = eolian_type_alias_get_by_name("Pointer2")));
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Pointer2")));
|
||||
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
|
||||
fail_if(strcmp(eolian_type_free_func_get(type), "ptr_free"));
|
||||
|
||||
eolian_shutdown();
|
||||
|
@ -1055,7 +1057,7 @@ END_TEST
|
|||
START_TEST(eolian_import)
|
||||
{
|
||||
const Eolian_Class *class;
|
||||
const Eolian_Type *type;
|
||||
const Eolian_Typedecl *tdl;
|
||||
|
||||
eolian_init();
|
||||
|
||||
|
@ -1064,11 +1066,11 @@ START_TEST(eolian_import)
|
|||
fail_if(!eolian_file_parse(PACKAGE_DATA_DIR"/data/import.eo"));
|
||||
fail_if(!(class = eolian_class_get_by_name("Import")));
|
||||
|
||||
fail_if(!(type = eolian_type_alias_get_by_name("Imported")));
|
||||
fail_if(strcmp(eolian_type_file_get(type), "import_types.eot"));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Imported")));
|
||||
fail_if(strcmp(eolian_typedecl_file_get(tdl), "import_types.eot"));
|
||||
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Imported_Struct")));
|
||||
fail_if(strcmp(eolian_type_file_get(type), "import_types.eot"));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Imported_Struct")));
|
||||
fail_if(strcmp(eolian_typedecl_file_get(tdl), "import_types.eot"));
|
||||
|
||||
eolian_shutdown();
|
||||
}
|
||||
|
@ -1077,7 +1079,7 @@ END_TEST
|
|||
START_TEST(eolian_decl)
|
||||
{
|
||||
const Eolian_Declaration *decl;
|
||||
const Eolian_Type *type;
|
||||
const Eolian_Typedecl *tdl;
|
||||
const Eolian_Class *class;
|
||||
const Eolian_Variable *var;
|
||||
Eina_Iterator *itr;
|
||||
|
@ -1094,23 +1096,23 @@ START_TEST(eolian_decl)
|
|||
fail_if(!eina_iterator_next(itr, (void**)&decl));
|
||||
fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_STRUCT);
|
||||
fail_if(strcmp(eolian_declaration_name_get(decl), "A"));
|
||||
fail_if(!(type = eolian_declaration_data_type_get(decl)));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_STRUCT);
|
||||
fail_if(strcmp(eolian_type_name_get(type), "A"));
|
||||
fail_if(!(tdl = eolian_declaration_data_type_get(decl)));
|
||||
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
|
||||
fail_if(strcmp(eolian_typedecl_name_get(tdl), "A"));
|
||||
|
||||
fail_if(!eina_iterator_next(itr, (void**)&decl));
|
||||
fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_ENUM);
|
||||
fail_if(strcmp(eolian_declaration_name_get(decl), "B"));
|
||||
fail_if(!(type = eolian_declaration_data_type_get(decl)));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_ENUM);
|
||||
fail_if(strcmp(eolian_type_name_get(type), "B"));
|
||||
fail_if(!(tdl = eolian_declaration_data_type_get(decl)));
|
||||
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ENUM);
|
||||
fail_if(strcmp(eolian_typedecl_name_get(tdl), "B"));
|
||||
|
||||
fail_if(!eina_iterator_next(itr, (void**)&decl));
|
||||
fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_ALIAS);
|
||||
fail_if(strcmp(eolian_declaration_name_get(decl), "C"));
|
||||
fail_if(!(type = eolian_declaration_data_type_get(decl)));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_ALIAS);
|
||||
fail_if(strcmp(eolian_type_name_get(type), "C"));
|
||||
fail_if(!(tdl = eolian_declaration_data_type_get(decl)));
|
||||
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ALIAS);
|
||||
fail_if(strcmp(eolian_typedecl_name_get(tdl), "C"));
|
||||
|
||||
fail_if(!eina_iterator_next(itr, (void**)&decl));
|
||||
fail_if(eolian_declaration_type_get(decl) != EOLIAN_DECL_VAR);
|
||||
|
@ -1137,7 +1139,7 @@ END_TEST
|
|||
|
||||
START_TEST(eolian_docs)
|
||||
{
|
||||
const Eolian_Type *type;
|
||||
const Eolian_Typedecl *tdl;
|
||||
const Eolian_Class *class;
|
||||
const Eolian_Event *event;
|
||||
const Eolian_Variable *var;
|
||||
|
@ -1154,8 +1156,8 @@ START_TEST(eolian_docs)
|
|||
|
||||
fail_if(!eolian_file_parse(PACKAGE_DATA_DIR"/data/docs.eo"));
|
||||
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Foo")));
|
||||
fail_if(!(doc = eolian_type_documentation_get(type)));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Foo")));
|
||||
fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
|
||||
fail_if(strcmp(eolian_documentation_summary_get(doc),
|
||||
"This is struct Foo. It does stuff."));
|
||||
fail_if(strcmp(eolian_documentation_description_get(doc),
|
||||
|
@ -1167,45 +1169,45 @@ START_TEST(eolian_docs)
|
|||
fail_if(strcmp(eolian_documentation_since_get(doc),
|
||||
"1.66"));
|
||||
|
||||
fail_if(!(sfl = eolian_type_struct_field_get(type, "field1")));
|
||||
fail_if(!(doc = eolian_type_struct_field_documentation_get(sfl)));
|
||||
fail_if(!(sfl = eolian_typedecl_struct_field_get(tdl, "field1")));
|
||||
fail_if(!(doc = eolian_typedecl_struct_field_documentation_get(sfl)));
|
||||
fail_if(strcmp(eolian_documentation_summary_get(doc),
|
||||
"Field documentation."));
|
||||
fail_if(eolian_documentation_description_get(doc));
|
||||
|
||||
fail_if(!(sfl = eolian_type_struct_field_get(type, "field2")));
|
||||
fail_if(eolian_type_struct_field_documentation_get(sfl));
|
||||
fail_if(!(sfl = eolian_typedecl_struct_field_get(tdl, "field2")));
|
||||
fail_if(eolian_typedecl_struct_field_documentation_get(sfl));
|
||||
|
||||
fail_if(!(sfl = eolian_type_struct_field_get(type, "field3")));
|
||||
fail_if(!(doc = eolian_type_struct_field_documentation_get(sfl)));
|
||||
fail_if(!(sfl = eolian_typedecl_struct_field_get(tdl, "field3")));
|
||||
fail_if(!(doc = eolian_typedecl_struct_field_documentation_get(sfl)));
|
||||
fail_if(strcmp(eolian_documentation_summary_get(doc),
|
||||
"Another field documentation."));
|
||||
fail_if(eolian_documentation_description_get(doc));
|
||||
|
||||
fail_if(!(type = eolian_type_enum_get_by_name("Bar")));
|
||||
fail_if(!(doc = eolian_type_documentation_get(type)));
|
||||
fail_if(!(tdl = eolian_typedecl_enum_get_by_name("Bar")));
|
||||
fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
|
||||
fail_if(strcmp(eolian_documentation_summary_get(doc),
|
||||
"Docs for enum Bar."));
|
||||
fail_if(eolian_documentation_description_get(doc));
|
||||
fail_if(eolian_documentation_since_get(doc));
|
||||
|
||||
fail_if(!(efl = eolian_type_enum_field_get(type, "blah")));
|
||||
fail_if(eolian_type_enum_field_documentation_get(efl));
|
||||
fail_if(!(efl = eolian_typedecl_enum_field_get(tdl, "blah")));
|
||||
fail_if(eolian_typedecl_enum_field_documentation_get(efl));
|
||||
|
||||
fail_if(!(efl = eolian_type_enum_field_get(type, "foo")));
|
||||
fail_if(!(doc = eolian_type_enum_field_documentation_get(efl)));
|
||||
fail_if(!(efl = eolian_typedecl_enum_field_get(tdl, "foo")));
|
||||
fail_if(!(doc = eolian_typedecl_enum_field_documentation_get(efl)));
|
||||
fail_if(strcmp(eolian_documentation_summary_get(doc),
|
||||
"Docs for foo."));
|
||||
fail_if(eolian_documentation_description_get(doc));
|
||||
|
||||
fail_if(!(efl = eolian_type_enum_field_get(type, "bar")));
|
||||
fail_if(!(doc = eolian_type_enum_field_documentation_get(efl)));
|
||||
fail_if(!(efl = eolian_typedecl_enum_field_get(tdl, "bar")));
|
||||
fail_if(!(doc = eolian_typedecl_enum_field_documentation_get(efl)));
|
||||
fail_if(strcmp(eolian_documentation_summary_get(doc),
|
||||
"Docs for bar."));
|
||||
fail_if(eolian_documentation_description_get(doc));
|
||||
|
||||
fail_if(!(type = eolian_type_alias_get_by_name("Alias")));
|
||||
fail_if(!(doc = eolian_type_documentation_get(type)));
|
||||
fail_if(!(tdl = eolian_typedecl_alias_get_by_name("Alias")));
|
||||
fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
|
||||
fail_if(strcmp(eolian_documentation_summary_get(doc),
|
||||
"Docs for typedef."));
|
||||
fail_if(strcmp(eolian_documentation_description_get(doc),
|
||||
|
@ -1219,8 +1221,8 @@ START_TEST(eolian_docs)
|
|||
"Docs for var."));
|
||||
fail_if(eolian_documentation_description_get(doc));
|
||||
|
||||
fail_if(!(type = eolian_type_struct_get_by_name("Opaque")));
|
||||
fail_if(!(doc = eolian_type_documentation_get(type)));
|
||||
fail_if(!(tdl = eolian_typedecl_struct_get_by_name("Opaque")));
|
||||
fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
|
||||
fail_if(strcmp(eolian_documentation_summary_get(doc),
|
||||
"Opaque struct docs. See @Foo for another struct."));
|
||||
fail_if(eolian_documentation_description_get(doc));
|
||||
|
|
Loading…
Reference in New Issue