diff options
Diffstat (limited to 'src/tests/efl_mono/Structs.cs')
-rw-r--r-- | src/tests/efl_mono/Structs.cs | 76 |
1 files changed, 58 insertions, 18 deletions
diff --git a/src/tests/efl_mono/Structs.cs b/src/tests/efl_mono/Structs.cs index d546298908..334057c907 100644 --- a/src/tests/efl_mono/Structs.cs +++ b/src/tests/efl_mono/Structs.cs @@ -180,8 +180,7 @@ internal class TestStructs public override bool StructSimpleOut(out Dummy.StructSimple simple) { called = true; - simple = new Dummy.StructSimple(); - simple.Fstring = "Virtual Struct Out"; + simple = new Dummy.StructSimple(fstring: "Virtual Struct Out"); return true; } @@ -206,8 +205,7 @@ internal class TestStructs public override Dummy.StructSimple StructSimpleReturn() { called = true; - var simple = new Dummy.StructSimple(); - simple.Fstring = "Virtual Struct Return"; + var simple = new Dummy.StructSimple(fstring: "Virtual Struct Return"); return simple; } @@ -234,7 +232,6 @@ internal class TestStructs { StructReturner t = new StructReturner(); var simple = structSimpleWithValues(); - simple.Fstring = "Virtual Struct In"; t.CallStructSimpleIn(simple); Test.Assert(t.called); @@ -352,6 +349,50 @@ internal class TestStructs t.Dispose(); } + public static void complex_iterator_retrieves_list_correctly() + { + var complex = structComplexWithValues(); + + var i = 0; + foreach (var elm in complex.Fiterator) { + Test.AssertEquals(elm, complex.Flist[i]); + i++; + } + } + + public static void complex_iterator_retrieves_array_correctly() + { + var complex = structComplexWithValues(); + + var i = 0; + foreach (var elm in complex.Fiterator) { + Test.AssertEquals(elm, complex.Farray[i]); + i++; + } + } + + public static void complex_accessor_retrieves_list_correctly() + { + var complex = structComplexWithValues(); + + var i = 0; + foreach (var elm in complex.Faccessor) { + Test.AssertEquals(elm, complex.Flist[i]); + i++; + } + } + + public static void complex_accessor_retrieves_array_correctly() + { + var complex = structComplexWithValues(); + + var i = 0; + foreach (var elm in complex.Faccessor) { + Test.AssertEquals(elm, complex.Farray[i]); + i++; + } + } + // public static void complex_ptr_out() // { // } @@ -379,13 +420,13 @@ internal class TestStructs internal class TestStructEquality { - static Dummy.StructSimple a = new Dummy.StructSimple(1, 2, (char)3, 4, Fstring: "", Fmstring: "", Fstringshare: ""); - static Dummy.StructSimple b = new Dummy.StructSimple(1, 2, (char)3, 4, Fstring: "", Fmstring: "", Fstringshare: ""); + static Dummy.StructSimple a = new Dummy.StructSimple(1, 2, (char)3, 4, fstring: "", fmstring: "", fstringshare: ""); + static Dummy.StructSimple b = new Dummy.StructSimple(1, 2, (char)3, 4, fstring: "", fmstring: "", fstringshare: ""); - static Dummy.StructSimple c = new Dummy.StructSimple(4, 3, (char)2, 1, Fstring: "", Fmstring: "", Fstringshare: ""); + static Dummy.StructSimple c = new Dummy.StructSimple(4, 3, (char)2, 1, fstring: "", fmstring: "", fstringshare: ""); // to check if we differ on a single struct field - static Dummy.StructSimple singleDifferentField = new Dummy.StructSimple(1, 2, (char)3, 5, Fstring: "", Fmstring: "", Fstringshare: ""); + static Dummy.StructSimple singleDifferentField = new Dummy.StructSimple(1, 2, (char)3, 5, fstring: "", fmstring: "", fstringshare: ""); public static void test_equals() { @@ -458,15 +499,14 @@ internal class TestStructTuples #if EFL_BETA public static void test_complex_fields_assign_conversion() { var pos = new Eina.Position2D(1, 2); - var action = Efl.Ui.SelectionAction.Unknown; - var format = Efl.Ui.SelectionFormat.None; - var item = null as Efl.Canvas.Vg.Object; - - Efl.Dnd.DragPos attr = (pos, action, format, item); - Test.AssertEquals(attr.Pos, pos); - Test.AssertEquals(attr.Action, action); - Test.AssertEquals(attr.Format, format); - Test.AssertEquals(attr.Item, item); + uint seat = 3; + var types = new System.String[] {"text", "markup"}; + + Efl.Ui.DropEvent attr = (pos, seat, types); + Test.AssertEquals(attr.Position, pos); + Test.AssertEquals(attr.Seat, seat); + Test.AssertEquals(attr.AvailableTypes.ElementAt(0), types[0]); + Test.AssertEquals(attr.AvailableTypes.ElementAt(1), types[1]); } #endif } |