diff --git a/csharp/test/Ice/adapterDeactivation/ServantLocatorI.cs b/csharp/test/Ice/adapterDeactivation/ServantLocatorI.cs index 475af2a93c3..02d2749c475 100644 --- a/csharp/test/Ice/adapterDeactivation/ServantLocatorI.cs +++ b/csharp/test/Ice/adapterDeactivation/ServantLocatorI.cs @@ -36,13 +36,7 @@ public ServantLocatorI() } } - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public Ice.Object locate(Ice.Current current, out System.Object cookie) { diff --git a/csharp/test/Ice/ami/TestI.cs b/csharp/test/Ice/ami/TestI.cs index b49ded40948..d4edf7300bc 100644 --- a/csharp/test/Ice/ami/TestI.cs +++ b/csharp/test/Ice/ami/TestI.cs @@ -8,14 +8,7 @@ namespace ami { public class TestI : Test.TestIntfDisp_ { - protected static void test(bool b) - { - if (!b) - { - Debug.Assert(false); - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public TestI() { diff --git a/csharp/test/Ice/background/AllTests.cs b/csharp/test/Ice/background/AllTests.cs index 7d09e3d57d6..624bdf4ab2e 100644 --- a/csharp/test/Ice/background/AllTests.cs +++ b/csharp/test/Ice/background/AllTests.cs @@ -2,7 +2,7 @@ using Test; -public class AllTests +public class AllTests : global::Test.AllTests { public class Progress : IProgress { @@ -20,14 +20,6 @@ public void Report(bool value) } } - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } - private class OpThread { internal OpThread(BackgroundPrx background) diff --git a/csharp/test/Ice/dictMapping/Twoways.cs b/csharp/test/Ice/dictMapping/Twoways.cs index 945e078f5e5..9f636a728fb 100644 --- a/csharp/test/Ice/dictMapping/Twoways.cs +++ b/csharp/test/Ice/dictMapping/Twoways.cs @@ -6,13 +6,7 @@ namespace dictMapping { internal class Twoways { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); internal static void twoways(Ice.Communicator communicator, Test.MyClassPrx p) { diff --git a/csharp/test/Ice/dictMapping/TwowaysAMI.cs b/csharp/test/Ice/dictMapping/TwowaysAMI.cs index 60399e02b0e..d369e0b1540 100644 --- a/csharp/test/Ice/dictMapping/TwowaysAMI.cs +++ b/csharp/test/Ice/dictMapping/TwowaysAMI.cs @@ -1,26 +1,12 @@ // Copyright (c) ZeroC, Inc. -/* Unmerged change from project 'collocated' -Before: -using System.Diagnostics; -using System.Collections.Generic; -After: -using System.Collections.Generic; -using System.Diagnostics; -*/ namespace Ice { namespace dictMapping { public class TwowaysAMI { - private static void test(bool b) - { - if (!b) - { - throw new System.SystemException(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); internal static async Task twowaysAMI(Test.MyClassPrx p) { diff --git a/csharp/test/Ice/executor/Executor.cs b/csharp/test/Ice/executor/Executor.cs index 9e3cd0aa49a..0a2477547b7 100644 --- a/csharp/test/Ice/executor/Executor.cs +++ b/csharp/test/Ice/executor/Executor.cs @@ -4,13 +4,7 @@ public class Executor { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public Executor() { diff --git a/csharp/test/Ice/executor/TestI.cs b/csharp/test/Ice/executor/TestI.cs index 24fc5d2f485..767d4138c9f 100644 --- a/csharp/test/Ice/executor/TestI.cs +++ b/csharp/test/Ice/executor/TestI.cs @@ -4,13 +4,7 @@ public class TestI : TestIntfDisp_ { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public TestI() { @@ -43,13 +37,7 @@ public override void public class TestControllerI : TestIntfControllerDisp_ { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public override void holdAdapter(Ice.Current current) diff --git a/csharp/test/Ice/hold/HoldI.cs b/csharp/test/Ice/hold/HoldI.cs index d7d6a92eea4..200473f2339 100644 --- a/csharp/test/Ice/hold/HoldI.cs +++ b/csharp/test/Ice/hold/HoldI.cs @@ -8,13 +8,7 @@ public sealed class HoldI : Test.HoldDisp_ private int _last = 0; private readonly object _taskMutex = new object(); - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public HoldI(Ice.ObjectAdapter adapter) => _adapter = adapter; diff --git a/csharp/test/Ice/operations/BatchOneways.cs b/csharp/test/Ice/operations/BatchOneways.cs index 1d12ffb260f..b8b8a91c979 100644 --- a/csharp/test/Ice/operations/BatchOneways.cs +++ b/csharp/test/Ice/operations/BatchOneways.cs @@ -6,13 +6,7 @@ namespace operations { internal class BatchOneways { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); private class BatchRequestInterceptorI { diff --git a/csharp/test/Ice/operations/BatchOnewaysAMI.cs b/csharp/test/Ice/operations/BatchOnewaysAMI.cs index fb89455edfc..bf7fbd0cf83 100644 --- a/csharp/test/Ice/operations/BatchOnewaysAMI.cs +++ b/csharp/test/Ice/operations/BatchOnewaysAMI.cs @@ -8,13 +8,7 @@ namespace operations { internal class BatchOnewaysAMI { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); private class Callback { diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs index e1fd63dfe1d..8cc50d67aa6 100644 --- a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs @@ -8,13 +8,7 @@ namespace AMD { public sealed class MyDerivedClassI : Test.MyDerivedClassDisp_ { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); internal class Thread_opVoid : TaskCompletionSource { diff --git a/csharp/test/Ice/operations/MyDerivedClassI.cs b/csharp/test/Ice/operations/MyDerivedClassI.cs index 1d9d4d084bb..315b0cfaaf6 100644 --- a/csharp/test/Ice/operations/MyDerivedClassI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassI.cs @@ -6,13 +6,7 @@ namespace operations { public sealed class MyDerivedClassI : Test.MyDerivedClassDisp_ { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public override void shutdown(Ice.Current current) { diff --git a/csharp/test/Ice/operations/Oneways.cs b/csharp/test/Ice/operations/Oneways.cs index 5d64ef63996..5187973d89d 100644 --- a/csharp/test/Ice/operations/Oneways.cs +++ b/csharp/test/Ice/operations/Oneways.cs @@ -6,13 +6,7 @@ namespace operations { internal class Oneways { - private static void test(bool b) - { - if (!b) - { - throw new System.SystemException(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); internal static void oneways(global::Test.TestHelper helper, Test.MyClassPrx p) { diff --git a/csharp/test/Ice/operations/OnewaysAMI.cs b/csharp/test/Ice/operations/OnewaysAMI.cs index 1f26de3cc54..06874fac503 100644 --- a/csharp/test/Ice/operations/OnewaysAMI.cs +++ b/csharp/test/Ice/operations/OnewaysAMI.cs @@ -6,13 +6,7 @@ namespace operations { public class OnewaysAMI { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); internal static async Task onewaysAMI(Test.MyClassPrx proxy) { diff --git a/csharp/test/Ice/operations/Twoways.cs b/csharp/test/Ice/operations/Twoways.cs index 6702ff83ffb..4ef58cff776 100644 --- a/csharp/test/Ice/operations/Twoways.cs +++ b/csharp/test/Ice/operations/Twoways.cs @@ -6,13 +6,7 @@ namespace operations { internal class Twoways { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); private class PerThreadContextInvokeThread { diff --git a/csharp/test/Ice/operations/TwowaysAMI.cs b/csharp/test/Ice/operations/TwowaysAMI.cs index 0d0e49aa997..a85118cf71d 100644 --- a/csharp/test/Ice/operations/TwowaysAMI.cs +++ b/csharp/test/Ice/operations/TwowaysAMI.cs @@ -6,13 +6,7 @@ namespace operations { public class TwowaysAMI { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyClassPrx p) { diff --git a/csharp/test/Ice/plugin/BasePlugin.cs b/csharp/test/Ice/plugin/BasePlugin.cs index 5274e5d5b1b..950c9b11087 100644 --- a/csharp/test/Ice/plugin/BasePlugin.cs +++ b/csharp/test/Ice/plugin/BasePlugin.cs @@ -17,13 +17,7 @@ public bool isDestroyed() return _destroyed; } - protected static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + protected static void test(bool b) => global::Test.TestHelper.test(b); public abstract void initialize(); public abstract void destroy(); diff --git a/csharp/test/Ice/plugin/BasePluginFail.cs b/csharp/test/Ice/plugin/BasePluginFail.cs index 2fb91ac5a42..0947ab5104b 100644 --- a/csharp/test/Ice/plugin/BasePluginFail.cs +++ b/csharp/test/Ice/plugin/BasePluginFail.cs @@ -19,13 +19,7 @@ public bool isDestroyed() return _destroyed; } - protected static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + protected static void test(bool b) => global::Test.TestHelper.test(b); public abstract void initialize(); public abstract void destroy(); diff --git a/csharp/test/Ice/plugin/PluginFactory.cs b/csharp/test/Ice/plugin/PluginFactory.cs index 2cde4648c0c..44743700cfd 100644 --- a/csharp/test/Ice/plugin/PluginFactory.cs +++ b/csharp/test/Ice/plugin/PluginFactory.cs @@ -40,13 +40,7 @@ public void destroy() } } - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); private bool _initialized = false; private bool _destroyed = false; diff --git a/csharp/test/Ice/plugin/PluginInitializeFailFactory.cs b/csharp/test/Ice/plugin/PluginInitializeFailFactory.cs index 97ed300626e..f5a1ca109fe 100644 --- a/csharp/test/Ice/plugin/PluginInitializeFailFactory.cs +++ b/csharp/test/Ice/plugin/PluginInitializeFailFactory.cs @@ -16,15 +16,7 @@ public void initialize() public void destroy() { - test(false); - } - - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } + global::Test.TestHelper.test(false); } } } diff --git a/csharp/test/Ice/plugin/msbuild/plugin/plugin.csproj b/csharp/test/Ice/plugin/msbuild/plugin/plugin.csproj index 1bb817767ea..e293de1b735 100644 --- a/csharp/test/Ice/plugin/msbuild/plugin/plugin.csproj +++ b/csharp/test/Ice/plugin/msbuild/plugin/plugin.csproj @@ -21,6 +21,7 @@ + diff --git a/csharp/test/Ice/seqMapping/Twoways.cs b/csharp/test/Ice/seqMapping/Twoways.cs index 4f5d09d4bd4..3ff5de94610 100644 --- a/csharp/test/Ice/seqMapping/Twoways.cs +++ b/csharp/test/Ice/seqMapping/Twoways.cs @@ -6,13 +6,7 @@ namespace seqMapping { internal class Twoways { - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); private static int _length = 100; diff --git a/csharp/test/Ice/seqMapping/TwowaysAMI.cs b/csharp/test/Ice/seqMapping/TwowaysAMI.cs index df1f9f1bb5e..904a440b527 100644 --- a/csharp/test/Ice/seqMapping/TwowaysAMI.cs +++ b/csharp/test/Ice/seqMapping/TwowaysAMI.cs @@ -6,13 +6,7 @@ namespace seqMapping { public class TwowaysAMI { - private static void test(bool b) - { - if (!b) - { - throw new System.SystemException(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); private static readonly int _length = 100; diff --git a/csharp/test/Ice/servantLocator/ServantLocatorAMDI.cs b/csharp/test/Ice/servantLocator/ServantLocatorAMDI.cs index 04aecec7d40..b1644bf7474 100644 --- a/csharp/test/Ice/servantLocator/ServantLocatorAMDI.cs +++ b/csharp/test/Ice/servantLocator/ServantLocatorAMDI.cs @@ -23,13 +23,7 @@ public ServantLocatorI(String category) } } - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public Ice.Object locate(Ice.Current current, out object cookie) { diff --git a/csharp/test/Ice/servantLocator/ServantLocatorI.cs b/csharp/test/Ice/servantLocator/ServantLocatorI.cs index 1450019a575..0f1f4555bf9 100644 --- a/csharp/test/Ice/servantLocator/ServantLocatorI.cs +++ b/csharp/test/Ice/servantLocator/ServantLocatorI.cs @@ -21,13 +21,7 @@ public ServantLocatorI(string category) } } - private static void test(bool b) - { - if (!b) - { - throw new System.Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public Ice.Object locate(Ice.Current current, out object cookie) { diff --git a/csharp/test/Ice/slicing/objects/TestAMDI.cs b/csharp/test/Ice/slicing/objects/TestAMDI.cs index 503bb84bb48..579504efa91 100644 --- a/csharp/test/Ice/slicing/objects/TestAMDI.cs +++ b/csharp/test/Ice/slicing/objects/TestAMDI.cs @@ -4,13 +4,7 @@ public sealed class TestI : TestIntfDisp_ { - private static void test(bool b) - { - if (!b) - { - throw new Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public override Task shutdownAsync(Ice.Current current) { diff --git a/csharp/test/Ice/slicing/objects/TestI.cs b/csharp/test/Ice/slicing/objects/TestI.cs index 8f584ffbc3d..91761784812 100644 --- a/csharp/test/Ice/slicing/objects/TestI.cs +++ b/csharp/test/Ice/slicing/objects/TestI.cs @@ -4,13 +4,7 @@ public sealed class TestI : TestIntfDisp_ { - private static void test(bool b) - { - if (!b) - { - throw new Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public override void shutdown(Ice.Current current) { diff --git a/csharp/test/IceSSL/configuration/AllTests.cs b/csharp/test/IceSSL/configuration/AllTests.cs index e3ddd199be5..4c0ae88b53b 100644 --- a/csharp/test/IceSSL/configuration/AllTests.cs +++ b/csharp/test/IceSSL/configuration/AllTests.cs @@ -9,16 +9,8 @@ using System.Security.Cryptography.X509Certificates; using Test; -public class AllTests +public class AllTests : global::Test.AllTests { - private static void test(bool b) - { - if (!b) - { - throw new Exception(); - } - } - private static X509Certificate2 createCertificate(string certPEM) { return new X509Certificate2(System.Text.Encoding.ASCII.GetBytes(certPEM)); diff --git a/csharp/test/IceSSL/configuration/TestI.cs b/csharp/test/IceSSL/configuration/TestI.cs index 3e376d802b5..50f708e247e 100644 --- a/csharp/test/IceSSL/configuration/TestI.cs +++ b/csharp/test/IceSSL/configuration/TestI.cs @@ -60,26 +60,14 @@ internal void destroy() _communicator.destroy(); } - private static void test(bool b) - { - if (!b) - { - throw new Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); private Ice.Communicator _communicator; } internal sealed class ServerFactoryI : ServerFactoryDisp_ { - private static void test(bool b) - { - if (!b) - { - throw new Exception(); - } - } + private static void test(bool b) => global::Test.TestHelper.test(b); public ServerFactoryI(string defaultDir) {