diff options
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/test/Ice/objects/AllTests.rb | 19 | ||||
-rwxr-xr-x | ruby/test/Ice/objects/Client.rb | 1 | ||||
-rw-r--r-- | ruby/test/Ice/objects/Forward.ice | 20 | ||||
-rw-r--r-- | ruby/test/Ice/objects/Test.ice | 15 |
4 files changed, 55 insertions, 0 deletions
diff --git a/ruby/test/Ice/objects/AllTests.rb b/ruby/test/Ice/objects/AllTests.rb index 69abd80f806..9e92f11131a 100644 --- a/ruby/test/Ice/objects/AllTests.rb +++ b/ruby/test/Ice/objects/AllTests.rb @@ -384,5 +384,24 @@ def allTests(helper, communicator) test(m2.v[k2].data == "two") puts "ok" + print "testing forward declarations... " + STDOUT.flush + f11, f12 = initial.opF1(Test::F1.new("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() then + f31, f32 = initial.opF3(Test::F3.new(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") + end + puts "ok" return initial end diff --git a/ruby/test/Ice/objects/Client.rb b/ruby/test/Ice/objects/Client.rb index 1e9516066b6..53d3faf3a14 100755 --- a/ruby/test/Ice/objects/Client.rb +++ b/ruby/test/Ice/objects/Client.rb @@ -5,6 +5,7 @@ require 'Ice' Ice::loadSlice('Test.ice') +Ice::loadSlice('Forward.ice') Ice::loadSlice('ClientPrivate.ice') require './AllTests' diff --git a/ruby/test/Ice/objects/Forward.ice b/ruby/test/Ice/objects/Forward.ice new file mode 100644 index 00000000000..5cc93e83b4a --- /dev/null +++ b/ruby/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/ruby/test/Ice/objects/Test.ice b/ruby/test/Ice/objects/Test.ice index d22849cb7cb..b4e0f3fd690 100644 --- a/ruby/test/Ice/objects/Test.ice +++ b/ruby/test/Ice/objects/Test.ice @@ -163,6 +163,16 @@ class M LMap v; } +// Forward declaration +class F1; +interface F2; + +class F3 +{ + F1 f1; + F2* f2; +} + class Initial { void shutdown(); @@ -202,6 +212,11 @@ class Initial Compact getCompact(); 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(); } } |