eolian: move all tests to use the new @move syntax and API
This commit is contained in:
parent
b530670058
commit
0b6e8f71f1
|
@ -328,11 +328,11 @@ eolian_function_return_is_move(const Eolian_Function *fid,
|
|||
case EOLIAN_PROP_GET:
|
||||
if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY))
|
||||
return EINA_FALSE;
|
||||
return !fid->get_return_move;
|
||||
return fid->get_return_move;
|
||||
case EOLIAN_PROP_SET:
|
||||
if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY))
|
||||
return EINA_FALSE;
|
||||
return !fid->set_return_move;
|
||||
return fid->set_return_move;
|
||||
default:
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
|
|
@ -1131,6 +1131,7 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
|
|||
eo_lexer_get(ls);
|
||||
break;
|
||||
case KW_at_owned:
|
||||
case KW_at_move:
|
||||
CASE_LOCK(ls, owned, "owned qualifier");
|
||||
par->type->owned = par->move = EINA_TRUE;
|
||||
eo_lexer_get(ls);
|
||||
|
|
|
@ -2,20 +2,20 @@ class Complex_Type {
|
|||
methods {
|
||||
@property a {
|
||||
set {
|
||||
return: list<array<strbuf @owned> > @owned;
|
||||
return: list<array<strbuf @move> > @move;
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
value: list<string> @owned;
|
||||
value: list<string> @move;
|
||||
}
|
||||
}
|
||||
foo {
|
||||
params {
|
||||
buf: mstring @owned;
|
||||
buf: mstring @move;
|
||||
sl: slice<ubyte>;
|
||||
}
|
||||
return: list<stringshare> @owned; [[comment for method return]]
|
||||
return: list<stringshare> @move; [[comment for method return]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class Enum {
|
|||
params {
|
||||
idx: int;
|
||||
}
|
||||
return: mstring @owned;
|
||||
return: mstring @move;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class Extern {
|
|||
params {
|
||||
idx: int;
|
||||
}
|
||||
return: mstring @owned;
|
||||
return: mstring @move;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class Free_Func {
|
|||
params {
|
||||
idx: int;
|
||||
}
|
||||
return: mstring @owned;
|
||||
return: mstring @move;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ class Function_As_Argument {
|
|||
a: int;
|
||||
b: double;
|
||||
}
|
||||
return: mstring @owned;
|
||||
return: mstring @move;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ function SimpleFunc {
|
|||
function ComplexFunc {
|
||||
params {
|
||||
@in c: string;
|
||||
@out d: mstring @owned;
|
||||
@out d: mstring @move;
|
||||
}
|
||||
return: double;
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ abstract Object_Impl extends Base {
|
|||
part: string;
|
||||
}
|
||||
values {
|
||||
value: list<string> @owned;
|
||||
value: list<string> @move;
|
||||
}
|
||||
}
|
||||
@property b {
|
||||
|
@ -23,7 +23,7 @@ abstract Object_Impl extends Base {
|
|||
/* set as virtual pure - no implementation expected */
|
||||
}
|
||||
values {
|
||||
value: list<string> @owned;
|
||||
value: list<string> @move;
|
||||
}
|
||||
}
|
||||
constructor_1 {
|
||||
|
|
|
@ -9,7 +9,7 @@ class Object_Impl_Add extends Base {
|
|||
/* set as virtual pure - no implementation expected */
|
||||
}
|
||||
values {
|
||||
value: list<string> @owned;
|
||||
value: list<string> @move;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,16 +2,16 @@ class Owning {
|
|||
methods {
|
||||
test1 {
|
||||
params {
|
||||
test1 : list<string> @owned;
|
||||
test2 : iterator<string> @owned;
|
||||
test3 : hash<string, string> @owned;
|
||||
test4 : accessor<string> @owned;
|
||||
test1 : list<string> @move;
|
||||
test2 : iterator<string> @move;
|
||||
test3 : hash<string, string> @move;
|
||||
test4 : accessor<string> @move;
|
||||
}
|
||||
}
|
||||
test2 {
|
||||
params {
|
||||
test1 : list<array<int> @owned> @owned;
|
||||
test2 : hash<string, array<int> @owned> @owned;
|
||||
test1 : list<array<int> @move> @move;
|
||||
test2 : hash<string, array<int> @move> @move;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class Struct {
|
|||
params {
|
||||
idx: int;
|
||||
}
|
||||
return: mstring @owned;
|
||||
return: mstring @move;
|
||||
}
|
||||
bar {
|
||||
return: ptr(Named);
|
||||
|
|
|
@ -23,7 +23,7 @@ class Typedef {
|
|||
params {
|
||||
idx: int;
|
||||
}
|
||||
return: mstring @owned;
|
||||
return: mstring @move;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class Var {
|
|||
params {
|
||||
idx: int;
|
||||
}
|
||||
return: mstring @owned;
|
||||
return: mstring @move;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -357,7 +357,6 @@ EFL_START_TEST(eolian_typedef)
|
|||
eina_stringshare_del(type_name);
|
||||
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
|
||||
fail_if(!(type_name = eolian_type_short_name_get(type)));
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_type_is_const(type));
|
||||
fail_if(eolian_type_base_type_get(type));
|
||||
fail_if(strcmp(type_name, "int"));
|
||||
|
@ -377,14 +376,12 @@ EFL_START_TEST(eolian_typedef)
|
|||
fail_if(strcmp(type_name, "List_Objects"));
|
||||
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(strcmp(type_name, "Eina_List *"));
|
||||
eina_stringshare_del(type_name);
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(!!eolian_type_next_type_get(type));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
|
||||
fail_if(strcmp(type_name, "Typedef *"));
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
eina_stringshare_del(type_name);
|
||||
|
||||
/* List */
|
||||
|
@ -429,21 +426,21 @@ EFL_START_TEST(eolian_complex_type)
|
|||
fail_if(!(fid = eolian_class_function_by_name_get(class, "a", EOLIAN_PROPERTY)));
|
||||
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_PROP_SET)));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
|
||||
fail_if(!eolian_type_is_owned(type));
|
||||
fail_if(!eolian_function_return_is_move(fid, EOLIAN_PROP_SET));
|
||||
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_LIST);
|
||||
fail_if(strcmp(type_name, "Eina_List *"));
|
||||
eina_stringshare_del(type_name);
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(!!eolian_type_next_type_get(type));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_type_is_move(type));
|
||||
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_ARRAY);
|
||||
fail_if(strcmp(type_name, "Eina_Array *"));
|
||||
eina_stringshare_del(type_name);
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(!!eolian_type_next_type_get(type));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
|
||||
fail_if(!eolian_type_is_owned(type));
|
||||
fail_if(!eolian_type_is_move(type));
|
||||
fail_if(strcmp(type_name, "Eina_Strbuf *"));
|
||||
eina_stringshare_del(type_name);
|
||||
/* Properties parameter type */
|
||||
|
@ -454,13 +451,13 @@ EFL_START_TEST(eolian_complex_type)
|
|||
fail_if(strcmp(eolian_parameter_name_get(param), "value"));
|
||||
fail_if(!(type = eolian_parameter_type_get(param)));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
|
||||
fail_if(!eolian_type_is_owned(type));
|
||||
fail_if(!eolian_parameter_is_move(param));
|
||||
fail_if(strcmp(type_name, "Eina_List *"));
|
||||
eina_stringshare_del(type_name);
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(!!eolian_type_next_type_get(type));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_type_is_move(type));
|
||||
fail_if(strcmp(type_name, "const char *"));
|
||||
eina_stringshare_del(type_name);
|
||||
|
||||
|
@ -468,13 +465,13 @@ EFL_START_TEST(eolian_complex_type)
|
|||
fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
|
||||
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_METHOD)));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
|
||||
fail_if(!eolian_type_is_owned(type));
|
||||
fail_if(!eolian_function_return_is_move(fid, EOLIAN_METHOD));
|
||||
fail_if(strcmp(type_name, "Eina_List *"));
|
||||
eina_stringshare_del(type_name);
|
||||
fail_if(!(type = eolian_type_base_type_get(type)));
|
||||
fail_if(!!eolian_type_next_type_get(type));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_type_is_move(type));
|
||||
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_STRINGSHARE);
|
||||
fail_if(strcmp(type_name, "Eina_Stringshare *"));
|
||||
eina_stringshare_del(type_name);
|
||||
|
@ -485,7 +482,7 @@ EFL_START_TEST(eolian_complex_type)
|
|||
fail_if(strcmp(eolian_parameter_name_get(param), "buf"));
|
||||
fail_if(!(type = eolian_parameter_type_get(param)));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
|
||||
fail_if(!eolian_type_is_owned(type));
|
||||
fail_if(!eolian_parameter_is_move(param));
|
||||
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_MSTRING);
|
||||
fail_if(strcmp(type_name, "char *"));
|
||||
eina_stringshare_del(type_name);
|
||||
|
@ -494,7 +491,7 @@ EFL_START_TEST(eolian_complex_type)
|
|||
fail_if(strcmp(eolian_parameter_name_get(param), "sl"));
|
||||
fail_if(!(type = eolian_parameter_type_get(param)));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_parameter_is_move(param));
|
||||
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_SLICE);
|
||||
fail_if(strcmp(type_name, "Eina_Slice"));
|
||||
eina_stringshare_del(type_name);
|
||||
|
@ -1386,7 +1383,7 @@ EFL_START_TEST(eolian_function_types)
|
|||
fail_if(strcmp(eolian_parameter_name_get(param), "c"));
|
||||
fail_if(!(type = eolian_parameter_type_get(param)));
|
||||
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_parameter_is_move(param));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
|
||||
fail_if(strcmp(type_name, "const char *"));
|
||||
|
||||
|
@ -1395,7 +1392,7 @@ EFL_START_TEST(eolian_function_types)
|
|||
fail_if(strcmp(eolian_parameter_name_get(param), "d"));
|
||||
fail_if(eolian_parameter_direction_get(param) != EOLIAN_OUT_PARAM);
|
||||
fail_if(!(type = eolian_parameter_type_get(param)));
|
||||
fail_if(!eolian_type_is_owned(type));
|
||||
fail_if(!eolian_parameter_is_move(param));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
|
||||
fail_if(strcmp(type_name, "char *"));
|
||||
|
||||
|
@ -1416,7 +1413,7 @@ EFL_START_TEST(eolian_function_types)
|
|||
fail_if(strcmp(eolian_parameter_name_get(param), "cb"));
|
||||
fail_if(!(type = eolian_parameter_type_get(param)));
|
||||
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_parameter_is_move(param));
|
||||
fail_if(!(type_name = eolian_type_short_name_get(type)));
|
||||
fail_if(strcmp(type_name, "VoidFunc"));
|
||||
fail_if(!(arg_decl = eolian_type_typedecl_get(type)));
|
||||
|
@ -1426,7 +1423,7 @@ EFL_START_TEST(eolian_function_types)
|
|||
fail_if(strcmp(eolian_parameter_name_get(param), "another_cb"));
|
||||
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
|
||||
fail_if(!(type = eolian_parameter_type_get(param)));
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_parameter_is_move(param));
|
||||
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_REGULAR);
|
||||
fail_if(!(type_name = eolian_type_short_name_get(type)));
|
||||
fail_if(strcmp(type_name, "SimpleFunc"));
|
||||
|
@ -1467,7 +1464,7 @@ EFL_START_TEST(eolian_function_as_arguments)
|
|||
fail_if(strcmp(eolian_parameter_name_get(param), "cb"));
|
||||
fail_if(!(type = eolian_parameter_type_get(param)));
|
||||
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
|
||||
fail_if(eolian_type_is_owned(type));
|
||||
fail_if(eolian_parameter_is_move(param));
|
||||
fail_if(!(type_name = eolian_type_short_name_get(type)));
|
||||
fail_if(strcmp(type_name, "SimpleFunc"));
|
||||
fail_if(!(arg_decl = eolian_type_typedecl_get(type)));
|
||||
|
|
Loading…
Reference in New Issue