forked from enlightenment/efl
eolian_mono: parse `binbuf` and `event` keywords, also re-enable binbuf tests
Summary:
Parse `binbuf` and `event` type names and generate the proper binding type.
In 288f645e3c
tests for `Eina.Binbuf` were disabled in order to avoid the
usage of deprecated notations in eolian.
Since the new `binbuf` keyword works as a substitute for the old notation
`ptr(Eina.Binbuf)`, tests were updated and re-enabled using the new notation.
Test Plan: `meson test`
Reviewers: felipealmeida, lauromoura, q66
Reviewed By: q66
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9349
This commit is contained in:
parent
8c90deecd7
commit
253e18159b
|
@ -103,6 +103,20 @@ struct marshall_type_visitor_generate
|
||||||
r.namespaces.clear();
|
r.namespaces.clear();
|
||||||
return r;
|
return r;
|
||||||
}}
|
}}
|
||||||
|
, {"binbuf", nullptr, [&]
|
||||||
|
{
|
||||||
|
regular_type_def r = regular;
|
||||||
|
r.base_type = "System.IntPtr";
|
||||||
|
r.namespaces.clear();
|
||||||
|
return r;
|
||||||
|
}}
|
||||||
|
, {"event", nullptr, [&]
|
||||||
|
{
|
||||||
|
regular_type_def r = regular;
|
||||||
|
r.base_type = "Efl.Event.NativeStruct";
|
||||||
|
r.namespaces.clear();
|
||||||
|
return r;
|
||||||
|
}}
|
||||||
, {"any_value", true, [&]
|
, {"any_value", true, [&]
|
||||||
{
|
{
|
||||||
regular_type_def r = regular;
|
regular_type_def r = regular;
|
||||||
|
|
|
@ -214,6 +214,14 @@ struct visitor_generate
|
||||||
{
|
{
|
||||||
return regular_type_def{"Eina.Strbuf", regular.base_qualifier, {}};
|
return regular_type_def{"Eina.Strbuf", regular.base_qualifier, {}};
|
||||||
}}
|
}}
|
||||||
|
, {"binbuf", nullptr, [&]
|
||||||
|
{
|
||||||
|
return regular_type_def{"Eina.Binbuf", regular.base_qualifier, {}};
|
||||||
|
}}
|
||||||
|
, {"event", nullptr, [&]
|
||||||
|
{
|
||||||
|
return regular_type_def{"Efl.Event", regular.base_qualifier, {}};
|
||||||
|
}}
|
||||||
, {"any_value", true, [&]
|
, {"any_value", true, [&]
|
||||||
{ return regular_type_def{"Eina.Value", regular.base_qualifier, {}};
|
{ return regular_type_def{"Eina.Value", regular.base_qualifier, {}};
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -12,7 +12,6 @@ namespace TestSuite
|
||||||
|
|
||||||
#if EFL_BETA
|
#if EFL_BETA
|
||||||
|
|
||||||
/*
|
|
||||||
class TestEinaBinbuf
|
class TestEinaBinbuf
|
||||||
{
|
{
|
||||||
private static readonly byte[] test_string = System.Text.Encoding.UTF8.GetBytes("0123456789ABCDEF");
|
private static readonly byte[] test_string = System.Text.Encoding.UTF8.GetBytes("0123456789ABCDEF");
|
||||||
|
@ -309,7 +308,6 @@ class TestEinaBinbuf
|
||||||
Test.Assert(t.binbuf_return_own_no_longer_own());
|
Test.Assert(t.binbuf_return_own_no_longer_own());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,6 @@ class NativeInheritImpl : Dummy.TestObject
|
||||||
// //
|
// //
|
||||||
//
|
//
|
||||||
#if EFL_BETA
|
#if EFL_BETA
|
||||||
/*
|
|
||||||
override public bool EinaBinbufIn(Eina.Binbuf binbuf)
|
override public bool EinaBinbufIn(Eina.Binbuf binbuf)
|
||||||
{
|
{
|
||||||
binbuf_in_flag = true;
|
binbuf_in_flag = true;
|
||||||
|
@ -282,7 +281,6 @@ class NativeInheritImpl : Dummy.TestObject
|
||||||
binbuf_return_own_binbuf = null;
|
binbuf_return_own_binbuf = null;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,8 +148,8 @@ internal class StructHelpers
|
||||||
complex.Fany_value_ptr = new Eina.Value(Eina.ValueType.String);
|
complex.Fany_value_ptr = new Eina.Value(Eina.ValueType.String);
|
||||||
complex.Fany_value_ptr.Set("abc");
|
complex.Fany_value_ptr.Set("abc");
|
||||||
|
|
||||||
//complex.Fbinbuf = new Eina.Binbuf();
|
complex.Fbinbuf = new Eina.Binbuf();
|
||||||
//complex.Fbinbuf.Append(126);
|
complex.Fbinbuf.Append(126);
|
||||||
|
|
||||||
complex.Fslice.Length = 1;
|
complex.Fslice.Length = 1;
|
||||||
complex.Fslice.Mem = Eina.MemoryNative.Alloc(1);
|
complex.Fslice.Mem = Eina.MemoryNative.Alloc(1);
|
||||||
|
@ -187,8 +187,8 @@ internal class StructHelpers
|
||||||
Test.Assert(complex.Fany_value_ptr.Get(out str_val));
|
Test.Assert(complex.Fany_value_ptr.Get(out str_val));
|
||||||
Test.Assert(str_val == "abc");
|
Test.Assert(str_val == "abc");
|
||||||
|
|
||||||
//Test.Assert(complex.Fbinbuf.Length == 1);
|
Test.Assert(complex.Fbinbuf.Length == 1);
|
||||||
//Test.Assert(complex.Fbinbuf.GetBytes()[0] == 126);
|
Test.Assert(complex.Fbinbuf.GetBytes()[0] == 126);
|
||||||
|
|
||||||
Test.Assert(complex.Fslice.Length == 1);
|
Test.Assert(complex.Fslice.Length == 1);
|
||||||
Test.Assert(complex.Fslice.GetBytes()[0] == 125);
|
Test.Assert(complex.Fslice.GetBytes()[0] == 125);
|
||||||
|
@ -206,7 +206,7 @@ internal class StructHelpers
|
||||||
Test.Assert(complex.Fiterator == null);
|
Test.Assert(complex.Fiterator == null);
|
||||||
Test.Assert(complex.Fany_value == null);
|
Test.Assert(complex.Fany_value == null);
|
||||||
Test.Assert(complex.Fany_value_ptr == 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.Length == 0);
|
||||||
Test.Assert(complex.Fslice.Mem == IntPtr.Zero);
|
Test.Assert(complex.Fslice.Mem == IntPtr.Zero);
|
||||||
|
|
|
@ -347,7 +347,6 @@ Eina_Rw_Slice _dummy_test_object_eina_rw_slice_return(EINA_UNUSED Eo *obj, EINA_
|
||||||
return slc;
|
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 _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)));
|
Eina_Bool r = (0 == memcmp(eina_binbuf_string_get(binbuf), base_seq, eina_binbuf_length_get(binbuf)));
|
||||||
|
@ -459,7 +458,6 @@ Eina_Binbuf *_dummy_test_object_call_eina_binbuf_return_own(Eo *obj, EINA_UNUSED
|
||||||
{
|
{
|
||||||
return dummy_test_object_eina_binbuf_return_own(obj);
|
return dummy_test_object_eina_binbuf_return_own(obj);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static const int base_seq_int[] = {0x0,0x2A,0x42};
|
static const int base_seq_int[] = {0x0,0x2A,0x42};
|
||||||
|
@ -4118,8 +4116,8 @@ void struct_complex_with_values(Dummy_StructComplex *complex)
|
||||||
complex->fany_value_ptr = eina_value_new(EINA_VALUE_TYPE_STRING);
|
complex->fany_value_ptr = eina_value_new(EINA_VALUE_TYPE_STRING);
|
||||||
eina_value_set(complex->fany_value_ptr, "abc");
|
eina_value_set(complex->fany_value_ptr, "abc");
|
||||||
|
|
||||||
//complex->fbinbuf = eina_binbuf_new();
|
complex->fbinbuf = eina_binbuf_new();
|
||||||
//eina_binbuf_append_char(complex->fbinbuf, 126);
|
eina_binbuf_append_char(complex->fbinbuf, 126);
|
||||||
|
|
||||||
complex->fslice.len = 1;
|
complex->fslice.len = 1;
|
||||||
complex->fslice.mem = malloc(1);
|
complex->fslice.mem = malloc(1);
|
||||||
|
@ -4153,10 +4151,8 @@ Eina_Bool check_and_modify_struct_complex(Dummy_StructComplex *complex)
|
||||||
if (!eina_value_get(complex->fany_value_ptr, &str_val) || strcmp(str_val, "abc") != 0)
|
if (!eina_value_get(complex->fany_value_ptr, &str_val) || strcmp(str_val, "abc") != 0)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
||||||
/*
|
|
||||||
if (eina_binbuf_length_get(complex->fbinbuf) != 1 || eina_binbuf_string_get(complex->fbinbuf)[0] != 126)
|
if (eina_binbuf_length_get(complex->fbinbuf) != 1 || eina_binbuf_string_get(complex->fbinbuf)[0] != 126)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
*/
|
|
||||||
|
|
||||||
if (complex->fslice.len != 1 || *(char*)complex->fslice.mem != 125)
|
if (complex->fslice.len != 1 || *(char*)complex->fslice.mem != 125)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
|
@ -81,7 +81,7 @@ struct @beta @free(free) Dummy.StructComplex {
|
||||||
fiterator: iterator<string>;
|
fiterator: iterator<string>;
|
||||||
fany_value: any_value;
|
fany_value: any_value;
|
||||||
fany_value_ptr: any_value_ptr;
|
fany_value_ptr: any_value_ptr;
|
||||||
// fbinbuf: ptr(Eina.Binbuf);
|
fbinbuf: binbuf;
|
||||||
fslice: slice<ubyte>;
|
fslice: slice<ubyte>;
|
||||||
// fslice: ptr(Eina.Slice); // TODO
|
// fslice: ptr(Eina.Slice); // TODO
|
||||||
fobj: Dummy.Numberwrapper;
|
fobj: Dummy.Numberwrapper;
|
||||||
|
@ -298,31 +298,30 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
eina_binbuf_in @beta {
|
eina_binbuf_in @beta {
|
||||||
params {
|
params {
|
||||||
@in binbuf: ptr(Eina.Binbuf);
|
@in binbuf: binbuf;
|
||||||
}
|
}
|
||||||
return: bool;
|
return: bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
call_eina_binbuf_in @beta {
|
call_eina_binbuf_in @beta {
|
||||||
params {
|
params {
|
||||||
@in binbuf: ptr(Eina.Binbuf);
|
@in binbuf: binbuf;
|
||||||
}
|
}
|
||||||
return: bool;
|
return: bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
eina_binbuf_in_own @beta {
|
eina_binbuf_in_own @beta {
|
||||||
params {
|
params {
|
||||||
@in binbuf: ptr(Eina.Binbuf) @owned;
|
@in binbuf: binbuf @owned;
|
||||||
}
|
}
|
||||||
return: bool;
|
return: bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
call_eina_binbuf_in_own @beta {
|
call_eina_binbuf_in_own @beta {
|
||||||
params {
|
params {
|
||||||
@in str: ptr(Eina.Binbuf) @owned;
|
@in str: binbuf @owned;
|
||||||
}
|
}
|
||||||
return: bool;
|
return: bool;
|
||||||
}
|
}
|
||||||
|
@ -333,13 +332,13 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
|
||||||
|
|
||||||
eina_binbuf_out @beta {
|
eina_binbuf_out @beta {
|
||||||
params {
|
params {
|
||||||
@out binbuf: ptr(Eina.Binbuf);
|
@out binbuf: binbuf;
|
||||||
}
|
}
|
||||||
return: bool;
|
return: bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
call_eina_binbuf_out @beta {
|
call_eina_binbuf_out @beta {
|
||||||
return: ptr(Eina.Binbuf);
|
return: binbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
check_binbuf_out {
|
check_binbuf_out {
|
||||||
|
@ -348,21 +347,21 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
|
||||||
|
|
||||||
eina_binbuf_out_own @beta {
|
eina_binbuf_out_own @beta {
|
||||||
params {
|
params {
|
||||||
@out binbuf: ptr(Eina.Binbuf) @owned;
|
@out binbuf: binbuf @owned;
|
||||||
}
|
}
|
||||||
return: bool;
|
return: bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
call_eina_binbuf_out_own @beta {
|
call_eina_binbuf_out_own @beta {
|
||||||
return: ptr(Eina.Binbuf) @owned;
|
return: binbuf @owned;
|
||||||
}
|
}
|
||||||
|
|
||||||
eina_binbuf_return @beta {
|
eina_binbuf_return @beta {
|
||||||
return: ptr(Eina.Binbuf);
|
return: binbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
call_eina_binbuf_return @beta {
|
call_eina_binbuf_return @beta {
|
||||||
return: ptr(Eina.Binbuf);
|
return: binbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
check_binbuf_return {
|
check_binbuf_return {
|
||||||
|
@ -370,13 +369,12 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
|
||||||
}
|
}
|
||||||
|
|
||||||
eina_binbuf_return_own @beta {
|
eina_binbuf_return_own @beta {
|
||||||
return: ptr(Eina.Binbuf) @owned;
|
return: binbuf @owned;
|
||||||
}
|
}
|
||||||
|
|
||||||
call_eina_binbuf_return_own @beta {
|
call_eina_binbuf_return_own @beta {
|
||||||
return: ptr(Eina.Binbuf) @owned;
|
return: binbuf @owned;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/* Eina Array */
|
/* Eina Array */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue