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 /js | |
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 'js')
-rw-r--r-- | js/test/Common/TestSuites.json | 2 | ||||
-rw-r--r-- | js/test/Ice/objects/.gitignore | 1 | ||||
-rw-r--r-- | js/test/Ice/objects/Client.js | 24 | ||||
-rw-r--r-- | js/test/Ice/objects/Forward.ice | 20 | ||||
-rw-r--r-- | js/test/Ice/objects/InitialI.js | 23 | ||||
-rw-r--r-- | js/test/Ice/objects/Server.js | 1 | ||||
-rw-r--r-- | js/test/Ice/objects/Test.ice | 15 |
7 files changed, 85 insertions, 1 deletions
diff --git a/js/test/Common/TestSuites.json b/js/test/Common/TestSuites.json index 652d6c792f4..cc006b8c164 100644 --- a/js/test/Common/TestSuites.json +++ b/js/test/Common/TestSuites.json @@ -74,7 +74,7 @@ }, "Ice/objects": { - "files": ["Test.js", "Client.js", "InitialI.js", "Server.js"], + "files": ["Test.js", "Forward.js", "Client.js", "InitialI.js", "Server.js"], "testcases": [ { diff --git a/js/test/Ice/objects/.gitignore b/js/test/Ice/objects/.gitignore index d158d9308ba..e0c127372d7 100644 --- a/js/test/Ice/objects/.gitignore +++ b/js/test/Ice/objects/.gitignore @@ -1,2 +1,3 @@ Test.js +Forward.js index.html diff --git a/js/test/Ice/objects/Client.js b/js/test/Ice/objects/Client.js index 6e8f7602c5c..23984ccaed8 100644 --- a/js/test/Ice/objects/Client.js +++ b/js/test/Ice/objects/Client.js @@ -6,6 +6,7 @@ { const Ice = require("ice").Ice; const Test = require("Test").Test; + require("Forward"); const TestHelper = require("TestHelper").TestHelper; const test = TestHelper.test; @@ -464,6 +465,29 @@ } out.writeLine("ok"); + out.write("testing forward declarations... "); + { + const [f11, f12] = await initial.opF1(new Test.F1("F11")); + test(f11.name == "F11"); + test(f12.name == "F12"); + + const [f21, f22] = await initial.opF2(Test.F2Prx.uncheckedCast(communicator.stringToProxy("F21"))); + test(f21.ice_getIdentity().name == "F21"); + test(f22.ice_getIdentity().name == "F22"); + + if(initial.hasF3()) + { + const [f31, f32] = await initial.opF3( + new Test.F3(new Test.F1("F11"), Test.F2Prx.uncheckedCast(communicator.stringToProxy("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"); + } + } + out.writeLine("ok"); + await initial.shutdown(); } diff --git a/js/test/Ice/objects/Forward.ice b/js/test/Ice/objects/Forward.ice new file mode 100644 index 00000000000..5cc93e83b4a --- /dev/null +++ b/js/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/js/test/Ice/objects/InitialI.js b/js/test/Ice/objects/InitialI.js index 50e7af444bc..e6140642963 100644 --- a/js/test/Ice/objects/InitialI.js +++ b/js/test/Ice/objects/InitialI.js @@ -6,6 +6,7 @@ { const Ice = require("ice").Ice; const Test = require("Test").Test; + require("Forward"); class BI extends Test.B { @@ -322,6 +323,28 @@ return [v1, v1]; } + opF1(f11, current) + { + return [f11, new Test.F1("F12")]; + } + + opF2(f21, current) + { + return [f21, current.adapter.getCommunicator().stringToProxy("F22")]; + } + + opF3(f31, current) + { + return [f31, + new Test.F3(new Test.F1("F12"), + current.adapter.getCommunicator().stringToProxy("F22"))]; + } + + hasF3(current) + { + return true; + } + shutdown(current) { current.adapter.getCommunicator().shutdown(); diff --git a/js/test/Ice/objects/Server.js b/js/test/Ice/objects/Server.js index 3bd99210f48..fa55ce23596 100644 --- a/js/test/Ice/objects/Server.js +++ b/js/test/Ice/objects/Server.js @@ -6,6 +6,7 @@ { const Ice = require("ice").Ice; const Test = require("Test").Test; + require("Forward"); const TestHelper = require("TestHelper").TestHelper; const InitialI = require("InitialI").InitialI; diff --git a/js/test/Ice/objects/Test.ice b/js/test/Ice/objects/Test.ice index b908511f680..617deda65de 100644 --- a/js/test/Ice/objects/Test.ice +++ b/js/test/Ice/objects/Test.ice @@ -197,6 +197,16 @@ class M LMap v; } +// Forward declarations +class F1; +interface F2; + +class F3 +{ + F1 f1; + F2* f2; +} + interface Initial { void shutdown(); @@ -242,6 +252,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(); } class Empty |