summaryrefslogtreecommitdiff
path: root/python/test
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-09-20 14:14:45 +0200
committerJose <jose@zeroc.com>2018-09-20 14:14:45 +0200
commit260b8bf8523164f68bdf97d469616cbf01c71cc0 (patch)
tree102ff9d0f45ae66a0c38dc02aa03cbf054c65358 /python/test
parentMerge branch '3.7.1-xcode10' into 3.7 (diff)
downloadice-260b8bf8523164f68bdf97d469616cbf01c71cc0.tar.bz2
ice-260b8bf8523164f68bdf97d469616cbf01c71cc0.tar.xz
ice-260b8bf8523164f68bdf97d469616cbf01c71cc0.zip
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
Diffstat (limited to 'python/test')
-rw-r--r--python/test/Ice/objects/AllTests.py15
-rw-r--r--python/test/Ice/objects/Test.ice8
-rw-r--r--python/test/Ice/objects/TestI.py9
3 files changed, 32 insertions, 0 deletions
diff --git a/python/test/Ice/objects/AllTests.py b/python/test/Ice/objects/AllTests.py
index 2ddefafb01b..5f59683ff33 100644
--- a/python/test/Ice/objects/AllTests.py
+++ b/python/test/Ice/objects/AllTests.py
@@ -118,6 +118,21 @@ def allTests(helper, communicator):
test(k.value.data == "l")
print("ok")
+ sys.stdout.write("testing Value as parameter... ")
+ sys.stdout.flush()
+ v1, v2 = initial.opValue(Test.L("l"))
+ test(v1.data == "l")
+ test(v2.data == "l")
+
+ v1, v2 = initial.opValueSeq([Test.L("l")])
+ test(v1[0].data == "l")
+ test(v2[0].data == "l")
+
+ v1, v2 = initial.opValueMap({"l":Test.L("l")})
+ test(v1["l"].data == "l")
+ test(v2["l"].data == "l")
+ print("ok")
+
sys.stdout.write("getting D1... ")
sys.stdout.flush()
d1 = initial.getD1(Test.D1(Test.A1("a1"), Test.A1("a2"), Test.A1("a3"), Test.A1("a4")))
diff --git a/python/test/Ice/objects/Test.ice b/python/test/Ice/objects/Test.ice
index a6a3034400e..d6d3e1e381d 100644
--- a/python/test/Ice/objects/Test.ice
+++ b/python/test/Ice/objects/Test.ice
@@ -182,6 +182,10 @@ class L
string data;
}
+sequence<Value> ValueSeq;
+dictionary<string, Value> ValueMap;
+
+
interface Initial
{
void shutdown();
@@ -206,6 +210,10 @@ interface Initial
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;
diff --git a/python/test/Ice/objects/TestI.py b/python/test/Ice/objects/TestI.py
index 6da50f05ef2..83cb67e51a8 100644
--- a/python/test/Ice/objects/TestI.py
+++ b/python/test/Ice/objects/TestI.py
@@ -156,6 +156,15 @@ class InitialI(Test.Initial):
def getK(self, current=None):
return Test.K(Test.L("l"))
+ def opValue(self, v1, current=None):
+ return v1, v1
+
+ def opValueSeq(self, v1, current=None):
+ return v1, v1
+
+ def opValueMap(self, v1, current=None):
+ return v1, v1
+
def getD1(self, d1, current=None):
return d1