diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 803f1dfcc1d..1e587a2c0ba 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -732,7 +732,6 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) other.push_back("::Ice::Value"); other.sort(); ids.merge(other); - ids.sort(); ids.unique(); assert(find(ids.begin(), ids.end(), scoped) != ids.end()); diff --git a/csharp/test/Ice/background/AllTests.cs b/csharp/test/Ice/background/AllTests.cs index abcf07388f6..50b03940719 100644 --- a/csharp/test/Ice/background/AllTests.cs +++ b/csharp/test/Ice/background/AllTests.cs @@ -115,14 +115,14 @@ public static async Task allTests(Test.TestHelper helper) Console.Write("testing connect... "); Console.Out.Flush(); { - connectTests(configuration, background); + await connectTests(configuration, background); } Console.Out.WriteLine("ok"); Console.Write("testing initialization... "); Console.Out.Flush(); { - initializeTests(configuration, background, backgroundController); + await initializeTests(configuration, background, backgroundController); } Console.Out.WriteLine("ok"); @@ -136,7 +136,7 @@ public static async Task allTests(Test.TestHelper helper) Console.Write("testing read/write... "); Console.Out.Flush(); { - readWriteTests(configuration, background, backgroundController); + await readWriteTests(configuration, background, backgroundController); } Console.Out.WriteLine("ok"); @@ -254,7 +254,7 @@ public static async Task allTests(Test.TestHelper helper) return background; } - private static async void connectTests(Configuration configuration, Test.BackgroundPrx background) + private static async Task connectTests(Configuration configuration, Test.BackgroundPrx background) { try { @@ -353,7 +353,7 @@ private static async void connectTests(Configuration configuration, Test.Backgro } } - private static async void initializeTests( + private static async Task initializeTests( Configuration configuration, BackgroundPrx background, BackgroundControllerPrx ctl) @@ -557,7 +557,7 @@ private static async Task validationTests( configuration.readException(null); } - if(!background.ice_getCommunicator().getProperties().getProperty("Ice.Default.Protocol").Equals("test-ssl") && + if (!background.ice_getCommunicator().getProperties().getProperty("Ice.Default.Protocol").Equals("test-ssl") && !background.ice_getCommunicator().getProperties().getProperty("Ice.Default.Protocol").Equals("test-wss")) { try @@ -718,7 +718,7 @@ private static async Task validationTests( await closeConnection(backgroundBatchOneway); } - private static async void readWriteTests( + private static async Task readWriteTests( Configuration configuration, BackgroundPrx background, BackgroundControllerPrx ctl) diff --git a/csharp/test/Ice/background/Configuration.cs b/csharp/test/Ice/background/Configuration.cs index c06a3020593..7d7d6841a41 100644 --- a/csharp/test/Ice/background/Configuration.cs +++ b/csharp/test/Ice/background/Configuration.cs @@ -160,7 +160,7 @@ static public Configuration getInstance() private Ice.LocalException _connectException; private Ice.LocalException _initializeException; private int _readReadyCount; - private Ice.LocalException _readException; + public Ice.LocalException _readException; private int _writeReadyCount; private Ice.LocalException _writeException; private bool _buffered; diff --git a/csharp/test/Ice/faultTolerance/AllTests.cs b/csharp/test/Ice/faultTolerance/AllTests.cs index c0de036aece..5ef1c9d70e0 100644 --- a/csharp/test/Ice/faultTolerance/AllTests.cs +++ b/csharp/test/Ice/faultTolerance/AllTests.cs @@ -128,7 +128,15 @@ public static async Task allTests(Test.TestHelper helper, List ports) { output.Write("aborting server #" + i + " with AMI... "); output.Flush(); - await obj.abortAsync(); + try + { + await obj.abortAsync(); + test(false); + } + catch (Ice.Exception ex) + { + exceptAbortI(ex, output); + } output.WriteLine("ok"); } } @@ -160,7 +168,15 @@ public static async Task allTests(Test.TestHelper helper, List ports) { output.Write("aborting server #" + i + " and #" + (i + 1) + " with idempotent AMI call... "); output.Flush(); - await obj.idempotentAbortAsync(); + try + { + await obj.idempotentAbortAsync(); + test(false); + } + catch (Ice.Exception ex) + { + exceptAbortI(ex, output); + } output.WriteLine("ok"); } ++i; diff --git a/csharp/test/Ice/hold/AllTests.cs b/csharp/test/Ice/hold/AllTests.cs index 0dcae2a45a2..122e8b3a7df 100644 --- a/csharp/test/Ice/hold/AllTests.cs +++ b/csharp/test/Ice/hold/AllTests.cs @@ -3,7 +3,6 @@ // using System; -using System.Collections.Generic; using System.Threading.Tasks; namespace Ice @@ -126,14 +125,14 @@ public static async Task allTests(global::Test.TestHelper helper) int expected = value; var t = hold.setAsync( ++value, value < 500 ? rand.Next(5) : 0, - progress: new Progress(value => sentTcs.SetResult())); + progress: new Progress(value => sentTcs.TrySetResult())); _ = Task.Run( async () => { var response = await t; if(response != expected) { - outOfOrderTcs.SetResult(); + outOfOrderTcs.TrySetResult(); } }); if(value % 100 == 0) @@ -167,7 +166,7 @@ public static async Task allTests(global::Test.TestHelper helper) _ = holdSerialized.setAsync( ++value, 0, - progress: new Progress(value => sentTcs.SetResult())); + progress: new Progress(value => sentTcs.TrySetResult())); if(value % 100 == 0) { await sentTcs.Task; @@ -203,7 +202,7 @@ public static async Task allTests(global::Test.TestHelper helper) result = ((Test.HoldPrx)holdSerialized.ice_oneway()).setOnewayAsync( value + 1, value, - progress: new Progress(value => sentTcs.SetResult())); + progress: new Progress(value => sentTcs.TrySetResult())); ++value; if((i % 100) == 0) { diff --git a/csharp/test/Ice/location/AllTests.cs b/csharp/test/Ice/location/AllTests.cs index 9925de9f258..659ec9c343c 100644 --- a/csharp/test/Ice/location/AllTests.cs +++ b/csharp/test/Ice/location/AllTests.cs @@ -12,7 +12,7 @@ namespace location { public class AllTests : global::Test.AllTests { - public static async void allTests(global::Test.TestHelper helper) + public static async Task allTests(global::Test.TestHelper helper) { Ice.Communicator communicator = helper.communicator(); var manager = Test.ServerManagerPrxHelper.checkedCast( @@ -277,7 +277,7 @@ public static async void allTests(global::Test.TestHelper helper) { results.Add(hello.sayHelloAsync()); } - foreach(Task t in results) + foreach (Task t in results) { await t; } @@ -298,6 +298,7 @@ public static async void allTests(global::Test.TestHelper helper) try { await t; + test(false); } catch (NotRegisteredException) { diff --git a/csharp/test/Ice/location/Client.cs b/csharp/test/Ice/location/Client.cs index ab4c1eb94e4..15b0c4776e2 100644 --- a/csharp/test/Ice/location/Client.cs +++ b/csharp/test/Ice/location/Client.cs @@ -11,13 +11,13 @@ namespace location { public class Client : TestHelper { - public override void run(string[] args) + public override async Task runAsync(string[] args) { Ice.Properties properties = createTestProperties(ref args); properties.setProperty("Ice.Default.Locator", "locator:" + getTestEndpoint(properties, 0)); using(var communicator = initialize(properties)) { - AllTests.allTests(this); + await AllTests.allTests(this); } } diff --git a/csharp/test/Ice/operations/TwowaysAMI.cs b/csharp/test/Ice/operations/TwowaysAMI.cs index 08fd4be122b..ec0462d4bb5 100644 --- a/csharp/test/Ice/operations/TwowaysAMI.cs +++ b/csharp/test/Ice/operations/TwowaysAMI.cs @@ -583,6 +583,7 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla }; var result = await p.opMyStructMyEnumDAsync(di1, di2); + di2[s12] = Test.MyEnum.enum2; test(CollectionComparer.Equals(result.p3, di1)); test(CollectionComparer.Equals(result.returnValue, di2)); @@ -597,12 +598,14 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla [10] = true, [100] = false }; + var di2 = new Dictionary { [10] = true, [11] = false, [101] = true }; + var di3 = new Dictionary { [100] = false, @@ -615,8 +618,26 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opByteBoolDSAsync(dsi1, dsi2); - test(CollectionComparer.Equals(result.p3, dsi1)); - test(CollectionComparer.Equals(result.returnValue, dsi2)); + test(result.returnValue.Length == 2); + test(result.returnValue[0].Count == 3); + test(result.returnValue[0][10]); + test(!result.returnValue[0][11]); + test(result.returnValue[0][101]); + test(result.returnValue[1].Count == 2); + test(result.returnValue[1][10]); + test(!result.returnValue[1][100]); + + test(result.p3.Length == 3); + test(result.p3[0].Count == 2); + test(!result.p3[0][100]); + test(!result.p3[0][101]); + test(result.p3[1].Count == 2); + test(result.p3[1][10]); + test(!result.p3[1][100]); + test(result.p3[2].Count == 3); + test(result.p3[2][10]); + test(!result.p3[2][11]); + test(result.p3[2][101]); } { @@ -645,8 +666,25 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = p.opShortIntDSAsync(dsi1, dsi2).Result; - test(CollectionComparer.Equals(result.p3, dsi1)); - test(CollectionComparer.Equals(result.returnValue, dsi2)); + test(result.returnValue.Length == 2); + test(result.returnValue[0].Count == 3); + test(result.returnValue[0][110] == -1); + test(result.returnValue[0][111] == -100); + test(result.returnValue[0][1101] == 0); + test(result.returnValue[1].Count == 2); + test(result.returnValue[1][110] == -1); + test(result.returnValue[1][1100] == 123123); + + test(result.p3.Length == 3); + test(result.p3[0].Count == 1); + test(result.p3[0][100] == -1001); + test(result.p3[1].Count == 2); + test(result.p3[1][110] == -1); + test(result.p3[1][1100] == 123123); + test(result.p3[2].Count == 3); + test(result.p3[2][110] == -1); + test(result.p3[2][111] == -100); + test(result.p3[2][1101] == 0); } { @@ -675,8 +713,25 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opLongFloatDSAsync(dsi1, dsi2); - test(CollectionComparer.Equals(result.p3, dsi1)); - test(CollectionComparer.Equals(result.returnValue, dsi2)); + test(result.returnValue.Length == 2); + test(result.returnValue[0].Count == 3); + test(result.returnValue[0][999999110L] == -1.1f); + test(result.returnValue[0][999999120L] == -100.4f); + test(result.returnValue[0][999999130L] == 0.5f); + test(result.returnValue[1].Count == 2); + test(result.returnValue[1][999999110L] == -1.1f); + test(result.returnValue[1][999999111L] == 123123.2f); + + test(result.p3.Length == 3); + test(result.p3[0].Count == 1); + test(result.p3[0][999999140L] == 3.14f); + test(result.p3[1].Count == 2); + test(result.p3[1][999999110L] == -1.1f); + test(result.p3[1][999999111L] == 123123.2f); + test(result.p3[2].Count == 3); + test(result.p3[2][999999110L] == -1.1f); + test(result.p3[2][999999120L] == -100.4f); + test(result.p3[2][999999130L] == 0.5f); } { @@ -705,8 +760,25 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = p.opStringStringDSAsync(dsi1, dsi2).Result; - test(CollectionComparer.Equals(result.p3, dsi1)); - test(CollectionComparer.Equals(result.returnValue, dsi2)); + test(result.returnValue.Length == 2); + test(result.returnValue[0].Count == 3); + test(result.returnValue[0]["foo"].Equals("abc -1.1")); + test(result.returnValue[0]["FOO"].Equals("abc -100.4")); + test(result.returnValue[0]["BAR"].Equals("abc 0.5")); + test(result.returnValue[1].Count == 2); + test(result.returnValue[1]["foo"] == "abc -1.1"); + test(result.returnValue[1]["bar"] == "abc 123123.2"); + + test(result.p3.Length == 3); + test(result.p3[0].Count == 1); + test(result.p3[0]["f00"].Equals("ABC -3.14")); + test(result.p3[1].Count == 2); + test(result.p3[1]["foo"].Equals("abc -1.1")); + test(result.p3[1]["bar"].Equals("abc 123123.2")); + test(result.p3[2].Count == 3); + test(result.p3[2]["foo"].Equals("abc -1.1")); + test(result.p3[2]["FOO"].Equals("abc -100.4")); + test(result.p3[2]["BAR"].Equals("abc 0.5")); } { @@ -735,8 +807,25 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opStringMyEnumDSAsync(dsi1, dsi2); - test(CollectionComparer.Equals(result.p3, dsi1)); - test(CollectionComparer.Equals(result.returnValue, dsi2)); + test(result.returnValue.Length == 2); + test(result.returnValue[0].Count == 3); + test(result.returnValue[0]["abc"] == Test.MyEnum.enum1); + test(result.returnValue[0]["qwerty"] == Test.MyEnum.enum3); + test(result.returnValue[0]["Hello!!"] == Test.MyEnum.enum2); + test(result.returnValue[1].Count == 2); + test(result.returnValue[1]["abc"] == Test.MyEnum.enum1); + test(result.returnValue[1][""] == Test.MyEnum.enum2); + + test(result.p3.Length == 3); + test(result.p3[0].Count == 1); + test(result.p3[0]["Goodbye"] == Test.MyEnum.enum1); + test(result.p3[1].Count == 2); + test(result.p3[1]["abc"] == Test.MyEnum.enum1); + test(result.p3[1][""] == Test.MyEnum.enum2); + test(result.p3[2].Count == 3); + test(result.p3[2]["abc"] == Test.MyEnum.enum1); + test(result.p3[2]["qwerty"] == Test.MyEnum.enum3); + test(result.p3[2]["Hello!!"] == Test.MyEnum.enum2); } { @@ -763,8 +852,21 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opMyEnumStringDSAsync(dsi1, dsi2); - test(CollectionComparer.Equals(result.p3, dsi1)); - test(CollectionComparer.Equals(result.returnValue, dsi2)); + test(result.returnValue.Length == 2); + test(result.returnValue[0].Count == 2); + test(result.returnValue[0][Test.MyEnum.enum2].Equals("Hello!!")); + test(result.returnValue[0][Test.MyEnum.enum3].Equals("qwerty")); + test(result.returnValue[1].Count == 1); + test(result.returnValue[1][Test.MyEnum.enum1].Equals("abc")); + + test(result.p3.Length == 3); + test(result.p3[0].Count == 1); + test(result.p3[0][Test.MyEnum.enum1].Equals("Goodbye")); + test(result.p3[1].Count == 1); + test(result.p3[1][Test.MyEnum.enum1].Equals("abc")); + test(result.p3[2].Count == 2); + test(result.p3[2][Test.MyEnum.enum2].Equals("Hello!!")); + test(result.p3[2][Test.MyEnum.enum3].Equals("qwerty")); } { @@ -799,8 +901,25 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opMyStructMyEnumDSAsync(dsi1, dsi2); - test(CollectionComparer.Equals(result.p3, dsi1)); - test(CollectionComparer.Equals(result.returnValue, dsi2)); + test(result.returnValue.Length == 2); + test(result.returnValue[0].Count == 3); + test(result.returnValue[0][s11] == Test.MyEnum.enum1); + test(result.returnValue[0][s22] == Test.MyEnum.enum3); + test(result.returnValue[0][s23] == Test.MyEnum.enum2); + test(result.returnValue[1].Count == 2); + test(result.returnValue[1][s11] == Test.MyEnum.enum1); + test(result.returnValue[1][s12] == Test.MyEnum.enum2); + + test(result.p3.Length == 3); + test(result.p3[0].Count == 1); + test(result.p3[0][s23] == Test.MyEnum.enum3); + test(result.p3[1].Count == 2); + test(result.p3[1][s11] == Test.MyEnum.enum1); + test(result.p3[1][s12] == Test.MyEnum.enum2); + test(result.p3[2].Count == 3); + test(result.p3[2][s11] == Test.MyEnum.enum1); + test(result.p3[2][s22] == Test.MyEnum.enum3); + test(result.p3[2][s23] == Test.MyEnum.enum2); } { @@ -817,8 +936,20 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opByteByteSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3[0xf1].Length == 2); + test(result.p3[0xf1][0] == 0xf2); + test(result.p3[0xf1][1] == 0xf3); + + test(result.returnValue.Count == 3); + test(result.returnValue[0x01].Length == 2); + test(result.returnValue[0x01][0] == 0x01); + test(result.returnValue[0x01][1] == 0x11); + test(result.returnValue[0x22].Length == 1); + test(result.returnValue[0x22][0] == 0x12); + test(result.returnValue[0xf1].Length == 2); + test(result.returnValue[0xf1][0] == 0xf2); + test(result.returnValue[0xf1][1] == 0xf3); } { @@ -834,8 +965,18 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opBoolBoolSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3[false].Length == 2); + test(result.p3[false][0]); + test(!result.p3[false][1]); + test(result.returnValue.Count == 2); + test(result.returnValue[false].Length == 2); + test(result.returnValue[false][0]); + test(!result.returnValue[false][1]); + test(result.returnValue[true].Length == 3); + test(!result.returnValue[true][0]); + test(result.returnValue[true][1]); + test(result.returnValue[true][2]); } { @@ -852,8 +993,22 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opShortShortSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3[4].Length == 2); + test(result.p3[4][0] == 6); + test(result.p3[4][1] == 7); + + test(result.returnValue.Count == 3); + test(result.returnValue[1].Length == 3); + test(result.returnValue[1][0] == 1); + test(result.returnValue[1][1] == 2); + test(result.returnValue[1][2] == 3); + test(result.returnValue[2].Length == 2); + test(result.returnValue[2][0] == 4); + test(result.returnValue[2][1] == 5); + test(result.returnValue[4].Length == 2); + test(result.returnValue[4][0] == 6); + test(result.returnValue[4][1] == 7); } { @@ -870,8 +1025,22 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opIntIntSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3[400].Length == 2); + test(result.p3[400][0] == 600); + test(result.p3[400][1] == 700); + + test(result.returnValue.Count == 3); + test(result.returnValue[100].Length == 3); + test(result.returnValue[100][0] == 100); + test(result.returnValue[100][1] == 200); + test(result.returnValue[100][2] == 300); + test(result.returnValue[200].Length == 2); + test(result.returnValue[200][0] == 400); + test(result.returnValue[200][1] == 500); + test(result.returnValue[400].Length == 2); + test(result.returnValue[400][0] == 600); + test(result.returnValue[400][1] == 700); } { @@ -888,8 +1057,21 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opLongLongSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3[999999992L].Length == 2); + test(result.p3[999999992L][0] == 999999110L); + test(result.p3[999999992L][1] == 999999120L); + test(result.returnValue.Count == 3); + test(result.returnValue[999999990L].Length == 3); + test(result.returnValue[999999990L][0] == 999999110L); + test(result.returnValue[999999990L][1] == 999999111L); + test(result.returnValue[999999990L][2] == 999999110L); + test(result.returnValue[999999991L].Length == 2); + test(result.returnValue[999999991L][0] == 999999120L); + test(result.returnValue[999999991L][1] == 999999130L); + test(result.returnValue[999999992L].Length == 2); + test(result.returnValue[999999992L][0] == 999999110L); + test(result.returnValue[999999992L][1] == 999999120L); } { @@ -906,8 +1088,22 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opStringFloatSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3["aBc"].Length == 2); + test(result.p3["aBc"][0] == -3.14f); + test(result.p3["aBc"][1] == 3.14f); + + test(result.returnValue.Count == 3); + test(result.returnValue["abc"].Length == 3); + test(result.returnValue["abc"][0] == -1.1f); + test(result.returnValue["abc"][1] == 123123.2f); + test(result.returnValue["abc"][2] == 100.0f); + test(result.returnValue["ABC"].Length == 2); + test(result.returnValue["ABC"][0] == 42.24f); + test(result.returnValue["ABC"][1] == -1.61f); + test(result.returnValue["aBc"].Length == 2); + test(result.returnValue["aBc"][0] == -3.14f); + test(result.returnValue["aBc"][1] == 3.14f); } { @@ -924,8 +1120,21 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opStringDoubleSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3[""].Length == 2); + test(result.p3[""][0] == 1.6E10); + test(result.p3[""][1] == 1.7E10); + test(result.returnValue.Count == 3); + test(result.returnValue["Hello!!"].Length == 3); + test(result.returnValue["Hello!!"][0] == 1.1E10); + test(result.returnValue["Hello!!"][1] == 1.2E10); + test(result.returnValue["Hello!!"][2] == 1.3E10); + test(result.returnValue["Goodbye"].Length == 2); + test(result.returnValue["Goodbye"][0] == 1.4E10); + test(result.returnValue["Goodbye"][1] == 1.5E10); + test(result.returnValue[""].Length == 2); + test(result.returnValue[""][0] == 1.6E10); + test(result.returnValue[""][1] == 1.7E10); } { @@ -942,8 +1151,22 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opStringStringSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3["ghi"].Length == 2); + test(result.p3["ghi"][0].Equals("and")); + test(result.p3["ghi"][1].Equals("xor")); + + test(result.returnValue.Count == 3); + test(result.returnValue["abc"].Length == 3); + test(result.returnValue["abc"][0].Equals("abc")); + test(result.returnValue["abc"][1].Equals("de")); + test(result.returnValue["abc"][2].Equals("fghi")); + test(result.returnValue["def"].Length == 2); + test(result.returnValue["def"][0].Equals("xyz")); + test(result.returnValue["def"][1].Equals("or")); + test(result.returnValue["ghi"].Length == 2); + test(result.returnValue["ghi"][0].Equals("and")); + test(result.returnValue["ghi"][1].Equals("xor")); } { @@ -960,8 +1183,21 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opMyEnumMyEnumSDAsync(sdi1, sdi2); - test(CollectionComparer.Equals(result.p3, sdi1)); - test(CollectionComparer.Equals(result.returnValue, sdi2)); + test(result.p3.Count == 1); + test(result.p3[Test.MyEnum.enum1].Length == 2); + test(result.p3[Test.MyEnum.enum1][0] == Test.MyEnum.enum3); + test(result.p3[Test.MyEnum.enum1][1] == Test.MyEnum.enum3); + test(result.returnValue.Count == 3); + test(result.returnValue[Test.MyEnum.enum3].Length == 3); + test(result.returnValue[Test.MyEnum.enum3][0] == Test.MyEnum.enum1); + test(result.returnValue[Test.MyEnum.enum3][1] == Test.MyEnum.enum1); + test(result.returnValue[Test.MyEnum.enum3][2] == Test.MyEnum.enum2); + test(result.returnValue[Test.MyEnum.enum2].Length == 2); + test(result.returnValue[Test.MyEnum.enum2][0] == Test.MyEnum.enum1); + test(result.returnValue[Test.MyEnum.enum2][1] == Test.MyEnum.enum2); + test(result.returnValue[Test.MyEnum.enum1].Length == 2); + test(result.returnValue[Test.MyEnum.enum1][0] == Test.MyEnum.enum3); + test(result.returnValue[Test.MyEnum.enum1][1] == Test.MyEnum.enum3); } { @@ -977,7 +1213,10 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla var result = await p.opIntSAsync(s); - test(CollectionComparer.Equals(s, result)); + for (int j = 0; j < result.Length; ++j) + { + test(result[j] == -j); + } } } diff --git a/csharp/test/Ice/seqMapping/TwowaysAMI.cs b/csharp/test/Ice/seqMapping/TwowaysAMI.cs index c413d4e8622..23d3eb5757e 100644 --- a/csharp/test/Ice/seqMapping/TwowaysAMI.cs +++ b/csharp/test/Ice/seqMapping/TwowaysAMI.cs @@ -510,8 +510,15 @@ internal static async Task twowaysAMI(Communicator communicator, Test.MyClassPrx } var result = await p.opAObjectSAsync(i); - test(CollectionComparer.Equals(i, result.o)); - test(CollectionComparer.Equals(i, result.returnValue)); + System.Collections.IEnumerator eo = result.o.GetEnumerator(); + System.Collections.IEnumerator er = result.returnValue.GetEnumerator(); + foreach (Test.CV obj in i) + { + eo.MoveNext(); + er.MoveNext(); + test(obj.i == ((Test.CV)eo.Current).i); + test(obj.i == ((Test.CV)er.Current).i); + } } { @@ -522,8 +529,15 @@ internal static async Task twowaysAMI(Communicator communicator, Test.MyClassPrx } var result = await p.opLObjectSAsync(i); - test(CollectionComparer.Equals(i, result.o)); - test(CollectionComparer.Equals(i, result.returnValue)); + System.Collections.IEnumerator eo = result.o.GetEnumerator(); + System.Collections.IEnumerator er = result.returnValue.GetEnumerator(); + foreach (Test.CV obj in i) + { + eo.MoveNext(); + er.MoveNext(); + test(obj.i == ((Test.CV)eo.Current).i); + test(obj.i == ((Test.CV)er.Current).i); + } } { @@ -654,8 +668,15 @@ internal static async Task twowaysAMI(Communicator communicator, Test.MyClassPrx } var result = await p.opACVSAsync(i); - test(CollectionComparer.Equals(i, result.o)); - test(CollectionComparer.Equals(i, result.returnValue)); + System.Collections.IEnumerator eo = result.o.GetEnumerator(); + System.Collections.IEnumerator er = result.returnValue.GetEnumerator(); + foreach (Test.CV obj in i) + { + eo.MoveNext(); + er.MoveNext(); + test(obj.i == ((Test.CV)eo.Current).i); + test(obj.i == ((Test.CV)er.Current).i); + } } { @@ -666,8 +687,15 @@ internal static async Task twowaysAMI(Communicator communicator, Test.MyClassPrx } var result = await p.opLCVSAsync(i); - test(CollectionComparer.Equals(i, result.o)); - test(CollectionComparer.Equals(i, result.returnValue)); + System.Collections.IEnumerator eo = result.o.GetEnumerator(); + System.Collections.IEnumerator er = result.returnValue.GetEnumerator(); + foreach (Test.CV obj in i) + { + eo.MoveNext(); + er.MoveNext(); + test(obj.i == ((Test.CV)eo.Current).i); + test(obj.i == ((Test.CV)er.Current).i); + } } { @@ -738,8 +766,15 @@ internal static async Task twowaysAMI(Communicator communicator, Test.MyClassPrx } var result = await p.opACRSAsync(i); - test(CollectionComparer.Equals(i, result.o)); - test(CollectionComparer.Equals(i, result.returnValue)); + System.Collections.IEnumerator eo = result.o.GetEnumerator(); + System.Collections.IEnumerator er = result.returnValue.GetEnumerator(); + foreach (Test.CR obj in i) + { + eo.MoveNext(); + er.MoveNext(); + test(obj.v.i == ((Test.CR)eo.Current).v.i); + test(obj.v.i == ((Test.CR)er.Current).v.i); + } } { @@ -750,8 +785,15 @@ internal static async Task twowaysAMI(Communicator communicator, Test.MyClassPrx } var result = await p.opLCRSAsync(i); - test(CollectionComparer.Equals(i, result.o)); - test(CollectionComparer.Equals(i, result.returnValue)); + System.Collections.IEnumerator eo = result.o.GetEnumerator(); + System.Collections.IEnumerator er = result.returnValue.GetEnumerator(); + foreach (Test.CR obj in i) + { + eo.MoveNext(); + er.MoveNext(); + test(obj.v.i == ((Test.CR)eo.Current).v.i); + test(obj.v.i == ((Test.CR)er.Current).v.i); + } } { @@ -834,8 +876,15 @@ internal static async Task twowaysAMI(Communicator communicator, Test.MyClassPrx } var result = await p.opCustomCVSAsync(i); - test(CollectionComparer.Equals(i, result.o)); - test(CollectionComparer.Equals(i, result.returnValue)); + System.Collections.IEnumerator eo = result.o.GetEnumerator(); + System.Collections.IEnumerator er = result.returnValue.GetEnumerator(); + foreach (Test.CV obj in i) + { + eo.MoveNext(); + er.MoveNext(); + test(obj.i == ((Test.CV)eo.Current).i); + test(obj.i == ((Test.CV)er.Current).i); + } } { @@ -868,8 +917,30 @@ internal static async Task twowaysAMI(Communicator communicator, Test.MyClassPrx } var result = await p.opCustomCVSSAsync(i); - test(CollectionComparer.Equals(i, result.o)); - test(CollectionComparer.Equals(i, result.returnValue)); + IEnumerator> eo = result.o.GetEnumerator(); + IEnumerator> er = result.returnValue.GetEnumerator(); + foreach (Custom s in i) + { + eo.MoveNext(); + er.MoveNext(); + IEnumerator io = eo.Current.GetEnumerator(); + IEnumerator ir = er.Current.GetEnumerator(); + foreach (Test.CV obj in s) + { + io.MoveNext(); + ir.MoveNext(); + if (obj == null) + { + test(io.Current == null); + test(ir.Current == null); + } + else + { + test(obj.i == io.Current.i); + test(obj.i == ir.Current.i); + } + } + } } } }