summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Eo.cs
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2020-01-30 16:49:04 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2020-02-18 16:47:38 -0300
commit595cb754b3aa280cdbebcb5fa0c51f287099b713 (patch)
tree49ce2ed6e0e25b7268267d8255dddf46266dfe71 /src/tests/efl_mono/Eo.cs
parentd00dadb79ab1c216ecc0519716ca25a1f92c3632 (diff)
eolian-mono: Make Get/Set internal for generated properties
Make Get and Set methods internal for properties that get the property syntax generated. Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D11252
Diffstat (limited to 'src/tests/efl_mono/Eo.cs')
-rw-r--r--src/tests/efl_mono/Eo.cs45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 8d00155e10..8c0c9ab994 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -149,8 +149,8 @@ class TestEoNames
149 var obj = new Dummy.TestObject(); 149 var obj = new Dummy.TestObject();
150 150
151 string name = "Dummy"; 151 string name = "Dummy";
152 obj.SetName(name); 152 obj.Name = name;
153 Test.AssertEquals(name, obj.GetName()); 153 Test.AssertEquals(name, obj.Name);
154 obj.Dispose(); 154 obj.Dispose();
155 } 155 }
156} 156}
@@ -162,9 +162,9 @@ class TestEoParent
162 var parent = new Dummy.TestObject(null); 162 var parent = new Dummy.TestObject(null);
163 var child = new Dummy.TestObject(parent); 163 var child = new Dummy.TestObject(parent);
164 164
165 Test.AssertEquals(parent, child.GetParent()); 165 Test.AssertEquals(parent, child.Parent);
166 166
167 var parent_retrieved = child.GetParent() as Dummy.TestObject; 167 var parent_retrieved = child.Parent as Dummy.TestObject;
168 Test.AssertEquals(parent, parent_retrieved); 168 Test.AssertEquals(parent, parent_retrieved);
169 child.Dispose(); 169 child.Dispose();
170 parent.Dispose(); 170 parent.Dispose();
@@ -175,9 +175,9 @@ class TestEoParent
175 Dummy.Numberwrapper parent = new Dummy.Numberwrapper(null); 175 Dummy.Numberwrapper parent = new Dummy.Numberwrapper(null);
176 var child = new Dummy.TestObject(parent); 176 var child = new Dummy.TestObject(parent);
177 177
178 Test.AssertEquals(parent, child.GetParent()); 178 Test.AssertEquals(parent, child.Parent);
179 179
180 Dummy.Numberwrapper parent_retrieved = child.GetParent() as Dummy.Numberwrapper; 180 Dummy.Numberwrapper parent_retrieved = child.Parent as Dummy.Numberwrapper;
181 Test.AssertEquals(parent, parent_retrieved); 181 Test.AssertEquals(parent, parent_retrieved);
182 child.Dispose(); 182 child.Dispose();
183 parent.Dispose(); 183 parent.Dispose();
@@ -195,9 +195,9 @@ class TestEoParent
195 var parent = new Derived(null); 195 var parent = new Derived(null);
196 var child = new Derived(parent); 196 var child = new Derived(parent);
197 197
198 Test.AssertEquals(parent, child.GetParent()); 198 Test.AssertEquals(parent, child.Parent);
199 199
200 var parent_from_cast = child.GetParent() as Derived; 200 var parent_from_cast = child.Parent as Derived;
201 Test.AssertEquals(parent, parent_from_cast); 201 Test.AssertEquals(parent, parent_from_cast);
202 child.Dispose(); 202 child.Dispose();
203 parent.Dispose(); 203 parent.Dispose();
@@ -209,15 +209,15 @@ class TestKlassMethods
209 public static void basic_class_method() 209 public static void basic_class_method()
210 { 210 {
211 int reference = 0xbeef; 211 int reference = 0xbeef;
212 Dummy.TestObject.SetKlassProp(reference); 212 Dummy.TestObject.KlassProp = reference;
213 Test.AssertEquals(reference, Dummy.TestObject.GetKlassProp()); 213 Test.AssertEquals(reference, Dummy.TestObject.KlassProp);
214 } 214 }
215 215
216 public static void inherited_class_method() 216 public static void inherited_class_method()
217 { 217 {
218 int reference = 0xdead; 218 int reference = 0xdead;
219 Dummy.Child.SetKlassProp(reference); 219 Dummy.Child.KlassProp = reference;
220 Test.AssertEquals(reference, Dummy.Child.GetKlassProp()); 220 Test.AssertEquals(reference, Dummy.Child.KlassProp);
221 } 221 }
222} 222}
223 223
@@ -559,7 +559,7 @@ class TestConstructors
559#else 559#else
560 var obj = new Dummy.Child(null, a, b); 560 var obj = new Dummy.Child(null, a, b);
561#endif 561#endif
562 Test.Assert(!obj.GetIfaceWasSet()); 562 Test.Assert(!obj.IfaceWasSet);
563 obj.Dispose(); 563 obj.Dispose();
564 } 564 }
565} 565}
@@ -586,7 +586,7 @@ class TestProvider
586 var obj = new Dummy.TestObject(); 586 var obj = new Dummy.TestObject();
587 Dummy.Numberwrapper provider = obj.FindProvider(typeof(Dummy.Numberwrapper)) as Dummy.Numberwrapper; 587 Dummy.Numberwrapper provider = obj.FindProvider(typeof(Dummy.Numberwrapper)) as Dummy.Numberwrapper;
588 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper)); 588 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper));
589 Test.AssertEquals(provider.GetNumber(), 1999); 589 Test.AssertEquals(provider.Number, 1999);
590 obj.Dispose(); 590 obj.Dispose();
591 } 591 }
592 592
@@ -685,16 +685,16 @@ class TestProtectedInterfaceMembers
685 { 685 {
686 var type = typeof(Dummy.ITestIface); 686 var type = typeof(Dummy.ITestIface);
687 var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance); 687 var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance);
688 var properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
688 689
689 // Fully protected property 690 // Fully protected property
690 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "GetProtectedProp")); 691 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "GetProtectedProp"));
691 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "SetProtectedProp")); 692 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "SetProtectedProp"));
692 693
693 // Partially protected property 694 // Partially protected property
694 Test.AssertNotNull(methods.SingleOrDefault(m => m.Name == "GetPublicGetterPrivateSetter")); 695 Test.AssertNotNull(properties.SingleOrDefault(m => m.Name == "PublicGetterPrivateSetter"));
695 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "SetPublicGetterPrivateSetter")); 696 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "SetPublicGetterPrivateSetter"));
696 697
697 var properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
698 Test.AssertNull(properties.SingleOrDefault(m => m.Name == "ProtectedProp")); 698 Test.AssertNull(properties.SingleOrDefault(m => m.Name == "ProtectedProp"));
699 Test.AssertNotNull(properties.SingleOrDefault(m => m.Name == "PublicGetterPrivateSetter")); 699 Test.AssertNotNull(properties.SingleOrDefault(m => m.Name == "PublicGetterPrivateSetter"));
700 } 700 }
@@ -703,15 +703,16 @@ class TestProtectedInterfaceMembers
703 { 703 {
704 var type = typeof(Dummy.TestObject); 704 var type = typeof(Dummy.TestObject);
705 705
706 // Fully protected property 706 // Fully internal property
707 var protected_methods = type.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Where(m => m.IsFamily); 707 var internal_methods = type.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Where(m => m.IsAssembly);
708 Test.AssertNotNull(protected_methods.SingleOrDefault(m => m.Name == "GetProtectedProp")); 708 Test.AssertNotNull(internal_methods.SingleOrDefault(m => m.Name == "GetProtectedProp"));
709 Test.AssertNotNull(protected_methods.SingleOrDefault(m => m.Name == "SetProtectedProp")); 709 Test.AssertNotNull(internal_methods.SingleOrDefault(m => m.Name == "SetProtectedProp"));
710 710
711 // Partially protected property 711 // Partially protected property
712 var public_methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance); 712 var public_methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance);
713 Test.AssertNotNull(public_methods.SingleOrDefault(m => m.Name == "GetPublicGetterPrivateSetter")); 713 Test.AssertNull(public_methods.SingleOrDefault(m => m.Name == "GetPublicGetterPrivateSetter"));
714 Test.AssertNotNull(protected_methods.SingleOrDefault(m => m.Name == "SetPublicGetterPrivateSetter")); 714 Test.AssertNotNull(internal_methods.SingleOrDefault(m => m.Name == "GetPublicGetterPrivateSetter"));
715 Test.AssertNotNull(internal_methods.SingleOrDefault(m => m.Name == "SetPublicGetterPrivateSetter"));
715 716
716 var protected_properties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance); 717 var protected_properties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance);
717 var prop = protected_properties.SingleOrDefault(m => m.Name == "ProtectedProp"); 718 var prop = protected_properties.SingleOrDefault(m => m.Name == "ProtectedProp");