Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorRadek Doulik <rodo@xamarin.com>2018-01-17 18:30:29 +0300
committerMarek Safar <marek.safar@gmail.com>2018-01-17 22:44:25 +0300
commit9a183f2c833a54e10fdcb09a3300d86e89ee85ae (patch)
tree171371065db5a0931f2eefadb503316f1b6bae36 /mcs
parentf162931e25c4cc1ad3d1a21117bb085089f168cd (diff)
[Tests] Do not assume order of returned interfaces
Updated the System.Reflection.Emit/SaveTest to not depend on order of interfaces returned from the System.Type::GetInterfaces method, as the order is not guaranted. As described in the [documentation][0]. Also see github [issue][1] for more information and reasoning. [0]: https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2 [1]: https://github.com/xamarin/xamarin-android/issues/1186
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs b/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs
index b42ad25a899..0bfa00ea850 100644
--- a/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs
+++ b/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs
@@ -317,9 +317,10 @@ public class SaveTest
// Type attributes
Assert.AreEqual (TypeAttributes.Public|TypeAttributes.SequentialLayout, type1.Attributes);
// Interfaces
- Assert.AreEqual (2, type1.GetInterfaces ().Length);
- Assert.AreEqual (iface1, type1.GetInterfaces () [0]);
- Assert.AreEqual (typeof (IComparable), type1.GetInterfaces () [1]);
+ var ifaces = type1.GetInterfaces ();
+ Assert.AreEqual (2, ifaces.Length);
+ Assert.IsTrue (iface1 == ifaces [0] || iface1 == ifaces [1]);
+ Assert.IsTrue (typeof (IComparable) == ifaces [0] || typeof (IComparable) == ifaces [1]);
CheckCattr (type1);
// FIXME: Class size/packing size