efl js: Update Javascript binding to compile with new Eolian API

Reword test method names to check naming convention.
This commit is contained in:
Vitor Sousa 2016-03-14 13:14:37 -03:00
parent bd200cefc4
commit a85348b70b
13 changed files with 528 additions and 435 deletions

View File

@ -38,28 +38,37 @@ inline std::string type_class_name(Eolian_Type const* tp)
if (tp) if (tp)
{ {
Eolian_Type_Type tpt = ::eolian_type_type_get(tp); Eolian_Type_Type tpt = ::eolian_type_type_get(tp);
if (tpt == EOLIAN_TYPE_POINTER || tpt == EOLIAN_TYPE_ALIAS || tpt == EOLIAN_TYPE_REGULAR) if (tpt == EOLIAN_TYPE_POINTER)
{ {
return type_class_name(::eolian_type_base_type_get(tp)); return type_class_name(::eolian_type_base_type_get(tp));
} }
else if(tpt == EOLIAN_TYPE_CLASS) else
{ {
Eolian_Class const* klass = ::eolian_type_class_get(tp); tp = ::eolian_type_aliased_base_get(tp);
if (klass) tpt = ::eolian_type_type_get(tp);
if (tpt == EOLIAN_TYPE_CLASS)
{ {
Eina_Stringshare* klass_name = ::eolian_class_full_name_get(klass); Eolian_Class const* klass = ::eolian_type_class_get(tp);
if (!klass_name) if (klass)
throw std::runtime_error("Could not get Eo class name"); {
Eina_Stringshare* klass_name = ::eolian_class_full_name_get(klass);
if (!klass_name)
throw std::runtime_error("Could not get Eo class name");
return klass_name; return klass_name;
} // TODO: else should throw std::runtime_error("Could not get Eo class"); } // TODO: else should throw std::runtime_error("Could not get Eo class");
} }
else if(tpt == EOLIAN_TYPE_STRUCT) else if (tpt == EOLIAN_TYPE_REGULAR)
{ {
auto struct_type_full_name = ::eolian_type_full_name_get(tp); auto tpd = eolian_type_typedecl_get(tp);
if (!struct_type_full_name) if (tpd && eolian_typedecl_type_get(tpd) == EOLIAN_TYPEDECL_STRUCT)
throw std::runtime_error("Could not get struct name"); {
return struct_type_full_name; auto struct_type_full_name = ::eolian_type_full_name_get(tp);
if (!struct_type_full_name)
throw std::runtime_error("Could not get struct name");
return struct_type_full_name;
}
}
} }
} }
return ""; return "";

View File

@ -152,7 +152,21 @@ std::string format_method(std::string const& in)
std::string format_field(std::string const& in) std::string format_field(std::string const& in)
{ {
return format_method(in); std::string r;
bool up = false;
for (char c : in)
{
if (c == '_')
up = true;
else if (!up)
r += c;
else
{
r += std::toupper(c);
up = false;
}
}
return r;
} }
std::string format_class(std::string const& in) std::string format_class(std::string const& in)

View File

@ -66,13 +66,19 @@ _final_type_and_type_type_get(Eolian_Type const* tp_in, Eolian_Type const*& tp_o
{ {
tp_out = tp_in; tp_out = tp_in;
tpt_out = eolian_type_type_get(tp_in); tpt_out = eolian_type_type_get(tp_in);
while ((tpt_out == EOLIAN_TYPE_REGULAR || tpt_out == EOLIAN_TYPE_ALIAS) && !eolian_type_is_extern(tp_out)) if (tpt_out == EOLIAN_TYPE_REGULAR)
{ {
auto t = eolian_type_base_type_get(tp_out); auto tpd = eolian_type_typedecl_get(tp_out);
// TODO: shouldn't __undefined_type be flagged as external??? if (tpd && eolian_typedecl_type_get(tpd) == EOLIAN_TYPEDECL_ALIAS &&
if (!t || !eolian_type_full_name_get(t) || strcmp(eolian_type_full_name_get(t), "__undefined_type") == 0) break; !eolian_typedecl_is_extern(tpd))
tp_out = t; {
tpt_out = eolian_type_type_get(t); auto btp = eolian_typedecl_aliased_base_get(tpd);
if (btp && eolian_type_full_name_get(btp) &&
strcmp(eolian_type_full_name_get(btp), "__undefined_type") != 0)
{
_final_type_and_type_type_get(btp, tp_out, tpt_out);
}
}
} }
} }
@ -84,7 +90,7 @@ _eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller
Eolian_Type_Type tpt = EOLIAN_TYPE_UNKNOWN_TYPE; Eolian_Type_Type tpt = EOLIAN_TYPE_UNKNOWN_TYPE;
_final_type_and_type_type_get(tp, tp, tpt); _final_type_and_type_type_get(tp, tp, tpt);
if (tpt == EOLIAN_TYPE_UNKNOWN_TYPE) if (tpt == EOLIAN_TYPE_UNKNOWN_TYPE || tpt == EOLIAN_TYPE_UNDEFINED)
return "error"; return "error";
std::string result; std::string result;
@ -92,10 +98,6 @@ _eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller
if ((tpt == EOLIAN_TYPE_VOID if ((tpt == EOLIAN_TYPE_VOID
|| tpt == EOLIAN_TYPE_REGULAR || tpt == EOLIAN_TYPE_REGULAR
|| tpt == EOLIAN_TYPE_COMPLEX || tpt == EOLIAN_TYPE_COMPLEX
|| tpt == EOLIAN_TYPE_STRUCT
|| tpt == EOLIAN_TYPE_STRUCT_OPAQUE
|| tpt == EOLIAN_TYPE_ENUM
|| tpt == EOLIAN_TYPE_ALIAS
|| tpt == EOLIAN_TYPE_CLASS) || tpt == EOLIAN_TYPE_CLASS)
&& is_const) && is_const)
{ {
@ -105,10 +107,6 @@ _eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller
if (tpt == EOLIAN_TYPE_REGULAR if (tpt == EOLIAN_TYPE_REGULAR
|| tpt == EOLIAN_TYPE_COMPLEX || tpt == EOLIAN_TYPE_COMPLEX
|| tpt == EOLIAN_TYPE_STRUCT
|| tpt == EOLIAN_TYPE_STRUCT_OPAQUE
|| tpt == EOLIAN_TYPE_ENUM
|| tpt == EOLIAN_TYPE_ALIAS
|| tpt == EOLIAN_TYPE_CLASS) || tpt == EOLIAN_TYPE_CLASS)
{ {
for (efl::eina::iterator<const char> first(::eolian_type_namespaces_get(tp)), last; first != last; ++first) for (efl::eina::iterator<const char> first(::eolian_type_namespaces_get(tp)), last; first != last; ++first)
@ -164,14 +162,15 @@ _eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller
type_name = it->second; type_name = it->second;
result += type_name; result += type_name;
if (tpt == EOLIAN_TYPE_STRUCT) auto tpd = eolian_type_typedecl_get(tp);
if (tpd && eolian_typedecl_type_get(tpd) == EOLIAN_TYPEDECL_STRUCT)
{ {
result = "efl::eina::js::make_struct_tag<" + result + ">"; result = "efl::eina::js::make_struct_tag<" + result + ">";
} }
} }
else if (tpt == EOLIAN_TYPE_VOID) else if (tpt == EOLIAN_TYPE_VOID)
result += "void"; result += "void";
else // tpt == EOLIAN_TYPE_POINTER else if (tpt == EOLIAN_TYPE_POINTER)
{ {
auto btp = eolian_type_base_type_get(tp); auto btp = eolian_type_base_type_get(tp);
result += _eolian_type_cpp_type_named_get(btp, caller_class_prefix, need_name_getter); result += _eolian_type_cpp_type_named_get(btp, caller_class_prefix, need_name_getter);
@ -180,8 +179,9 @@ _eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller
Eolian_Type_Type btpt = EOLIAN_TYPE_UNKNOWN_TYPE; Eolian_Type_Type btpt = EOLIAN_TYPE_UNKNOWN_TYPE;
_final_type_and_type_type_get(btp, btp, btpt); _final_type_and_type_type_get(btp, btp, btpt);
auto btpd = eolian_type_typedecl_get(btp);
if (btpt == EOLIAN_TYPE_STRUCT) if (btpd && eolian_typedecl_type_get(btpd) == EOLIAN_TYPEDECL_STRUCT)
{ {
std::string f = "::make_struct_tag"; std::string f = "::make_struct_tag";
auto p = result.find(f); auto p = result.find(f);
@ -230,6 +230,10 @@ _eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller
result += ">"; result += ">";
} }
} }
else
{
throw std::runtime_error("unhandled Eolian_Type_Type value");
}
/*if (!name.empty()) /*if (!name.empty())
{ {
@ -303,6 +307,10 @@ void separate_functions(Eolian_Class const* klass, Eolian_Function_Type t, bool
strcmp("constructor", ::eolian_function_name_get(function)) != 0 && // TODO: remove this strcmp("constructor", ::eolian_function_name_get(function)) != 0 && // TODO: remove this
strcmp("render_updates", ::eolian_function_name_get(function)) != 0 && // TODO: remove this strcmp("render_updates", ::eolian_function_name_get(function)) != 0 && // TODO: remove this
strcmp("render2_updates", ::eolian_function_name_get(function)) != 0 && // TODO: remove this strcmp("render2_updates", ::eolian_function_name_get(function)) != 0 && // TODO: remove this
strcmp("efl_canvas_surface_x11_pixmap_set", ::eolian_function_full_c_name_get(function, t, EINA_FALSE)) != 0 && // TODO: remove this
strcmp("efl_canvas_surface_x11_pixmap_get", ::eolian_function_full_c_name_get(function, t, EINA_FALSE)) != 0 && // TODO: remove this
strcmp("efl_canvas_surface_native_buffer_set", ::eolian_function_full_c_name_get(function, t, EINA_FALSE)) != 0 && // TODO: remove this
strcmp("efl_canvas_surface_native_buffer_get", ::eolian_function_full_c_name_get(function, t, EINA_FALSE)) != 0 && // TODO: remove this
strcmp("event_callback_priority_add", ::eolian_function_name_get(function)) != 0 && // TODO: remove this strcmp("event_callback_priority_add", ::eolian_function_name_get(function)) != 0 && // TODO: remove this
strcmp("event_callback_array_priority_add", ::eolian_function_name_get(function)) != 0 && // TODO: remove this strcmp("event_callback_array_priority_add", ::eolian_function_name_get(function)) != 0 && // TODO: remove this
strcmp("event_callback_array_del", ::eolian_function_name_get(function)) != 0 && // TODO: remove this strcmp("event_callback_array_del", ::eolian_function_name_get(function)) != 0 && // TODO: remove this
@ -591,16 +599,16 @@ int main(int argc, char** argv)
// generate all structs parsed in this file // generate all structs parsed in this file
std::stringstream structs_ss; std::stringstream structs_ss;
for (efl::eina::iterator<Eolian_Type> first(::eolian_type_structs_get_by_file(file_basename.c_str())) for (efl::eina::iterator<Eolian_Typedecl> first(::eolian_typedecl_structs_get_by_file(file_basename.c_str()))
, last; first != last; ++first) , last; first != last; ++first)
{ {
std::stringstream ss; std::stringstream ss;
auto tp = &*first; auto tpd = &*first;
if (::eolian_type_type_get(tp) == EOLIAN_TYPE_STRUCT_OPAQUE) if (!tpd || ::eolian_typedecl_type_get(tpd) == EOLIAN_TYPEDECL_STRUCT_OPAQUE)
continue; continue;
auto struct_name = ::eolian_type_name_get(tp); auto struct_name = ::eolian_typedecl_name_get(tpd);
auto struct_type_full_name = ::eolian_type_full_name_get(tp); auto struct_type_full_name = ::eolian_typedecl_full_name_get(tpd);
if (!struct_name || !struct_type_full_name) if (!struct_name || !struct_type_full_name)
{ {
EINA_CXX_DOM_LOG_ERR(eolian::js::domain) << "Could not get struct type name"; EINA_CXX_DOM_LOG_ERR(eolian::js::domain) << "Could not get struct type name";
@ -613,11 +621,11 @@ int main(int argc, char** argv)
ss << " {\n"; ss << " {\n";
ss << " auto fields_func = [](v8::Isolate* isolate_, v8::Local<v8::ObjectTemplate> prototype_)\n"; ss << " auto fields_func = [](v8::Isolate* isolate_, v8::Local<v8::ObjectTemplate> prototype_)\n";
ss << " {\n"; ss << " {\n";
for (efl::eina::iterator<Eolian_Struct_Type_Field> sf(::eolian_type_struct_fields_get(tp)) for (efl::eina::iterator<Eolian_Struct_Type_Field> sf(::eolian_typedecl_struct_fields_get(tpd))
, sf_end; sf != sf_end; ++sf) , sf_end; sf != sf_end; ++sf)
{ {
auto field_type = ::eolian_type_struct_field_type_get(&*sf); auto field_type = ::eolian_typedecl_struct_field_type_get(&*sf);
auto field_name = ::eolian_type_struct_field_name_get(&*sf); auto field_name = ::eolian_typedecl_struct_field_name_get(&*sf);
if (!field_name) if (!field_name)
{ {
EINA_CXX_DOM_LOG_ERR(eolian::js::domain) << "Could not get struct field name"; EINA_CXX_DOM_LOG_ERR(eolian::js::domain) << "Could not get struct field name";
@ -654,7 +662,7 @@ int main(int argc, char** argv)
ss << " };\n"; ss << " };\n";
ss << " auto to_export = ::efl::eo::js::get_namespace({"; ss << " auto to_export = ::efl::eo::js::get_namespace({";
bool comma = false; bool comma = false;
for (efl::eina::iterator<const char> ns_it(::eolian_type_namespaces_get(tp)), ns_end; ns_it != ns_end; ++ns_it) for (efl::eina::iterator<const char> ns_it(::eolian_typedecl_namespaces_get(tpd)), ns_end; ns_it != ns_end; ++ns_it)
{ {
if (comma) if (comma)
ss << ", "; ss << ", ";
@ -1042,17 +1050,17 @@ int main(int argc, char** argv)
os << structs_ss.str(); os << structs_ss.str();
// generate enumerations // generate enumerations
for (efl::eina::iterator<Eolian_Type> first(::eolian_type_enums_get_by_file(file_basename.c_str())) for (efl::eina::iterator<Eolian_Typedecl> first(::eolian_typedecl_enums_get_by_file(file_basename.c_str()))
, last; first != last; ++first) , last; first != last; ++first)
{ {
auto tp = &*first; auto tpd = &*first;
if (::eolian_type_is_extern(tp)) if (::eolian_typedecl_is_extern(tpd))
continue; continue;
std::string enum_name = ::eolian_type_name_get(tp); std::string enum_name = ::eolian_typedecl_name_get(tpd);
os << " {\n"; os << " {\n";
os << " auto to_export = ::efl::eo::js::get_namespace({"; os << " auto to_export = ::efl::eo::js::get_namespace({";
bool comma = false; bool comma = false;
for (efl::eina::iterator<const char> ns_it(::eolian_type_namespaces_get(tp)), ns_end; ns_it != ns_end; ++ns_it) for (efl::eina::iterator<const char> ns_it(::eolian_typedecl_namespaces_get(tpd)), ns_end; ns_it != ns_end; ++ns_it)
{ {
if (comma) if (comma)
os << ", "; os << ", ";
@ -1063,11 +1071,11 @@ int main(int argc, char** argv)
os << " v8::Handle<v8::Object> enum_obj = efl::eina::js::compatibility_new<v8::Object>(isolate);\n"; os << " v8::Handle<v8::Object> enum_obj = efl::eina::js::compatibility_new<v8::Object>(isolate);\n";
os << " to_export->Set(efl::eina::js::compatibility_new<v8::String>(isolate, \"" os << " to_export->Set(efl::eina::js::compatibility_new<v8::String>(isolate, \""
<< format::format_enum(enum_name) << "\"), enum_obj);\n"; << format::format_enum(enum_name) << "\"), enum_obj);\n";
for (efl::eina::iterator<Eolian_Enum_Type_Field> ef(::eolian_type_enum_fields_get(tp)) for (efl::eina::iterator<Eolian_Enum_Type_Field> ef(::eolian_typedecl_enum_fields_get(tpd))
, ef_end; ef != ef_end; ++ef) , ef_end; ef != ef_end; ++ef)
{ {
auto field_name = ::eolian_type_enum_field_name_get(&*ef); auto field_name = ::eolian_typedecl_enum_field_name_get(&*ef);
auto field_c_name = ::eolian_type_enum_field_c_name_get(&*ef); auto field_c_name = ::eolian_typedecl_enum_field_c_name_get(&*ef);
if (!field_name || !field_c_name) if (!field_name || !field_c_name)
{ {
EINA_CXX_DOM_LOG_ERR(eolian::js::domain) << "Could not get enum field name"; EINA_CXX_DOM_LOG_ERR(eolian::js::domain) << "Could not get enum field name";

View File

@ -51,15 +51,13 @@ EAPI void register_job(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_parent(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_parent(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_poller(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_poller(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_timer(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_timer(v8::Handle<v8::Object> global, v8::Isolate* isolate);
namespace con {
EAPI void register_base(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_client(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_server(v8::Handle<v8::Object> global, v8::Isolate* isolate);
}
} }
namespace efl { namespace network { namespace efl { namespace network {
EAPI void register_base(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_server(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_connector(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_connector(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_client(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_url(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_url(v8::Handle<v8::Object> global, v8::Isolate* isolate);
}} }}
@ -97,7 +95,6 @@ EAPI void register_line(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_object(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_object(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_object_smart(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_object_smart(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_out(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_out(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_polygon(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_rectangle(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_rectangle(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_scrollable_interface(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_scrollable_interface(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_selectable_interface(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_selectable_interface(v8::Handle<v8::Object> global, v8::Isolate* isolate);
@ -120,6 +117,10 @@ EAPI void register_scene(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_texture(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_texture(v8::Handle<v8::Object> global, v8::Isolate* isolate);
} } } }
namespace efl { namespace canvas {
EAPI void register_polygon(v8::Handle<v8::Object> global, v8::Isolate* isolate);
}}
namespace edje { namespace edje {
EAPI void register_edit(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_edit(v8::Handle<v8::Object> global, v8::Isolate* isolate);
EAPI void register_object(v8::Handle<v8::Object> global, v8::Isolate* isolate); EAPI void register_object(v8::Handle<v8::Object> global, v8::Isolate* isolate);
@ -165,10 +166,10 @@ EAPI void init(v8::Handle<v8::Object> exports)
ecore::register_parent(exports, v8::Isolate::GetCurrent()); ecore::register_parent(exports, v8::Isolate::GetCurrent());
ecore::register_poller(exports, v8::Isolate::GetCurrent()); ecore::register_poller(exports, v8::Isolate::GetCurrent());
ecore::register_timer(exports, v8::Isolate::GetCurrent()); ecore::register_timer(exports, v8::Isolate::GetCurrent());
ecore::con::register_base(exports, v8::Isolate::GetCurrent()); efl::network::register_base(exports, v8::Isolate::GetCurrent());
ecore::con::register_client(exports, v8::Isolate::GetCurrent()); efl::network::register_client(exports, v8::Isolate::GetCurrent());
efl::network::register_connector(exports, v8::Isolate::GetCurrent()); efl::network::register_connector(exports, v8::Isolate::GetCurrent());
ecore::con::register_server(exports, v8::Isolate::GetCurrent()); efl::network::register_server(exports, v8::Isolate::GetCurrent());
efl::network::register_url(exports, v8::Isolate::GetCurrent()); efl::network::register_url(exports, v8::Isolate::GetCurrent());
#if 1 #if 1
register_ecore_audio(exports, v8::Isolate::GetCurrent()); register_ecore_audio(exports, v8::Isolate::GetCurrent());
@ -199,7 +200,6 @@ EAPI void init(v8::Handle<v8::Object> exports)
evas::register_object(exports, v8::Isolate::GetCurrent()); evas::register_object(exports, v8::Isolate::GetCurrent());
evas::register_object_smart(exports, v8::Isolate::GetCurrent()); evas::register_object_smart(exports, v8::Isolate::GetCurrent());
evas::register_out(exports, v8::Isolate::GetCurrent()); evas::register_out(exports, v8::Isolate::GetCurrent());
evas::register_polygon(exports, v8::Isolate::GetCurrent());
evas::register_rectangle(exports, v8::Isolate::GetCurrent()); evas::register_rectangle(exports, v8::Isolate::GetCurrent());
evas::register_scrollable_interface(exports, v8::Isolate::GetCurrent()); evas::register_scrollable_interface(exports, v8::Isolate::GetCurrent());
evas::register_selectable_interface(exports, v8::Isolate::GetCurrent()); evas::register_selectable_interface(exports, v8::Isolate::GetCurrent());
@ -218,6 +218,7 @@ EAPI void init(v8::Handle<v8::Object> exports)
evas::canvas3d::register_object(exports, v8::Isolate::GetCurrent()); evas::canvas3d::register_object(exports, v8::Isolate::GetCurrent());
evas::canvas3d::register_scene(exports, v8::Isolate::GetCurrent()); evas::canvas3d::register_scene(exports, v8::Isolate::GetCurrent());
evas::canvas3d::register_texture(exports, v8::Isolate::GetCurrent()); evas::canvas3d::register_texture(exports, v8::Isolate::GetCurrent());
efl::canvas::register_polygon(exports, v8::Isolate::GetCurrent());
#endif #endif
#if 1 #if 1
edje::register_edit(exports, v8::Isolate::GetCurrent()); edje::register_edit(exports, v8::Isolate::GetCurrent());

View File

@ -829,12 +829,11 @@ struct _v8_get_current_context<T, true> : T
} }
}; };
template <typename T>
inline v8::Local<v8::Value> inline v8::Local<v8::Value>
new_v8_external_instance(v8::Handle<v8::Function>& ctor, T v, v8::Isolate* isolate) new_v8_external_instance(v8::Handle<v8::Function>& ctor, void const* v, v8::Isolate* isolate)
{ {
// TODO: ensure v8::External ownership ??? (memory leak in case NewInstance throws) // TODO: ensure v8::External ownership ??? (memory leak in case NewInstance throws)
v8::Handle<v8::Value> a[] = {efl::eina::js::compatibility_new<v8::External>(isolate, v)}; v8::Handle<v8::Value> a[] = {efl::eina::js::compatibility_new<v8::External>(isolate, const_cast<void*>(v))};
return ctor->NewInstance(1, a); return ctor->NewInstance(1, a);
} }
@ -842,10 +841,10 @@ inline
compatibility_return_type cast_function(compatibility_callback_info_type args); compatibility_return_type cast_function(compatibility_callback_info_type args);
inline v8::Local<v8::Value> inline v8::Local<v8::Value>
new_v8_external_instance(v8::Handle<v8::Function>& ctor, Eo* v, v8::Isolate* isolate) new_v8_external_instance(v8::Handle<v8::Function>& ctor, Eo const* v, v8::Isolate* isolate)
{ {
// TODO: ensure v8::External ownership ??? (memory leak in case NewInstance throws) // TODO: ensure v8::External ownership ??? (memory leak in case NewInstance throws)
v8::Handle<v8::Value> a[] = {efl::eina::js::compatibility_new<v8::External>(isolate, v)}; v8::Handle<v8::Value> a[] = {efl::eina::js::compatibility_new<v8::External>(isolate, const_cast<Eo*>(v))};
auto obj = ctor->NewInstance(1, a); auto obj = ctor->NewInstance(1, a);
obj->Set(compatibility_new<v8::String>(isolate, "cast"), obj->Set(compatibility_new<v8::String>(isolate, "cast"),
compatibility_new<v8::FunctionTemplate>(isolate, &cast_function)->GetFunction()); compatibility_new<v8::FunctionTemplate>(isolate, &cast_function)->GetFunction());

View File

@ -221,17 +221,17 @@ get_value_from_c(efl::eina::js::complex_tag<const Eina_Iterator *, T, K>, v8::Is
std::abort(); std::abort();
} }
template <typename T, typename U, typename K> template <typename T, typename KT, typename U, typename KU>
inline v8::Local<v8::Value> inline v8::Local<v8::Value>
get_value_from_c(efl::eina::js::complex_tag<Eina_Hash *, T, U, K>, v8::Isolate*, const char*) get_value_from_c(efl::eina::js::complex_tag<Eina_Hash *, T, KT, U, KU>, v8::Isolate*, const char*)
{ {
std::cerr << "get_value_from_c for Eina_Hash not implemented. Aborting..." << std::endl; std::cerr << "get_value_from_c for Eina_Hash not implemented. Aborting..." << std::endl;
std::abort(); std::abort();
} }
template <typename T, typename U, typename K> template <typename T, typename KT, typename U, typename KU>
inline v8::Local<v8::Value> inline v8::Local<v8::Value>
get_value_from_c(efl::eina::js::complex_tag<const Eina_Hash *, T, U, K>, v8::Isolate*, const char*) get_value_from_c(efl::eina::js::complex_tag<const Eina_Hash *, T, KT, U, KU>, v8::Isolate*, const char*)
{ {
std::cerr << "get_value_from_c for Eina_Hash not implemented. Aborting..." << std::endl; std::cerr << "get_value_from_c for Eina_Hash not implemented. Aborting..." << std::endl;
std::abort(); std::abort();

View File

@ -38,7 +38,7 @@ struct arg_index<In, 0> : std::integral_constant<std::size_t, 0>
template <typename In, typename Out, typename Ownership, typename F, typename Return, typename Parameters> template <typename In, typename Out, typename Ownership, typename F, typename Return, typename Parameters>
struct method_caller struct method_caller
{ {
typedef typename eina::_mpl::function_params<F>::type parameters_t; typedef typename eo::js::eo_function_params<F>::type parameters_t;
template <std::size_t I> template <std::size_t I>
struct is_out : eina::_mpl::tuple_contains<std::integral_constant<std::size_t, I>, Out> struct is_out : eina::_mpl::tuple_contains<std::integral_constant<std::size_t, I>, Out>
@ -190,7 +190,7 @@ struct method_caller
template <typename OutParameters, std::size_t... I> template <typename OutParameters, std::size_t... I>
eina::js::compatibility_return_type eina::js::compatibility_return_type
aux(eina::js::compatibility_callback_info_type args, eina::index_sequence<I...> aux(Eo* eo, eina::js::compatibility_callback_info_type args, eina::index_sequence<I...>
, std::true_type) const , std::true_type) const
{ {
typename eina::_mpl::tuple_transform<Out, out_transform<parameters_t> >::type outs {}; typename eina::_mpl::tuple_transform<Out, out_transform<parameters_t> >::type outs {};
@ -200,13 +200,13 @@ struct method_caller
{(init_inout<I>(args, outs, args.GetIsolate(), class_names[I], typename is_inout<I>::type()), 0)...}; {(init_inout<I>(args, outs, args.GetIsolate(), class_names[I], typename is_inout<I>::type()), 0)...};
static_cast<void>(l); static_cast<void>(l);
function(get_value<I>(args, outs, args.GetIsolate(), class_names[I], typename is_out<I>::type())...); function(eo, get_value<I>(args, outs, args.GetIsolate(), class_names[I], typename is_out<I>::type())...);
return create_return_value<OutParameters>(args, outs); return create_return_value<OutParameters>(args, outs);
} }
template <typename OutParameters, std::size_t... I> template <typename OutParameters, std::size_t... I>
eina::js::compatibility_return_type eina::js::compatibility_return_type
aux(eina::js::compatibility_callback_info_type args, eina::index_sequence<I...> aux(Eo* eo, eina::js::compatibility_callback_info_type args, eina::index_sequence<I...>
, std::false_type) const , std::false_type) const
{ {
typename eina::_mpl::tuple_transform<Out, out_transform<parameters_t> >::type outs {}; typename eina::_mpl::tuple_transform<Out, out_transform<parameters_t> >::type outs {};
@ -217,7 +217,7 @@ struct method_caller
static_cast<void>(l); static_cast<void>(l);
typename eina::_mpl::function_return<F>::type r = typename eina::_mpl::function_return<F>::type r =
function(get_value<I>(args, outs, args.GetIsolate(), class_names[I], typename is_out<I>::type())...); function(eo, get_value<I>(args, outs, args.GetIsolate(), class_names[I], typename is_out<I>::type())...);
return create_return_value<OutParameters>(args, r, outs); return create_return_value<OutParameters>(args, r, outs);
} }
@ -243,13 +243,9 @@ struct method_caller
Eo* eo = static_cast<Eo*>(v8::External::Cast(*external)->Value()); Eo* eo = static_cast<Eo*>(v8::External::Cast(*external)->Value());
try try
{ {
eo_do aux<OutParameters>(eo, args,
(eo, eina::make_index_sequence<std::tuple_size<parameters_t>::value>(),
aux<OutParameters>( std::is_same<void, Return>());
args,
eina::make_index_sequence<std::tuple_size<parameters_t>::value>(),
std::is_same<void, Return>())
);
} }
catch(std::logic_error const&) catch(std::logic_error const&)
{ {

View File

@ -15,6 +15,21 @@
namespace efl { namespace eo { namespace js { namespace efl { namespace eo { namespace js {
template <typename T>
struct eo_function_params;
template <typename R, typename... P>
struct eo_function_params<R(*)(Eo*, P...)>
{
typedef std::tuple<P...> type;
};
template <typename R, typename... P>
struct eo_function_params<R(*)(Eo const*, P...)>
{
typedef std::tuple<P...> type;
};
inline eina::js::compatibility_return_type constructor(eina::js::compatibility_callback_info_type args) inline eina::js::compatibility_return_type constructor(eina::js::compatibility_callback_info_type args)
{ {
if(args.IsConstructCall()) if(args.IsConstructCall())
@ -45,7 +60,7 @@ struct constructor_caller
void operator()(T function) const void operator()(T function) const
{ {
int const parameters int const parameters
= std::tuple_size<typename eina::_mpl::function_params<T>::type>::value; = std::tuple_size<typename eo::js::eo_function_params<T>::type>::value;
if(*current + parameters <= args->Length()) if(*current + parameters <= args->Length())
{ {
aux(function, eina::make_index_sequence<parameters>()); aux(function, eina::make_index_sequence<parameters>());
@ -62,24 +77,25 @@ struct constructor_caller
template <typename U, std::size_t I> template <typename U, std::size_t I>
static static
typename std::tuple_element<I, typename eina::_mpl::function_params<U>::type>::type typename std::tuple_element<I, typename eo::js::eo_function_params<U>::type>::type
get_value(v8::Local<v8::Value> v, v8::Isolate* isolate) get_value(v8::Local<v8::Value> v, v8::Isolate* isolate)
{ {
typename std::tuple_element<I, typename eina::_mpl::function_params<U>::type>::type typename std::tuple_element<I, typename eo::js::eo_function_params<U>::type>::type
tmp = tmp =
eina::js::get_value_from_javascript eina::js::get_value_from_javascript
(v, isolate, "" (v, isolate, ""
, eina::js::value_tag<typename std::tuple_element , eina::js::value_tag<typename std::tuple_element
<I, typename eina::_mpl::function_params<U>::type>::type>()); <I, typename eo::js::eo_function_params<U>::type>::type>());
return tmp; return tmp;
} }
template <typename T, std::size_t... I> template <typename T, std::size_t... I>
void aux(T function, eina::index_sequence<I...>) const void aux(T function, eina::index_sequence<I...>) const
{ {
function(get_value<T, I>((*args)[I + *current], args->GetIsolate())...); function(obj_eo_self, get_value<T, I>((*args)[I + *current], args->GetIsolate())...);
} }
Eo* obj_eo_self;
int* current; int* current;
eina::js::compatibility_callback_info_pointer args; eina::js::compatibility_callback_info_pointer args;
}; };
@ -96,7 +112,7 @@ struct constructor_caller
Eo* eo = eo_add Eo* eo = eo_add
(klass (klass
, parent , parent
, eina::_mpl::for_each(constructors, call{&current_index, &args}) , eina::_mpl::for_each(constructors, call{eo_self, &current_index, &args})
); );
assert(eo != 0); assert(eo != 0);
v8::Local<v8::Object> self = args.This(); v8::Local<v8::Object> self = args.This();

View File

@ -54,18 +54,17 @@ inline v8::Local<v8::Value> get_event_info<void>(void*, v8::Isolate* isolate, co
} }
template <typename T> template <typename T>
inline Eina_Bool event_callback(void* data, Eo* obj, Eo_Event_Description const* inline Eina_Bool event_callback(void* data, Eo_Event const* eo_event)
, void* event_info)
{ {
v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
event_callback_information* event = static_cast<event_callback_information*>(data); event_callback_information* event = static_cast<event_callback_information*>(data);
v8::Handle<v8::Value> a[] = {eina::js::compatibility_new<v8::External>(isolate, obj)}; v8::Handle<v8::Value> a[] = {eina::js::compatibility_new<v8::External>(isolate, eo_event->obj)};
v8::Local<v8::Object> self = (event->event_info->constructor->handle())->NewInstance(1, a); v8::Local<v8::Object> self = (event->event_info->constructor->handle())->NewInstance(1, a);
v8::Local<v8::Value> call_args[] = { v8::Local<v8::Value> call_args[] = {
self, self,
get_event_info<T>(event_info, isolate, event->event_info->class_name) get_event_info<T>(eo_event->event_info, isolate, event->event_info->class_name)
}; };
event->function.handle()->Call(eina::js::compatibility_global(), 2, call_args); event->function.handle()->Call(eina::js::compatibility_global(), 2, call_args);
@ -100,8 +99,7 @@ inline eina::js::compatibility_return_type on_event(eina::js::compatibility_call
event_callback_information* i = new event_callback_information event_callback_information* i = new event_callback_information
{event, {isolate, eina::js::compatibility_cast<v8::Function>(f)}}; {event, {isolate, eina::js::compatibility_cast<v8::Function>(f)}};
eo_do(eo, eo_event_callback_priority_add eo_event_callback_add(eo, event->event, event->event_callback, i);
(event->event, EO_CALLBACK_PRIORITY_DEFAULT, event->event_callback, i));
} }
else else
{ {

View File

@ -42,9 +42,9 @@ using efl::eina::js::compatibility_return;
using efl::eina::js::compatibility_new; using efl::eina::js::compatibility_new;
#define JS_BENCHMARK_ARGS0(v) #define JS_BENCHMARK_ARGS0(v)
#define JS_BENCHMARK_ARGS1(v) v #define JS_BENCHMARK_ARGS1(v) ,v
#define JS_BENCHMARK_ARGS2(v) v,v #define JS_BENCHMARK_ARGS2(v) ,v,v
#define JS_BENCHMARK_ARGS10(v) v,v,v,v,v,v,v,v,v,v #define JS_BENCHMARK_ARGS10(v) ,v,v,v,v,v,v,v,v,v,v
#define JS_BENCHMARK_FUNC(name, number, v) \ #define JS_BENCHMARK_FUNC(name, number, v) \
compatibility_return_type js_benchmark_object_##name##arg(compatibility_callback_info_type) \ compatibility_return_type js_benchmark_object_##name##arg(compatibility_callback_info_type) \
{ \ { \
@ -55,13 +55,13 @@ using efl::eina::js::compatibility_new;
/* Warm */ \ /* Warm */ \
for(int i = 0; i != 10; i++) \ for(int i = 0; i != 10; i++) \
{ \ { \
eo_do(object, benchmark_object_##name##arg(JS_BENCHMARK_ARGS##number(v))); \ benchmark_object_##name##arg(object JS_BENCHMARK_ARGS##number(v)); \
} \ } \
/* Real loop */ \ /* Real loop */ \
eina_counter_start(counter); \ eina_counter_start(counter); \
for(int i = 0; i != 20000; i++) \ for(int i = 0; i != 20000; i++) \
{ \ { \
eo_do(object, benchmark_object_##name##arg(JS_BENCHMARK_ARGS##number(v))); \ benchmark_object_##name##arg(object JS_BENCHMARK_ARGS##number(v)); \
} \ } \
eina_counter_stop(counter, 20000); \ eina_counter_stop(counter, 20000); \
fprintf(stderr, "%s", eina_counter_dump(counter)); \ fprintf(stderr, "%s", eina_counter_dump(counter)); \

View File

@ -31,7 +31,7 @@ if(typeof process !== 'undefined')
} }
else else
{ {
assert = function(test, message) { if (test !== true) throw message; }; assert = function(test, message) { if (!test) throw message; };
print('running from libv8') print('running from libv8')
//FIXME Add levels to v8 tests //FIXME Add levels to v8 tests
printError = print printError = print
@ -99,9 +99,9 @@ startTest("integral_in_and_out_parameters", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var expectedValue = 1234; var expectedValue = 1234;
obj.methodIntegralInA(expectedValue); obj.checkMethodIntegralInA(expectedValue);
var actualValue = obj.methodIntegralOutA(); var actualValue = obj.checkMethodIntegralOutA();
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
}); });
@ -109,11 +109,11 @@ startTest("integral_inout_parameter", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var expectedValue = 1234; var expectedValue = 1234;
var actualValue = obj.methodIntegralInout(-expectedValue); var actualValue = obj.checkMethodIntegralInout(-expectedValue);
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
var expectedValue = -4321; var expectedValue = -4321;
var actualValue = obj.methodIntegralInout(-expectedValue); var actualValue = obj.checkMethodIntegralInout(-expectedValue);
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
}); });
@ -121,38 +121,38 @@ startTest("integral_return_value", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var expectedValue = 1234; var expectedValue = 1234;
obj.methodIntegralInA(expectedValue); obj.checkMethodIntegralInA(expectedValue);
var actualValue = obj.methodIntegralReturnA(); var actualValue = obj.checkMethodIntegralReturnA();
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
}); });
startTest("more_parameters_than_expected_is_ok", function() { startTest("more_parameters_than_expected_is_ok", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var expectedValue = 1234; var expectedValue = 1234;
obj.methodIntegralInA(expectedValue, 4321); obj.checkMethodIntegralInA(expectedValue, 4321);
var actualValue = obj.methodIntegralOutA(); var actualValue = obj.checkMethodIntegralOutA();
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
}); });
startTest("less_parameters_that_expected_fails", function() { startTest("less_parameters_that_expected_fails", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
expectException(function() { expectException(function() {
obj.methodIntegralInA(); obj.checkMethodIntegralInA();
}); });
}); });
startTest("wrong_parameter_type_fails", function() { startTest("wrong_parameter_type_fails", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
expectException(function() { expectException(function() {
obj.methodIntegralInA('string'); obj.checkMethodIntegralInA('string');
}); });
}); });
startTest("mixed_in_out_and_result", function() { startTest("mixed_in_out_and_result", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodDivMod(7, 3); var ret = obj.checkMethodDivMod(7, 3);
var success = ret[0]; var success = ret[0];
var quotient = ret[1]; var quotient = ret[1];
var remainder = ret[2]; var remainder = ret[2];
@ -160,46 +160,46 @@ startTest("mixed_in_out_and_result", function() {
assert(2 == quotient); assert(2 == quotient);
assert(1 == remainder); assert(1 == remainder);
ret = obj.methodDivMod(42, 0); ret = obj.checkMethodDivMod(42, 0);
success = ret[0]; success = ret[0];
assert(!success); assert(!success);
}); });
startTest("boolean", function() { startTest("boolean", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodAnd(false, false); var ret = obj.checkMethodAnd(false, false);
assert(ret == false); assert(ret == false);
ret = obj.methodAnd(false, true); ret = obj.checkMethodAnd(false, true);
assert(ret == false); assert(ret == false);
ret = obj.methodAnd(true, false); ret = obj.checkMethodAnd(true, false);
assert(ret == false); assert(ret == false);
ret = obj.methodAnd(true, true); ret = obj.checkMethodAnd(true, true);
assert(ret); assert(ret);
}); });
startTest("floating_point", function() { startTest("floating_point", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodModf(3.14159); var ret = obj.checkMethodModf(3.14159);
assert(Math.abs(ret[0] - 0.14159) < 0.00001, "Math.abs(ret[0] - 0.14159) < 0.00001 (" + Math.abs(ret[0] - 0.14159) + " < 0.00001)"); assert(Math.abs(ret[0] - 0.14159) < 0.00001, "Math.abs(ret[0] - 0.14159) < 0.00001 (" + Math.abs(ret[0] - 0.14159) + " < 0.00001)");
assert(ret[1] == 3, "ret[1] == 3 (" + ret[1] + " == 3)"); assert(ret[1] == 3, "ret[1] == 3 (" + ret[1] + " == 3)");
}); });
startTest("string_inout", function() { startTest("string_inout", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodUppercase('hello world'); var ret = obj.checkMethodUppercase('hello world');
assert(ret == "HELLO WORLD", "ret == " + ret); assert(ret == "HELLO WORLD", "ret == " + ret);
}); });
startTest("in_null_string", function() { startTest("in_null_string", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var success = obj.methodInNull(null); var success = obj.checkMethodInNull(null);
assert(success, "success == " + success); assert(success, "success == " + success);
}); });
startTest("out_null_string", function() { startTest("out_null_string", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodOutNull(); var ret = obj.checkMethodOutNull();
assert(ret[0], "success == " + ret[0]); assert(ret[0], "success == " + ret[0]);
assert(ret[1] === null, "output == " + ret[1]); assert(ret[1] === null, "output == " + ret[1]);
}); });
@ -207,7 +207,7 @@ startTest("out_null_string", function() {
startTest("inout_null_string", function() { startTest("inout_null_string", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodInoutNull(null); var ret = obj.checkMethodInoutNull(null);
assert(ret[0], "success == " + ret[0]); assert(ret[0], "success == " + ret[0]);
assert(ret[1] === null, "output == " + ret[1]); assert(ret[1] === null, "output == " + ret[1]);
}); });
@ -215,14 +215,14 @@ startTest("inout_null_string", function() {
startTest("return_null_string", function() { startTest("return_null_string", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodReturnNull(); var ret = obj.checkMethodReturnNull();
assert(ret === null, "ret == " + ret); assert(ret === null, "ret == " + ret);
}); });
startTest("null_values", function() { startTest("null_values", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodNull(null, null); var ret = obj.checkMethodNull(null, null);
assert(ret[0] === null, "ret == " + ret[0]); assert(ret[0] === null, "ret == " + ret[0]);
assert(ret[1] === null, "ret == " + ret[1]); assert(ret[1] === null, "ret == " + ret[1]);
assert(ret[2] === null, "ret == " + ret[2]); assert(ret[2] === null, "ret == " + ret[2]);
@ -230,11 +230,11 @@ startTest("null_values", function() {
startTest("enum_values", function() { startTest("enum_values", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.methodInEnumReturnEnum(suite.Test.EnumEx.SECOND); var ret = obj.checkMethodInEnumReturnEnum(suite.Test.EnumEx.SECOND);
assert(ret === suite.Test.EnumEx.SECOND); assert(ret === suite.Test.EnumEx.SECOND);
var value = suite.Test.EnumEx.THIRD; var value = suite.Test.EnumEx.THIRD;
assert(value === 2); assert(value === 2);
ret = obj.methodInEnumReturnEnum(value); ret = obj.checkMethodInEnumReturnEnum(value);
assert(ret === value); assert(ret === value);
}); });
@ -247,7 +247,7 @@ startTest("struct_values", function() {
assert(ret === 42); assert(ret === 42);
ret = newStruct.valueEnum; ret = newStruct.valueEnum;
assert(ret === suite.Test.EnumEx.FOURTH); assert(ret === suite.Test.EnumEx.FOURTH);
ret = obj.methodInStructReturnStruct(newStruct); ret = obj.checkMethodInStructReturnStruct(newStruct);
assert(ret.valueInt === 42); assert(ret.valueInt === 42);
assert(ret.valueEnum === suite.Test.EnumEx.FOURTH); assert(ret.valueEnum === suite.Test.EnumEx.FOURTH);
}); });
@ -264,7 +264,7 @@ startTest("event_simple", function() {
} }
); );
printInfo('going to call event'); printInfo('going to call event');
obj.callEvent(); obj.emitEvent();
printInfo('is event called?'); printInfo('is event called?');
assert(v); assert(v);
}); });
@ -280,14 +280,14 @@ startTest("event_object_call", function() {
var o = arguments[0]; var o = arguments[0];
assert(o != null); assert(o != null);
var expectedValue = 1234; var expectedValue = 1234;
o.methodIntegralInA(expectedValue); o.checkMethodIntegralInA(expectedValue);
var actualValue = o.methodIntegralOutA(); var actualValue = o.checkMethodIntegralOutA();
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
v = true; v = true;
} }
); );
printInfo('going to call event'); printInfo('going to call event');
obj.callEvent(); obj.emitEvent();
printInfo('is event called?'); printInfo('is event called?');
assert(v); assert(v);
}); });
@ -296,7 +296,7 @@ startTest("event_structarg", function() {
var v = false; var v = false;
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.on var ret = obj.on
("test_structarg", ("test,structarg",
function() function()
{ {
printInfo('Event called'); printInfo('Event called');
@ -308,7 +308,7 @@ startTest("event_structarg", function() {
} }
); );
printInfo('going to call event'); printInfo('going to call event');
obj.callEvent(); obj.emitEvent();
printInfo('is event called?'); printInfo('is event called?');
assert(v); assert(v);
}); });
@ -317,7 +317,7 @@ startTest("event_stringarg", function() {
var v = false; var v = false;
var obj = new TestObject(null); var obj = new TestObject(null);
var ret = obj.on var ret = obj.on
("test_stringarg", ("test,stringarg",
function() function()
{ {
printInfo('Event called'); printInfo('Event called');
@ -327,7 +327,7 @@ startTest("event_stringarg", function() {
} }
); );
printInfo('going to call event'); printInfo('going to call event');
obj.callEvent(); obj.emitEvent();
printInfo('is event called?'); printInfo('is event called?');
assert(v); assert(v);
}); });
@ -335,15 +335,15 @@ startTest("event_stringarg", function() {
// // TODO: disabled. Not implemented yet // // TODO: disabled. Not implemented yet
// startTest("integral_array", function() { // startTest("integral_array", function() {
// var obj = new TestObject(null); // var obj = new TestObject(null);
// var ret = obj.methodArrayAt([1, 2, 3, 4, 5], 1); // var ret = obj.checkMethodArrayAt([1, 2, 3, 4, 5], 1);
// assert(ret == 2, "ret == " + ret); // assert(ret == 2, "ret == " + ret);
// }); // });
startTest("array_in_array_out", function() { startTest("array_in_array_out", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var newArray = obj.methodArrayWith42(); var newArray = obj.checkMethodArrayWith42();
assert(newArray != null); assert(newArray != null);
var arr = obj.methodArrayInArrayOut(newArray); var arr = obj.checkMethodArrayInArrayOut(newArray);
assert(arr != null); assert(arr != null);
assert(arr[0] === 42); assert(arr[0] === 42);
assert(newArray[0] === arr[0]); assert(newArray[0] === arr[0]);
@ -351,80 +351,80 @@ startTest("array_in_array_out", function() {
startTest("method_array_of_objects", function() { startTest("method_array_of_objects", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var arr = obj.methodArrayOfObjects(null); var arr = obj.checkMethodArrayOfObjects(null);
assert(arr != null); assert(arr != null);
assert(arr[0] != null); assert(arr[0] != null);
arr = obj.methodArrayOfObjects(arr); arr = obj.checkMethodArrayOfObjects(arr);
assert(arr != null); assert(arr != null);
var v = arr[0]; var v = arr[0];
assert(v != null); assert(v != null);
// assert(v == obj); // TODO: check if same Eo object pointer? // assert(v == obj); // TODO: check if same Eo object pointer?
var expectedValue = 1234; var expectedValue = 1234;
v.methodIntegralInA(expectedValue); v.checkMethodIntegralInA(expectedValue);
var actualValue = v.methodIntegralOutA(); var actualValue = v.checkMethodIntegralOutA();
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
}); });
// FIXME // FIXME
// startTest("method_array_of_strings", function() { // startTest("method_array_of_strings", function() {
// var obj = new TestObject(null); // var obj = new TestObject(null);
// var arr = obj.methodArrayOfStrings(null); // var arr = obj.checkMethodArrayOfStrings(null);
// assert(arr != null); // assert(arr != null);
// assert(arr[0] === "foo"); // assert(arr[0] === "foo");
// arr = obj.methodArrayOfStrings(arr); // arr = obj.checkMethodArrayOfStrings(arr);
// assert(arr != null); // assert(arr != null);
// assert(arr[0] === "foo"); // assert(arr[0] === "foo");
// }); // });
startTest("method_array_of_ints", function() { startTest("method_array_of_ints", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var arr = obj.methodArrayOfInts(null); var arr = obj.checkMethodArrayOfInts(null);
assert(arr != null); assert(arr != null);
assert(arr[0] === 42); assert(arr[0] === 42);
arr = obj.methodArrayOfInts(arr); arr = obj.checkMethodArrayOfInts(arr);
assert(arr != null); assert(arr != null);
assert(arr[0] === 42); assert(arr[0] === 42);
}); });
startTest("method_array_of_bools", function() { startTest("method_array_of_bools", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var arr = obj.methodArrayOfBools(null); var arr = obj.checkMethodArrayOfBools(null);
assert(arr != null); assert(arr != null);
assert(arr[0] === true); assert(arr[0] === true);
arr = obj.methodArrayOfBools(arr); arr = obj.checkMethodArrayOfBools(arr);
assert(arr != null); assert(arr != null);
assert(arr[0] === true); assert(arr[0] === true);
}); });
startTest("method_array_of_doubles", function() { startTest("method_array_of_doubles", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var arr = obj.methodArrayOfDoubles(null); var arr = obj.checkMethodArrayOfDoubles(null);
assert(arr != null); assert(arr != null);
assert(arr[0] === 42.0); assert(arr[0] === 42.0);
arr = obj.methodArrayOfDoubles(arr); arr = obj.checkMethodArrayOfDoubles(arr);
assert(arr != null); assert(arr != null);
assert(arr[0] === 42.0); assert(arr[0] === 42.0);
}); });
startTest("method_array_of_enums", function() { startTest("method_array_of_enums", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var arr = obj.methodArrayOfEnums(null); var arr = obj.checkMethodArrayOfEnums(null);
assert(arr != null); assert(arr != null);
assert(arr[0] === suite.Test.EnumEx.THIRD); assert(arr[0] === suite.Test.EnumEx.THIRD);
arr = obj.methodArrayOfEnums(arr); arr = obj.checkMethodArrayOfEnums(arr);
assert(arr != null); assert(arr != null);
assert(arr[0] === suite.Test.EnumEx.THIRD); assert(arr[0] === suite.Test.EnumEx.THIRD);
}); });
startTest("method_array_of_structs", function() { startTest("method_array_of_structs", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var arr = obj.methodArrayOfStructs(null); var arr = obj.checkMethodArrayOfStructs(null);
assert(arr != null); assert(arr != null);
var s = arr[0]; var s = arr[0];
assert(s != null); assert(s != null);
assert(s.valueInt === 42); assert(s.valueInt === 42);
assert(s.valueEnum === suite.Test.EnumEx.THIRD); assert(s.valueEnum === suite.Test.EnumEx.THIRD);
arr = obj.methodArrayOfStructs(arr); arr = obj.checkMethodArrayOfStructs(arr);
s = arr[0]; s = arr[0];
assert(s != null); assert(s != null);
assert(s.valueInt === 42); assert(s.valueInt === 42);
@ -433,9 +433,9 @@ startTest("method_array_of_structs", function() {
startTest("list_in_list_out", function() { startTest("list_in_list_out", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var newList = obj.methodListWith42(); var newList = obj.checkMethodListWith42();
assert(newList != null); assert(newList != null);
var lis = obj.methodListInListOut(newList); var lis = obj.checkMethodListInListOut(newList);
assert(lis != null); assert(lis != null);
// assert(lis == newList); // TODO: check same list pointer? // assert(lis == newList); // TODO: check same list pointer?
assert(lis[0] === 42); assert(lis[0] === 42);
@ -444,80 +444,80 @@ startTest("list_in_list_out", function() {
startTest("method_list_of_objects", function() { startTest("method_list_of_objects", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var lis = obj.methodListOfObjects(null); var lis = obj.checkMethodListOfObjects(null);
assert(lis != null); assert(lis != null);
assert(lis[0] != null); assert(lis[0] != null);
lis = obj.methodListOfObjects(lis); lis = obj.checkMethodListOfObjects(lis);
assert(lis != null); assert(lis != null);
var v = lis[0]; var v = lis[0];
assert(v != null); assert(v != null);
// assert(v == obj); // TODO: check if same Eo object pointer? // assert(v == obj); // TODO: check if same Eo object pointer?
var expectedValue = 1234; var expectedValue = 1234;
v.methodIntegralInA(expectedValue); v.checkMethodIntegralInA(expectedValue);
var actualValue = v.methodIntegralOutA(); var actualValue = v.checkMethodIntegralOutA();
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
}); });
// FIXME // FIXME
// startTest("method_list_of_strings", function() { // startTest("method_list_of_strings", function() {
// var obj = new TestObject(null); // var obj = new TestObject(null);
// var lis = obj.methodListOfStrings(null); // var lis = obj.checkMethodListOfStrings(null);
// assert(lis != null); // assert(lis != null);
// assert(lis[0] === "foo"); // assert(lis[0] === "foo");
// lis = obj.methodListOfStrings(lis); // lis = obj.checkMethodListOfStrings(lis);
// assert(lis != null); // assert(lis != null);
// assert(lis[0] === "foo"); // assert(lis[0] === "foo");
// }); // });
startTest("method_list_of_ints", function() { startTest("method_list_of_ints", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var lis = obj.methodListOfInts(null); var lis = obj.checkMethodListOfInts(null);
assert(lis != null); assert(lis != null);
assert(lis[0] === 42); assert(lis[0] === 42);
lis = obj.methodListOfInts(lis); lis = obj.checkMethodListOfInts(lis);
assert(lis != null); assert(lis != null);
assert(lis[0] === 42); assert(lis[0] === 42);
}); });
startTest("method_list_of_bools", function() { startTest("method_list_of_bools", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var lis = obj.methodListOfBools(null); var lis = obj.checkMethodListOfBools(null);
assert(lis != null); assert(lis != null);
assert(lis[0] === true); assert(lis[0] === true);
lis = obj.methodListOfBools(lis); lis = obj.checkMethodListOfBools(lis);
assert(lis != null); assert(lis != null);
assert(lis[0] === true); assert(lis[0] === true);
}); });
startTest("method_list_of_doubles", function() { startTest("method_list_of_doubles", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var lis = obj.methodListOfDoubles(null); var lis = obj.checkMethodListOfDoubles(null);
assert(lis != null); assert(lis != null);
assert(lis[0] === 42.0); assert(lis[0] === 42.0);
lis = obj.methodListOfDoubles(lis); lis = obj.checkMethodListOfDoubles(lis);
assert(lis != null); assert(lis != null);
assert(lis[0] === 42.0); assert(lis[0] === 42.0);
}); });
startTest("method_list_of_enums", function() { startTest("method_list_of_enums", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var lis = obj.methodListOfEnums(null); var lis = obj.checkMethodListOfEnums(null);
assert(lis != null); assert(lis != null);
assert(lis[0] === suite.Test.EnumEx.THIRD); assert(lis[0] === suite.Test.EnumEx.THIRD);
lis = obj.methodListOfEnums(lis); lis = obj.checkMethodListOfEnums(lis);
assert(lis != null); assert(lis != null);
assert(lis[0] === suite.Test.EnumEx.THIRD); assert(lis[0] === suite.Test.EnumEx.THIRD);
}); });
startTest("method_list_of_structs", function() { startTest("method_list_of_structs", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var lis = obj.methodListOfStructs(null); var lis = obj.checkMethodListOfStructs(null);
assert(lis != null); assert(lis != null);
var s = lis[0]; var s = lis[0];
assert(s != null); assert(s != null);
assert(s.valueInt === 42); assert(s.valueInt === 42);
assert(s.valueEnum === suite.Test.EnumEx.THIRD); assert(s.valueEnum === suite.Test.EnumEx.THIRD);
lis = obj.methodListOfStructs(lis); lis = obj.checkMethodListOfStructs(lis);
s = lis[0]; s = lis[0];
assert(s != null); assert(s != null);
assert(s.valueInt === 42); assert(s.valueInt === 42);
@ -526,79 +526,79 @@ startTest("method_list_of_structs", function() {
startTest("method_accessor_of_objects", function() { startTest("method_accessor_of_objects", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var acc = obj.methodAccessorOfObjects(null); var acc = obj.checkMethodAccessorOfObjects(null);
assert(acc != null); assert(acc != null);
assert(acc.get(0) != null); assert(acc.get(0) != null);
acc = obj.methodAccessorOfObjects(acc); acc = obj.checkMethodAccessorOfObjects(acc);
assert(acc != null); assert(acc != null);
var v = acc.get(0); var v = acc.get(0);
assert(v != null); assert(v != null);
var expectedValue = 1234; var expectedValue = 1234;
v.methodIntegralInA(expectedValue); v.checkMethodIntegralInA(expectedValue);
var actualValue = v.methodIntegralOutA(); var actualValue = v.checkMethodIntegralOutA();
assert(actualValue == expectedValue, actualValue + " == " + expectedValue); assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
}); });
// FIXME // FIXME
// startTest("method_accessor_of_strings", function() { // startTest("method_accessor_of_strings", function() {
// var obj = new TestObject(null); // var obj = new TestObject(null);
// var acc = obj.methodAccessorOfStrings(null); // var acc = obj.checkMethodAccessorOfStrings(null);
// assert(acc != null); // assert(acc != null);
// assert(acc.get(0) === "foo"); // assert(acc.get(0) === "foo");
// acc = obj.methodAccessorOfStrings(acc); // acc = obj.checkMethodAccessorOfStrings(acc);
// assert(acc != null); // assert(acc != null);
// assert(acc.get(0) === "foo"); // assert(acc.get(0) === "foo");
// }); // });
startTest("method_accessor_of_ints", function() { startTest("method_accessor_of_ints", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var acc = obj.methodAccessorOfInts(null); var acc = obj.checkMethodAccessorOfInts(null);
assert(acc != null); assert(acc != null);
assert(acc.get(0) === 42); assert(acc.get(0) === 42);
acc = obj.methodAccessorOfInts(acc); acc = obj.checkMethodAccessorOfInts(acc);
assert(acc != null); assert(acc != null);
assert(acc.get(0) === 42); assert(acc.get(0) === 42);
}); });
startTest("method_accessor_of_bools", function() { startTest("method_accessor_of_bools", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var acc = obj.methodAccessorOfBools(null); var acc = obj.checkMethodAccessorOfBools(null);
assert(acc != null); assert(acc != null);
assert(acc.get(0) === true); assert(acc.get(0) === true);
acc = obj.methodAccessorOfBools(acc); acc = obj.checkMethodAccessorOfBools(acc);
assert(acc != null); assert(acc != null);
assert(acc.get(0) === true); assert(acc.get(0) === true);
}); });
startTest("method_accessor_of_doubles", function() { startTest("method_accessor_of_doubles", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var acc = obj.methodAccessorOfDoubles(null); var acc = obj.checkMethodAccessorOfDoubles(null);
assert(acc != null); assert(acc != null);
assert(acc.get(0) === 42.0); assert(acc.get(0) === 42.0);
acc = obj.methodAccessorOfDoubles(acc); acc = obj.checkMethodAccessorOfDoubles(acc);
assert(acc != null); assert(acc != null);
assert(acc.get(0) === 42.0); assert(acc.get(0) === 42.0);
}); });
startTest("method_accessor_of_enums", function() { startTest("method_accessor_of_enums", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var acc = obj.methodAccessorOfEnums(null); var acc = obj.checkMethodAccessorOfEnums(null);
assert(acc != null); assert(acc != null);
assert(acc.get(0) === suite.Test.EnumEx.THIRD); assert(acc.get(0) === suite.Test.EnumEx.THIRD);
acc = obj.methodAccessorOfEnums(acc); acc = obj.checkMethodAccessorOfEnums(acc);
assert(acc != null); assert(acc != null);
assert(acc.get(0) === suite.Test.EnumEx.THIRD); assert(acc.get(0) === suite.Test.EnumEx.THIRD);
}); });
startTest("method_accessor_of_structs", function() { startTest("method_accessor_of_structs", function() {
var obj = new TestObject(null); var obj = new TestObject(null);
var acc = obj.methodAccessorOfStructs(null); var acc = obj.checkMethodAccessorOfStructs(null);
assert(acc != null); assert(acc != null);
var s = acc.get(0); var s = acc.get(0);
assert(s != null); assert(s != null);
assert(s.valueInt === 42); assert(s.valueInt === 42);
assert(s.valueEnum === suite.Test.EnumEx.THIRD); assert(s.valueEnum === suite.Test.EnumEx.THIRD);
acc = obj.methodAccessorOfStructs(acc); acc = obj.checkMethodAccessorOfStructs(acc);
assert(acc != null); assert(acc != null);
s = acc.get(0); s = acc.get(0);
assert(s != null); assert(s != null);
@ -611,12 +611,12 @@ startTest("method_accessor_of_structs", function() {
// FIXME // FIXME
// startTest("method_array_of_arrays_of_ints", function() { // startTest("method_array_of_arrays_of_ints", function() {
// var obj = new TestObject(null); // var obj = new TestObject(null);
// var arr = obj.methodArrayOfArraysOfInts(null); // var arr = obj.checkMethodArrayOfArraysOfInts(null);
// assert(arr != null); // assert(arr != null);
// var a = arr[0]; // var a = arr[0];
// assert(a != null); // assert(a != null);
// assert(a[0] === 42); // assert(a[0] === 42);
// arr = obj.methodArrayOfArraysOfInts(arr); // arr = obj.checkMethodArrayOfArraysOfInts(arr);
// assert(arr != null); // assert(arr != null);
// a = arr[0]; // a = arr[0];
// assert(a != null); // assert(a != null);
@ -626,12 +626,12 @@ startTest("method_accessor_of_structs", function() {
// FIXME // FIXME
// startTest("method_list_of_lists_of_ints", function() { // startTest("method_list_of_lists_of_ints", function() {
// var obj = new TestObject(null); // var obj = new TestObject(null);
// var lis = obj.methodListOfListsOfInts(null); // var lis = obj.checkMethodListOfListsOfInts(null);
// assert(lis != null); // assert(lis != null);
// var l = lis[0]; // var l = lis[0];
// assert(l != null); // assert(l != null);
// assert(l[0] === 42); // assert(l[0] === 42);
// lis = obj.methodListOfListsOfInts(lis); // lis = obj.checkMethodListOfListsOfInts(lis);
// assert(lis != null); // assert(lis != null);
// l = lis[0]; // l = lis[0];
// assert(l != null); // assert(l != null);
@ -641,12 +641,12 @@ startTest("method_accessor_of_structs", function() {
// FIXME // FIXME
// startTest("method_array_of_lists_of_ints", function() { // startTest("method_array_of_lists_of_ints", function() {
// var obj = new TestObject(null); // var obj = new TestObject(null);
// var arr = obj.methodArrayOfListsOfInts(null); // var arr = obj.checkMethodArrayOfListsOfInts(null);
// assert(arr != null); // assert(arr != null);
// var l = arr[0]; // var l = arr[0];
// assert(l != null); // assert(l != null);
// assert(l[0] === 42); // assert(l[0] === 42);
// arr = obj.methodArrayOfListsOfInts(arr); // arr = obj.checkMethodArrayOfListsOfInts(arr);
// assert(arr != null); // assert(arr != null);
// l = arr[0]; // l = arr[0];
// assert(l != null); // assert(l != null);
@ -656,12 +656,12 @@ startTest("method_accessor_of_structs", function() {
// FIXME // FIXME
// startTest("method_list_of_arrays_of_ints", function() { // startTest("method_list_of_arrays_of_ints", function() {
// var obj = new TestObject(null); // var obj = new TestObject(null);
// var lis = obj.methodListOfArraysOfInts(null); // var lis = obj.checkMethodListOfArraysOfInts(null);
// assert(lis != null); // assert(lis != null);
// var a = lis[0]; // var a = lis[0];
// assert(a != null); // assert(a != null);
// assert(a[0] === 42); // assert(a[0] === 42);
// lis = obj.methodListOfArraysOfInts(lis); // lis = obj.checkMethodListOfArraysOfInts(lis);
// assert(lis != null); // assert(lis != null);
// a = lis[0]; // a = lis[0];
// assert(a != null); // assert(a != null);

View File

@ -27,6 +27,7 @@ EOLIAN static Eo_Base *
_test_object_eo_base_constructor(Eo* obj, Test_Object_Data *pd) _test_object_eo_base_constructor(Eo* obj, Test_Object_Data *pd)
{ {
fprintf(stdout, "_test_object_eo_base_constructor\n"); fprintf(stdout, "_test_object_eo_base_constructor\n");
fflush(stdout);
pd->a = 0; pd->a = 0;
return eo_constructor(eo_super(obj, MY_CLASS)); return eo_constructor(eo_super(obj, MY_CLASS));
@ -36,6 +37,7 @@ EOLIAN static Eo *
_test_object_eo_base_finalize(Eo *obj, Test_Object_Data *pd EINA_UNUSED) _test_object_eo_base_finalize(Eo *obj, Test_Object_Data *pd EINA_UNUSED)
{ {
fprintf(stdout, "_test_object_eo_base_finalize\n"); fprintf(stdout, "_test_object_eo_base_finalize\n");
fflush(stdout);
return eo_finalize(eo_super(obj, MY_CLASS)); return eo_finalize(eo_super(obj, MY_CLASS));
} }
@ -44,54 +46,60 @@ EOLIAN static void
_test_object_eo_base_destructor(Eo* obj, Test_Object_Data *pd EINA_UNUSED) _test_object_eo_base_destructor(Eo* obj, Test_Object_Data *pd EINA_UNUSED)
{ {
fprintf(stdout, "_test_object_eo_base_destructor\n"); fprintf(stdout, "_test_object_eo_base_destructor\n");
fflush(stdout);
eo_destructor(eo_super(obj, MY_CLASS)); eo_destructor(eo_super(obj, MY_CLASS));
} }
EOLIAN static void EOLIAN static void
_test_object_method_integral_in_a(Eo* obj EINA_UNUSED, _test_object_method_integral_in_a_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd, Test_Object_Data *pd,
int a) int a)
{ {
fprintf(stdout, "_test_object_method_integral_in_a(%d)\n", a); fprintf(stdout, "_test_object_method_integral_in_a_check(%d)\n", a);
fflush(stdout);
pd->a = a; pd->a = a;
} }
EOLIAN static void EOLIAN static void
_test_object_method_integral_out_a(Eo* obj EINA_UNUSED, _test_object_method_integral_out_a_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd, Test_Object_Data *pd,
int *a) int *a)
{ {
fprintf(stdout, "_test_object_method_integral_out_a(%p)\n", a); fprintf(stdout, "_test_object_method_integral_out_a_check(%p)\n", a);
fflush(stdout);
*a = pd->a; *a = pd->a;
} }
EOLIAN static void EOLIAN static void
_test_object_method_integral_inout(Eo* obj EINA_UNUSED, _test_object_method_integral_inout_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
int *a) int *a)
{ {
fprintf(stdout, "_test_object_method_integral_inout(%d [%p])\n", *a, a); fprintf(stdout, "_test_object_method_integral_inout_check(%d [%p])\n", *a, a);
fflush(stdout);
*a = -(*a); *a = -(*a);
} }
EOLIAN static int EOLIAN static int
_test_object_method_integral_return_a(Eo* obj EINA_UNUSED, _test_object_method_integral_return_a_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd) Test_Object_Data *pd)
{ {
fprintf(stdout, "_test_object_method_integral_return_a()\n"); fprintf(stdout, "_test_object_method_integral_return_a_check()\n");
fflush(stdout);
return pd->a; return pd->a;
} }
EOLIAN static Eina_Bool EOLIAN static Eina_Bool
_test_object_method_div_mod(Eo* obj EINA_UNUSED, _test_object_method_div_mod_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
int a, int a,
int b, int b,
int *quotient, int *quotient,
int *remainder) int *remainder)
{ {
fprintf(stdout, "_test_object_method_div_mod(%d, %d, %p, %p)\n", a, b, quotient, remainder); fprintf(stdout, "_test_object_method_div_mod_check(%d, %d, %p, %p)\n", a, b, quotient, remainder);
fflush(stdout);
if (0 == b) return EINA_FALSE; if (0 == b) return EINA_FALSE;
*quotient = a / b; *quotient = a / b;
*remainder = a % b; *remainder = a % b;
@ -99,31 +107,34 @@ _test_object_method_div_mod(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Bool EOLIAN static Eina_Bool
_test_object_method_and(Eo* obj EINA_UNUSED, _test_object_method_and_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Bool a, Eina_Bool a,
Eina_Bool b) Eina_Bool b)
{ {
fprintf(stdout, "_test_object_method_and(%d, %d)\n", a, b); fprintf(stdout, "_test_object_method_and_check(%d, %d)\n", a, b);
fflush(stdout);
return a && b; return a && b;
} }
EOLIAN static double EOLIAN static double
_test_object_method_modf(Eo* obj EINA_UNUSED, _test_object_method_modf_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
double x, double x,
double *int_part) double *int_part)
{ {
fprintf(stdout, "_test_object_method_modf(%f, %p)\n", x, int_part); fprintf(stdout, "_test_object_method_modf_check(%f, %p)\n", x, int_part);
fflush(stdout);
return modf(x, int_part); return modf(x, int_part);
} }
EOLIAN static void EOLIAN static void
_test_object_method_uppercase(Eo* obj EINA_UNUSED, _test_object_method_uppercase_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
char **str) char **str)
{ {
fprintf(stdout, "_test_object_method_uppercase('%s')\n", *str); fprintf(stdout, "_test_object_method_uppercase_check('%s')\n", *str);
fflush(stdout);
if (!*str) return; if (!*str) return;
char *p = *str; char *p = *str;
@ -135,45 +146,50 @@ _test_object_method_uppercase(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Bool EOLIAN static Eina_Bool
_test_object_method_in_null(Eo* obj EINA_UNUSED, _test_object_method_in_null_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
char *a) char *a)
{ {
fprintf(stdout, "_test_object_method_in_null(%p)\n", a); fprintf(stdout, "_test_object_method_in_null_check(%p)\n", a);
fflush(stdout);
return NULL == a; return NULL == a;
} }
EOLIAN static Eina_Bool EOLIAN static Eina_Bool
_test_object_method_out_null(Eo* obj EINA_UNUSED, _test_object_method_out_null_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
char **a) char **a)
{ {
fprintf(stdout, "_test_object_method_out_null(%p)\n", a); fprintf(stdout, "_test_object_method_out_null_check(%p)\n", a);
fflush(stdout);
*a = NULL; *a = NULL;
return EINA_TRUE; return EINA_TRUE;
} }
EOLIAN static Eina_Bool EOLIAN static Eina_Bool
_test_object_method_inout_null(Eo* obj EINA_UNUSED, _test_object_method_inout_null_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
char **a) char **a)
{ {
fprintf(stdout, "_test_object_method_inout_null(%p)\n", a); fprintf(stdout, "_test_object_method_inout_null_check(%p)\n", a);
fflush(stdout);
return NULL == *a; return NULL == *a;
} }
EOLIAN static char * EOLIAN static char *
_test_object_method_return_null(Eo* obj EINA_UNUSED, _test_object_method_return_null_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED) Test_Object_Data *pd EINA_UNUSED)
{ {
fprintf(stdout, "_test_object_method_return_null()\n"); fprintf(stdout, "_test_object_method_return_null_check()\n");
fflush(stdout);
return NULL; return NULL;
} }
EOLIAN static void EOLIAN static void
_test_object_call_event(Eo* obj, Test_Object_Data *pd EINA_UNUSED) _test_object_event_emit(Eo* obj, Test_Object_Data *pd EINA_UNUSED)
{ {
fprintf(stderr, "_test_object_event_call()\n"); fflush(stderr); fprintf(stdout, "_test_object_event_emit()\n");
fflush(stdout);
static Test_Struct_Ex s = {42, TEST_ENUM_EX_THIRD}; static Test_Struct_Ex s = {42, TEST_ENUM_EX_THIRD};
eo_event_callback_call(obj, TEST_OBJECT_EVENT_TEST, NULL); eo_event_callback_call(obj, TEST_OBJECT_EVENT_TEST, NULL);
eo_event_callback_call(obj, TEST_OBJECT_EVENT_TEST_STRUCTARG, &s); eo_event_callback_call(obj, TEST_OBJECT_EVENT_TEST_STRUCTARG, &s);
@ -181,13 +197,14 @@ _test_object_call_event(Eo* obj, Test_Object_Data *pd EINA_UNUSED)
} }
EOLIAN static char * EOLIAN static char *
_test_object_method_null(Eo* obj EINA_UNUSED, _test_object_method_null_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
char *in, char *in,
char **out, char **out,
char **inout) char **inout)
{ {
fprintf(stdout, "_test_object_method_null(%p, %p, %p)\n", in, out, inout); fprintf(stdout, "_test_object_method_null_check(%p, %p, %p)\n", in, out, inout);
fflush(stdout);
assert(!in); assert(!in);
*out = NULL; *out = NULL;
*inout = NULL; *inout = NULL;
@ -197,20 +214,22 @@ _test_object_method_null(Eo* obj EINA_UNUSED,
// Arrays // // Arrays //
EOLIAN static int EOLIAN static int
_test_object_method_array_at(Eo* obj EINA_UNUSED, _test_object_method_array_at_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *array, Eina_Array *array,
int index) int index)
{ {
fprintf(stdout, "_test_object_method_array_at(%p, %d)\n", array, index); fprintf(stdout, "_test_object_method_array_at_check(%p, %d)\n", array, index);
fflush(stdout);
return *((int*)eina_array_data_get(array, index)); return *((int*)eina_array_data_get(array, index));
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_with_42(Eo* obj EINA_UNUSED, _test_object_method_array_with_42_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED) Test_Object_Data *pd EINA_UNUSED)
{ {
fprintf(stdout, "_test_object_method_array_with_42()\n"); fprintf(stdout, "_test_object_method_array_with_42_check()\n");
fflush(stdout);
Eina_Array *arr = eina_array_new(2); Eina_Array *arr = eina_array_new(2);
int* n = malloc(sizeof(int)); int* n = malloc(sizeof(int));
*n = 42; *n = 42;
@ -219,21 +238,23 @@ _test_object_method_array_with_42(Eo* obj EINA_UNUSED,
} }
EOLIAN static void EOLIAN static void
_test_object_method_array_in_array_out(Eo* obj EINA_UNUSED, _test_object_method_array_in_array_out_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in, Eina_Array *a_in,
Eina_Array **a_out) Eina_Array **a_out)
{ {
fprintf(stdout, "_test_object_method_array_in_array_out(%p, %p)\n", a_in, a_out); fprintf(stdout, "_test_object_method_array_in_array_out_check(%p, %p)\n", a_in, a_out);
fflush(stdout);
*a_out = a_in; *a_out = a_in;
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_objects(Eo* obj, _test_object_method_array_of_objects_check(Eo* obj,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_objects(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_objects_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Eina_Array *arr = eina_array_new(2); Eina_Array *arr = eina_array_new(2);
eina_array_push(arr, obj); eina_array_push(arr, obj);
@ -242,11 +263,12 @@ _test_object_method_array_of_objects(Eo* obj,
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_strings(Eo* obj EINA_UNUSED, _test_object_method_array_of_strings_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_strings(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_strings_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Eina_Array *arr = eina_array_new(2); Eina_Array *arr = eina_array_new(2);
const char* v = "foo"; const char* v = "foo";
@ -256,11 +278,12 @@ _test_object_method_array_of_strings(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_ints(Eo* obj EINA_UNUSED, _test_object_method_array_of_ints_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_ints(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_ints_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
int *v = malloc(sizeof(int)); int *v = malloc(sizeof(int));
*v = 42; *v = 42;
@ -270,11 +293,12 @@ _test_object_method_array_of_ints(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_bools(Eo* obj EINA_UNUSED, _test_object_method_array_of_bools_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_bools(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_bools_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Eina_Bool *v = malloc(sizeof(Eina_Bool)); Eina_Bool *v = malloc(sizeof(Eina_Bool));
*v = EINA_TRUE; *v = EINA_TRUE;
@ -284,11 +308,12 @@ _test_object_method_array_of_bools(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_doubles(Eo* obj EINA_UNUSED, _test_object_method_array_of_doubles_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_doubles(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_doubles_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
double *v = malloc(sizeof(double)); double *v = malloc(sizeof(double));
*v = 42; *v = 42;
@ -298,11 +323,12 @@ _test_object_method_array_of_doubles(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_enums(Eo* obj EINA_UNUSED, _test_object_method_array_of_enums_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_enums(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_enums_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex)); Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
*v = TEST_ENUM_EX_THIRD; *v = TEST_ENUM_EX_THIRD;
@ -312,11 +338,12 @@ _test_object_method_array_of_enums(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_structs(Eo* obj EINA_UNUSED, _test_object_method_array_of_structs_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_structs(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_structs_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex)); Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
v->value_int = 42; v->value_int = 42;
@ -327,11 +354,12 @@ _test_object_method_array_of_structs(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_arrays_of_ints(Eo* obj EINA_UNUSED, _test_object_method_array_of_arrays_of_ints_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_arrays_of_ints(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_arrays_of_ints_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
int *v = malloc(sizeof(int)); int *v = malloc(sizeof(int));
*v = 42; *v = 42;
@ -345,52 +373,57 @@ _test_object_method_array_of_arrays_of_ints(Eo* obj EINA_UNUSED,
// Lists // // Lists //
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_with_42(Eo* obj EINA_UNUSED, _test_object_method_list_with_42_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED) Test_Object_Data *pd EINA_UNUSED)
{ {
fprintf(stdout, "_test_object_method_list_with_42()\n"); fprintf(stdout, "_test_object_method_list_with_42_check()\n");
fflush(stdout);
int* n = malloc(sizeof(int)); int* n = malloc(sizeof(int));
*n = 42; *n = 42;
return eina_list_append(NULL, n); return eina_list_append(NULL, n);
} }
EOLIAN static void EOLIAN static void
_test_object_method_list_in_list_out(Eo* obj EINA_UNUSED, _test_object_method_list_in_list_out_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in, Eina_List *l_in,
Eina_List **l_out) Eina_List **l_out)
{ {
fprintf(stdout, "_test_object_method_list_in_list_out(%p , %p)\n", l_in, l_out); fprintf(stdout, "_test_object_method_list_in_list_out_check(%p , %p)\n", l_in, l_out);
fflush(stdout);
*l_out = l_in; *l_out = l_in;
} }
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_objects(Eo* obj, _test_object_method_list_of_objects_check(Eo* obj,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_objects(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_objects_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
return eina_list_append(NULL, obj); return eina_list_append(NULL, obj);
} }
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_strings(Eo* obj EINA_UNUSED, _test_object_method_list_of_strings_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_strings(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_strings_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
return eina_list_append(NULL, "foo"); return eina_list_append(NULL, "foo");
} }
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_ints(Eo* obj EINA_UNUSED, _test_object_method_list_of_ints_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_ints(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_ints_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
int *v = malloc(sizeof(int)); int *v = malloc(sizeof(int));
*v = 42; *v = 42;
@ -398,11 +431,12 @@ _test_object_method_list_of_ints(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_bools(Eo* obj EINA_UNUSED, _test_object_method_list_of_bools_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_bools(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_bools_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
Eina_Bool *v = malloc(sizeof(Eina_Bool)); Eina_Bool *v = malloc(sizeof(Eina_Bool));
*v = EINA_TRUE; *v = EINA_TRUE;
@ -410,11 +444,12 @@ _test_object_method_list_of_bools(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_doubles(Eo* obj EINA_UNUSED, _test_object_method_list_of_doubles_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_doubles(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_doubles_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
double *v = malloc(sizeof(double)); double *v = malloc(sizeof(double));
*v = 42; *v = 42;
@ -422,11 +457,12 @@ _test_object_method_list_of_doubles(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_enums(Eo* obj EINA_UNUSED, _test_object_method_list_of_enums_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_enums(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_enums_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex)); Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
*v = TEST_ENUM_EX_THIRD; *v = TEST_ENUM_EX_THIRD;
@ -434,11 +470,12 @@ _test_object_method_list_of_enums(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_structs(Eo* obj EINA_UNUSED, _test_object_method_list_of_structs_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_structs(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_structs_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex)); Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
v->value_int = 42; v->value_int = 42;
@ -449,11 +486,12 @@ _test_object_method_list_of_structs(Eo* obj EINA_UNUSED,
// Accessors // // Accessors //
EOLIAN static Eina_Accessor * EOLIAN static Eina_Accessor *
_test_object_method_accessor_of_objects(Eo* obj, _test_object_method_accessor_of_objects_check(Eo* obj,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Accessor *a_in) Eina_Accessor *a_in)
{ {
fprintf(stdout, "_test_object_method_accessor_of_objects(%p)\n", a_in); fprintf(stdout, "_test_object_method_accessor_of_objects_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Eina_Array *arr = eina_array_new(2); Eina_Array *arr = eina_array_new(2);
eina_array_push(arr, obj); eina_array_push(arr, obj);
@ -461,11 +499,12 @@ _test_object_method_accessor_of_objects(Eo* obj,
} }
EOLIAN static Eina_Accessor * EOLIAN static Eina_Accessor *
_test_object_method_accessor_of_strings(Eo* obj EINA_UNUSED, _test_object_method_accessor_of_strings_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Accessor *a_in) Eina_Accessor *a_in)
{ {
fprintf(stdout, "_test_object_method_accessor_of_strings(%p)\n", a_in); fprintf(stdout, "_test_object_method_accessor_of_strings_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Eina_Array *arr = eina_array_new(2); Eina_Array *arr = eina_array_new(2);
eina_array_push(arr, "foo"); eina_array_push(arr, "foo");
@ -473,11 +512,12 @@ _test_object_method_accessor_of_strings(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Accessor * EOLIAN static Eina_Accessor *
_test_object_method_accessor_of_ints(Eo* obj EINA_UNUSED, _test_object_method_accessor_of_ints_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Accessor *a_in) Eina_Accessor *a_in)
{ {
fprintf(stdout, "_test_object_method_accessor_of_ints(%p)\n", a_in); fprintf(stdout, "_test_object_method_accessor_of_ints_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
int *v = malloc(sizeof(int)); int *v = malloc(sizeof(int));
*v = 42; *v = 42;
@ -487,11 +527,12 @@ _test_object_method_accessor_of_ints(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Accessor * EOLIAN static Eina_Accessor *
_test_object_method_accessor_of_bools(Eo* obj EINA_UNUSED, _test_object_method_accessor_of_bools_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Accessor *a_in) Eina_Accessor *a_in)
{ {
fprintf(stdout, "_test_object_method_accessor_of_bools(%p)\n", a_in); fprintf(stdout, "_test_object_method_accessor_of_bools_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Eina_Bool *v = malloc(sizeof(Eina_Bool)); Eina_Bool *v = malloc(sizeof(Eina_Bool));
*v = EINA_TRUE; *v = EINA_TRUE;
@ -501,11 +542,12 @@ _test_object_method_accessor_of_bools(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Accessor * EOLIAN static Eina_Accessor *
_test_object_method_accessor_of_doubles(Eo* obj EINA_UNUSED, _test_object_method_accessor_of_doubles_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Accessor *a_in) Eina_Accessor *a_in)
{ {
fprintf(stdout, "_test_object_method_accessor_of_doubles(%p)\n", a_in); fprintf(stdout, "_test_object_method_accessor_of_doubles_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
double *v = malloc(sizeof(double)); double *v = malloc(sizeof(double));
*v = 42.0; *v = 42.0;
@ -515,11 +557,12 @@ _test_object_method_accessor_of_doubles(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Accessor * EOLIAN static Eina_Accessor *
_test_object_method_accessor_of_enums(Eo* obj EINA_UNUSED, _test_object_method_accessor_of_enums_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Accessor *a_in) Eina_Accessor *a_in)
{ {
fprintf(stdout, "_test_object_method_accessor_of_enums(%p)\n", a_in); fprintf(stdout, "_test_object_method_accessor_of_enums_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex)); Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
*v = TEST_ENUM_EX_THIRD; *v = TEST_ENUM_EX_THIRD;
@ -529,11 +572,12 @@ _test_object_method_accessor_of_enums(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Accessor * EOLIAN static Eina_Accessor *
_test_object_method_accessor_of_structs(Eo* obj EINA_UNUSED, _test_object_method_accessor_of_structs_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Accessor *a_in) Eina_Accessor *a_in)
{ {
fprintf(stdout, "_test_object_method_accessor_of_structs(%p)\n", a_in); fprintf(stdout, "_test_object_method_accessor_of_structs_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex)); Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
v->value_int = 42; v->value_int = 42;
@ -546,11 +590,12 @@ _test_object_method_accessor_of_structs(Eo* obj EINA_UNUSED,
// Combinations of complex types // Combinations of complex types
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_lists_of_ints(Eo* obj EINA_UNUSED, _test_object_method_list_of_lists_of_ints_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_lists_of_ints(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_lists_of_ints_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
int *v = malloc(sizeof(int)); int *v = malloc(sizeof(int));
*v = 42; *v = 42;
@ -558,11 +603,12 @@ _test_object_method_list_of_lists_of_ints(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_Array * EOLIAN static Eina_Array *
_test_object_method_array_of_lists_of_ints(Eo* obj EINA_UNUSED, _test_object_method_array_of_lists_of_ints_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_Array *a_in) Eina_Array *a_in)
{ {
fprintf(stdout, "_test_object_method_array_of_lists_of_ints(%p)\n", a_in); fprintf(stdout, "_test_object_method_array_of_lists_of_ints_check(%p)\n", a_in);
fflush(stdout);
if (a_in) return a_in; if (a_in) return a_in;
int *v = malloc(sizeof(int)); int *v = malloc(sizeof(int));
*v = 42; *v = 42;
@ -572,11 +618,12 @@ _test_object_method_array_of_lists_of_ints(Eo* obj EINA_UNUSED,
} }
EOLIAN static Eina_List * EOLIAN static Eina_List *
_test_object_method_list_of_arrays_of_ints(Eo* obj EINA_UNUSED, _test_object_method_list_of_arrays_of_ints_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Eina_List *l_in) Eina_List *l_in)
{ {
fprintf(stdout, "_test_object_method_list_of_arrays_of_ints(%p)\n", l_in); fprintf(stdout, "_test_object_method_list_of_arrays_of_ints_check(%p)\n", l_in);
fflush(stdout);
if (l_in) return l_in; if (l_in) return l_in;
int *v = malloc(sizeof(int)); int *v = malloc(sizeof(int));
*v = 42; *v = 42;
@ -586,35 +633,40 @@ _test_object_method_list_of_arrays_of_ints(Eo* obj EINA_UNUSED,
} }
EOLIAN static const Eina_List * EOLIAN static const Eina_List *
_test_object_method_list_with_opaque_elements(Eo* obj EINA_UNUSED, _test_object_method_list_with_opaque_elements_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED) Test_Object_Data *pd EINA_UNUSED)
{ {
fprintf(stdout, "_test_object_method_list_with_opaque_elements()\n"); fprintf(stdout, "_test_object_method_list_with_opaque_elements_check()\n");
fflush(stdout);
return NULL; return NULL;
} }
EOLIAN static Test_Enum_Ex EOLIAN static Test_Enum_Ex
_test_object_method_in_enum_return_enum(Eo* obj EINA_UNUSED, _test_object_method_in_enum_return_enum_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Test_Enum_Ex e) Test_Enum_Ex e)
{ {
fprintf(stdout, "_test_object_method_in_enum_return_enum(%d)\n", e); fprintf(stdout, "_test_object_method_in_enum_return_enum_check(%d)\n", e);
fflush(stdout);
return e; return e;
} }
EOLIAN static Test_Struct_Ex * EOLIAN static Test_Struct_Ex *
_test_object_method_in_struct_return_struct(Eo* obj EINA_UNUSED, _test_object_method_in_struct_return_struct_check(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED, Test_Object_Data *pd EINA_UNUSED,
Test_Struct_Ex *s) Test_Struct_Ex *s)
{ {
fprintf(stdout, "_test_object_method_in_struct_return_struct()\n"); fprintf(stdout, "_test_object_method_in_struct_return_struct_check(%p)\n", s);
fflush(stdout);
return s; return s;
} }
EOLIAN static void EOLIAN static void
_test_object_event_repeated_event_name(Eo* obj EINA_UNUSED, _test_object_event_repeated_event_name(Eo* obj EINA_UNUSED,
Test_Object_Data *pd EINA_UNUSED) Test_Object_Data *pd EINA_UNUSED)
{ {
fprintf(stdout, "_test_object_event_repeated_event_name()\n");
fflush(stdout);
} }
#include <test_object.eo.c> #include <test_object.eo.c>

View File

@ -13,23 +13,23 @@ struct Test.Struct_Ex {
class Test.Object (Eo.Base) { class Test.Object (Eo.Base) {
legacy_prefix: null; legacy_prefix: null;
methods { methods {
method_integral_in_a { method_integral_in_a_check {
[[ tests integral in ]] [[ tests integral in ]]
params { a: int; } params { a: int; }
} }
method_integral_out_a { method_integral_out_a_check {
[[ tests integral out ]] [[ tests integral out ]]
params { @out a: int; } params { @out a: int; }
} }
method_integral_inout { method_integral_inout_check {
[[ tests integral inout ]] [[ tests integral inout ]]
params { @inout a: int; } params { @inout a: int; }
} }
method_integral_return_a { method_integral_return_a_check {
[[ tests integral result ]] [[ tests integral result ]]
return: int; return: int;
} }
method_div_mod { method_div_mod_check {
[[ tests mixed in, outs and result ]] [[ tests mixed in, outs and result ]]
params { params {
a: int; a: int;
@ -39,7 +39,7 @@ class Test.Object (Eo.Base) {
} }
return: bool; return: bool;
} }
method_and { method_and_check {
[[ tests boolean ]] [[ tests boolean ]]
params { params {
a: bool; a: bool;
@ -47,7 +47,7 @@ class Test.Object (Eo.Base) {
} }
return: bool; return: bool;
} }
method_modf { method_modf_check {
[[ tests floating point ]] [[ tests floating point ]]
params { params {
a: double; a: double;
@ -55,38 +55,38 @@ class Test.Object (Eo.Base) {
} }
return: double; return: double;
} }
method_uppercase { method_uppercase_check {
[[ tests string ]] [[ tests string ]]
params { params {
@inout str: char*; @inout str: char*;
} }
} }
method_in_null { method_in_null_check {
[[ tests null input ]] [[ tests null input ]]
params { params {
a: char*; a: char*;
} }
return: bool; return: bool;
} }
method_out_null { method_out_null_check {
[[ tests null output ]] [[ tests null output ]]
params { params {
@out a: char*; @out a: char*;
} }
return: bool; return: bool;
} }
method_inout_null { method_inout_null_check {
[[ tests null output ]] [[ tests null output ]]
params { params {
@inout a: char*; @inout a: char*;
} }
return: bool; return: bool;
} }
method_return_null { method_return_null_check {
[[ tests null return ]] [[ tests null return ]]
return: char*; return: char*;
} }
method_null { method_null_check {
[[ tests null values ]] [[ tests null values ]]
params { params {
in: char*; in: char*;
@ -95,7 +95,7 @@ class Test.Object (Eo.Base) {
} }
return: char*; return: char*;
} }
method_array_at { method_array_at_check {
[[ tests array ]] [[ tests array ]]
params { params {
array: array<int>*; array: array<int>*;
@ -103,190 +103,190 @@ class Test.Object (Eo.Base) {
} }
return: int; return: int;
} }
method_array_with_42 { method_array_with_42_check {
[[ tests parameters ]] [[ tests parameters ]]
return: free(own(array<int> *), eina_array_free) @warn_unused; return: free(own(array<int> *), eina_array_free) @warn_unused;
} }
method_array_in_array_out { method_array_in_array_out_check {
[[ tests parameters ]] [[ tests parameters ]]
params { params {
@in a_in: array<int> *; @in a_in: array<int> *;
@out a_out: array<int> *; @out a_out: array<int> *;
} }
} }
method_array_of_objects { method_array_of_objects_check {
params { params {
@in a_in: array<Test.Object *> *; @in a_in: array<Test.Object *> *;
} }
return: array<Test.Object *> *; return: array<Test.Object *> *;
} }
method_array_of_strings { method_array_of_strings_check {
params { params {
@in a_in: array<const(char) *> *; @in a_in: array<const(char) *> *;
} }
return: array<const(char) *> *; return: array<const(char) *> *;
} }
method_array_of_ints { method_array_of_ints_check {
params { params {
@in a_in: array<int> *; @in a_in: array<int> *;
} }
return: array<int> *; return: array<int> *;
} }
method_array_of_bools { method_array_of_bools_check {
params { params {
@in a_in: array<bool> *; @in a_in: array<bool> *;
} }
return: array<bool> *; return: array<bool> *;
} }
method_array_of_doubles { method_array_of_doubles_check {
params { params {
@in a_in: array<double> *; @in a_in: array<double> *;
} }
return: array<double> *; return: array<double> *;
} }
method_array_of_enums { method_array_of_enums_check {
params { params {
@in a_in: array<Test.Enum_Ex> *; @in a_in: array<Test.Enum_Ex> *;
} }
return: array<Test.Enum_Ex> *; return: array<Test.Enum_Ex> *;
} }
method_array_of_structs { method_array_of_structs_check {
params { params {
@in a_in: array<Test.Struct_Ex> *; @in a_in: array<Test.Struct_Ex> *;
} }
return: array<Test.Struct_Ex> *; return: array<Test.Struct_Ex> *;
} }
method_list_with_42 { method_list_with_42_check {
[[ tests parameters ]] [[ tests parameters ]]
return: free(own(list<int> *), eina_list_free) @warn_unused; return: free(own(list<int> *), eina_list_free) @warn_unused;
} }
method_list_in_list_out { method_list_in_list_out_check {
[[ tests parameters ]] [[ tests parameters ]]
params { params {
@in l_in: list<int> *; @in l_in: list<int> *;
@out l_out: list<int> *; @out l_out: list<int> *;
} }
} }
method_list_of_objects { method_list_of_objects_check {
params { params {
@in l_in: list<Test.Object *> *; @in l_in: list<Test.Object *> *;
} }
return: list<Test.Object *> *; return: list<Test.Object *> *;
} }
method_list_of_strings { method_list_of_strings_check {
params { params {
@in l_in: list<const(char) *> *; @in l_in: list<const(char) *> *;
} }
return: list<const(char) *> *; return: list<const(char) *> *;
} }
method_list_of_ints { method_list_of_ints_check {
params { params {
@in l_in: list<int> *; @in l_in: list<int> *;
} }
return: list<int> *; return: list<int> *;
} }
method_list_of_bools { method_list_of_bools_check {
params { params {
@in l_in: list<bool> *; @in l_in: list<bool> *;
} }
return: list<bool> *; return: list<bool> *;
} }
method_list_of_doubles { method_list_of_doubles_check {
params { params {
@in l_in: list<double> *; @in l_in: list<double> *;
} }
return: list<double> *; return: list<double> *;
} }
method_list_of_enums { method_list_of_enums_check {
params { params {
@in l_in: list<Test.Enum_Ex> *; @in l_in: list<Test.Enum_Ex> *;
} }
return: list<Test.Enum_Ex> *; return: list<Test.Enum_Ex> *;
} }
method_list_of_structs { method_list_of_structs_check {
params { params {
@in l_in: list<Test.Struct_Ex> *; @in l_in: list<Test.Struct_Ex> *;
} }
return: list<Test.Struct_Ex> *; return: list<Test.Struct_Ex> *;
} }
method_accessor_of_objects { method_accessor_of_objects_check {
params { params {
@in a_in: accessor<Test.Object *> *; @in a_in: accessor<Test.Object *> *;
} }
return: accessor<Test.Object *> *; return: accessor<Test.Object *> *;
} }
method_accessor_of_strings { method_accessor_of_strings_check {
params { params {
@in a_in: accessor<const(char) *> *; @in a_in: accessor<const(char) *> *;
} }
return: accessor<const(char) *> *; return: accessor<const(char) *> *;
} }
method_accessor_of_ints { method_accessor_of_ints_check {
params { params {
@in a_in: accessor<int> *; @in a_in: accessor<int> *;
} }
return: accessor<int> *; return: accessor<int> *;
} }
method_accessor_of_bools { method_accessor_of_bools_check {
params { params {
@in a_in: accessor<bool> *; @in a_in: accessor<bool> *;
} }
return: accessor<bool> *; return: accessor<bool> *;
} }
method_accessor_of_doubles { method_accessor_of_doubles_check {
params { params {
@in a_in: accessor<double> *; @in a_in: accessor<double> *;
} }
return: accessor<double> *; return: accessor<double> *;
} }
method_accessor_of_enums { method_accessor_of_enums_check {
params { params {
@in a_in: accessor<Test.Enum_Ex> *; @in a_in: accessor<Test.Enum_Ex> *;
} }
return: accessor<Test.Enum_Ex> *; return: accessor<Test.Enum_Ex> *;
} }
method_accessor_of_structs { method_accessor_of_structs_check {
params { params {
@in a_in: accessor<Test.Struct_Ex> *; @in a_in: accessor<Test.Struct_Ex> *;
} }
return: accessor<Test.Struct_Ex> *; return: accessor<Test.Struct_Ex> *;
} }
method_array_of_arrays_of_ints { method_array_of_arrays_of_ints_check {
params { params {
@in a_in: array<array<int> *> *; @in a_in: array<array<int> *> *;
} }
return: array<array<int> *> *; return: array<array<int> *> *;
} }
method_list_of_lists_of_ints { method_list_of_lists_of_ints_check {
params { params {
@in l_in: list<list<int> *> *; @in l_in: list<list<int> *> *;
} }
return: list<list<int> *> *; return: list<list<int> *> *;
} }
method_array_of_lists_of_ints { method_array_of_lists_of_ints_check {
params { params {
@in a_in: array<list<int> *> *; @in a_in: array<list<int> *> *;
} }
return: array<list<int> *> *; return: array<list<int> *> *;
} }
method_list_of_arrays_of_ints { method_list_of_arrays_of_ints_check {
params { params {
@in l_in: list<array<int> *> *; @in l_in: list<array<int> *> *;
} }
return: list<array<int> *> *; return: list<array<int> *> *;
} }
method_list_with_opaque_elements { method_list_with_opaque_elements_check {
return: const(list<Elm.Calendar.Mark*>)*; return: const(list<Elm.Calendar.Mark*>)*;
} }
method_in_enum_return_enum { method_in_enum_return_enum_check {
params { e: Test.Enum_Ex; } params { e: Test.Enum_Ex; }
return: Test.Enum_Ex; return: Test.Enum_Ex;
} }
method_in_struct_return_struct { method_in_struct_return_struct_check {
params { e: Test.Struct_Ex *; } params { e: Test.Struct_Ex *; }
return: Test.Struct_Ex *; return: Test.Struct_Ex *;
} }
call_event { event_emit {
} }
event_repeated_event_name { event_repeated_event_name {
} }