aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/eolian_js
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eolian_js')
-rw-r--r--src/tests/eolian_js/constructor_method_class.eo59
-rw-r--r--src/tests/eolian_js/eolian_js_suite.cc61
-rwxr-xr-xsrc/tests/eolian_js/eolian_js_suite.js796
-rw-r--r--src/tests/eolian_js/eolian_js_test_constructor_method_impl.c147
-rw-r--r--src/tests/eolian_js/eolian_js_test_eolian_js_binding.cc44
-rw-r--r--src/tests/eolian_js/eolian_js_test_evas_box.cc151
-rw-r--r--src/tests/eolian_js/eolian_js_test_test_object_impl.c620
-rw-r--r--src/tests/eolian_js/test_object.eo305
8 files changed, 2183 insertions, 0 deletions
diff --git a/src/tests/eolian_js/constructor_method_class.eo b/src/tests/eolian_js/constructor_method_class.eo
new file mode 100644
index 0000000000..f307a18fc5
--- /dev/null
+++ b/src/tests/eolian_js/constructor_method_class.eo
@@ -0,0 +1,59 @@
+class Constructor_Method_Class (Eo.Base)
+{
+ legacy_prefix: null;
+ data: Constructor_Method_Class_Data;
+ methods {
+ @property fail {
+ get {
+ }
+ values {
+ is_fail: bool;
+ }
+ }
+ constructor1 {
+ params { @in one: int; }
+ }
+ constructor2 {
+ params { @in two: double; }
+ }
+ method1 {
+ params { @in one: int; }
+ }
+ method2 {
+ params { @in one: int; }
+ return: int;
+ }
+ method3 {
+ params { @in one: int; @in two: double; }
+ }
+ method4 {
+ params { @in one: int; @in two: double; }
+ return: int;
+ }
+ outmethod1 {
+ params { @out one: int; }
+ }
+ outmethod2 {
+ params { @out one: int; }
+ return: int;
+ }
+ outmethod3 {
+ params { @out one: int; @out two: double; }
+ }
+ classoutmethod1 {
+ params { @in one: int; @in two: double; }
+ return: free(own(Constructor_Method_Class *), eo_unref) @warn_unused;
+ }
+ classoutmethod2 {
+ params { @in one: int; @in two: double; @out out_class: own(Constructor_Method_Class *); }
+ }
+ }
+ implements {
+ Eo.Base.constructor;
+ Eo.Base.finalize;
+ }
+ constructors {
+ .constructor1;
+ .constructor2;
+ }
+}
diff --git a/src/tests/eolian_js/eolian_js_suite.cc b/src/tests/eolian_js/eolian_js_suite.cc
new file mode 100644
index 0000000000..cea5d19d33
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_suite.cc
@@ -0,0 +1,61 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <Eina.hh>
+#include <Eina_Js.hh>
+
+#include <check.h>
+
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+
+#ifndef HAVE_NODEJS
+#include "suite_runner.hh"
+void eolian_js_test_register_eolian_js_binding(v8::Handle<v8::Object> exports);
+
+int main(int, char*[])
+{
+ return run_script(TESTS_SRC_DIR "/eolian_js_suite.js", &eolian_js_test_register_eolian_js_binding);
+}
+#else
+#ifdef HAVE_NODE_NODE_H
+#include <node/node.h>
+#elif defined(HAVE_NODEJS_DEPS_NODE_NODE_H)
+#include <nodejs/deps/node/node.h>
+#elif defined(HAVE_NODEJS_DEPS_NODE_INCLUDE_NODE_H)
+#include <nodejs/deps/node/include/node.h>
+#elif defined(HAVE_NODEJS_SRC_NODE_H)
+#include <nodejs/src/node.h>
+#elif defined(HAVE_NODE_H)
+#include <node.h>
+#else
+#error We must have at least one node header to include
+#endif
+void eolian_js_test_register_eolian_js_binding(v8::Handle<v8::Object> exports);
+
+namespace {
+
+void eolian_js_module_init(v8::Handle<v8::Object> exports)
+{
+ fprintf(stderr, "test suite eolian_js_module_init\n"); fflush(stderr);
+ try
+ {
+ eina_init();
+ eo_init();
+ eolian_js_test_register_eolian_js_binding(exports);
+ std::cerr << "registered" << std::endl;
+ }
+ catch(...)
+ {
+ std::cerr << "Error" << std::endl;
+ std::abort();
+ }
+}
+
+}
+
+NODE_MODULE(eolian_js_suite_mod, ::eolian_js_module_init)
+
+#endif
diff --git a/src/tests/eolian_js/eolian_js_suite.js b/src/tests/eolian_js/eolian_js_suite.js
new file mode 100755
index 0000000000..146127323e
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_suite.js
@@ -0,0 +1,796 @@
+#!/usr/bin/env node
+
+// Preamble //
+function assert(condition, message) {
+ if (!condition) {
+ print("Assertion failed ", message);
+ throw new Error(message || "Assertion failed");
+ }
+}
+
+if(typeof process !== 'undefined')
+{
+ console.log('running from nodejs');
+ console.log('path', process.env.NODE_PATH);
+ console.log("teste1");
+
+ efl = require('efl');
+ assert(efl != null, "could not load efl node module");
+
+ // Setup output aliases
+ print = console.log;
+ printError = function() {
+ if (process.argv.indexOf("--supress-errors") == -1)
+ console.error.apply(null, arguments);
+ };
+ printInfo = function() {
+ if (process.argv.indexOf("--verbose") != -1)
+ console.info.apply(null, arguments);
+ };
+ exit = efl.ecore_mainloop_quit;
+}
+else
+{
+ assert = function(test, message) { if (test !== true) throw message; };
+ print('running from libv8')
+ //FIXME Add levels to v8 tests
+ printError = print
+ printInfo = print
+ exit = function() {}
+}
+
+// Global flag for suite success //
+suiteSuccess = true;
+// Global test summary
+suiteOk = 0;
+suiteFail = []; // Will store the name of the failures
+
+// Basic test function //
+function startTest(testName, testFunc) {
+ print("[ RUN ] eolian_js_suite: " + testName);
+ var testResult = true;
+ try {
+ testFunc();
+ } catch (e) {
+ suiteSuccess = false;
+ testResult = false;
+ printError("Error: ", e, e.stack);
+ }
+ print("[ " + (testResult ? "PASS" : "FAIL") + " ] eolian_js_suite: " + testName);
+ if (testResult)
+ suiteOk += 1;
+ else
+ suiteFail.push(testName);
+}
+// end Preamble
+
+// eolian Preamble
+if (typeof process != "undefined")
+{
+ suite = require('eolian_js_suite_mod');
+ assert(suite != null, "could not load eolian_js_suite_mod");
+ ConstructorMethodClass = suite.ConstructorMethodClass;
+ TestObject = suite.Test.Object;
+}
+else
+{
+ ConstructorMethodClass = suite.ConstructorMethodClass;
+ TestObject = suite.Test.Object;
+}
+
+function expectException(func) {
+ var exceptionCaught = false;
+ try {
+ func();
+ } catch (e) {
+ exceptionCaught = true;
+ }
+ assert(exceptionCaught, "Exception expected but not thrown!");
+}
+// end eolian Preamble
+
+// Test cases //
+startTest("constructor_null_parent", function() {
+ var obj = new TestObject(null);
+ assert(obj !== null);
+});
+
+startTest("integral_in_and_out_parameters", function() {
+ var obj = new TestObject(null);
+
+ var expectedValue = 1234;
+ obj.methodIntegralInA(expectedValue);
+
+ var actualValue = obj.methodIntegralOutA();
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+});
+
+startTest("integral_inout_parameter", function() {
+ var obj = new TestObject(null);
+
+ var expectedValue = 1234;
+ var actualValue = obj.methodIntegralInout(-expectedValue);
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+
+ var expectedValue = -4321;
+ var actualValue = obj.methodIntegralInout(-expectedValue);
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+});
+
+startTest("integral_return_value", function() {
+ var obj = new TestObject(null);
+
+ var expectedValue = 1234;
+ obj.methodIntegralInA(expectedValue);
+
+ var actualValue = obj.methodIntegralReturnA();
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+});
+
+startTest("more_parameters_than_expected_is_ok", function() {
+ var obj = new TestObject(null);
+ var expectedValue = 1234;
+ obj.methodIntegralInA(expectedValue, 4321);
+
+ var actualValue = obj.methodIntegralOutA();
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+});
+
+startTest("less_parameters_that_expected_fails", function() {
+ var obj = new TestObject(null);
+ expectException(function() {
+ obj.methodIntegralInA();
+ });
+});
+
+startTest("wrong_parameter_type_fails", function() {
+ var obj = new TestObject(null);
+ expectException(function() {
+ obj.methodIntegralInA('string');
+ });
+});
+
+startTest("mixed_in_out_and_result", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodDivMod(7, 3);
+ var success = ret[0];
+ var quotient = ret[1];
+ var remainder = ret[2];
+ assert(success);
+ assert(2 == quotient);
+ assert(1 == remainder);
+
+ ret = obj.methodDivMod(42, 0);
+ success = ret[0];
+ assert(!success);
+});
+
+startTest("boolean", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodAnd(false, false);
+ assert(ret == false);
+ ret = obj.methodAnd(false, true);
+ assert(ret == false);
+ ret = obj.methodAnd(true, false);
+ assert(ret == false);
+ ret = obj.methodAnd(true, true);
+ assert(ret);
+});
+
+startTest("floating_point", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodModf(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(ret[1] == 3, "ret[1] == 3 (" + ret[1] + " == 3)");
+});
+
+startTest("string_inout", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodUppercase('hello world');
+ assert(ret == "HELLO WORLD", "ret == " + ret);
+});
+
+startTest("in_null_string", function() {
+ var obj = new TestObject(null);
+ var success = obj.methodInNull(null);
+ assert(success, "success == " + success);
+});
+
+
+startTest("out_null_string", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodOutNull();
+ assert(ret[0], "success == " + ret[0]);
+ assert(ret[1] === null, "output == " + ret[1]);
+});
+
+
+startTest("inout_null_string", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodInoutNull(null);
+ assert(ret[0], "success == " + ret[0]);
+ assert(ret[1] === null, "output == " + ret[1]);
+});
+
+
+startTest("return_null_string", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodReturnNull();
+ assert(ret === null, "ret == " + ret);
+});
+
+
+startTest("null_values", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodNull(null, null);
+ assert(ret[0] === null, "ret == " + ret[0]);
+ assert(ret[1] === null, "ret == " + ret[1]);
+ assert(ret[2] === null, "ret == " + ret[2]);
+});
+
+startTest("enum_values", function() {
+ var obj = new TestObject(null);
+ var ret = obj.methodInEnumReturnEnum(suite.Test.EnumEx.SECOND);
+ assert(ret === suite.Test.EnumEx.SECOND);
+ var value = suite.Test.EnumEx.THIRD;
+ assert(value === 2);
+ ret = obj.methodInEnumReturnEnum(value);
+ assert(ret === value);
+});
+
+startTest("struct_values", function() {
+ var obj = new TestObject(null);
+ var newStruct = new suite.Test.StructEx;
+ newStruct.valueInt = 42;
+ newStruct.valueEnum = suite.Test.EnumEx.FOURTH;
+ var ret = newStruct.valueInt;
+ assert(ret === 42);
+ ret = newStruct.valueEnum;
+ assert(ret === suite.Test.EnumEx.FOURTH);
+ ret = obj.methodInStructReturnStruct(newStruct);
+ assert(ret.valueInt === 42);
+ assert(ret.valueEnum === suite.Test.EnumEx.FOURTH);
+});
+
+startTest("event_simple", function() {
+ var v = false;
+ var obj = new TestObject(null);
+ var ret = obj.on
+ ("test",
+ function()
+ {
+ printInfo('Event called')
+ v = true;
+ }
+ );
+ printInfo('going to call event');
+ obj.callEvent();
+ printInfo('is event called?');
+ assert(v);
+});
+
+startTest("event_object_call", function() {
+ var v = false;
+ var obj = new TestObject(null);
+ var ret = obj.on
+ ("test",
+ function()
+ {
+ printInfo('Event called');
+ var o = arguments[0];
+ assert(o != null);
+ var expectedValue = 1234;
+ o.methodIntegralInA(expectedValue);
+ var actualValue = o.methodIntegralOutA();
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+ v = true;
+ }
+ );
+ printInfo('going to call event');
+ obj.callEvent();
+ printInfo('is event called?');
+ assert(v);
+});
+
+startTest("event_structarg", function() {
+ var v = false;
+ var obj = new TestObject(null);
+ var ret = obj.on
+ ("test_structarg",
+ function()
+ {
+ printInfo('Event called');
+ var s = arguments[1];
+ assert(s != null);
+ assert(s.valueInt === 42);
+ assert(s.valueEnum === suite.Test.EnumEx.THIRD);
+ v = true;
+ }
+ );
+ printInfo('going to call event');
+ obj.callEvent();
+ printInfo('is event called?');
+ assert(v);
+});
+
+startTest("event_stringarg", function() {
+ var v = false;
+ var obj = new TestObject(null);
+ var ret = obj.on
+ ("test_stringarg",
+ function()
+ {
+ printInfo('Event called');
+ var s = arguments[1];
+ assert(s === "foo");
+ v = true;
+ }
+ );
+ printInfo('going to call event');
+ obj.callEvent();
+ printInfo('is event called?');
+ assert(v);
+});
+
+// // TODO: disabled. Not implemented yet
+// startTest("integral_array", function() {
+// var obj = new TestObject(null);
+// var ret = obj.methodArrayAt([1, 2, 3, 4, 5], 1);
+// assert(ret == 2, "ret == " + ret);
+// });
+
+startTest("array_in_array_out", function() {
+ var obj = new TestObject(null);
+ var newArray = obj.methodArrayWith42();
+ assert(newArray != null);
+ var arr = obj.methodArrayInArrayOut(newArray);
+ assert(arr != null);
+ assert(arr[0] === 42);
+ assert(newArray[0] === arr[0]);
+});
+
+startTest("method_array_of_objects", function() {
+ var obj = new TestObject(null);
+ var arr = obj.methodArrayOfObjects(null);
+ assert(arr != null);
+ assert(arr[0] != null);
+ arr = obj.methodArrayOfObjects(arr);
+ assert(arr != null);
+ var v = arr[0];
+ assert(v != null);
+ // assert(v == obj); // TODO: check if same Eo object pointer?
+ var expectedValue = 1234;
+ v.methodIntegralInA(expectedValue);
+ var actualValue = v.methodIntegralOutA();
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+});
+
+// FIXME
+// startTest("method_array_of_strings", function() {
+// var obj = new TestObject(null);
+// var arr = obj.methodArrayOfStrings(null);
+// assert(arr != null);
+// assert(arr[0] === "foo");
+// arr = obj.methodArrayOfStrings(arr);
+// assert(arr != null);
+// assert(arr[0] === "foo");
+// });
+
+startTest("method_array_of_ints", function() {
+ var obj = new TestObject(null);
+ var arr = obj.methodArrayOfInts(null);
+ assert(arr != null);
+ assert(arr[0] === 42);
+ arr = obj.methodArrayOfInts(arr);
+ assert(arr != null);
+ assert(arr[0] === 42);
+});
+
+startTest("method_array_of_bools", function() {
+ var obj = new TestObject(null);
+ var arr = obj.methodArrayOfBools(null);
+ assert(arr != null);
+ assert(arr[0] === true);
+ arr = obj.methodArrayOfBools(arr);
+ assert(arr != null);
+ assert(arr[0] === true);
+});
+
+startTest("method_array_of_doubles", function() {
+ var obj = new TestObject(null);
+ var arr = obj.methodArrayOfDoubles(null);
+ assert(arr != null);
+ assert(arr[0] === 42.0);
+ arr = obj.methodArrayOfDoubles(arr);
+ assert(arr != null);
+ assert(arr[0] === 42.0);
+});
+
+startTest("method_array_of_enums", function() {
+ var obj = new TestObject(null);
+ var arr = obj.methodArrayOfEnums(null);
+ assert(arr != null);
+ assert(arr[0] === suite.Test.EnumEx.THIRD);
+ arr = obj.methodArrayOfEnums(arr);
+ assert(arr != null);
+ assert(arr[0] === suite.Test.EnumEx.THIRD);
+});
+
+startTest("method_array_of_structs", function() {
+ var obj = new TestObject(null);
+ var arr = obj.methodArrayOfStructs(null);
+ assert(arr != null);
+ var s = arr[0];
+ assert(s != null);
+ assert(s.valueInt === 42);
+ assert(s.valueEnum === suite.Test.EnumEx.THIRD);
+ arr = obj.methodArrayOfStructs(arr);
+ s = arr[0];
+ assert(s != null);
+ assert(s.valueInt === 42);
+ assert(s.valueEnum === suite.Test.EnumEx.THIRD);
+});
+
+startTest("list_in_list_out", function() {
+ var obj = new TestObject(null);
+ var newList = obj.methodListWith42();
+ assert(newList != null);
+ var lis = obj.methodListInListOut(newList);
+ assert(lis != null);
+ // assert(lis == newList); // TODO: check same list pointer?
+ assert(lis[0] === 42);
+ assert(newList[0] === lis[0]);
+});
+
+startTest("method_list_of_objects", function() {
+ var obj = new TestObject(null);
+ var lis = obj.methodListOfObjects(null);
+ assert(lis != null);
+ assert(lis[0] != null);
+ lis = obj.methodListOfObjects(lis);
+ assert(lis != null);
+ var v = lis[0];
+ assert(v != null);
+ // assert(v == obj); // TODO: check if same Eo object pointer?
+ var expectedValue = 1234;
+ v.methodIntegralInA(expectedValue);
+ var actualValue = v.methodIntegralOutA();
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+});
+
+// FIXME
+// startTest("method_list_of_strings", function() {
+// var obj = new TestObject(null);
+// var lis = obj.methodListOfStrings(null);
+// assert(lis != null);
+// assert(lis[0] === "foo");
+// lis = obj.methodListOfStrings(lis);
+// assert(lis != null);
+// assert(lis[0] === "foo");
+// });
+
+startTest("method_list_of_ints", function() {
+ var obj = new TestObject(null);
+ var lis = obj.methodListOfInts(null);
+ assert(lis != null);
+ assert(lis[0] === 42);
+ lis = obj.methodListOfInts(lis);
+ assert(lis != null);
+ assert(lis[0] === 42);
+});
+
+startTest("method_list_of_bools", function() {
+ var obj = new TestObject(null);
+ var lis = obj.methodListOfBools(null);
+ assert(lis != null);
+ assert(lis[0] === true);
+ lis = obj.methodListOfBools(lis);
+ assert(lis != null);
+ assert(lis[0] === true);
+});
+
+startTest("method_list_of_doubles", function() {
+ var obj = new TestObject(null);
+ var lis = obj.methodListOfDoubles(null);
+ assert(lis != null);
+ assert(lis[0] === 42.0);
+ lis = obj.methodListOfDoubles(lis);
+ assert(lis != null);
+ assert(lis[0] === 42.0);
+});
+
+startTest("method_list_of_enums", function() {
+ var obj = new TestObject(null);
+ var lis = obj.methodListOfEnums(null);
+ assert(lis != null);
+ assert(lis[0] === suite.Test.EnumEx.THIRD);
+ lis = obj.methodListOfEnums(lis);
+ assert(lis != null);
+ assert(lis[0] === suite.Test.EnumEx.THIRD);
+});
+
+startTest("method_list_of_structs", function() {
+ var obj = new TestObject(null);
+ var lis = obj.methodListOfStructs(null);
+ assert(lis != null);
+ var s = lis[0];
+ assert(s != null);
+ assert(s.valueInt === 42);
+ assert(s.valueEnum === suite.Test.EnumEx.THIRD);
+ lis = obj.methodListOfStructs(lis);
+ s = lis[0];
+ assert(s != null);
+ assert(s.valueInt === 42);
+ assert(s.valueEnum === suite.Test.EnumEx.THIRD);
+});
+
+startTest("method_accessor_of_objects", function() {
+ var obj = new TestObject(null);
+ var acc = obj.methodAccessorOfObjects(null);
+ assert(acc != null);
+ assert(acc.get(0) != null);
+ acc = obj.methodAccessorOfObjects(acc);
+ assert(acc != null);
+ var v = acc.get(0);
+ assert(v != null);
+ var expectedValue = 1234;
+ v.methodIntegralInA(expectedValue);
+ var actualValue = v.methodIntegralOutA();
+ assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
+});
+
+// FIXME
+// startTest("method_accessor_of_strings", function() {
+// var obj = new TestObject(null);
+// var acc = obj.methodAccessorOfStrings(null);
+// assert(acc != null);
+// assert(acc.get(0) === "foo");
+// acc = obj.methodAccessorOfStrings(acc);
+// assert(acc != null);
+// assert(acc.get(0) === "foo");
+// });
+
+startTest("method_accessor_of_ints", function() {
+ var obj = new TestObject(null);
+ var acc = obj.methodAccessorOfInts(null);
+ assert(acc != null);
+ assert(acc.get(0) === 42);
+ acc = obj.methodAccessorOfInts(acc);
+ assert(acc != null);
+ assert(acc.get(0) === 42);
+});
+
+startTest("method_accessor_of_bools", function() {
+ var obj = new TestObject(null);
+ var acc = obj.methodAccessorOfBools(null);
+ assert(acc != null);
+ assert(acc.get(0) === true);
+ acc = obj.methodAccessorOfBools(acc);
+ assert(acc != null);
+ assert(acc.get(0) === true);
+});
+
+startTest("method_accessor_of_doubles", function() {
+ var obj = new TestObject(null);
+ var acc = obj.methodAccessorOfDoubles(null);
+ assert(acc != null);
+ assert(acc.get(0) === 42.0);
+ acc = obj.methodAccessorOfDoubles(acc);
+ assert(acc != null);
+ assert(acc.get(0) === 42.0);
+});
+
+startTest("method_accessor_of_enums", function() {
+ var obj = new TestObject(null);
+ var acc = obj.methodAccessorOfEnums(null);
+ assert(acc != null);
+ assert(acc.get(0) === suite.Test.EnumEx.THIRD);
+ acc = obj.methodAccessorOfEnums(acc);
+ assert(acc != null);
+ assert(acc.get(0) === suite.Test.EnumEx.THIRD);
+});
+
+startTest("method_accessor_of_structs", function() {
+ var obj = new TestObject(null);
+ var acc = obj.methodAccessorOfStructs(null);
+ assert(acc != null);
+ var s = acc.get(0);
+ assert(s != null);
+ assert(s.valueInt === 42);
+ assert(s.valueEnum === suite.Test.EnumEx.THIRD);
+ acc = obj.methodAccessorOfStructs(acc);
+ assert(acc != null);
+ s = acc.get(0);
+ assert(s != null);
+ assert(s.valueInt === 42);
+ assert(s.valueEnum === suite.Test.EnumEx.THIRD);
+});
+
+// Combinations of complex types //
+
+// FIXME
+// startTest("method_array_of_arrays_of_ints", function() {
+// var obj = new TestObject(null);
+// var arr = obj.methodArrayOfArraysOfInts(null);
+// assert(arr != null);
+// var a = arr[0];
+// assert(a != null);
+// assert(a[0] === 42);
+// arr = obj.methodArrayOfArraysOfInts(arr);
+// assert(arr != null);
+// a = arr[0];
+// assert(a != null);
+// assert(a[0] === 42);
+// });
+
+// FIXME
+// startTest("method_list_of_lists_of_ints", function() {
+// var obj = new TestObject(null);
+// var lis = obj.methodListOfListsOfInts(null);
+// assert(lis != null);
+// var l = lis[0];
+// assert(l != null);
+// assert(l[0] === 42);
+// lis = obj.methodListOfListsOfInts(lis);
+// assert(lis != null);
+// l = lis[0];
+// assert(l != null);
+// assert(l[0] === 42);
+// });
+
+// FIXME
+// startTest("method_array_of_lists_of_ints", function() {
+// var obj = new TestObject(null);
+// var arr = obj.methodArrayOfListsOfInts(null);
+// assert(arr != null);
+// var l = arr[0];
+// assert(l != null);
+// assert(l[0] === 42);
+// arr = obj.methodArrayOfListsOfInts(arr);
+// assert(arr != null);
+// l = arr[0];
+// assert(l != null);
+// assert(l[0] === 42);
+// });
+
+// FIXME
+// startTest("method_list_of_arrays_of_ints", function() {
+// var obj = new TestObject(null);
+// var lis = obj.methodListOfArraysOfInts(null);
+// assert(lis != null);
+// var a = lis[0];
+// assert(a != null);
+// assert(a[0] === 42);
+// lis = obj.methodListOfArraysOfInts(lis);
+// assert(lis != null);
+// a = lis[0];
+// assert(a != null);
+// assert(a[0] === 42);
+// });
+
+startTest("new Constructor_Method_Class", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ assert(obj);
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class method1", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ obj.method1(2);
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class method2", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ var r = obj.method2(3);
+ assert(r === 5);
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class method3", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ obj.method3(3, 11.1);
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class method4", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ var r = obj.method4(3, 11.1);
+ assert(r == 5);
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class method3 less parameters than expected", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ expectException(function() {
+ obj.method3(3);
+ });
+});
+
+startTest("Constructor_Method_Class constructor less parameters than expected", function() {
+ expectException(function() {
+ var obj = new ConstructorMethodClass(null, 5);
+ });
+});
+
+startTest("Constructor_Method_Class constructor wrong parameter types", function() {
+ expectException(function() {
+ var obj = new ConstructorMethodClass(null, 5.1, 10);
+ });
+});
+
+// Out parameters //
+
+startTest("Constructor_Method_Class outmethod1", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ var r = obj.outmethod1();
+ assert(r == 5);
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class outmethod2", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ var r = obj.outmethod2();
+ assert(Array.isArray(r));
+ printInfo("Return is array from outmethod2");
+ assert(r[0] == 11);
+ assert(r[1] == 10);
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class outmethod3", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ var r = obj.outmethod3();
+ assert(Array.isArray(r));
+ printInfo("Return is array from outmethod3");
+ assert(r[0] == 11);
+ assert(r[1] == 5.1);
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class classoutmethod1", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ var c = obj.classoutmethod1(5, 10.0);
+ assert(c);
+ var r = c.method4(3, 11.1);
+ assert(r == 5);
+ assert(c.getFail() == false, "object fail flag set");
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("Constructor_Method_Class classoutmethod2", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ printInfo('1');
+ var c = obj.classoutmethod2(5, 10.0);
+ assert(c);
+ var r = c.method4(3, 11.1);
+ assert(r);
+ assert(r == 5);
+ assert(c.getFail() == false, "object fail flag set");
+ assert(obj.getFail() == false, "object fail flag set");
+});
+
+startTest("cast", function() {
+ var obj = new ConstructorMethodClass(null, 5, 10.0);
+ var c = obj.classoutmethod1(5, 10.0);
+ print('classoutmethod1');
+ assert(c);
+ var d = c.cast('Constructor_Method_Class');
+ assert(d);
+});
+
+if (!suiteSuccess) {
+ print ("[ Total tests run: %s ]", suiteOk + suiteFail.length);
+ print ("[ Total successful: %s ]", suiteOk);
+ print ("[ Total failures: %s ]", suiteFail.length);
+ print ("[ Tests failed: ]");
+ for (var i = 0; i < suiteFail.length; i++) {
+ print ("[ %s]", suiteFail[i]);
+ };
+ assert(false, "[ Test suite fail ]");
+} else {
+ print ("[ Test execution with success ]");
+ print ("[ Total tests run: %s ]", suiteOk);
+}
+
+exit();
diff --git a/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c b/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c
new file mode 100644
index 0000000000..1f454ebbf2
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c
@@ -0,0 +1,147 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Eo.h>
+#include <Ecore.h>
+
+#include <stdlib.h>
+
+#include "constructor_method_class.eo.h"
+
+#include <check.h>
+
+struct _Constructor_Method_Class_Data
+{
+ Eina_Bool fail;
+};
+typedef struct _Constructor_Method_Class_Data Constructor_Method_Class_Data;
+
+#define MY_CLASS CONSTRUCTOR_METHOD_CLASS_CLASS
+
+EOLIAN static Eo_Base *
+_constructor_method_class_eo_base_constructor(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd)
+{
+ pd->fail = EINA_FALSE;
+ return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
+}
+
+EOLIAN static void
+_constructor_method_class_constructor1(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one)
+{
+ fprintf(stderr, "one == %d\n", one);
+ fflush(stderr);
+ if (one != 5)
+ pd->fail = EINA_TRUE;
+}
+
+EOLIAN static void
+_constructor_method_class_constructor2(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, double two)
+{
+ fprintf(stderr, "two == %f\n", two);
+ fflush(stderr);
+ if (two != 10.0)
+ pd->fail = EINA_TRUE;
+}
+
+EOLIAN static Eo *
+_constructor_method_class_eo_base_finalize(Eo *obj, Constructor_Method_Class_Data *pd)
+{
+ if (pd->fail)
+ return NULL;
+
+ return eo_do_super_ret(obj, MY_CLASS, obj, eo_finalize());
+}
+
+EOLIAN static Eina_Bool
+_constructor_method_class_fail_get(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd)
+{
+ return pd->fail;
+}
+
+EOLIAN static void
+_constructor_method_class_method1(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one)
+{
+ fprintf(stderr, "method1 one == %d\n", one);
+ fflush(stderr);
+ if (one != 2)
+ pd->fail = EINA_TRUE;
+}
+
+EOLIAN static int
+_constructor_method_class_method2(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one)
+{
+ fprintf(stderr, "method2 one == %d\n", one);
+ fflush(stderr);
+ if (one != 3)
+ pd->fail = EINA_TRUE;
+ return 5;
+}
+
+EOLIAN static void
+_constructor_method_class_method3(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one, double two)
+{
+ fprintf(stderr, "method3 one == %d two == %f\n", one, two);
+ fflush(stderr);
+ if (one != 3)
+ pd->fail = EINA_TRUE;
+ if (two != 11.1)
+ pd->fail = EINA_TRUE;
+}
+
+EOLIAN static int
+_constructor_method_class_method4(Eo * obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one, double two)
+{
+ fprintf(stderr, "method4 one == %d two == %f\n", one, two);
+ fflush(stderr);
+ if (one != 3)
+ pd->fail = EINA_TRUE;
+ if (two != 11.1)
+ pd->fail = EINA_TRUE;
+ return 5;
+}
+
+EOLIAN static void
+_constructor_method_class_outmethod1(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int *one)
+{
+ fprintf(stderr, "outmethod1\n");
+ fflush(stderr);
+ *one = 5;
+}
+
+EOLIAN static int
+_constructor_method_class_outmethod2(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int *one)
+{
+ fprintf(stderr, "outmethod2\n");
+ fflush(stderr);
+ *one = 10;
+ return 11;
+}
+
+EOLIAN static void
+_constructor_method_class_outmethod3(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int *one, double *two)
+{
+ fprintf(stderr, "outmethod3\n");
+ fflush(stderr);
+ *one = 11;
+ *two = 5.1;
+}
+
+EOLIAN static Constructor_Method_Class *
+_constructor_method_class_classoutmethod1(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int one, double two)
+{
+ fprintf(stderr, "classoutmethod1\n");
+ fflush(stderr);
+ return eo_add(MY_CLASS, NULL, constructor_method_class_constructor1(one), constructor_method_class_constructor2(two));
+}
+
+EOLIAN static void
+_constructor_method_class_classoutmethod2(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int one, double two, Constructor_Method_Class **out_class)
+{
+ fprintf(stderr, "classoutmethod2\n");
+ fflush(stderr);
+ *out_class = eo_add(MY_CLASS, NULL, constructor_method_class_constructor1(one), constructor_method_class_constructor2(two));
+}
+
+
+#include <constructor_method_class.eo.c>
diff --git a/src/tests/eolian_js/eolian_js_test_eolian_js_binding.cc b/src/tests/eolian_js/eolian_js_test_eolian_js_binding.cc
new file mode 100644
index 0000000000..dbdd016a34
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_test_eolian_js_binding.cc
@@ -0,0 +1,44 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Eo_Js.hh>
+#include <Eina.hh>
+#include <Eo.hh>
+
+#include <check.h>
+
+
+#include <iostream>
+#include <cassert>
+#include <fstream>
+
+typedef struct _Elm_Calendar_Mark Elm_Calendar_Mark;
+
+#include "constructor_method_class.eo.js.cc"
+#include "test_object.eo.js.cc"
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# define EAPI __declspec(dllimport)
+#else
+# ifdef __GNUC__
+# if __GNUC__ >= 4
+# define EAPI __attribute__ ((visibility("default")))
+# else
+# define EAPI
+# endif
+# else
+# define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+void eolian_js_test_register_eolian_js_binding(v8::Handle<v8::Object> exports)
+{
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ test::register_object(exports, isolate);
+ register_constructor_method_class(exports, isolate);
+}
diff --git a/src/tests/eolian_js/eolian_js_test_evas_box.cc b/src/tests/eolian_js/eolian_js_test_evas_box.cc
new file mode 100644
index 0000000000..e859f2a24f
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_test_evas_box.cc
@@ -0,0 +1,151 @@
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Eo_Js.hh>
+#include <Eina.hh>
+#include <Eo.hh>
+
+#include <check.h>
+
+#include <iostream>
+
+#include <cassert>
+#include <tuple>
+
+namespace evas {
+EAPI void register_box(v8::Handle<v8::Object> global, v8::Isolate* isolate);
+}
+
+namespace {
+
+static const char script[] =
+ "function assert(condition, message) {\n"
+ " if (!condition) {\n"
+ " print(\"Assertion failed \", message);\n"
+ " throw message || \"Assertion failed\";\n"
+ " }\n"
+ "}\n"
+ "print(\"teste\");\n"
+ "x = new Box();\n"
+ ;
+
+const char* ToCString(const v8::String::Utf8Value& value) {
+ return *value ? *value : "<string conversion failed>";
+}
+
+// Executes a string within the current v8 context.
+bool ExecuteString(v8::Isolate* isolate,
+ v8::Handle<v8::String> source,
+ v8::Handle<v8::Value> name)
+{
+ efl::eina::js::compatibility_handle_scope handle_scope(isolate);
+ v8::TryCatch try_catch;
+ v8::ScriptOrigin origin(name);
+ v8::Handle<v8::Script> script = v8::Script::Compile(source, &origin);
+ if (script.IsEmpty()) {
+ std::abort();
+ // Print errors that happened during compilation.
+ // if (report_exceptions)
+ // ReportException(isolate, &try_catch);
+ return false;
+ }
+ else
+ {
+ v8::Handle<v8::Value> result = script->Run();
+ if (result.IsEmpty()) {
+ std::cout << "Failed with exception thrown" << std::endl;
+ assert(try_catch.HasCaught());
+ std::abort();
+ // Print errors that happened during execution.
+ // if (report_exceptions)
+ // ReportException(isolate, &try_catch);
+ return false;
+ } else {
+ assert(!try_catch.HasCaught());
+ // if (print_result && !result->IsUndefined()) {
+ // // If all went well and the result wasn't undefined then print
+ // // the returned value.
+ // v8::String::Utf8Value str(result);
+ // const char* cstr = ToCString(str);
+ // printf("%s\n", cstr);
+ // }
+ return true;
+ }
+ }
+}
+
+efl::eina::js::compatibility_return_type Print(efl::eina::js::compatibility_callback_info_type args) {
+ bool first = true;
+ for (int i = 0; i < args.Length(); i++) {
+ efl::eina::js::compatibility_handle_scope handle_scope(args.GetIsolate());
+ if (first) {
+ first = false;
+ } else {
+ printf(" ");
+ }
+ v8::String::Utf8Value str(args[i]);
+ const char* cstr = ToCString(str);
+ printf("%s", cstr);
+ }
+ printf("\n");
+ fflush(stdout);
+}
+
+START_TEST(eolian_js_test_evas_box)
+{
+ int argc = 1;
+ const char* argv[] = {"test"};
+ efl::eina::eina_init eina_init;
+ efl::eo::eo_init eo_init;
+
+ //v8::V8::InitializeICU();
+ v8::V8::Initialize();
+ v8::V8::SetFlagsFromCommandLine(&argc, const_cast<char**>(argv), true);
+
+ v8::Isolate* isolate = efl::eina::js::compatibility_isolate_new();
+
+ v8::Isolate::Scope isolate_scope(isolate);
+
+ assert(isolate != 0);
+
+ v8::Handle<v8::Context> context;
+ efl::eina::js::compatibility_handle_scope handle_scope(isolate);
+
+ {
+ // Create a template for the global object.
+ v8::Handle<v8::ObjectTemplate> global = efl::eina::js::compatibility_new<v8::ObjectTemplate>(isolate);
+ // Bind the global 'print' function to the C++ Print callback.
+ global->Set(efl::eina::js::compatibility_new<v8::String>(isolate, "print"),
+ efl::eina::js::compatibility_new<v8::FunctionTemplate>(isolate, Print));
+
+ context = efl::eina::js::compatibility_new<v8::Context>(isolate, nullptr, global);
+
+ }
+ if (context.IsEmpty()) {
+ fprintf(stderr, "Error creating context\n");
+ }
+ context->Enter();
+ {
+ // Enter the execution environment before evaluating any code.
+ v8::Context::Scope context_scope(context);
+ v8::Local<v8::String> name(efl::eina::js::compatibility_new<v8::String>(/*context->GetIsolate()*/nullptr, "(shell)"));
+
+ evas::register_box(context->Global(), isolate);
+
+ efl::eina::js::compatibility_handle_scope handle_scope(/*context->GetIsolate()*/nullptr);
+ ExecuteString(/*context->GetIsolate()*/isolate,
+ efl::eina::js::compatibility_new<v8::String>/*FromUtf8*/(/*context->GetIsolate()*/nullptr, script),
+ name);
+ }
+ context->Exit();
+}
+END_TEST
+
+}
+
+void eolian_js_test_evas_box(TCase* tc)
+{
+ tcase_add_test(tc, eolian_js_test_evas_box);
+}
diff --git a/src/tests/eolian_js/eolian_js_test_test_object_impl.c b/src/tests/eolian_js/eolian_js_test_test_object_impl.c
new file mode 100644
index 0000000000..6f35b7ecdd
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_test_test_object_impl.c
@@ -0,0 +1,620 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <Eo.h>
+#include <Ecore.h>
+
+#include "test_object.eo.h"
+
+#include <check.h>
+
+#include <assert.h>
+#include <ctype.h>
+#include <math.h>
+#include <stdlib.h>
+
+struct _Test_Object_Data
+{
+ int a;
+};
+
+typedef struct _Test_Object_Data Test_Object_Data;
+
+#define MY_CLASS TEST_OBJECT_CLASS
+
+EOLIAN static Eo_Base *
+_test_object_eo_base_constructor(Eo* obj, Test_Object_Data *pd)
+{
+ fprintf(stdout, "_test_object_eo_base_constructor\n");
+
+ pd->a = 0;
+ return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
+}
+
+EOLIAN static Eo *
+_test_object_eo_base_finalize(Eo *obj, Test_Object_Data *pd EINA_UNUSED)
+{
+ fprintf(stdout, "_test_object_eo_base_finalize\n");
+
+ return eo_do_super_ret(obj, MY_CLASS, obj, eo_finalize());
+}
+
+EOLIAN static void
+_test_object_eo_base_destructor(Eo* obj, Test_Object_Data *pd EINA_UNUSED)
+{
+ fprintf(stdout, "_test_object_eo_base_destructor\n");
+ eo_do_super(obj, MY_CLASS, eo_destructor());
+}
+
+
+EOLIAN static void
+_test_object_method_integral_in_a(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd,
+ int a)
+{
+ fprintf(stdout, "_test_object_method_integral_in_a(%d)\n", a);
+ pd->a = a;
+}
+
+EOLIAN static void
+_test_object_method_integral_out_a(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd,
+ int *a)
+{
+ fprintf(stdout, "_test_object_method_integral_out_a(%p)\n", a);
+ *a = pd->a;
+}
+
+EOLIAN static void
+_test_object_method_integral_inout(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ int *a)
+{
+ fprintf(stdout, "_test_object_method_integral_inout(%d [%p])\n", *a, a);
+ *a = -(*a);
+}
+
+EOLIAN static int
+_test_object_method_integral_return_a(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd)
+{
+ fprintf(stdout, "_test_object_method_integral_return_a()\n");
+ return pd->a;
+}
+
+EOLIAN static Eina_Bool
+_test_object_method_div_mod(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ int a,
+ int b,
+ int *quotient,
+ int *remainder)
+{
+ fprintf(stdout, "_test_object_method_div_mod(%d, %d, %p, %p)\n", a, b, quotient, remainder);
+ if (0 == b) return EINA_FALSE;
+ *quotient = a / b;
+ *remainder = a % b;
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_test_object_method_and(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Bool a,
+ Eina_Bool b)
+{
+ fprintf(stdout, "_test_object_method_and(%d, %d)\n", a, b);
+ return a && b;
+}
+
+EOLIAN static double
+_test_object_method_modf(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ double x,
+ double *int_part)
+{
+ fprintf(stdout, "_test_object_method_modf(%f, %p)\n", x, int_part);
+ return modf(x, int_part);
+}
+
+EOLIAN static void
+_test_object_method_uppercase(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ char **str)
+{
+ fprintf(stdout, "_test_object_method_uppercase('%s')\n", *str);
+ if (!*str) return;
+
+ char *p = *str;
+ while ('\0' != *p)
+ {
+ *p = toupper(*p);
+ p++;
+ }
+}
+
+EOLIAN static Eina_Bool
+_test_object_method_in_null(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ char *a)
+{
+ fprintf(stdout, "_test_object_method_in_null(%p)\n", a);
+ return NULL == a;
+}
+
+EOLIAN static Eina_Bool
+_test_object_method_out_null(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ char **a)
+{
+ fprintf(stdout, "_test_object_method_out_null(%p)\n", a);
+ *a = NULL;
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_test_object_method_inout_null(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ char **a)
+{
+ fprintf(stdout, "_test_object_method_inout_null(%p)\n", a);
+ return NULL == *a;
+}
+
+EOLIAN static char *
+_test_object_method_return_null(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED)
+{
+ fprintf(stdout, "_test_object_method_return_null()\n");
+ return NULL;
+}
+
+EOLIAN static void
+_test_object_call_event(Eo* obj, Test_Object_Data *pd EINA_UNUSED)
+{
+ fprintf(stderr, "_test_object_event_call()\n"); fflush(stderr);
+ static Test_Struct_Ex s = {42, TEST_ENUM_EX_THIRD};
+ eo_do(obj, eo_event_callback_call(TEST_OBJECT_EVENT_TEST, NULL));
+ eo_do(obj, eo_event_callback_call(TEST_OBJECT_EVENT_TEST_STRUCTARG, &s));
+ eo_do(obj, eo_event_callback_call(TEST_OBJECT_EVENT_TEST_STRINGARG, "foo"));
+}
+
+EOLIAN static char *
+_test_object_method_null(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ char *in,
+ char **out,
+ char **inout)
+{
+ fprintf(stdout, "_test_object_method_null(%p, %p, %p)\n", in, out, inout);
+ assert(!in);
+ *out = NULL;
+ *inout = NULL;
+ return NULL;
+}
+
+// Arrays //
+
+EOLIAN static int
+_test_object_method_array_at(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *array,
+ int index)
+{
+ fprintf(stdout, "_test_object_method_array_at(%p, %d)\n", array, index);
+ return *((int*)eina_array_data_get(array, index));
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_with_42(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED)
+{
+ fprintf(stdout, "_test_object_method_array_with_42()\n");
+ Eina_Array *arr = eina_array_new(2);
+ int* n = malloc(sizeof(int));
+ *n = 42;
+ eina_array_push(arr, n);
+ return arr;
+}
+
+EOLIAN static void
+_test_object_method_array_in_array_out(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in,
+ Eina_Array **a_out)
+{
+ fprintf(stdout, "_test_object_method_array_in_array_out(%p, %p)\n", a_in, a_out);
+ *a_out = a_in;
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_objects(Eo* obj,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_objects(%p)\n", a_in);
+ if (a_in) return a_in;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, obj);
+ return arr;
+}
+
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_strings(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_strings(%p)\n", a_in);
+ if (a_in) return a_in;
+ Eina_Array *arr = eina_array_new(2);
+ const char* v = "foo";
+ fprintf(stdout, "v = %p\n", v);
+ eina_array_push(arr, v);
+ return arr;
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_ints(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_ints(%p)\n", a_in);
+ if (a_in) return a_in;
+ int *v = malloc(sizeof(int));
+ *v = 42;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return arr;
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_bools(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_bools(%p)\n", a_in);
+ if (a_in) return a_in;
+ Eina_Bool *v = malloc(sizeof(Eina_Bool));
+ *v = EINA_TRUE;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return arr;
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_doubles(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_doubles(%p)\n", a_in);
+ if (a_in) return a_in;
+ double *v = malloc(sizeof(double));
+ *v = 42;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return arr;
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_enums(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_enums(%p)\n", a_in);
+ if (a_in) return a_in;
+ Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
+ *v = TEST_ENUM_EX_THIRD;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return arr;
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_structs(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_structs(%p)\n", a_in);
+ if (a_in) return a_in;
+ Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
+ v->value_int = 42;
+ v->value_enum = TEST_ENUM_EX_THIRD;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return arr;
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_arrays_of_ints(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_arrays_of_ints(%p)\n", a_in);
+ if (a_in) return a_in;
+ int *v = malloc(sizeof(int));
+ *v = 42;
+ Eina_Array *a1 = eina_array_new(2);
+ eina_array_push(a1, v);
+ Eina_Array *a2 = eina_array_new(2);
+ eina_array_push(a2, a1);
+ return a2;
+}
+
+// Lists //
+
+EOLIAN static Eina_List *
+_test_object_method_list_with_42(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED)
+{
+ fprintf(stdout, "_test_object_method_list_with_42()\n");
+ int* n = malloc(sizeof(int));
+ *n = 42;
+ return eina_list_append(NULL, n);
+}
+
+EOLIAN static void
+_test_object_method_list_in_list_out(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in,
+ Eina_List **l_out)
+{
+ fprintf(stdout, "_test_object_method_list_in_list_out(%p , %p)\n", l_in, l_out);
+ *l_out = l_in;
+}
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_objects(Eo* obj,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_objects(%p)\n", l_in);
+ if (l_in) return l_in;
+ return eina_list_append(NULL, obj);
+}
+
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_strings(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_strings(%p)\n", l_in);
+ if (l_in) return l_in;
+ return eina_list_append(NULL, "foo");
+}
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_ints(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_ints(%p)\n", l_in);
+ if (l_in) return l_in;
+ int *v = malloc(sizeof(int));
+ *v = 42;
+ return eina_list_append(NULL, v);
+}
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_bools(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_bools(%p)\n", l_in);
+ if (l_in) return l_in;
+ Eina_Bool *v = malloc(sizeof(Eina_Bool));
+ *v = EINA_TRUE;
+ return eina_list_append(NULL, v);
+}
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_doubles(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_doubles(%p)\n", l_in);
+ if (l_in) return l_in;
+ double *v = malloc(sizeof(double));
+ *v = 42;
+ return eina_list_append(NULL, v);
+}
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_enums(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_enums(%p)\n", l_in);
+ if (l_in) return l_in;
+ Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
+ *v = TEST_ENUM_EX_THIRD;
+ return eina_list_append(NULL, v);
+}
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_structs(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_structs(%p)\n", l_in);
+ if (l_in) return l_in;
+ Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
+ v->value_int = 42;
+ v->value_enum = TEST_ENUM_EX_THIRD;
+ return eina_list_append(NULL, v);
+}
+
+// Accessors //
+
+EOLIAN static Eina_Accessor *
+_test_object_method_accessor_of_objects(Eo* obj,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Accessor *a_in)
+{
+ fprintf(stdout, "_test_object_method_accessor_of_objects(%p)\n", a_in);
+ if (a_in) return a_in;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, obj);
+ return eina_array_accessor_new(arr);
+}
+
+EOLIAN static Eina_Accessor *
+_test_object_method_accessor_of_strings(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Accessor *a_in)
+{
+ fprintf(stdout, "_test_object_method_accessor_of_strings(%p)\n", a_in);
+ if (a_in) return a_in;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, "foo");
+ return eina_array_accessor_new(arr);
+}
+
+EOLIAN static Eina_Accessor *
+_test_object_method_accessor_of_ints(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Accessor *a_in)
+{
+ fprintf(stdout, "_test_object_method_accessor_of_ints(%p)\n", a_in);
+ if (a_in) return a_in;
+ int *v = malloc(sizeof(int));
+ *v = 42;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return eina_array_accessor_new(arr);
+}
+
+EOLIAN static Eina_Accessor *
+_test_object_method_accessor_of_bools(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Accessor *a_in)
+{
+ fprintf(stdout, "_test_object_method_accessor_of_bools(%p)\n", a_in);
+ if (a_in) return a_in;
+ Eina_Bool *v = malloc(sizeof(Eina_Bool));
+ *v = EINA_TRUE;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return eina_array_accessor_new(arr);
+}
+
+EOLIAN static Eina_Accessor *
+_test_object_method_accessor_of_doubles(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Accessor *a_in)
+{
+ fprintf(stdout, "_test_object_method_accessor_of_doubles(%p)\n", a_in);
+ if (a_in) return a_in;
+ double *v = malloc(sizeof(double));
+ *v = 42.0;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return eina_array_accessor_new(arr);
+}
+
+EOLIAN static Eina_Accessor *
+_test_object_method_accessor_of_enums(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Accessor *a_in)
+{
+ fprintf(stdout, "_test_object_method_accessor_of_enums(%p)\n", a_in);
+ if (a_in) return a_in;
+ Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
+ *v = TEST_ENUM_EX_THIRD;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return eina_array_accessor_new(arr);
+}
+
+EOLIAN static Eina_Accessor *
+_test_object_method_accessor_of_structs(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Accessor *a_in)
+{
+ fprintf(stdout, "_test_object_method_accessor_of_structs(%p)\n", a_in);
+ if (a_in) return a_in;
+ Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
+ v->value_int = 42;
+ v->value_enum = TEST_ENUM_EX_THIRD;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return eina_array_accessor_new(arr);
+}
+
+// Combinations of complex types
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_lists_of_ints(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_lists_of_ints(%p)\n", l_in);
+ if (l_in) return l_in;
+ int *v = malloc(sizeof(int));
+ *v = 42;
+ return eina_list_append(NULL, eina_list_append(NULL, v));
+}
+
+EOLIAN static Eina_Array *
+_test_object_method_array_of_lists_of_ints(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_Array *a_in)
+{
+ fprintf(stdout, "_test_object_method_array_of_lists_of_ints(%p)\n", a_in);
+ if (a_in) return a_in;
+ int *v = malloc(sizeof(int));
+ *v = 42;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, eina_list_append(NULL, v));
+ return arr;
+}
+
+EOLIAN static Eina_List *
+_test_object_method_list_of_arrays_of_ints(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Eina_List *l_in)
+{
+ fprintf(stdout, "_test_object_method_list_of_arrays_of_ints(%p)\n", l_in);
+ if (l_in) return l_in;
+ int *v = malloc(sizeof(int));
+ *v = 42;
+ Eina_Array *arr = eina_array_new(2);
+ eina_array_push(arr, v);
+ return eina_list_append(NULL, arr);
+}
+
+EOLIAN static const Eina_List *
+_test_object_method_list_with_opaque_elements(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED)
+{
+ fprintf(stdout, "_test_object_method_list_with_opaque_elements()\n");
+ return NULL;
+}
+
+EOLIAN static Test_Enum_Ex
+_test_object_method_in_enum_return_enum(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Test_Enum_Ex e)
+{
+ fprintf(stdout, "_test_object_method_in_enum_return_enum(%d)\n", e);
+ return e;
+}
+
+EOLIAN static Test_Struct_Ex *
+_test_object_method_in_struct_return_struct(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED,
+ Test_Struct_Ex *s)
+{
+ fprintf(stdout, "_test_object_method_in_struct_return_struct()\n");
+ return s;
+}
+
+EOLIAN static void
+_test_object_event_repeated_event_name(Eo* obj EINA_UNUSED,
+ Test_Object_Data *pd EINA_UNUSED)
+{
+}
+
+#include <test_object.eo.c>
diff --git a/src/tests/eolian_js/test_object.eo b/src/tests/eolian_js/test_object.eo
new file mode 100644
index 0000000000..c292c248e7
--- /dev/null
+++ b/src/tests/eolian_js/test_object.eo
@@ -0,0 +1,305 @@
+enum Test.Enum_Ex {
+ first = 0,
+ second,
+ third,
+ fourth
+}
+
+struct Test.Struct_Ex {
+ value_int: int;
+ value_enum: Test.Enum_Ex;
+}
+
+class Test.Object (Eo.Base) {
+ legacy_prefix: null;
+ methods {
+ method_integral_in_a {
+ [[ tests integral in ]]
+ params { a: int; }
+ }
+ method_integral_out_a {
+ [[ tests integral out ]]
+ params { @out a: int; }
+ }
+ method_integral_inout {
+ [[ tests integral inout ]]
+ params { @inout a: int; }
+ }
+ method_integral_return_a {
+ [[ tests integral result ]]
+ return: int;
+ }
+ method_div_mod {
+ [[ tests mixed in, outs and result ]]
+ params {
+ a: int;
+ b: int;
+ @out quotient: int;
+ @out remainder: int;
+ }
+ return: bool;
+ }
+ method_and {
+ [[ tests boolean ]]
+ params {
+ a: bool;
+ b: bool;
+ }
+ return: bool;
+ }
+ method_modf {
+ [[ tests floating point ]]
+ params {
+ a: double;
+ @out int_part: double;
+ }
+ return: double;
+ }
+ method_uppercase {
+ [[ tests string ]]
+ params {
+ @inout str: char*;
+ }
+ }
+ method_in_null {
+ [[ tests null input ]]
+ params {
+ a: char*;
+ }
+ return: bool;
+ }
+ method_out_null {
+ [[ tests null output ]]
+ params {
+ @out a: char*;
+ }
+ return: bool;
+ }
+ method_inout_null {
+ [[ tests null output ]]
+ params {
+ @inout a: char*;
+ }
+ return: bool;
+ }
+ method_return_null {
+ [[ tests null return ]]
+ return: char*;
+ }
+ method_null {
+ [[ tests null values ]]
+ params {
+ in: char*;
+ @out out: char*;
+ @inout inout: char*;
+ }
+ return: char*;
+ }
+ method_array_at {
+ [[ tests array ]]
+ params {
+ array: array<int>*;
+ index: int;
+ }
+ return: int;
+ }
+ method_array_with_42 {
+ [[ tests parameters ]]
+ return: free(own(array<int> *), eina_array_free) @warn_unused;
+ }
+ method_array_in_array_out {
+ [[ tests parameters ]]
+ params {
+ @in a_in: array<int> *;
+ @out a_out: array<int> *;
+ }
+ }
+ method_array_of_objects {
+ params {
+ @in a_in: array<Test.Object *> *;
+ }
+ return: array<Test.Object *> *;
+ }
+ method_array_of_strings {
+ params {
+ @in a_in: array<const(char) *> *;
+ }
+ return: array<const(char) *> *;
+ }
+ method_array_of_ints {
+ params {
+ @in a_in: array<int> *;
+ }
+ return: array<int> *;
+ }
+ method_array_of_bools {
+ params {
+ @in a_in: array<bool> *;
+ }
+ return: array<bool> *;
+ }
+ method_array_of_doubles {
+ params {
+ @in a_in: array<double> *;
+ }
+ return: array<double> *;
+ }
+ method_array_of_enums {
+ params {
+ @in a_in: array<Test.Enum_Ex> *;
+ }
+ return: array<Test.Enum_Ex> *;
+ }
+ method_array_of_structs {
+ params {
+ @in a_in: array<Test.Struct_Ex> *;
+ }
+ return: array<Test.Struct_Ex> *;
+ }
+ method_list_with_42 {
+ [[ tests parameters ]]
+ return: free(own(list<int> *), eina_list_free) @warn_unused;
+ }
+ method_list_in_list_out {
+ [[ tests parameters ]]
+ params {
+ @in l_in: list<int> *;
+ @out l_out: list<int> *;
+ }
+ }
+ method_list_of_objects {
+ params {
+ @in l_in: list<Test.Object *> *;
+ }
+ return: list<Test.Object *> *;
+ }
+ method_list_of_strings {
+ params {
+ @in l_in: list<const(char) *> *;
+ }
+ return: list<const(char) *> *;
+ }
+ method_list_of_ints {
+ params {
+ @in l_in: list<int> *;
+ }
+ return: list<int> *;
+ }
+ method_list_of_bools {
+ params {
+ @in l_in: list<bool> *;
+ }
+ return: list<bool> *;
+ }
+ method_list_of_doubles {
+ params {
+ @in l_in: list<double> *;
+ }
+ return: list<double> *;
+ }
+ method_list_of_enums {
+ params {
+ @in l_in: list<Test.Enum_Ex> *;
+ }
+ return: list<Test.Enum_Ex> *;
+ }
+ method_list_of_structs {
+ params {
+ @in l_in: list<Test.Struct_Ex> *;
+ }
+ return: list<Test.Struct_Ex> *;
+ }
+ method_accessor_of_objects {
+ params {
+ @in a_in: accessor<Test.Object *> *;
+ }
+ return: accessor<Test.Object *> *;
+ }
+ method_accessor_of_strings {
+ params {
+ @in a_in: accessor<const(char) *> *;
+ }
+ return: accessor<const(char) *> *;
+ }
+ method_accessor_of_ints {
+ params {
+ @in a_in: accessor<int> *;
+ }
+ return: accessor<int> *;
+ }
+ method_accessor_of_bools {
+ params {
+ @in a_in: accessor<bool> *;
+ }
+ return: accessor<bool> *;
+ }
+ method_accessor_of_doubles {
+ params {
+ @in a_in: accessor<double> *;
+ }
+ return: accessor<double> *;
+ }
+ method_accessor_of_enums {
+ params {
+ @in a_in: accessor<Test.Enum_Ex> *;
+ }
+ return: accessor<Test.Enum_Ex> *;
+ }
+ method_accessor_of_structs {
+ params {
+ @in a_in: accessor<Test.Struct_Ex> *;
+ }
+ return: accessor<Test.Struct_Ex> *;
+ }
+ method_array_of_arrays_of_ints {
+ params {
+ @in a_in: array<array<int> *> *;
+ }
+ return: array<array<int> *> *;
+ }
+ method_list_of_lists_of_ints {
+ params {
+ @in l_in: list<list<int> *> *;
+ }
+ return: list<list<int> *> *;
+ }
+ method_array_of_lists_of_ints {
+ params {
+ @in a_in: array<list<int> *> *;
+ }
+ return: array<list<int> *> *;
+ }
+ method_list_of_arrays_of_ints {
+ params {
+ @in l_in: list<array<int> *> *;
+ }
+ return: list<array<int> *> *;
+ }
+ method_list_with_opaque_elements {
+ return: const(list<Elm.Calendar.Mark*>)*;
+ }
+ method_in_enum_return_enum {
+ params { e: Test.Enum_Ex; }
+ return: Test.Enum_Ex;
+ }
+ method_in_struct_return_struct {
+ params { e: Test.Struct_Ex *; }
+ return: Test.Struct_Ex *;
+ }
+ call_event {
+ }
+ event_repeated_event_name {
+ }
+ }
+ implements {
+ Eo.Base.finalize;
+ Eo.Base.constructor;
+ Eo.Base.destructor;
+ }
+ events {
+ test;
+ test,structarg: Test.Struct_Ex;
+ test,stringarg: const(char)*;
+ repeated,event,name;
+ }
+}