diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-03-23 15:29:25 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-03-23 15:29:25 +0100 |
commit | 1597a75419cd8049252cfbca6fce6ae95ef8b2c7 (patch) | |
tree | 2b2c858df1dbe68c1d576cae06c4713fd2ad5c40 /csharp/test | |
parent | Use Ice\None with PHP namespace mapping (diff) | |
download | ice-1597a75419cd8049252cfbca6fce6ae95ef8b2c7.tar.bz2 ice-1597a75419cd8049252cfbca6fce6ae95ef8b2c7.tar.xz ice-1597a75419cd8049252cfbca6fce6ae95ef8b2c7.zip |
Fix for ICE-7125 - Added support for Ice.ClassGraphDepthMax
Diffstat (limited to 'csharp/test')
-rw-r--r-- | csharp/test/Ice/exceptions/AllTests.cs | 39 | ||||
-rw-r--r-- | csharp/test/Ice/objects/AllTests.cs | 32 | ||||
-rw-r--r-- | csharp/test/Ice/objects/Collocated.cs | 7 | ||||
-rw-r--r-- | csharp/test/Ice/objects/InitialI.cs | 13 | ||||
-rw-r--r-- | csharp/test/Ice/objects/Server.cs | 7 | ||||
-rw-r--r-- | csharp/test/Ice/objects/Test.ice | 8 |
6 files changed, 90 insertions, 16 deletions
diff --git a/csharp/test/Ice/exceptions/AllTests.cs b/csharp/test/Ice/exceptions/AllTests.cs index b0e7b109849..2627821fb7c 100644 --- a/csharp/test/Ice/exceptions/AllTests.cs +++ b/csharp/test/Ice/exceptions/AllTests.cs @@ -426,29 +426,40 @@ public class AllTests : TestCommon.AllTests catch(Ice.ConnectionLostException) { } + catch(Ice.UnknownLocalException) + { + // Expected with JS bidir server + } catch(Exception) { test(false); } - ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast( - communicator.stringToProxy("thrower:" + app.getTestEndpoint(1))); - try - { - thrower2.throwMemoryLimitException(new byte[2 * 1024 * 1024]); // 2MB (no limits) - } - catch(Ice.MemoryLimitException) - { - } - ThrowerPrx thrower3 = ThrowerPrxHelper.uncheckedCast( - communicator.stringToProxy("thrower:" + app.getTestEndpoint(2))); try { - thrower3.throwMemoryLimitException(new byte[1024]); // 1KB limit - test(false); + ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast( + communicator.stringToProxy("thrower:" + app.getTestEndpoint(1))); + try + { + thrower2.throwMemoryLimitException(new byte[2 * 1024 * 1024]); // 2MB (no limits) + } + catch(Ice.MemoryLimitException) + { + } + ThrowerPrx thrower3 = ThrowerPrxHelper.uncheckedCast( + communicator.stringToProxy("thrower:" + app.getTestEndpoint(2))); + try + { + thrower3.throwMemoryLimitException(new byte[1024]); // 1KB limit + test(false); + } + catch(Ice.ConnectionLostException) + { + } } - catch(Ice.ConnectionLostException) + catch(Ice.ConnectionRefusedException) { + // Expected with JS bidir server } WriteLine("ok"); diff --git a/csharp/test/Ice/objects/AllTests.cs b/csharp/test/Ice/objects/AllTests.cs index d050088c288..e61141f5daa 100644 --- a/csharp/test/Ice/objects/AllTests.cs +++ b/csharp/test/Ice/objects/AllTests.cs @@ -276,6 +276,38 @@ public class AllTests : TestCommon.AllTests } WriteLine("ok"); + Write("testing recursive type... "); + Flush(); + Recursive top = new Recursive(); + Recursive p = top; + int depth = 0; + try + { + for(; depth <= 1000; ++depth) + { + p.v = new Recursive(); + p = p.v; + if((depth < 10 && (depth % 10) == 0) || + (depth < 1000 && (depth % 100) == 0) || + (depth < 10000 && (depth % 1000) == 0) || + (depth % 10000) == 0) + { + initial.setRecursive(top); + } + } + test(!initial.supportsClassGraphDepthMax()); + } + catch(Ice.UnknownLocalException) + { + // Expected marshal exception from the server (max class graph depth reached) + } + catch(Ice.UnknownException) + { + // Expected stack overflow from the server (Java only) + } + initial.setRecursive(new Recursive()); + WriteLine("ok"); + Write("testing compact ID..."); Flush(); try diff --git a/csharp/test/Ice/objects/Collocated.cs b/csharp/test/Ice/objects/Collocated.cs index 637b8a01b77..7a034a4eb44 100644 --- a/csharp/test/Ice/objects/Collocated.cs +++ b/csharp/test/Ice/objects/Collocated.cs @@ -33,6 +33,13 @@ public class Collocated : TestCommon.Application return 0; } + protected override Ice.InitializationData getInitData(ref string[] args) + { + Ice.InitializationData initData = base.getInitData(ref args); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); + return initData; + } + public static int Main(string[] args) { Collocated app = new Collocated(); diff --git a/csharp/test/Ice/objects/InitialI.cs b/csharp/test/Ice/objects/InitialI.cs index 686beac8e0f..05f133c40c6 100644 --- a/csharp/test/Ice/objects/InitialI.cs +++ b/csharp/test/Ice/objects/InitialI.cs @@ -44,7 +44,7 @@ public sealed class InitialI : InitialDisp_ c = _c; d = _d; } - + public override B getB1(Ice.Current current) { return _b1; @@ -89,7 +89,16 @@ public sealed class InitialI : InitialDisp_ { return new HI(); } - + + public override void setRecursive(Recursive r, Ice.Current current) + { + } + + public override bool supportsClassGraphDepthMax(Ice.Current current) + { + return true; + } + public override D1 getD1(D1 d1, Ice.Current current) { return d1; diff --git a/csharp/test/Ice/objects/Server.cs b/csharp/test/Ice/objects/Server.cs index 26157bc146a..ab1f3c9cce2 100644 --- a/csharp/test/Ice/objects/Server.cs +++ b/csharp/test/Ice/objects/Server.cs @@ -54,6 +54,13 @@ public class Server : TestCommon.Application return 0; } + protected override Ice.InitializationData getInitData(ref string[] args) + { + Ice.InitializationData initData = base.getInitData(ref args); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); + return initData; + } + public static int Main(string[] args) { Server app = new Server(); diff --git a/csharp/test/Ice/objects/Test.ice b/csharp/test/Ice/objects/Test.ice index d985d0676ed..e33229ad4e9 100644 --- a/csharp/test/Ice/objects/Test.ice +++ b/csharp/test/Ice/objects/Test.ice @@ -162,6 +162,11 @@ exception EDerived extends EBase A1 a4; }; +class Recursive +{ + Recursive v; +}; + interface Initial { void shutdown(); @@ -172,6 +177,9 @@ interface Initial E getE(); F getF(); + void setRecursive(Recursive p); + bool supportsClassGraphDepthMax(); + ["marshaled-result"] B getMB(); ["amd", "marshaled-result"] B getAMDMB(); |