diff options
author | Jose <jose@zeroc.com> | 2019-07-09 17:13:39 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-07-09 17:13:39 +0200 |
commit | f0352140506800ed3a53a7fa7caca63f251bb1a4 (patch) | |
tree | 355dc0f3bb7ea8534e087474a35371140b3d0b18 /python | |
parent | IceSSL fixes for RHEL8 (diff) | |
download | ice-f0352140506800ed3a53a7fa7caca63f251bb1a4.tar.bz2 ice-f0352140506800ed3a53a7fa7caca63f251bb1a4.tar.xz ice-f0352140506800ed3a53a7fa7caca63f251bb1a4.zip |
Remove forward declarations limitation - Close #97
Diffstat (limited to 'python')
-rw-r--r-- | python/test/Ice/objects/AllTests.py | 20 | ||||
-rwxr-xr-x | python/test/Ice/objects/Client.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/objects/Collocated.py | 2 | ||||
-rw-r--r-- | python/test/Ice/objects/Forward.ice | 20 | ||||
-rwxr-xr-x | python/test/Ice/objects/Server.py | 2 | ||||
-rw-r--r-- | python/test/Ice/objects/Test.ice | 15 | ||||
-rw-r--r-- | python/test/Ice/objects/TestI.py | 13 |
7 files changed, 71 insertions, 3 deletions
diff --git a/python/test/Ice/objects/AllTests.py b/python/test/Ice/objects/AllTests.py index e47ca1d4089..d2b666a655b 100644 --- a/python/test/Ice/objects/AllTests.py +++ b/python/test/Ice/objects/AllTests.py @@ -335,4 +335,24 @@ def allTests(helper, communicator): print("ok") + sys.stdout.write("testing forward declarations... ") + sys.stdout.flush() + f11, f12 = initial.opF1(Test.F1("F11")) + test(f11.name == "F11") + test(f12.name == "F12") + + f21, f22 = initial.opF2(Test.F2Prx.uncheckedCast(communicator.stringToProxy("F21"))) + test(f21.ice_getIdentity().name == "F21") + test(f22.ice_getIdentity().name == "F22") + + if initial.hasF3(): + f31, f32 = initial.opF3(Test.F3(f11, f21)) + + test(f31.f1.name == "F11") + test(f31.f2.ice_getIdentity().name == "F21") + + test(f32.f1.name == "F12") + test(f32.f2.ice_getIdentity().name == "F22") + print("ok") + return initial diff --git a/python/test/Ice/objects/Client.py b/python/test/Ice/objects/Client.py index 441f6a1a83c..89cb791cc20 100755 --- a/python/test/Ice/objects/Client.py +++ b/python/test/Ice/objects/Client.py @@ -4,7 +4,7 @@ # from TestHelper import TestHelper -TestHelper.loadSlice("Test.ice ClientPrivate.ice") +TestHelper.loadSlice("Test.ice Forward.ice ClientPrivate.ice") import AllTests diff --git a/python/test/Ice/objects/Collocated.py b/python/test/Ice/objects/Collocated.py index ada3bc0d82b..ba6d78fd96e 100755 --- a/python/test/Ice/objects/Collocated.py +++ b/python/test/Ice/objects/Collocated.py @@ -4,7 +4,7 @@ # from TestHelper import TestHelper -TestHelper.loadSlice("Test.ice ClientPrivate.ice") +TestHelper.loadSlice("Test.ice Forward.ice ClientPrivate.ice") import Ice import TestI import AllTests diff --git a/python/test/Ice/objects/Forward.ice b/python/test/Ice/objects/Forward.ice new file mode 100644 index 00000000000..5cc93e83b4a --- /dev/null +++ b/python/test/Ice/objects/Forward.ice @@ -0,0 +1,20 @@ +// +// Copyright (c) ZeroC, Inc. All rights reserved. +// + +#pragma once + +module Test +{ + +class F1 +{ + string name; +} + +interface F2 +{ + void op(); +} + +}; diff --git a/python/test/Ice/objects/Server.py b/python/test/Ice/objects/Server.py index 033ac8911e9..2a9df124f4c 100755 --- a/python/test/Ice/objects/Server.py +++ b/python/test/Ice/objects/Server.py @@ -4,7 +4,7 @@ # from TestHelper import TestHelper -TestHelper.loadSlice("Test.ice ServerPrivate.ice") +TestHelper.loadSlice("Test.ice Forward.ice ServerPrivate.ice") import TestI import Ice diff --git a/python/test/Ice/objects/Test.ice b/python/test/Ice/objects/Test.ice index 3b4bf7807c9..e6e4828ffb9 100644 --- a/python/test/Ice/objects/Test.ice +++ b/python/test/Ice/objects/Test.ice @@ -193,6 +193,16 @@ class M LMap v; } +// Forward declarations +class F1; +interface F2; + +class F3 +{ + F1 f1; + F2* f2; +} + interface Initial { void shutdown(); @@ -238,6 +248,11 @@ interface Initial void throwInnerSubEx() throws Inner::Sub::Ex; M opM(M v1, out M v2); + + F1 opF1(F1 f11, out F1 f12); + F2* opF2(F2* f21, out F2* f22); + F3 opF3(F3 f31, out F3 f32); + bool hasF3(); } } diff --git a/python/test/Ice/objects/TestI.py b/python/test/Ice/objects/TestI.py index 921f5d8b485..e28c882a1bf 100644 --- a/python/test/Ice/objects/TestI.py +++ b/python/test/Ice/objects/TestI.py @@ -193,6 +193,19 @@ class InitialI(Test.Initial): def opM(self, m, current=None): return (m, m) + def opF1(self, f11, current=None): + return (f11, Test.F1("F12")) + + def opF2(self, f21, current=None): + return (f21, current.adapter.getCommunicator().stringToProxy("F22")) + + def opF3(self, f31, current): + return (f31, Test.F3(Test.F1("F12"), current.adapter.getCommunicator().stringToProxy("F22"))) + + def hasF3(self, current): + return True + + class UnexpectedObjectExceptionTestI(Test.UnexpectedObjectExceptionTest): def op(self, current=None): return Test.AlsoEmpty() |