From 260b8bf8523164f68bdf97d469616cbf01c71cc0 Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 20 Sep 2018 14:14:45 +0200 Subject: Test using Value as operation parameter Fix a bug in slice2java that generate bogus code or using Value as an Slice operation parameter Fix a bug in JavaScript mapping that cause a run-time error when invoking an operation that defines Value as an input parameter --- ruby/test/Ice/objects/AllTests.rb | 25 +++++++++++++++++++++++++ ruby/test/Ice/objects/Test.ice | 21 ++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) (limited to 'ruby') diff --git a/ruby/test/Ice/objects/AllTests.rb b/ruby/test/Ice/objects/AllTests.rb index c5c0e7a63bf..a41df03cb91 100644 --- a/ruby/test/Ice/objects/AllTests.rb +++ b/ruby/test/Ice/objects/AllTests.rb @@ -219,6 +219,31 @@ def allTests(helper, communicator) test(i) puts "ok" + print "getting K... " + STDOUT.flush + k = initial.getK() + test(k.value.data == "l") + puts "ok" + + print "testing Value as parameter... " + STDOUT.flush + v1 = Test::L.new("l") + v2, v3 = initial.opValue(v1) + test(v2.data == "l") + test(v3.data == "l") + + v1 = [Test::L.new("l")] + v2, v3 = initial.opValueSeq(v1) + test(v2[0].data == "l") + test(v3[0].data == "l") + + v1 = {} + v1["l"] = Test::L.new("l") + v2, v3 = initial.opValueMap(v1) + test(v2["l"].data == "l") + test(v3["l"].data == "l") + puts "ok" + print "getting D1... " STDOUT.flush d1 = initial.getD1(Test::D1.new(Test::A1.new("a1"), Test::A1.new("a2"), Test::A1.new("a3"), Test::A1.new("a4"))) diff --git a/ruby/test/Ice/objects/Test.ice b/ruby/test/Ice/objects/Test.ice index bf3d70ca9be..2f31f0f930d 100644 --- a/ruby/test/Ice/objects/Test.ice +++ b/ruby/test/Ice/objects/Test.ice @@ -142,6 +142,19 @@ class Recursive Recursive v; } +class K +{ + Value value; +} + +class L +{ + string data; +} + +sequence ValueSeq; +dictionary ValueMap; + class Initial { void shutdown(); @@ -160,9 +173,15 @@ class Initial void getAll(out B b1, out B b2, out C theC, out D theD); + I getH(); I getI(); I getJ(); - I getH(); + + K getK(); + + Value opValue(Value v1, out Value v2); + ValueSeq opValueSeq(ValueSeq v1, out ValueSeq v2); + ValueMap opValueMap(ValueMap v1, out ValueMap v2); D1 getD1(D1 d1); void throwEDerived() throws EDerived; -- cgit v1.2.3