summaryrefslogtreecommitdiff
path: root/python/test
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 /python/test
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 'python/test')
-rw-r--r--python/test/Ice/objects/AllTests.py20
-rw-r--r--python/test/Ice/objects/Test.ice15
-rw-r--r--python/test/Ice/objects/TestI.py3
3 files changed, 38 insertions, 0 deletions
diff --git a/python/test/Ice/objects/AllTests.py b/python/test/Ice/objects/AllTests.py
index 5f59683ff33..2f6a5f0fee5 100644
--- a/python/test/Ice/objects/AllTests.py
+++ b/python/test/Ice/objects/AllTests.py
@@ -320,4 +320,24 @@ def allTests(helper, communicator):
test(communicator.getValueFactoryManager().find("TestOF") != None)
print("ok")
+ sys.stdout.write("testing class containing complex dictionary... ")
+ sys.stdout.flush()
+ m = Test.M()
+ m.v = {}
+ k1 = Test.StructKey(1, "1")
+ m.v[k1] = Test.L("one")
+ k2 = Test.StructKey(2, "2")
+ m.v[k2] = Test.L("two")
+ m1, m2 = initial.opM(m)
+ test(len(m1.v) == 2)
+ test(len(m2.v) == 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")
+
+ print("ok")
+
return initial
diff --git a/python/test/Ice/objects/Test.ice b/python/test/Ice/objects/Test.ice
index 417891a894f..1bf545c88df 100644
--- a/python/test/Ice/objects/Test.ice
+++ b/python/test/Ice/objects/Test.ice
@@ -185,6 +185,19 @@ class L
sequence<Value> ValueSeq;
dictionary<string, Value> ValueMap;
+struct StructKey
+{
+ int i;
+ string s;
+}
+
+dictionary<StructKey, L> LMap;
+
+class M
+{
+ LMap v;
+}
+
interface Initial
{
void shutdown();
@@ -228,6 +241,8 @@ interface Initial
void throwInnerEx() throws Inner::Ex;
void throwInnerSubEx() throws Inner::Sub::Ex;
+
+ M opM(M v1, out M v2);
}
}
diff --git a/python/test/Ice/objects/TestI.py b/python/test/Ice/objects/TestI.py
index 83cb67e51a8..121ea779941 100644
--- a/python/test/Ice/objects/TestI.py
+++ b/python/test/Ice/objects/TestI.py
@@ -195,6 +195,9 @@ class InitialI(Test.Initial):
def throwInnerSubEx(self, current=None):
raise Test.Inner.Sub.Ex("Inner::Sub::Ex")
+ def opM(self, m, current=None):
+ return (m, m)
+
class UnexpectedObjectExceptionTestI(Test.UnexpectedObjectExceptionTest):
def op(self, current=None):
return Test.AlsoEmpty()