summaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-10-23 15:10:49 +0200
committerJose <jose@zeroc.com>2018-10-23 15:15:55 +0200
commitff2b0065aa7de98adb50d15d8b4e999f56b1a06d (patch)
treedc47e5e90e49034f17bc1b8a7999b27293af72ac /ruby
parentFixed IceGrid bug in the algorithm to find Query objects, fixes #255 (diff)
downloadice-ff2b0065aa7de98adb50d15d8b4e999f56b1a06d.tar.bz2
ice-ff2b0065aa7de98adb50d15d8b4e999f56b1a06d.tar.xz
ice-ff2b0065aa7de98adb50d15d8b4e999f56b1a06d.zip
Fixed slice2matlab generated code type for dictionary data members
Close #256
Diffstat (limited to 'ruby')
-rw-r--r--ruby/test/Ice/objects/AllTests.rb19
-rw-r--r--ruby/test/Ice/objects/Test.ice15
2 files changed, 34 insertions, 0 deletions
diff --git a/ruby/test/Ice/objects/AllTests.rb b/ruby/test/Ice/objects/AllTests.rb
index a41df03cb91..ec2ebd0603f 100644
--- a/ruby/test/Ice/objects/AllTests.rb
+++ b/ruby/test/Ice/objects/AllTests.rb
@@ -370,5 +370,24 @@ def allTests(helper, communicator)
test(communicator.getValueFactoryManager().find('TestOF') != nil)
puts "ok"
+ print "testing class containing complex dictionary... "
+ STDOUT.flush
+ m = Test::M.new
+ m.v = {}
+ k1 = Test::StructKey.new(1, "1")
+ m.v[k1] = Test::L.new("one")
+ k2 = Test::StructKey.new(2, "2")
+ m.v[k2] = Test::L.new("two")
+ m1, m2 = initial.opM(m)
+ test(m1.v.length == 2)
+ test(m2.v.length == 2)
+
+ test(m1.v[k1].data == "one")
+ test(m2.v[k1].data == "one")
+
+ test(m1.v[k2].data == "two")
+ test(m2.v[k2].data == "two")
+ puts "ok"
+
return initial
end
diff --git a/ruby/test/Ice/objects/Test.ice b/ruby/test/Ice/objects/Test.ice
index 2f31f0f930d..41af54b8b5c 100644
--- a/ruby/test/Ice/objects/Test.ice
+++ b/ruby/test/Ice/objects/Test.ice
@@ -155,6 +155,19 @@ class L
sequence<Value> ValueSeq;
dictionary<string, Value> ValueMap;
+struct StructKey
+{
+ int i;
+ string s;
+}
+
+dictionary<StructKey, L> LMap;
+
+class M
+{
+ LMap v;
+}
+
class Initial
{
void shutdown();
@@ -192,6 +205,8 @@ class Initial
BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq);
Compact getCompact();
+
+ M opM(M v1, out M v2);
}
}