Test.AssertEquals(-original, received);
}
+ /*
public static void simple_ptr_out()
{
int original = 1984;
Test.AssertEquals(original*2, received);
}
+ */
}
}
#if EFL_BETA
+/*
class TestEinaBinbuf
{
private static readonly byte[] test_string = System.Text.Encoding.UTF8.GetBytes("0123456789ABCDEF");
Test.Assert(t.binbuf_return_own_no_longer_own());
}
}
+*/
#endif
// Integer //
+ /*
public static void test_eina_array_int_in()
{
var t = new Dummy.TestObject();
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
}
+ */
// String //
public static void test_eina_array_str_in()
// Integer //
+ /*
public static void test_eina_list_int_in()
{
var t = new Dummy.TestObject();
lst.Dispose();
Test.Assert(lst.Handle == IntPtr.Zero);
}
+ */
// String //
public static void test_eina_list_str_in()
// Integer //
+ /*
public static void test_eina_hash_int_in()
{
var t = new Dummy.TestObject();
Test.Assert(hsh.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaHashIntReturnOwn());
}
+ */
// String //
// //
//
#if EFL_BETA
+/*
override public bool EinaBinbufIn(Eina.Binbuf binbuf)
{
binbuf_in_flag = true;
binbuf_return_own_binbuf = null;
return r;
}
+*/
#endif
}
{
var complex = new Dummy.StructComplex();
- complex.Farray = new Eina.Array<int>();
- complex.Farray.Push(0x0);
- complex.Farray.Push(0x2A);
- complex.Farray.Push(0x42);
+ complex.Farray = new Eina.Array<string>();
+ complex.Farray.Push("0x0");
+ complex.Farray.Push("0x2A");
+ complex.Farray.Push("0x42");
complex.Flist = new Eina.List<string>();
complex.Flist.Append("0x0");
complex.Fany_value_ptr = new Eina.Value(Eina.ValueType.String);
complex.Fany_value_ptr.Set("abc");
- complex.Fbinbuf = new Eina.Binbuf();
- complex.Fbinbuf.Append(126);
+ //complex.Fbinbuf = new Eina.Binbuf();
+ //complex.Fbinbuf.Append(126);
complex.Fslice.Length = 1;
complex.Fslice.Mem = Eina.MemoryNative.Alloc(1);
internal static void checkStructComplex(Dummy.StructComplex complex)
{
- Test.Assert(complex.Farray.ToArray().SequenceEqual(base_seq_int));
+ Test.Assert(complex.Farray.ToArray().SequenceEqual(base_seq_str));
Test.Assert(complex.Flist.ToArray().SequenceEqual(base_seq_str));
Test.Assert(complex.Fhash["cc"] == "ccc");
int idx = 0;
- foreach (int e in complex.Fiterator)
+ foreach (string e in complex.Fiterator)
{
- Test.Assert(e == base_seq_int[idx]);
+ Test.Assert(e == base_seq_str[idx]);
++idx;
}
+ Test.AssertEquals(idx, base_seq_str.Length);
double double_val = 0;
Test.Assert(complex.Fany_value.Get(out double_val));
Test.Assert(complex.Fany_value_ptr.Get(out str_val));
Test.Assert(str_val == "abc");
- Test.Assert(complex.Fbinbuf.Length == 1);
- Test.Assert(complex.Fbinbuf.GetBytes()[0] == 126);
+ //Test.Assert(complex.Fbinbuf.Length == 1);
+ //Test.Assert(complex.Fbinbuf.GetBytes()[0] == 126);
Test.Assert(complex.Fslice.Length == 1);
Test.Assert(complex.Fslice.GetBytes()[0] == 125);
Test.Assert(complex.Fiterator == null);
Test.Assert(complex.Fany_value == null);
Test.Assert(complex.Fany_value_ptr == null);
- Test.Assert(complex.Fbinbuf == null);
+ //Test.Assert(complex.Fbinbuf == null);
Test.Assert(complex.Fslice.Length == 0);
Test.Assert(complex.Fslice.Mem == IntPtr.Zero);
Test.Assert(r, "Function returned false");
}
+ /*
public static void simple_ptr_in()
{
var simple = structSimpleWithValues();
Test.AssertEquals(-original, result.Fint);
Test.AssertEquals("nwO nI rtP tcurtS", result.Fmstring);
}
+ */
public static void simple_out()
{
checkStructSimple(simple);
}
+ /*
public static void simple_ptr_out()
{
Dummy.StructSimple simple;
Test.AssertEquals(result.Fint, simple.Fint);
Test.AssertEquals(simple.Fstring, "Ptr Out Own");
}
+ */
public static void simple_return()
{
checkStructSimple(simple);
}
+ /*
public static void simple_ptr_return()
{
var t = new Dummy.TestObject();
var simple = t.StructSimplePtrReturnOwn();
Test.AssertEquals(simple.Fstring, "Ret Ptr Own");
}
+ */
public class StructReturner : Dummy.TestObject
{
return true;
}
+ /*
public override bool StructSimplePtrIn(ref Dummy.StructSimple simple)
{
called = true;
received = simple;
return received;
}
+ */
public override bool StructSimpleOut(out Dummy.StructSimple simple) {
called = true;
return true;
}
+ /*
public override Dummy.StructSimple StructSimplePtrOut(out Dummy.StructSimple simple) {
called = true;
// No way to explicitly define the ownership of the parameter.
simple.Fstring = "Virtual Struct Ptr Out Own";
return simple;
}
+ */
public override Dummy.StructSimple StructSimpleReturn()
{
return simple;
}
+ /*
public override Dummy.StructSimple StructSimplePtrReturn()
{
called = true;
simple.Fstring = "Virtual Struct Ptr Return Own";
return simple;
}
+ */
}
public static void simple_in_virtual()
Test.AssertEquals(simple.Fstring, t.received.Fstring);
}
+ /*
public static void simple_ptr_in_virtual()
{
StructReturner t = new StructReturner();
Test.Assert(t.called);
Test.AssertEquals(t.received.Fstring, simple.Fstring);
}
+ */
public static void simple_out_virtual()
{
Test.AssertEquals("Virtual Struct Out", simple.Fstring);
}
+ /*
public static void simple_ptr_out_virtual()
{
StructReturner t = new StructReturner();
Test.Assert(t.called, "override was not called");
Test.AssertEquals("Virtual Struct Ptr Out Own", simple.Fstring);
}
+ */
public static void simple_return_virtual()
{
Test.AssertEquals("Virtual Struct Return", simple.Fstring);
}
+ /*
public static void simple_ptr_return_virtual()
{
StructReturner t = new StructReturner();
Test.Assert(t.called, "override was not called");
Test.AssertEquals("Virtual Struct Ptr Return Own", simple.Fstring);
}
+ */
// Complex Structs
#if EFL_BETA
return slc;
}
+#if 0
Eina_Bool _dummy_test_object_eina_binbuf_in(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_Binbuf *binbuf)
{
Eina_Bool r = (0 == memcmp(eina_binbuf_string_get(binbuf), base_seq, eina_binbuf_length_get(binbuf)));
{
return dummy_test_object_eina_binbuf_return_own(obj);
}
+#endif
static const int base_seq_int[] = {0x0,0x2A,0x42};
void struct_complex_with_values(Dummy_StructComplex *complex)
{
complex->farray = eina_array_new(4);
- eina_array_push(complex->farray, _new_int(0x0));
- eina_array_push(complex->farray, _new_int(0x2A));
- eina_array_push(complex->farray, _new_int(0x42));
+ eina_array_push(complex->farray, strdup("0x0"));
+ eina_array_push(complex->farray, strdup("0x2A"));
+ eina_array_push(complex->farray, strdup("0x42"));
complex->flist = eina_list_append(complex->flist, strdup("0x0"));
complex->flist = eina_list_append(complex->flist, strdup("0x2A"));
complex->fany_value_ptr = eina_value_new(EINA_VALUE_TYPE_STRING);
eina_value_set(complex->fany_value_ptr, "abc");
- complex->fbinbuf = eina_binbuf_new();
- eina_binbuf_append_char(complex->fbinbuf, 126);
+ //complex->fbinbuf = eina_binbuf_new();
+ //eina_binbuf_append_char(complex->fbinbuf, 126);
complex->fslice.len = 1;
complex->fslice.mem = malloc(1);
static
Eina_Bool check_and_modify_struct_complex(Dummy_StructComplex *complex)
{
- if (!_array_int_equal(complex->farray, base_seq_int, base_seq_int_size))
+ if (!_array_str_equal(complex->farray, base_seq_str, base_seq_str_size))
return EINA_FALSE;
if (!_list_str_equal(complex->flist, base_seq_str, base_seq_str_size))
|| !_hash_str_check(complex->fhash, "cc", "ccc"))
return EINA_FALSE;
- if (!_iterator_int_equal(complex->fiterator, base_seq_int, base_seq_int_size, EINA_FALSE))
+ if (!_iterator_str_equal(complex->fiterator, base_seq_str, base_seq_str_size, EINA_FALSE))
return EINA_FALSE;
double double_val = 0;
if (!eina_value_get(complex->fany_value_ptr, &str_val) || strcmp(str_val, "abc") != 0)
return EINA_FALSE;
+ /*
if (eina_binbuf_length_get(complex->fbinbuf) != 1 || eina_binbuf_string_get(complex->fbinbuf)[0] != 126)
return EINA_FALSE;
+ */
if (complex->fslice.len != 1 || *(char*)complex->fslice.mem != 125)
return EINA_FALSE;
dummy_test_object_struct_simple_in(obj, simple);
}
+/*
EOLIAN
void _dummy_test_object_call_struct_simple_ptr_in(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Dummy_StructSimple *simple)
{
{
dummy_test_object_struct_simple_ptr_in_own(obj, simple);
}
+*/
EOLIAN
void _dummy_test_object_call_struct_simple_out(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Dummy_StructSimple *simple)
dummy_test_object_struct_simple_out(obj, simple);
}
+/*
EOLIAN
void _dummy_test_object_call_struct_simple_ptr_out(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Dummy_StructSimple **simple)
{
{
dummy_test_object_struct_simple_ptr_out_own(obj, simple);
}
+*/
EOLIAN
Dummy_StructSimple _dummy_test_object_call_struct_simple_return(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
return dummy_test_object_struct_simple_return(obj);
}
+/*
EOLIAN
Dummy_StructSimple *_dummy_test_object_call_struct_simple_ptr_return(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
{
{
return dummy_test_object_struct_simple_ptr_return_own(obj);
}
+*/
// with complex types
}
struct @beta @free(free) Dummy.StructComplex {
- farray: array<ptr(int)>;
+ farray: array<string>;
flist: list<string>;
fhash: hash<string, string>;
- fiterator: iterator<ptr(int)>;
+ fiterator: iterator<string>;
fany_value: any_value;
fany_value_ptr: any_value_ptr;
- fbinbuf: ptr(Eina.Binbuf);
+ // fbinbuf: ptr(Eina.Binbuf);
fslice: slice<ubyte>;
// fslice: ptr(Eina.Slice); // TODO
fobj: Dummy.Numberwrapper;
}
}
+ /*
int_ptr_out {
params {
@in x: int;
@out y: ptr(int);
}
}
+ */
in_stringshare {
params {
}
*/
+ /*
eina_binbuf_in @beta {
params {
@in binbuf: ptr(Eina.Binbuf);
call_eina_binbuf_return_own @beta {
return: ptr(Eina.Binbuf) @owned;
}
+ */
/* Eina Array */
/* Integer */
+ /*
eina_array_int_in {
params {
@in arr: array<ptr(int)>;
eina_array_int_return_own {
return: array<free(ptr(int),free) @owned> @owned;
}
+ */
/* String */
eina_array_str_in {
/* Eina List */
/* Integer */
+ /*
eina_list_int_in {
params {
@in lst: list<ptr(int)>;
eina_list_int_return_own {
return: list<free(ptr(int),free) @owned> @owned;
}
+ */
/* String */
eina_list_str_in {
// Eina Hash //
// Integer //
+ /*
eina_hash_int_in {
params {
@in hsh: hash<ptr(int), ptr(int)>;
check_eina_hash_int_return_own {
return: bool;
}
+ */
// String //
eina_hash_str_in {
return: bool;
}
+ /*
struct_simple_ptr_in {
params {
@in simple: ptr(Dummy.StructSimple);
}
return: Dummy.StructSimple;
}
+ */
struct_simple_out {
params {
return: bool;
}
+ /*
struct_simple_ptr_out {
params {
@out simple: ptr(Dummy.StructSimple);
}
return: Dummy.StructSimple;
}
+ */
struct_simple_return {
return: Dummy.StructSimple;
}
+ /*
struct_simple_ptr_return {
return: ptr(Dummy.StructSimple);
}
struct_simple_ptr_return_own {
return: ptr(Dummy.StructSimple) @owned;
}
+ */
call_struct_simple_in {
params {
}
}
+ /*
call_struct_simple_ptr_in {
params {
@in simple: ptr(Dummy.StructSimple);
@in simple: ptr(Dummy.StructSimple) @owned;
}
}
+ */
call_struct_simple_out {
params {
}
}
+ /*
call_struct_simple_ptr_out {
params {
@out simple: ptr(Dummy.StructSimple);
@out simple: ptr(Dummy.StructSimple) @owned;
}
}
+ */
call_struct_simple_return {
return: Dummy.StructSimple;
}
+ /*
call_struct_simple_ptr_return {
return: ptr(Dummy.StructSimple);
}
call_struct_simple_ptr_return_own {
return: ptr(Dummy.StructSimple) @owned;
}
+ */
struct_complex_in @beta {
params {
return: bool;
}
+ /*
struct_complex_ptr_in @beta {
params {
@in complex: ptr(Dummy.StructComplex);
}
return: bool;
}
+ */
struct_complex_out @beta {
params {