summaryrefslogtreecommitdiff
path: root/src/tests/eolian_js
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-09-01 15:08:49 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-12-23 23:59:40 -0200
commita3db1dddd3ba67c81118f7f2c0bc753dc8aac551 (patch)
tree233ee1be7bfa299bff560207135d20940c4e411f /src/tests/eolian_js
parent1a3cb45f1cc7fdf8d481879e6bd7349d9cb0b3fa (diff)
efl-js: JavaScript Eolian binding
To configure efl sources with bindings to use in nodejs add ––with-js=nodejs in configure flags to generate node files $ configure --with-js=nodejs and compile normally with: $ make $ make install To use, you have to require efl: efl = require('efl') The bindings is divided in two parts: generated and manually written. The generation uses the Eolian library for parsing Eo files and generate C++ code that is compiled against V8 interpreter library to create a efl.node file that can be required in a node.js instance. @feature
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 0000000..f307a18
--- /dev/null
+++ b/src/tests/eolian_js/constructor_method_class.eo
@@ -0,0 +1,59 @@
1class Constructor_Method_Class (Eo.Base)
2{
3 legacy_prefix: null;
4 data: Constructor_Method_Class_Data;
5 methods {
6 @property fail {
7 get {
8 }
9 values {
10 is_fail: bool;
11 }
12 }
13 constructor1 {
14 params { @in one: int; }
15 }
16 constructor2 {
17 params { @in two: double; }
18 }
19 method1 {
20 params { @in one: int; }
21 }
22 method2 {
23 params { @in one: int; }
24 return: int;
25 }
26 method3 {
27 params { @in one: int; @in two: double; }
28 }
29 method4 {
30 params { @in one: int; @in two: double; }
31 return: int;
32 }
33 outmethod1 {
34 params { @out one: int; }
35 }
36 outmethod2 {
37 params { @out one: int; }
38 return: int;
39 }
40 outmethod3 {
41 params { @out one: int; @out two: double; }
42 }
43 classoutmethod1 {
44 params { @in one: int; @in two: double; }
45 return: free(own(Constructor_Method_Class *), eo_unref) @warn_unused;
46 }
47 classoutmethod2 {
48 params { @in one: int; @in two: double; @out out_class: own(Constructor_Method_Class *); }
49 }
50 }
51 implements {
52 Eo.Base.constructor;
53 Eo.Base.finalize;
54 }
55 constructors {
56 .constructor1;
57 .constructor2;
58 }
59}
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 0000000..cea5d19
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_suite.cc
@@ -0,0 +1,61 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Eina.hh>
6#include <Eina_Js.hh>
7
8#include <check.h>
9
10#include <cassert>
11#include <cstdio>
12#include <cstdlib>
13
14#ifndef HAVE_NODEJS
15#include "suite_runner.hh"
16void eolian_js_test_register_eolian_js_binding(v8::Handle<v8::Object> exports);
17
18int main(int, char*[])
19{
20 return run_script(TESTS_SRC_DIR "/eolian_js_suite.js", &eolian_js_test_register_eolian_js_binding);
21}
22#else
23#ifdef HAVE_NODE_NODE_H
24#include <node/node.h>
25#elif defined(HAVE_NODEJS_DEPS_NODE_NODE_H)
26#include <nodejs/deps/node/node.h>
27#elif defined(HAVE_NODEJS_DEPS_NODE_INCLUDE_NODE_H)
28#include <nodejs/deps/node/include/node.h>
29#elif defined(HAVE_NODEJS_SRC_NODE_H)
30#include <nodejs/src/node.h>
31#elif defined(HAVE_NODE_H)
32#include <node.h>
33#else
34#error We must have at least one node header to include
35#endif
36void eolian_js_test_register_eolian_js_binding(v8::Handle<v8::Object> exports);
37
38namespace {
39
40void eolian_js_module_init(v8::Handle<v8::Object> exports)
41{
42 fprintf(stderr, "test suite eolian_js_module_init\n"); fflush(stderr);
43 try
44 {
45 eina_init();
46 eo_init();
47 eolian_js_test_register_eolian_js_binding(exports);
48 std::cerr << "registered" << std::endl;
49 }
50 catch(...)
51 {
52 std::cerr << "Error" << std::endl;
53 std::abort();
54 }
55}
56
57}
58
59NODE_MODULE(eolian_js_suite_mod, ::eolian_js_module_init)
60
61#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 0000000..1461273
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_suite.js
@@ -0,0 +1,796 @@
1#!/usr/bin/env node
2
3// Preamble //
4function assert(condition, message) {
5 if (!condition) {
6 print("Assertion failed ", message);
7 throw new Error(message || "Assertion failed");
8 }
9}
10
11if(typeof process !== 'undefined')
12{
13 console.log('running from nodejs');
14 console.log('path', process.env.NODE_PATH);
15 console.log("teste1");
16
17 efl = require('efl');
18 assert(efl != null, "could not load efl node module");
19
20 // Setup output aliases
21 print = console.log;
22 printError = function() {
23 if (process.argv.indexOf("--supress-errors") == -1)
24 console.error.apply(null, arguments);
25 };
26 printInfo = function() {
27 if (process.argv.indexOf("--verbose") != -1)
28 console.info.apply(null, arguments);
29 };
30 exit = efl.ecore_mainloop_quit;
31}
32else
33{
34 assert = function(test, message) { if (test !== true) throw message; };
35 print('running from libv8')
36 //FIXME Add levels to v8 tests
37 printError = print
38 printInfo = print
39 exit = function() {}
40}
41
42// Global flag for suite success //
43suiteSuccess = true;
44// Global test summary
45suiteOk = 0;
46suiteFail = []; // Will store the name of the failures
47
48// Basic test function //
49function startTest(testName, testFunc) {
50 print("[ RUN ] eolian_js_suite: " + testName);
51 var testResult = true;
52 try {
53 testFunc();
54 } catch (e) {
55 suiteSuccess = false;
56 testResult = false;
57 printError("Error: ", e, e.stack);
58 }
59 print("[ " + (testResult ? "PASS" : "FAIL") + " ] eolian_js_suite: " + testName);
60 if (testResult)
61 suiteOk += 1;
62 else
63 suiteFail.push(testName);
64}
65// end Preamble
66
67// eolian Preamble
68if (typeof process != "undefined")
69{
70 suite = require('eolian_js_suite_mod');
71 assert(suite != null, "could not load eolian_js_suite_mod");
72 ConstructorMethodClass = suite.ConstructorMethodClass;
73 TestObject = suite.Test.Object;
74}
75else
76{
77 ConstructorMethodClass = suite.ConstructorMethodClass;
78 TestObject = suite.Test.Object;
79}
80
81function expectException(func) {
82 var exceptionCaught = false;
83 try {
84 func();
85 } catch (e) {
86 exceptionCaught = true;
87 }
88 assert(exceptionCaught, "Exception expected but not thrown!");
89}
90// end eolian Preamble
91
92// Test cases //
93startTest("constructor_null_parent", function() {
94 var obj = new TestObject(null);
95 assert(obj !== null);
96});
97
98startTest("integral_in_and_out_parameters", function() {
99 var obj = new TestObject(null);
100
101 var expectedValue = 1234;
102 obj.methodIntegralInA(expectedValue);
103
104 var actualValue = obj.methodIntegralOutA();
105 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
106});
107
108startTest("integral_inout_parameter", function() {
109 var obj = new TestObject(null);
110
111 var expectedValue = 1234;
112 var actualValue = obj.methodIntegralInout(-expectedValue);
113 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
114
115 var expectedValue = -4321;
116 var actualValue = obj.methodIntegralInout(-expectedValue);
117 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
118});
119
120startTest("integral_return_value", function() {
121 var obj = new TestObject(null);
122
123 var expectedValue = 1234;
124 obj.methodIntegralInA(expectedValue);
125
126 var actualValue = obj.methodIntegralReturnA();
127 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
128});
129
130startTest("more_parameters_than_expected_is_ok", function() {
131 var obj = new TestObject(null);
132 var expectedValue = 1234;
133 obj.methodIntegralInA(expectedValue, 4321);
134
135 var actualValue = obj.methodIntegralOutA();
136 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
137});
138
139startTest("less_parameters_that_expected_fails", function() {
140 var obj = new TestObject(null);
141 expectException(function() {
142 obj.methodIntegralInA();
143 });
144});
145
146startTest("wrong_parameter_type_fails", function() {
147 var obj = new TestObject(null);
148 expectException(function() {
149 obj.methodIntegralInA('string');
150 });
151});
152
153startTest("mixed_in_out_and_result", function() {
154 var obj = new TestObject(null);
155 var ret = obj.methodDivMod(7, 3);
156 var success = ret[0];
157 var quotient = ret[1];
158 var remainder = ret[2];
159 assert(success);
160 assert(2 == quotient);
161 assert(1 == remainder);
162
163 ret = obj.methodDivMod(42, 0);
164 success = ret[0];
165 assert(!success);
166});
167
168startTest("boolean", function() {
169 var obj = new TestObject(null);
170 var ret = obj.methodAnd(false, false);
171 assert(ret == false);
172 ret = obj.methodAnd(false, true);
173 assert(ret == false);
174 ret = obj.methodAnd(true, false);
175 assert(ret == false);
176 ret = obj.methodAnd(true, true);
177 assert(ret);
178});
179
180startTest("floating_point", function() {
181 var obj = new TestObject(null);
182 var ret = obj.methodModf(3.14159);
183 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)");
184 assert(ret[1] == 3, "ret[1] == 3 (" + ret[1] + " == 3)");
185});
186
187startTest("string_inout", function() {
188 var obj = new TestObject(null);
189 var ret = obj.methodUppercase('hello world');
190 assert(ret == "HELLO WORLD", "ret == " + ret);
191});
192
193startTest("in_null_string", function() {
194 var obj = new TestObject(null);
195 var success = obj.methodInNull(null);
196 assert(success, "success == " + success);
197});
198
199
200startTest("out_null_string", function() {
201 var obj = new TestObject(null);
202 var ret = obj.methodOutNull();
203 assert(ret[0], "success == " + ret[0]);
204 assert(ret[1] === null, "output == " + ret[1]);
205});
206
207
208startTest("inout_null_string", function() {
209 var obj = new TestObject(null);
210 var ret = obj.methodInoutNull(null);
211 assert(ret[0], "success == " + ret[0]);
212 assert(ret[1] === null, "output == " + ret[1]);
213});
214
215
216startTest("return_null_string", function() {
217 var obj = new TestObject(null);
218 var ret = obj.methodReturnNull();
219 assert(ret === null, "ret == " + ret);
220});
221
222
223startTest("null_values", function() {
224 var obj = new TestObject(null);
225 var ret = obj.methodNull(null, null);
226 assert(ret[0] === null, "ret == " + ret[0]);
227 assert(ret[1] === null, "ret == " + ret[1]);
228 assert(ret[2] === null, "ret == " + ret[2]);
229});
230
231startTest("enum_values", function() {
232 var obj = new TestObject(null);
233 var ret = obj.methodInEnumReturnEnum(suite.Test.EnumEx.SECOND);
234 assert(ret === suite.Test.EnumEx.SECOND);
235 var value = suite.Test.EnumEx.THIRD;
236 assert(value === 2);
237 ret = obj.methodInEnumReturnEnum(value);
238 assert(ret === value);
239});
240
241startTest("struct_values", function() {
242 var obj = new TestObject(null);
243 var newStruct = new suite.Test.StructEx;
244 newStruct.valueInt = 42;
245 newStruct.valueEnum = suite.Test.EnumEx.FOURTH;
246 var ret = newStruct.valueInt;
247 assert(ret === 42);
248 ret = newStruct.valueEnum;
249 assert(ret === suite.Test.EnumEx.FOURTH);
250 ret = obj.methodInStructReturnStruct(newStruct);
251 assert(ret.valueInt === 42);
252 assert(ret.valueEnum === suite.Test.EnumEx.FOURTH);
253});
254
255startTest("event_simple", function() {
256 var v = false;
257 var obj = new TestObject(null);
258 var ret = obj.on
259 ("test",
260 function()
261 {
262 printInfo('Event called')
263 v = true;
264 }
265 );
266 printInfo('going to call event');
267 obj.callEvent();
268 printInfo('is event called?');
269 assert(v);
270});
271
272startTest("event_object_call", function() {
273 var v = false;
274 var obj = new TestObject(null);
275 var ret = obj.on
276 ("test",
277 function()
278 {
279 printInfo('Event called');
280 var o = arguments[0];
281 assert(o != null);
282 var expectedValue = 1234;
283 o.methodIntegralInA(expectedValue);
284 var actualValue = o.methodIntegralOutA();
285 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
286 v = true;
287 }
288 );
289 printInfo('going to call event');
290 obj.callEvent();
291 printInfo('is event called?');
292 assert(v);
293});
294
295startTest("event_structarg", function() {
296 var v = false;
297 var obj = new TestObject(null);
298 var ret = obj.on
299 ("test_structarg",
300 function()
301 {
302 printInfo('Event called');
303 var s = arguments[1];
304 assert(s != null);
305 assert(s.valueInt === 42);
306 assert(s.valueEnum === suite.Test.EnumEx.THIRD);
307 v = true;
308 }
309 );
310 printInfo('going to call event');
311 obj.callEvent();
312 printInfo('is event called?');
313 assert(v);
314});
315
316startTest("event_stringarg", function() {
317 var v = false;
318 var obj = new TestObject(null);
319 var ret = obj.on
320 ("test_stringarg",
321 function()
322 {
323 printInfo('Event called');
324 var s = arguments[1];
325 assert(s === "foo");
326 v = true;
327 }
328 );
329 printInfo('going to call event');
330 obj.callEvent();
331 printInfo('is event called?');
332 assert(v);
333});
334
335// // TODO: disabled. Not implemented yet
336// startTest("integral_array", function() {
337// var obj = new TestObject(null);
338// var ret = obj.methodArrayAt([1, 2, 3, 4, 5], 1);
339// assert(ret == 2, "ret == " + ret);
340// });
341
342startTest("array_in_array_out", function() {
343 var obj = new TestObject(null);
344 var newArray = obj.methodArrayWith42();
345 assert(newArray != null);
346 var arr = obj.methodArrayInArrayOut(newArray);
347 assert(arr != null);
348 assert(arr[0] === 42);
349 assert(newArray[0] === arr[0]);
350});
351
352startTest("method_array_of_objects", function() {
353 var obj = new TestObject(null);
354 var arr = obj.methodArrayOfObjects(null);
355 assert(arr != null);
356 assert(arr[0] != null);
357 arr = obj.methodArrayOfObjects(arr);
358 assert(arr != null);
359 var v = arr[0];
360 assert(v != null);
361 // assert(v == obj); // TODO: check if same Eo object pointer?
362 var expectedValue = 1234;
363 v.methodIntegralInA(expectedValue);
364 var actualValue = v.methodIntegralOutA();
365 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
366});
367
368// FIXME
369// startTest("method_array_of_strings", function() {
370// var obj = new TestObject(null);
371// var arr = obj.methodArrayOfStrings(null);
372// assert(arr != null);
373// assert(arr[0] === "foo");
374// arr = obj.methodArrayOfStrings(arr);
375// assert(arr != null);
376// assert(arr[0] === "foo");
377// });
378
379startTest("method_array_of_ints", function() {
380 var obj = new TestObject(null);
381 var arr = obj.methodArrayOfInts(null);
382 assert(arr != null);
383 assert(arr[0] === 42);
384 arr = obj.methodArrayOfInts(arr);
385 assert(arr != null);
386 assert(arr[0] === 42);
387});
388
389startTest("method_array_of_bools", function() {
390 var obj = new TestObject(null);
391 var arr = obj.methodArrayOfBools(null);
392 assert(arr != null);
393 assert(arr[0] === true);
394 arr = obj.methodArrayOfBools(arr);
395 assert(arr != null);
396 assert(arr[0] === true);
397});
398
399startTest("method_array_of_doubles", function() {
400 var obj = new TestObject(null);
401 var arr = obj.methodArrayOfDoubles(null);
402 assert(arr != null);
403 assert(arr[0] === 42.0);
404 arr = obj.methodArrayOfDoubles(arr);
405 assert(arr != null);
406 assert(arr[0] === 42.0);
407});
408
409startTest("method_array_of_enums", function() {
410 var obj = new TestObject(null);
411 var arr = obj.methodArrayOfEnums(null);
412 assert(arr != null);
413 assert(arr[0] === suite.Test.EnumEx.THIRD);
414 arr = obj.methodArrayOfEnums(arr);
415 assert(arr != null);
416 assert(arr[0] === suite.Test.EnumEx.THIRD);
417});
418
419startTest("method_array_of_structs", function() {
420 var obj = new TestObject(null);
421 var arr = obj.methodArrayOfStructs(null);
422 assert(arr != null);
423 var s = arr[0];
424 assert(s != null);
425 assert(s.valueInt === 42);
426 assert(s.valueEnum === suite.Test.EnumEx.THIRD);
427 arr = obj.methodArrayOfStructs(arr);
428 s = arr[0];
429 assert(s != null);
430 assert(s.valueInt === 42);
431 assert(s.valueEnum === suite.Test.EnumEx.THIRD);
432});
433
434startTest("list_in_list_out", function() {
435 var obj = new TestObject(null);
436 var newList = obj.methodListWith42();
437 assert(newList != null);
438 var lis = obj.methodListInListOut(newList);
439 assert(lis != null);
440 // assert(lis == newList); // TODO: check same list pointer?
441 assert(lis[0] === 42);
442 assert(newList[0] === lis[0]);
443});
444
445startTest("method_list_of_objects", function() {
446 var obj = new TestObject(null);
447 var lis = obj.methodListOfObjects(null);
448 assert(lis != null);
449 assert(lis[0] != null);
450 lis = obj.methodListOfObjects(lis);
451 assert(lis != null);
452 var v = lis[0];
453 assert(v != null);
454 // assert(v == obj); // TODO: check if same Eo object pointer?
455 var expectedValue = 1234;
456 v.methodIntegralInA(expectedValue);
457 var actualValue = v.methodIntegralOutA();
458 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
459});
460
461// FIXME
462// startTest("method_list_of_strings", function() {
463// var obj = new TestObject(null);
464// var lis = obj.methodListOfStrings(null);
465// assert(lis != null);
466// assert(lis[0] === "foo");
467// lis = obj.methodListOfStrings(lis);
468// assert(lis != null);
469// assert(lis[0] === "foo");
470// });
471
472startTest("method_list_of_ints", function() {
473 var obj = new TestObject(null);
474 var lis = obj.methodListOfInts(null);
475 assert(lis != null);
476 assert(lis[0] === 42);
477 lis = obj.methodListOfInts(lis);
478 assert(lis != null);
479 assert(lis[0] === 42);
480});
481
482startTest("method_list_of_bools", function() {
483 var obj = new TestObject(null);
484 var lis = obj.methodListOfBools(null);
485 assert(lis != null);
486 assert(lis[0] === true);
487 lis = obj.methodListOfBools(lis);
488 assert(lis != null);
489 assert(lis[0] === true);
490});
491
492startTest("method_list_of_doubles", function() {
493 var obj = new TestObject(null);
494 var lis = obj.methodListOfDoubles(null);
495 assert(lis != null);
496 assert(lis[0] === 42.0);
497 lis = obj.methodListOfDoubles(lis);
498 assert(lis != null);
499 assert(lis[0] === 42.0);
500});
501
502startTest("method_list_of_enums", function() {
503 var obj = new TestObject(null);
504 var lis = obj.methodListOfEnums(null);
505 assert(lis != null);
506 assert(lis[0] === suite.Test.EnumEx.THIRD);
507 lis = obj.methodListOfEnums(lis);
508 assert(lis != null);
509 assert(lis[0] === suite.Test.EnumEx.THIRD);
510});
511
512startTest("method_list_of_structs", function() {
513 var obj = new TestObject(null);
514 var lis = obj.methodListOfStructs(null);
515 assert(lis != null);
516 var s = lis[0];
517 assert(s != null);
518 assert(s.valueInt === 42);
519 assert(s.valueEnum === suite.Test.EnumEx.THIRD);
520 lis = obj.methodListOfStructs(lis);
521 s = lis[0];
522 assert(s != null);
523 assert(s.valueInt === 42);
524 assert(s.valueEnum === suite.Test.EnumEx.THIRD);
525});
526
527startTest("method_accessor_of_objects", function() {
528 var obj = new TestObject(null);
529 var acc = obj.methodAccessorOfObjects(null);
530 assert(acc != null);
531 assert(acc.get(0) != null);
532 acc = obj.methodAccessorOfObjects(acc);
533 assert(acc != null);
534 var v = acc.get(0);
535 assert(v != null);
536 var expectedValue = 1234;
537 v.methodIntegralInA(expectedValue);
538 var actualValue = v.methodIntegralOutA();
539 assert(actualValue == expectedValue, actualValue + " == " + expectedValue);
540});
541
542// FIXME
543// startTest("method_accessor_of_strings", function() {
544// var obj = new TestObject(null);
545// var acc = obj.methodAccessorOfStrings(null);
546// assert(acc != null);
547// assert(acc.get(0) === "foo");
548// acc = obj.methodAccessorOfStrings(acc);
549// assert(acc != null);
550// assert(acc.get(0) === "foo");
551// });
552
553startTest("method_accessor_of_ints", function() {
554 var obj = new TestObject(null);
555 var acc = obj.methodAccessorOfInts(null);
556 assert(acc != null);
557 assert(acc.get(0) === 42);
558 acc = obj.methodAccessorOfInts(acc);
559 assert(acc != null);
560 assert(acc.get(0) === 42);
561});
562
563startTest("method_accessor_of_bools", function() {
564 var obj = new TestObject(null);
565 var acc = obj.methodAccessorOfBools(null);
566 assert(acc != null);
567 assert(acc.get(0) === true);
568 acc = obj.methodAccessorOfBools(acc);
569 assert(acc != null);
570 assert(acc.get(0) === true);
571});
572
573startTest("method_accessor_of_doubles", function() {
574 var obj = new TestObject(null);
575 var acc = obj.methodAccessorOfDoubles(null);
576 assert(acc != null);
577 assert(acc.get(0) === 42.0);
578 acc = obj.methodAccessorOfDoubles(acc);
579 assert(acc != null);
580 assert(acc.get(0) === 42.0);
581});
582
583startTest("method_accessor_of_enums", function() {
584 var obj = new TestObject(null);
585 var acc = obj.methodAccessorOfEnums(null);
586 assert(acc != null);
587 assert(acc.get(0) === suite.Test.EnumEx.THIRD);
588 acc = obj.methodAccessorOfEnums(acc);
589 assert(acc != null);
590 assert(acc.get(0) === suite.Test.EnumEx.THIRD);
591});
592
593startTest("method_accessor_of_structs", function() {
594 var obj = new TestObject(null);
595 var acc = obj.methodAccessorOfStructs(null);
596 assert(acc != null);
597 var s = acc.get(0);
598 assert(s != null);
599 assert(s.valueInt === 42);
600 assert(s.valueEnum === suite.Test.EnumEx.THIRD);
601 acc = obj.methodAccessorOfStructs(acc);
602 assert(acc != null);
603 s = acc.get(0);
604 assert(s != null);
605 assert(s.valueInt === 42);
606 assert(s.valueEnum === suite.Test.EnumEx.THIRD);
607});
608
609// Combinations of complex types //
610
611// FIXME
612// startTest("method_array_of_arrays_of_ints", function() {
613// var obj = new TestObject(null);
614// var arr = obj.methodArrayOfArraysOfInts(null);
615// assert(arr != null);
616// var a = arr[0];
617// assert(a != null);
618// assert(a[0] === 42);
619// arr = obj.methodArrayOfArraysOfInts(arr);
620// assert(arr != null);
621// a = arr[0];
622// assert(a != null);
623// assert(a[0] === 42);
624// });
625
626// FIXME
627// startTest("method_list_of_lists_of_ints", function() {
628// var obj = new TestObject(null);
629// var lis = obj.methodListOfListsOfInts(null);
630// assert(lis != null);
631// var l = lis[0];
632// assert(l != null);
633// assert(l[0] === 42);
634// lis = obj.methodListOfListsOfInts(lis);
635// assert(lis != null);
636// l = lis[0];
637// assert(l != null);
638// assert(l[0] === 42);
639// });
640
641// FIXME
642// startTest("method_array_of_lists_of_ints", function() {
643// var obj = new TestObject(null);
644// var arr = obj.methodArrayOfListsOfInts(null);
645// assert(arr != null);
646// var l = arr[0];
647// assert(l != null);
648// assert(l[0] === 42);
649// arr = obj.methodArrayOfListsOfInts(arr);
650// assert(arr != null);
651// l = arr[0];
652// assert(l != null);
653// assert(l[0] === 42);
654// });
655
656// FIXME
657// startTest("method_list_of_arrays_of_ints", function() {
658// var obj = new TestObject(null);
659// var lis = obj.methodListOfArraysOfInts(null);
660// assert(lis != null);
661// var a = lis[0];
662// assert(a != null);
663// assert(a[0] === 42);
664// lis = obj.methodListOfArraysOfInts(lis);
665// assert(lis != null);
666// a = lis[0];
667// assert(a != null);
668// assert(a[0] === 42);
669// });
670
671startTest("new Constructor_Method_Class", function() {
672 var obj = new ConstructorMethodClass(null, 5, 10.0);
673 assert(obj);
674 assert(obj.getFail() == false, "object fail flag set");
675});
676
677startTest("Constructor_Method_Class method1", function() {
678 var obj = new ConstructorMethodClass(null, 5, 10.0);
679 obj.method1(2);
680 assert(obj.getFail() == false, "object fail flag set");
681});
682
683startTest("Constructor_Method_Class method2", function() {
684 var obj = new ConstructorMethodClass(null, 5, 10.0);
685 var r = obj.method2(3);
686 assert(r === 5);
687 assert(obj.getFail() == false, "object fail flag set");
688});
689
690startTest("Constructor_Method_Class method3", function() {
691 var obj = new ConstructorMethodClass(null, 5, 10.0);
692 obj.method3(3, 11.1);
693 assert(obj.getFail() == false, "object fail flag set");
694});
695
696startTest("Constructor_Method_Class method4", function() {
697 var obj = new ConstructorMethodClass(null, 5, 10.0);
698 var r = obj.method4(3, 11.1);
699 assert(r == 5);
700 assert(obj.getFail() == false, "object fail flag set");
701});
702
703startTest("Constructor_Method_Class method3 less parameters than expected", function() {
704 var obj = new ConstructorMethodClass(null, 5, 10.0);
705 expectException(function() {
706 obj.method3(3);
707 });
708});
709
710startTest("Constructor_Method_Class constructor less parameters than expected", function() {
711 expectException(function() {
712 var obj = new ConstructorMethodClass(null, 5);
713 });
714});
715
716startTest("Constructor_Method_Class constructor wrong parameter types", function() {
717 expectException(function() {
718 var obj = new ConstructorMethodClass(null, 5.1, 10);
719 });
720});
721
722// Out parameters //
723
724startTest("Constructor_Method_Class outmethod1", function() {
725 var obj = new ConstructorMethodClass(null, 5, 10.0);
726 var r = obj.outmethod1();
727 assert(r == 5);
728 assert(obj.getFail() == false, "object fail flag set");
729});
730
731startTest("Constructor_Method_Class outmethod2", function() {
732 var obj = new ConstructorMethodClass(null, 5, 10.0);
733 var r = obj.outmethod2();
734 assert(Array.isArray(r));
735 printInfo("Return is array from outmethod2");
736 assert(r[0] == 11);
737 assert(r[1] == 10);
738 assert(obj.getFail() == false, "object fail flag set");
739});
740
741startTest("Constructor_Method_Class outmethod3", function() {
742 var obj = new ConstructorMethodClass(null, 5, 10.0);
743 var r = obj.outmethod3();
744 assert(Array.isArray(r));
745 printInfo("Return is array from outmethod3");
746 assert(r[0] == 11);
747 assert(r[1] == 5.1);
748 assert(obj.getFail() == false, "object fail flag set");
749});
750
751startTest("Constructor_Method_Class classoutmethod1", function() {
752 var obj = new ConstructorMethodClass(null, 5, 10.0);
753 var c = obj.classoutmethod1(5, 10.0);
754 assert(c);
755 var r = c.method4(3, 11.1);
756 assert(r == 5);
757 assert(c.getFail() == false, "object fail flag set");
758 assert(obj.getFail() == false, "object fail flag set");
759});
760
761startTest("Constructor_Method_Class classoutmethod2", function() {
762 var obj = new ConstructorMethodClass(null, 5, 10.0);
763 printInfo('1');
764 var c = obj.classoutmethod2(5, 10.0);
765 assert(c);
766 var r = c.method4(3, 11.1);
767 assert(r);
768 assert(r == 5);
769 assert(c.getFail() == false, "object fail flag set");
770 assert(obj.getFail() == false, "object fail flag set");
771});
772
773startTest("cast", function() {
774 var obj = new ConstructorMethodClass(null, 5, 10.0);
775 var c = obj.classoutmethod1(5, 10.0);
776 print('classoutmethod1');
777 assert(c);
778 var d = c.cast('Constructor_Method_Class');
779 assert(d);
780});
781
782if (!suiteSuccess) {
783 print ("[ Total tests run: %s ]", suiteOk + suiteFail.length);
784 print ("[ Total successful: %s ]", suiteOk);
785 print ("[ Total failures: %s ]", suiteFail.length);
786 print ("[ Tests failed: ]");
787 for (var i = 0; i < suiteFail.length; i++) {
788 print ("[ %s]", suiteFail[i]);
789 };
790 assert(false, "[ Test suite fail ]");
791} else {
792 print ("[ Test execution with success ]");
793 print ("[ Total tests run: %s ]", suiteOk);
794}
795
796exit();
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 0000000..1f454eb
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_test_constructor_method_impl.c
@@ -0,0 +1,147 @@
1#ifdef HAVE_CONFIG_H
2#include <config.h>
3#endif
4
5#include <Eo.h>
6#include <Ecore.h>
7
8#include <stdlib.h>
9
10#include "constructor_method_class.eo.h"
11
12#include <check.h>
13
14struct _Constructor_Method_Class_Data
15{
16 Eina_Bool fail;
17};
18typedef struct _Constructor_Method_Class_Data Constructor_Method_Class_Data;
19
20#define MY_CLASS CONSTRUCTOR_METHOD_CLASS_CLASS
21
22EOLIAN static Eo_Base *
23_constructor_method_class_eo_base_constructor(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd)
24{
25 pd->fail = EINA_FALSE;
26 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
27}
28
29EOLIAN static void
30_constructor_method_class_constructor1(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one)
31{
32 fprintf(stderr, "one == %d\n", one);
33 fflush(stderr);
34 if (one != 5)
35 pd->fail = EINA_TRUE;
36}
37
38EOLIAN static void
39_constructor_method_class_constructor2(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, double two)
40{
41 fprintf(stderr, "two == %f\n", two);
42 fflush(stderr);
43 if (two != 10.0)
44 pd->fail = EINA_TRUE;
45}
46
47EOLIAN static Eo *
48_constructor_method_class_eo_base_finalize(Eo *obj, Constructor_Method_Class_Data *pd)
49{
50 if (pd->fail)
51 return NULL;
52
53 return eo_do_super_ret(obj, MY_CLASS, obj, eo_finalize());
54}
55
56EOLIAN static Eina_Bool
57_constructor_method_class_fail_get(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd)
58{
59 return pd->fail;
60}
61
62EOLIAN static void
63_constructor_method_class_method1(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one)
64{
65 fprintf(stderr, "method1 one == %d\n", one);
66 fflush(stderr);
67 if (one != 2)
68 pd->fail = EINA_TRUE;
69}
70
71EOLIAN static int
72_constructor_method_class_method2(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one)
73{
74 fprintf(stderr, "method2 one == %d\n", one);
75 fflush(stderr);
76 if (one != 3)
77 pd->fail = EINA_TRUE;
78 return 5;
79}
80
81EOLIAN static void
82_constructor_method_class_method3(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one, double two)
83{
84 fprintf(stderr, "method3 one == %d two == %f\n", one, two);
85 fflush(stderr);
86 if (one != 3)
87 pd->fail = EINA_TRUE;
88 if (two != 11.1)
89 pd->fail = EINA_TRUE;
90}
91
92EOLIAN static int
93_constructor_method_class_method4(Eo * obj EINA_UNUSED, Constructor_Method_Class_Data *pd, int one, double two)
94{
95 fprintf(stderr, "method4 one == %d two == %f\n", one, two);
96 fflush(stderr);
97 if (one != 3)
98 pd->fail = EINA_TRUE;
99 if (two != 11.1)
100 pd->fail = EINA_TRUE;
101 return 5;
102}
103
104EOLIAN static void
105_constructor_method_class_outmethod1(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int *one)
106{
107 fprintf(stderr, "outmethod1\n");
108 fflush(stderr);
109 *one = 5;
110}
111
112EOLIAN static int
113_constructor_method_class_outmethod2(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int *one)
114{
115 fprintf(stderr, "outmethod2\n");
116 fflush(stderr);
117 *one = 10;
118 return 11;
119}
120
121EOLIAN static void
122_constructor_method_class_outmethod3(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int *one, double *two)
123{
124 fprintf(stderr, "outmethod3\n");
125 fflush(stderr);
126 *one = 11;
127 *two = 5.1;
128}
129
130EOLIAN static Constructor_Method_Class *
131_constructor_method_class_classoutmethod1(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int one, double two)
132{
133 fprintf(stderr, "classoutmethod1\n");
134 fflush(stderr);
135 return eo_add(MY_CLASS, NULL, constructor_method_class_constructor1(one), constructor_method_class_constructor2(two));
136}
137
138EOLIAN static void
139_constructor_method_class_classoutmethod2(Eo* obj EINA_UNUSED, Constructor_Method_Class_Data *pd EINA_UNUSED, int one, double two, Constructor_Method_Class **out_class)
140{
141 fprintf(stderr, "classoutmethod2\n");
142 fflush(stderr);
143 *out_class = eo_add(MY_CLASS, NULL, constructor_method_class_constructor1(one), constructor_method_class_constructor2(two));
144}
145
146
147#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 0000000..dbdd016
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_test_eolian_js_binding.cc
@@ -0,0 +1,44 @@
1#ifdef HAVE_CONFIG_H
2#include <config.h>
3#endif
4
5#include <Eo_Js.hh>
6#include <Eina.hh>
7#include <Eo.hh>
8
9#include <check.h>
10
11
12#include <iostream>
13#include <cassert>
14#include <fstream>
15
16typedef struct _Elm_Calendar_Mark Elm_Calendar_Mark;
17
18#include "constructor_method_class.eo.js.cc"
19#include "test_object.eo.js.cc"
20
21#ifdef EAPI
22# undef EAPI
23#endif
24
25#ifdef _WIN32
26# define EAPI __declspec(dllimport)
27#else
28# ifdef __GNUC__
29# if __GNUC__ >= 4
30# define EAPI __attribute__ ((visibility("default")))
31# else
32# define EAPI
33# endif
34# else
35# define EAPI
36# endif
37#endif /* ! _WIN32 */
38
39void eolian_js_test_register_eolian_js_binding(v8::Handle<v8::Object> exports)
40{
41 v8::Isolate* isolate = v8::Isolate::GetCurrent();
42 test::register_object(exports, isolate);
43 register_constructor_method_class(exports, isolate);
44}
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 0000000..e859f2a
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_test_evas_box.cc
@@ -0,0 +1,151 @@
1
2#ifdef HAVE_CONFIG_H
3#include <config.h>
4#endif
5
6#include <Eo_Js.hh>
7#include <Eina.hh>
8#include <Eo.hh>
9
10#include <check.h>
11
12#include <iostream>
13
14#include <cassert>
15#include <tuple>
16
17namespace evas {
18EAPI void register_box(v8::Handle<v8::Object> global, v8::Isolate* isolate);
19}
20
21namespace {
22
23static const char script[] =
24 "function assert(condition, message) {\n"
25 " if (!condition) {\n"
26 " print(\"Assertion failed \", message);\n"
27 " throw message || \"Assertion failed\";\n"
28 " }\n"
29 "}\n"
30 "print(\"teste\");\n"
31 "x = new Box();\n"
32 ;
33
34const char* ToCString(const v8::String::Utf8Value& value) {
35 return *value ? *value : "<string conversion failed>";
36}
37
38// Executes a string within the current v8 context.
39bool ExecuteString(v8::Isolate* isolate,
40 v8::Handle<v8::String> source,
41 v8::Handle<v8::Value> name)
42{
43 efl::eina::js::compatibility_handle_scope handle_scope(isolate);
44 v8::TryCatch try_catch;
45 v8::ScriptOrigin origin(name);
46 v8::Handle<v8::Script> script = v8::Script::Compile(source, &origin);
47 if (script.IsEmpty()) {
48 std::abort();
49 // Print errors that happened during compilation.
50 // if (report_exceptions)
51 // ReportException(isolate, &try_catch);
52 return false;
53 }
54 else
55 {
56 v8::Handle<v8::Value> result = script->Run();
57 if (result.IsEmpty()) {
58 std::cout << "Failed with exception thrown" << std::endl;
59 assert(try_catch.HasCaught());
60 std::abort();
61 // Print errors that happened during execution.
62 // if (report_exceptions)
63 // ReportException(isolate, &try_catch);
64 return false;
65 } else {
66 assert(!try_catch.HasCaught());
67 // if (print_result && !result->IsUndefined()) {
68 // // If all went well and the result wasn't undefined then print
69 // // the returned value.
70 // v8::String::Utf8Value str(result);
71 // const char* cstr = ToCString(str);
72 // printf("%s\n", cstr);
73 // }
74 return true;
75 }
76 }
77}
78
79efl::eina::js::compatibility_return_type Print(efl::eina::js::compatibility_callback_info_type args) {
80 bool first = true;
81 for (int i = 0; i < args.Length(); i++) {
82 efl::eina::js::compatibility_handle_scope handle_scope(args.GetIsolate());
83 if (first) {
84 first = false;
85 } else {
86 printf(" ");
87 }
88 v8::String::Utf8Value str(args[i]);
89 const char* cstr = ToCString(str);
90 printf("%s", cstr);
91 }
92 printf("\n");
93 fflush(stdout);
94}
95
96START_TEST(eolian_js_test_evas_box)
97{
98 int argc = 1;
99 const char* argv[] = {"test"};
100 efl::eina::eina_init eina_init;
101 efl::eo::eo_init eo_init;
102
103 //v8::V8::InitializeICU();
104 v8::V8::Initialize();
105 v8::V8::SetFlagsFromCommandLine(&argc, const_cast<char**>(argv), true);
106
107 v8::Isolate* isolate = efl::eina::js::compatibility_isolate_new();
108
109 v8::Isolate::Scope isolate_scope(isolate);
110
111 assert(isolate != 0);
112
113 v8::Handle<v8::Context> context;
114 efl::eina::js::compatibility_handle_scope handle_scope(isolate);
115
116 {
117 // Create a template for the global object.
118 v8::Handle<v8::ObjectTemplate> global = efl::eina::js::compatibility_new<v8::ObjectTemplate>(isolate);
119 // Bind the global 'print' function to the C++ Print callback.
120 global->Set(efl::eina::js::compatibility_new<v8::String>(isolate, "print"),
121 efl::eina::js::compatibility_new<v8::FunctionTemplate>(isolate, Print));
122
123 context = efl::eina::js::compatibility_new<v8::Context>(isolate, nullptr, global);
124
125 }
126 if (context.IsEmpty()) {
127 fprintf(stderr, "Error creating context\n");
128 }
129 context->Enter();
130 {
131 // Enter the execution environment before evaluating any code.
132 v8::Context::Scope context_scope(context);
133 v8::Local<v8::String> name(efl::eina::js::compatibility_new<v8::String>(/*context->GetIsolate()*/nullptr, "(shell)"));
134
135 evas::register_box(context->Global(), isolate);
136
137 efl::eina::js::compatibility_handle_scope handle_scope(/*context->GetIsolate()*/nullptr);
138 ExecuteString(/*context->GetIsolate()*/isolate,
139 efl::eina::js::compatibility_new<v8::String>/*FromUtf8*/(/*context->GetIsolate()*/nullptr, script),
140 name);
141 }
142 context->Exit();
143}
144END_TEST
145
146}
147
148void eolian_js_test_evas_box(TCase* tc)
149{
150 tcase_add_test(tc, eolian_js_test_evas_box);
151}
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 0000000..6f35b7e
--- /dev/null
+++ b/src/tests/eolian_js/eolian_js_test_test_object_impl.c
@@ -0,0 +1,620 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Eo.h>
6#include <Ecore.h>
7
8#include "test_object.eo.h"
9
10#include <check.h>
11
12#include <assert.h>
13#include <ctype.h>
14#include <math.h>
15#include <stdlib.h>
16
17struct _Test_Object_Data
18{
19 int a;
20};
21
22typedef struct _Test_Object_Data Test_Object_Data;
23
24#define MY_CLASS TEST_OBJECT_CLASS
25
26EOLIAN static Eo_Base *
27_test_object_eo_base_constructor(Eo* obj, Test_Object_Data *pd)
28{
29 fprintf(stdout, "_test_object_eo_base_constructor\n");
30
31 pd->a = 0;
32 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
33}
34
35EOLIAN static Eo *
36_test_object_eo_base_finalize(Eo *obj, Test_Object_Data *pd EINA_UNUSED)
37{
38 fprintf(stdout, "_test_object_eo_base_finalize\n");
39
40 return eo_do_super_ret(obj, MY_CLASS, obj, eo_finalize());
41}
42
43EOLIAN static void
44_test_object_eo_base_destructor(Eo* obj, Test_Object_Data *pd EINA_UNUSED)
45{
46 fprintf(stdout, "_test_object_eo_base_destructor\n");
47 eo_do_super(obj, MY_CLASS, eo_destructor());
48}
49
50
51EOLIAN static void
52_test_object_method_integral_in_a(Eo* obj EINA_UNUSED,
53 Test_Object_Data *pd,
54 int a)
55{
56 fprintf(stdout, "_test_object_method_integral_in_a(%d)\n", a);
57 pd->a = a;
58}
59
60EOLIAN static void
61_test_object_method_integral_out_a(Eo* obj EINA_UNUSED,
62 Test_Object_Data *pd,
63 int *a)
64{
65 fprintf(stdout, "_test_object_method_integral_out_a(%p)\n", a);
66 *a = pd->a;
67}
68
69EOLIAN static void
70_test_object_method_integral_inout(Eo* obj EINA_UNUSED,
71 Test_Object_Data *pd EINA_UNUSED,
72 int *a)
73{
74 fprintf(stdout, "_test_object_method_integral_inout(%d [%p])\n", *a, a);
75 *a = -(*a);
76}
77
78EOLIAN static int
79_test_object_method_integral_return_a(Eo* obj EINA_UNUSED,
80 Test_Object_Data *pd)
81{
82 fprintf(stdout, "_test_object_method_integral_return_a()\n");
83 return pd->a;
84}
85
86EOLIAN static Eina_Bool
87_test_object_method_div_mod(Eo* obj EINA_UNUSED,
88 Test_Object_Data *pd EINA_UNUSED,
89 int a,
90 int b,
91 int *quotient,
92 int *remainder)
93{
94 fprintf(stdout, "_test_object_method_div_mod(%d, %d, %p, %p)\n", a, b, quotient, remainder);
95 if (0 == b) return EINA_FALSE;
96 *quotient = a / b;
97 *remainder = a % b;
98 return EINA_TRUE;
99}
100
101EOLIAN static Eina_Bool
102_test_object_method_and(Eo* obj EINA_UNUSED,
103 Test_Object_Data *pd EINA_UNUSED,
104 Eina_Bool a,
105 Eina_Bool b)
106{
107 fprintf(stdout, "_test_object_method_and(%d, %d)\n", a, b);
108 return a && b;
109}
110
111EOLIAN static double
112_test_object_method_modf(Eo* obj EINA_UNUSED,
113 Test_Object_Data *pd EINA_UNUSED,
114 double x,
115 double *int_part)
116{
117 fprintf(stdout, "_test_object_method_modf(%f, %p)\n", x, int_part);
118 return modf(x, int_part);
119}
120
121EOLIAN static void
122_test_object_method_uppercase(Eo* obj EINA_UNUSED,
123 Test_Object_Data *pd EINA_UNUSED,
124 char **str)
125{
126 fprintf(stdout, "_test_object_method_uppercase('%s')\n", *str);
127 if (!*str) return;
128
129 char *p = *str;
130 while ('\0' != *p)
131 {
132 *p = toupper(*p);
133 p++;
134 }
135}
136
137EOLIAN static Eina_Bool
138_test_object_method_in_null(Eo* obj EINA_UNUSED,
139 Test_Object_Data *pd EINA_UNUSED,
140 char *a)
141{
142 fprintf(stdout, "_test_object_method_in_null(%p)\n", a);
143 return NULL == a;
144}
145
146EOLIAN static Eina_Bool
147_test_object_method_out_null(Eo* obj EINA_UNUSED,
148 Test_Object_Data *pd EINA_UNUSED,
149 char **a)
150{
151 fprintf(stdout, "_test_object_method_out_null(%p)\n", a);
152 *a = NULL;
153 return EINA_TRUE;
154}
155
156EOLIAN static Eina_Bool
157_test_object_method_inout_null(Eo* obj EINA_UNUSED,
158 Test_Object_Data *pd EINA_UNUSED,
159 char **a)
160{
161 fprintf(stdout, "_test_object_method_inout_null(%p)\n", a);
162 return NULL == *a;
163}
164
165EOLIAN static char *
166_test_object_method_return_null(Eo* obj EINA_UNUSED,
167 Test_Object_Data *pd EINA_UNUSED)
168{
169 fprintf(stdout, "_test_object_method_return_null()\n");
170 return NULL;
171}
172
173EOLIAN static void
174_test_object_call_event(Eo* obj, Test_Object_Data *pd EINA_UNUSED)
175{
176 fprintf(stderr, "_test_object_event_call()\n"); fflush(stderr);
177 static Test_Struct_Ex s = {42, TEST_ENUM_EX_THIRD};
178 eo_do(obj, eo_event_callback_call(TEST_OBJECT_EVENT_TEST, NULL));
179 eo_do(obj, eo_event_callback_call(TEST_OBJECT_EVENT_TEST_STRUCTARG, &s));
180 eo_do(obj, eo_event_callback_call(TEST_OBJECT_EVENT_TEST_STRINGARG, "foo"));
181}
182
183EOLIAN static char *
184_test_object_method_null(Eo* obj EINA_UNUSED,
185 Test_Object_Data *pd EINA_UNUSED,
186 char *in,
187 char **out,
188 char **inout)
189{
190 fprintf(stdout, "_test_object_method_null(%p, %p, %p)\n", in, out, inout);
191 assert(!in);
192 *out = NULL;
193 *inout = NULL;
194 return NULL;
195}
196
197// Arrays //
198
199EOLIAN static int
200_test_object_method_array_at(Eo* obj EINA_UNUSED,
201 Test_Object_Data *pd EINA_UNUSED,
202 Eina_Array *array,
203 int index)
204{
205 fprintf(stdout, "_test_object_method_array_at(%p, %d)\n", array, index);
206 return *((int*)eina_array_data_get(array, index));
207}
208
209EOLIAN static Eina_Array *
210_test_object_method_array_with_42(Eo* obj EINA_UNUSED,
211 Test_Object_Data *pd EINA_UNUSED)
212{
213 fprintf(stdout, "_test_object_method_array_with_42()\n");
214 Eina_Array *arr = eina_array_new(2);
215 int* n = malloc(sizeof(int));
216 *n = 42;
217 eina_array_push(arr, n);
218 return arr;
219}
220
221EOLIAN static void
222_test_object_method_array_in_array_out(Eo* obj EINA_UNUSED,
223 Test_Object_Data *pd EINA_UNUSED,
224 Eina_Array *a_in,
225 Eina_Array **a_out)
226{
227 fprintf(stdout, "_test_object_method_array_in_array_out(%p, %p)\n", a_in, a_out);
228 *a_out = a_in;
229}
230
231EOLIAN static Eina_Array *
232_test_object_method_array_of_objects(Eo* obj,
233 Test_Object_Data *pd EINA_UNUSED,
234 Eina_Array *a_in)
235{
236 fprintf(stdout, "_test_object_method_array_of_objects(%p)\n", a_in);
237 if (a_in) return a_in;
238 Eina_Array *arr = eina_array_new(2);
239 eina_array_push(arr, obj);
240 return arr;
241}
242
243
244EOLIAN static Eina_Array *
245_test_object_method_array_of_strings(Eo* obj EINA_UNUSED,
246 Test_Object_Data *pd EINA_UNUSED,
247 Eina_Array *a_in)
248{
249 fprintf(stdout, "_test_object_method_array_of_strings(%p)\n", a_in);
250 if (a_in) return a_in;
251 Eina_Array *arr = eina_array_new(2);
252 const char* v = "foo";
253 fprintf(stdout, "v = %p\n", v);
254 eina_array_push(arr, v);
255 return arr;
256}
257
258EOLIAN static Eina_Array *
259_test_object_method_array_of_ints(Eo* obj EINA_UNUSED,
260 Test_Object_Data *pd EINA_UNUSED,
261 Eina_Array *a_in)
262{
263 fprintf(stdout, "_test_object_method_array_of_ints(%p)\n", a_in);
264 if (a_in) return a_in;
265 int *v = malloc(sizeof(int));
266 *v = 42;
267 Eina_Array *arr = eina_array_new(2);
268 eina_array_push(arr, v);
269 return arr;
270}
271
272EOLIAN static Eina_Array *
273_test_object_method_array_of_bools(Eo* obj EINA_UNUSED,
274 Test_Object_Data *pd EINA_UNUSED,
275 Eina_Array *a_in)
276{
277 fprintf(stdout, "_test_object_method_array_of_bools(%p)\n", a_in);
278 if (a_in) return a_in;
279 Eina_Bool *v = malloc(sizeof(Eina_Bool));
280 *v = EINA_TRUE;
281 Eina_Array *arr = eina_array_new(2);
282 eina_array_push(arr, v);
283 return arr;
284}
285
286EOLIAN static Eina_Array *
287_test_object_method_array_of_doubles(Eo* obj EINA_UNUSED,
288 Test_Object_Data *pd EINA_UNUSED,
289 Eina_Array *a_in)
290{
291 fprintf(stdout, "_test_object_method_array_of_doubles(%p)\n", a_in);
292 if (a_in) return a_in;
293 double *v = malloc(sizeof(double));
294 *v = 42;
295 Eina_Array *arr = eina_array_new(2);
296 eina_array_push(arr, v);
297 return arr;
298}
299
300EOLIAN static Eina_Array *
301_test_object_method_array_of_enums(Eo* obj EINA_UNUSED,
302 Test_Object_Data *pd EINA_UNUSED,
303 Eina_Array *a_in)
304{
305 fprintf(stdout, "_test_object_method_array_of_enums(%p)\n", a_in);
306 if (a_in) return a_in;
307 Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
308 *v = TEST_ENUM_EX_THIRD;
309 Eina_Array *arr = eina_array_new(2);
310 eina_array_push(arr, v);
311 return arr;
312}
313
314EOLIAN static Eina_Array *
315_test_object_method_array_of_structs(Eo* obj EINA_UNUSED,
316 Test_Object_Data *pd EINA_UNUSED,
317 Eina_Array *a_in)
318{
319 fprintf(stdout, "_test_object_method_array_of_structs(%p)\n", a_in);
320 if (a_in) return a_in;
321 Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
322 v->value_int = 42;
323 v->value_enum = TEST_ENUM_EX_THIRD;
324 Eina_Array *arr = eina_array_new(2);
325 eina_array_push(arr, v);
326 return arr;
327}
328
329EOLIAN static Eina_Array *
330_test_object_method_array_of_arrays_of_ints(Eo* obj EINA_UNUSED,
331 Test_Object_Data *pd EINA_UNUSED,
332 Eina_Array *a_in)
333{
334 fprintf(stdout, "_test_object_method_array_of_arrays_of_ints(%p)\n", a_in);
335 if (a_in) return a_in;
336 int *v = malloc(sizeof(int));
337 *v = 42;
338 Eina_Array *a1 = eina_array_new(2);
339 eina_array_push(a1, v);
340 Eina_Array *a2 = eina_array_new(2);
341 eina_array_push(a2, a1);
342 return a2;
343}
344
345// Lists //
346
347EOLIAN static Eina_List *
348_test_object_method_list_with_42(Eo* obj EINA_UNUSED,
349 Test_Object_Data *pd EINA_UNUSED)
350{
351 fprintf(stdout, "_test_object_method_list_with_42()\n");
352 int* n = malloc(sizeof(int));
353 *n = 42;
354 return eina_list_append(NULL, n);
355}
356
357EOLIAN static void
358_test_object_method_list_in_list_out(Eo* obj EINA_UNUSED,
359 Test_Object_Data *pd EINA_UNUSED,
360 Eina_List *l_in,
361 Eina_List **l_out)
362{
363 fprintf(stdout, "_test_object_method_list_in_list_out(%p , %p)\n", l_in, l_out);
364 *l_out = l_in;
365}
366
367EOLIAN static Eina_List *
368_test_object_method_list_of_objects(Eo* obj,
369 Test_Object_Data *pd EINA_UNUSED,
370 Eina_List *l_in)
371{
372 fprintf(stdout, "_test_object_method_list_of_objects(%p)\n", l_in);
373 if (l_in) return l_in;
374 return eina_list_append(NULL, obj);
375}
376
377
378EOLIAN static Eina_List *
379_test_object_method_list_of_strings(Eo* obj EINA_UNUSED,
380 Test_Object_Data *pd EINA_UNUSED,
381 Eina_List *l_in)
382{
383 fprintf(stdout, "_test_object_method_list_of_strings(%p)\n", l_in);
384 if (l_in) return l_in;
385 return eina_list_append(NULL, "foo");
386}
387
388EOLIAN static Eina_List *
389_test_object_method_list_of_ints(Eo* obj EINA_UNUSED,
390 Test_Object_Data *pd EINA_UNUSED,
391 Eina_List *l_in)
392{
393 fprintf(stdout, "_test_object_method_list_of_ints(%p)\n", l_in);
394 if (l_in) return l_in;
395 int *v = malloc(sizeof(int));
396 *v = 42;
397 return eina_list_append(NULL, v);
398}
399
400EOLIAN static Eina_List *
401_test_object_method_list_of_bools(Eo* obj EINA_UNUSED,
402 Test_Object_Data *pd EINA_UNUSED,
403 Eina_List *l_in)
404{
405 fprintf(stdout, "_test_object_method_list_of_bools(%p)\n", l_in);
406 if (l_in) return l_in;
407 Eina_Bool *v = malloc(sizeof(Eina_Bool));
408 *v = EINA_TRUE;
409 return eina_list_append(NULL, v);
410}
411
412EOLIAN static Eina_List *
413_test_object_method_list_of_doubles(Eo* obj EINA_UNUSED,
414 Test_Object_Data *pd EINA_UNUSED,
415 Eina_List *l_in)
416{
417 fprintf(stdout, "_test_object_method_list_of_doubles(%p)\n", l_in);
418 if (l_in) return l_in;
419 double *v = malloc(sizeof(double));
420 *v = 42;
421 return eina_list_append(NULL, v);
422}
423
424EOLIAN static Eina_List *
425_test_object_method_list_of_enums(Eo* obj EINA_UNUSED,
426 Test_Object_Data *pd EINA_UNUSED,
427 Eina_List *l_in)
428{
429 fprintf(stdout, "_test_object_method_list_of_enums(%p)\n", l_in);
430 if (l_in) return l_in;
431 Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
432 *v = TEST_ENUM_EX_THIRD;
433 return eina_list_append(NULL, v);
434}
435
436EOLIAN static Eina_List *
437_test_object_method_list_of_structs(Eo* obj EINA_UNUSED,
438 Test_Object_Data *pd EINA_UNUSED,
439 Eina_List *l_in)
440{
441 fprintf(stdout, "_test_object_method_list_of_structs(%p)\n", l_in);
442 if (l_in) return l_in;
443 Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
444 v->value_int = 42;
445 v->value_enum = TEST_ENUM_EX_THIRD;
446 return eina_list_append(NULL, v);
447}
448
449// Accessors //
450
451EOLIAN static Eina_Accessor *
452_test_object_method_accessor_of_objects(Eo* obj,
453 Test_Object_Data *pd EINA_UNUSED,
454 Eina_Accessor *a_in)
455{
456 fprintf(stdout, "_test_object_method_accessor_of_objects(%p)\n", a_in);
457 if (a_in) return a_in;
458 Eina_Array *arr = eina_array_new(2);
459 eina_array_push(arr, obj);
460 return eina_array_accessor_new(arr);
461}
462
463EOLIAN static Eina_Accessor *
464_test_object_method_accessor_of_strings(Eo* obj EINA_UNUSED,
465 Test_Object_Data *pd EINA_UNUSED,
466 Eina_Accessor *a_in)
467{
468 fprintf(stdout, "_test_object_method_accessor_of_strings(%p)\n", a_in);
469 if (a_in) return a_in;
470 Eina_Array *arr = eina_array_new(2);
471 eina_array_push(arr, "foo");
472 return eina_array_accessor_new(arr);
473}
474
475EOLIAN static Eina_Accessor *
476_test_object_method_accessor_of_ints(Eo* obj EINA_UNUSED,
477 Test_Object_Data *pd EINA_UNUSED,
478 Eina_Accessor *a_in)
479{
480 fprintf(stdout, "_test_object_method_accessor_of_ints(%p)\n", a_in);
481 if (a_in) return a_in;
482 int *v = malloc(sizeof(int));
483 *v = 42;
484 Eina_Array *arr = eina_array_new(2);
485 eina_array_push(arr, v);
486 return eina_array_accessor_new(arr);
487}
488
489EOLIAN static Eina_Accessor *
490_test_object_method_accessor_of_bools(Eo* obj EINA_UNUSED,
491 Test_Object_Data *pd EINA_UNUSED,
492 Eina_Accessor *a_in)
493{
494 fprintf(stdout, "_test_object_method_accessor_of_bools(%p)\n", a_in);
495 if (a_in) return a_in;
496 Eina_Bool *v = malloc(sizeof(Eina_Bool));
497 *v = EINA_TRUE;
498 Eina_Array *arr = eina_array_new(2);
499 eina_array_push(arr, v);
500 return eina_array_accessor_new(arr);
501}
502
503EOLIAN static Eina_Accessor *
504_test_object_method_accessor_of_doubles(Eo* obj EINA_UNUSED,
505 Test_Object_Data *pd EINA_UNUSED,
506 Eina_Accessor *a_in)
507{
508 fprintf(stdout, "_test_object_method_accessor_of_doubles(%p)\n", a_in);
509 if (a_in) return a_in;
510 double *v = malloc(sizeof(double));
511 *v = 42.0;
512 Eina_Array *arr = eina_array_new(2);
513 eina_array_push(arr, v);
514 return eina_array_accessor_new(arr);
515}
516
517EOLIAN static Eina_Accessor *
518_test_object_method_accessor_of_enums(Eo* obj EINA_UNUSED,
519 Test_Object_Data *pd EINA_UNUSED,
520 Eina_Accessor *a_in)
521{
522 fprintf(stdout, "_test_object_method_accessor_of_enums(%p)\n", a_in);
523 if (a_in) return a_in;
524 Test_Enum_Ex *v = malloc(sizeof(Test_Enum_Ex));
525 *v = TEST_ENUM_EX_THIRD;
526 Eina_Array *arr = eina_array_new(2);
527 eina_array_push(arr, v);
528 return eina_array_accessor_new(arr);
529}
530
531EOLIAN static Eina_Accessor *
532_test_object_method_accessor_of_structs(Eo* obj EINA_UNUSED,
533 Test_Object_Data *pd EINA_UNUSED,
534 Eina_Accessor *a_in)
535{
536 fprintf(stdout, "_test_object_method_accessor_of_structs(%p)\n", a_in);
537 if (a_in) return a_in;
538 Test_Struct_Ex *v = malloc(sizeof(Test_Struct_Ex));
539 v->value_int = 42;
540 v->value_enum = TEST_ENUM_EX_THIRD;
541 Eina_Array *arr = eina_array_new(2);
542 eina_array_push(arr, v);
543 return eina_array_accessor_new(arr);
544}
545
546// Combinations of complex types
547
548EOLIAN static Eina_List *
549_test_object_method_list_of_lists_of_ints(Eo* obj EINA_UNUSED,
550 Test_Object_Data *pd EINA_UNUSED,
551 Eina_List *l_in)
552{
553 fprintf(stdout, "_test_object_method_list_of_lists_of_ints(%p)\n", l_in);
554 if (l_in) return l_in;
555 int *v = malloc(sizeof(int));
556 *v = 42;
557 return eina_list_append(NULL, eina_list_append(NULL, v));
558}
559
560EOLIAN static Eina_Array *
561_test_object_method_array_of_lists_of_ints(Eo* obj EINA_UNUSED,
562 Test_Object_Data *pd EINA_UNUSED,
563 Eina_Array *a_in)
564{
565 fprintf(stdout, "_test_object_method_array_of_lists_of_ints(%p)\n", a_in);
566 if (a_in) return a_in;
567 int *v = malloc(sizeof(int));
568 *v = 42;
569 Eina_Array *arr = eina_array_new(2);
570 eina_array_push(arr, eina_list_append(NULL, v));
571 return arr;
572}
573
574EOLIAN static Eina_List *
575_test_object_method_list_of_arrays_of_ints(Eo* obj EINA_UNUSED,
576 Test_Object_Data *pd EINA_UNUSED,
577 Eina_List *l_in)
578{
579 fprintf(stdout, "_test_object_method_list_of_arrays_of_ints(%p)\n", l_in);
580 if (l_in) return l_in;
581 int *v = malloc(sizeof(int));
582 *v = 42;
583 Eina_Array *arr = eina_array_new(2);
584 eina_array_push(arr, v);
585 return eina_list_append(NULL, arr);
586}
587
588EOLIAN static const Eina_List *
589_test_object_method_list_with_opaque_elements(Eo* obj EINA_UNUSED,
590 Test_Object_Data *pd EINA_UNUSED)
591{
592 fprintf(stdout, "_test_object_method_list_with_opaque_elements()\n");
593 return NULL;
594}
595
596EOLIAN static Test_Enum_Ex
597_test_object_method_in_enum_return_enum(Eo* obj EINA_UNUSED,
598 Test_Object_Data *pd EINA_UNUSED,
599 Test_Enum_Ex e)
600{
601 fprintf(stdout, "_test_object_method_in_enum_return_enum(%d)\n", e);
602 return e;
603}
604
605EOLIAN static Test_Struct_Ex *
606_test_object_method_in_struct_return_struct(Eo* obj EINA_UNUSED,
607 Test_Object_Data *pd EINA_UNUSED,
608 Test_Struct_Ex *s)
609{
610 fprintf(stdout, "_test_object_method_in_struct_return_struct()\n");
611 return s;
612}
613
614EOLIAN static void
615_test_object_event_repeated_event_name(Eo* obj EINA_UNUSED,
616 Test_Object_Data *pd EINA_UNUSED)
617{
618}
619
620#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 0000000..c292c24
--- /dev/null
+++ b/src/tests/eolian_js/test_object.eo
@@ -0,0 +1,305 @@
1enum Test.Enum_Ex {
2 first = 0,
3 second,
4 third,
5 fourth
6}
7
8struct Test.Struct_Ex {
9 value_int: int;
10 value_enum: Test.Enum_Ex;
11}
12
13class Test.Object (Eo.Base) {
14 legacy_prefix: null;
15 methods {
16 method_integral_in_a {
17 [[ tests integral in ]]
18 params { a: int; }
19 }
20 method_integral_out_a {
21 [[ tests integral out ]]
22 params { @out a: int; }
23 }
24 method_integral_inout {
25 [[ tests integral inout ]]
26 params { @inout a: int; }
27 }
28 method_integral_return_a {
29 [[ tests integral result ]]
30 return: int;
31 }
32 method_div_mod {
33 [[ tests mixed in, outs and result ]]
34 params {
35 a: int;
36 b: int;
37 @out quotient: int;
38 @out remainder: int;
39 }
40 return: bool;
41 }
42 method_and {
43 [[ tests boolean ]]
44 params {
45 a: bool;
46 b: bool;
47 }
48 return: bool;
49 }
50 method_modf {
51 [[ tests floating point ]]
52 params {
53 a: double;
54 @out int_part: double;
55 }
56 return: double;
57 }
58 method_uppercase {
59 [[ tests string ]]
60 params {
61 @inout str: char*;
62 }
63 }
64 method_in_null {
65 [[ tests null input ]]
66 params {
67 a: char*;
68 }
69 return: bool;
70 }
71 method_out_null {
72 [[ tests null output ]]
73 params {
74 @out a: char*;
75 }
76 return: bool;
77 }
78 method_inout_null {
79 [[ tests null output ]]
80 params {
81 @inout a: char*;
82 }
83 return: bool;
84 }
85 method_return_null {
86 [[ tests null return ]]
87 return: char*;
88 }
89 method_null {
90 [[ tests null values ]]
91 params {
92 in: char*;
93 @out out: char*;
94 @inout inout: char*;
95 }
96 return: char*;
97 }
98 method_array_at {
99 [[ tests array ]]
100 params {
101 array: array<int>*;
102 index: int;
103 }
104 return: int;
105 }
106 method_array_with_42 {
107 [[ tests parameters ]]
108 return: free(own(array<int> *), eina_array_free) @warn_unused;
109 }
110 method_array_in_array_out {
111 [[ tests parameters ]]
112 params {
113 @in a_in: array<int> *;
114 @out a_out: array<int> *;
115 }
116 }
117 method_array_of_objects {
118 params {
119 @in a_in: array<Test.Object *> *;
120 }
121 return: array<Test.Object *> *;
122 }
123 method_array_of_strings {
124 params {
125 @in a_in: array<const(char) *> *;
126 }
127 return: array<const(char) *> *;
128 }
129 method_array_of_ints {
130 params {
131 @in a_in: array<int> *;
132 }
133 return: array<int> *;
134 }
135 method_array_of_bools {
136 params {
137 @in a_in: array<bool> *;
138 }
139 return: array<bool> *;
140 }
141 method_array_of_doubles {
142 params {
143 @in a_in: array<double> *;
144 }
145 return: array<double> *;
146 }
147 method_array_of_enums {
148 params {
149 @in a_in: array<Test.Enum_Ex> *;
150 }
151 return: array<Test.Enum_Ex> *;
152 }
153 method_array_of_structs {
154 params {
155 @in a_in: array<Test.Struct_Ex> *;
156 }
157 return: array<Test.Struct_Ex> *;
158 }
159 method_list_with_42 {
160 [[ tests parameters ]]
161 return: free(own(list<int> *), eina_list_free) @warn_unused;
162 }
163 method_list_in_list_out {
164 [[ tests parameters ]]
165 params {
166 @in l_in: list<int> *;
167 @out l_out: list<int> *;
168 }
169 }
170 method_list_of_objects {
171 params {
172 @in l_in: list<Test.Object *> *;
173 }
174 return: list<Test.Object *> *;
175 }
176 method_list_of_strings {
177 params {
178 @in l_in: list<const(char) *> *;
179 }
180 return: list<const(char) *> *;
181 }
182 method_list_of_ints {
183 params {
184 @in l_in: list<int> *;
185 }
186 return: list<int> *;
187 }
188 method_list_of_bools {
189 params {
190 @in l_in: list<bool> *;
191 }
192 return: list<bool> *;
193 }
194 method_list_of_doubles {
195 params {
196 @in l_in: list<double> *;
197 }
198 return: list<double> *;
199 }
200 method_list_of_enums {
201 params {
202 @in l_in: list<Test.Enum_Ex> *;
203 }
204 return: list<Test.Enum_Ex> *;
205 }
206 method_list_of_structs {
207 params {
208 @in l_in: list<Test.Struct_Ex> *;
209 }
210 return: list<Test.Struct_Ex> *;
211 }
212 method_accessor_of_objects {
213 params {
214 @in a_in: accessor<Test.Object *> *;
215 }
216 return: accessor<Test.Object *> *;
217 }
218 method_accessor_of_strings {
219 params {
220 @in a_in: accessor<const(char) *> *;
221 }
222 return: accessor<const(char) *> *;
223 }
224 method_accessor_of_ints {
225 params {
226 @in a_in: accessor<int> *;
227 }
228 return: accessor<int> *;
229 }
230 method_accessor_of_bools {
231 params {
232 @in a_in: accessor<bool> *;
233 }
234 return: accessor<bool> *;
235 }
236 method_accessor_of_doubles {
237 params {
238 @in a_in: accessor<double> *;
239 }
240 return: accessor<double> *;
241 }
242 method_accessor_of_enums {
243 params {
244 @in a_in: accessor<Test.Enum_Ex> *;
245 }
246 return: accessor<Test.Enum_Ex> *;
247 }
248 method_accessor_of_structs {
249 params {
250 @in a_in: accessor<Test.Struct_Ex> *;
251 }
252 return: accessor<Test.Struct_Ex> *;
253 }
254 method_array_of_arrays_of_ints {
255 params {
256 @in a_in: array<array<int> *> *;
257 }
258 return: array<array<int> *> *;
259 }
260 method_list_of_lists_of_ints {
261 params {
262 @in l_in: list<list<int> *> *;
263 }
264 return: list<list<int> *> *;
265 }
266 method_array_of_lists_of_ints {
267 params {
268 @in a_in: array<list<int> *> *;
269 }
270 return: array<list<int> *> *;
271 }
272 method_list_of_arrays_of_ints {
273 params {
274 @in l_in: list<array<int> *> *;
275 }
276 return: list<array<int> *> *;
277 }
278 method_list_with_opaque_elements {
279 return: const(list<Elm.Calendar.Mark*>)*;
280 }
281 method_in_enum_return_enum {
282 params { e: Test.Enum_Ex; }
283 return: Test.Enum_Ex;
284 }
285 method_in_struct_return_struct {
286 params { e: Test.Struct_Ex *; }
287 return: Test.Struct_Ex *;
288 }
289 call_event {
290 }
291 event_repeated_event_name {
292 }
293 }
294 implements {
295 Eo.Base.finalize;
296 Eo.Base.constructor;
297 Eo.Base.destructor;
298 }
299 events {
300 test;
301 test,structarg: Test.Struct_Ex;
302 test,stringarg: const(char)*;
303 repeated,event,name;
304 }
305}