summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-03-27 09:24:43 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-03-27 09:24:43 +0200
commit7a8af0219f7dd58cc6f954ce9a0c03d0c97bf05e (patch)
treefd2f244d477b4f18507742a675498559518dcdd6
parentFix (ICE-7700) - SChannel Unknown key exchange (diff)
downloadice-7a8af0219f7dd58cc6f954ce9a0c03d0c97bf05e.tar.bz2
ice-7a8af0219f7dd58cc6f954ce9a0c03d0c97bf05e.tar.xz
ice-7a8af0219f7dd58cc6f954ce9a0c03d0c97bf05e.zip
Fixed Ice/optional cross-testing failure with JS servers
-rw-r--r--cpp/test/Ice/optional/AllTests.cpp6
-rw-r--r--js/test/Ice/optional/AMDInitialI.js9
-rw-r--r--js/test/Ice/optional/Client.js16
-rw-r--r--js/test/Ice/optional/InitialI.js9
-rw-r--r--php/test/Ice/optional/Client.php11
-rw-r--r--python/test/Ice/optional/AllTests.py5
-rw-r--r--ruby/test/Ice/optional/AllTests.rb6
7 files changed, 53 insertions, 9 deletions
diff --git a/cpp/test/Ice/optional/AllTests.cpp b/cpp/test/Ice/optional/AllTests.cpp
index 2d37120a6de..06bb5284e57 100644
--- a/cpp/test/Ice/optional/AllTests.cpp
+++ b/cpp/test/Ice/optional/AllTests.cpp
@@ -1429,6 +1429,12 @@ allTests(const Ice::CommunicatorPtr& communicator, bool)
IceUtil::Optional<OneOptionalPtr> p2 = initial->opOneOptional(p1, p3);
test(!p2 && !p3);
+ if(initial->supportsNullOptional())
+ {
+ p2 = initial->opOneOptional(OneOptionalPtr(), p3);
+ test(*p2 == ICE_NULLPTR && *p3 == ICE_NULLPTR);
+ }
+
p1 = ICE_MAKE_SHARED(OneOptional, 58);
p2 = initial->opOneOptional(p1, p3);
test((*p2)->a == 58 && (*p3)->a == 58);
diff --git a/js/test/Ice/optional/AMDInitialI.js b/js/test/Ice/optional/AMDInitialI.js
index 7b90fa13697..545a637e580 100644
--- a/js/test/Ice/optional/AMDInitialI.js
+++ b/js/test/Ice/optional/AMDInitialI.js
@@ -337,14 +337,19 @@
return Promise.resolve(false);
}
+ supportsCsharpSerializable(current)
+ {
+ return Promise.resolve(false);
+ }
+
supportsCppStringView(current)
{
return false;
}
- supportsCsharpSerializable(current)
+ supportsNullOptional(current)
{
- return Promise.resolve(false);
+ return Promise.resolve(true);
}
}
diff --git a/js/test/Ice/optional/Client.js b/js/test/Ice/optional/Client.js
index 0847fb98194..92a24c702eb 100644
--- a/js/test/Ice/optional/Client.js
+++ b/js/test/Ice/optional/Client.js
@@ -624,6 +624,22 @@
var [p1, p2] = r;
test(p1 === undefined);
test(p2 === undefined);
+ return initial.supportsNullOptional();
+ }
+ ).then(r =>
+ {
+ if(r)
+ {
+ return initial.opOneOptional(null).then(r =>
+ {
+ var [p1, p2] = r;
+ test(p1 === null);
+ test(p2 === null);
+ });
+ }
+ }
+ ).then(() =>
+ {
return initial.opOneOptional(new Test.OneOptional(58));
}
).then(r =>
diff --git a/js/test/Ice/optional/InitialI.js b/js/test/Ice/optional/InitialI.js
index efc5ff788b7..04dd907c803 100644
--- a/js/test/Ice/optional/InitialI.js
+++ b/js/test/Ice/optional/InitialI.js
@@ -333,15 +333,20 @@
return false;
}
- supportsCppStringView(current)
+ supportsCsharpSerializable(current)
{
return false;
}
- supportsCsharpSerializable(current)
+ supportsCppStringView(current)
{
return false;
}
+
+ supportsNullOptional(current)
+ {
+ return true;
+ }
}
exports.InitialI = InitialI;
}
diff --git a/php/test/Ice/optional/Client.php b/php/test/Ice/optional/Client.php
index b189d06bce9..2a4df75c57a 100644
--- a/php/test/Ice/optional/Client.php
+++ b/php/test/Ice/optional/Client.php
@@ -142,8 +142,8 @@ function allTests($communicator)
test($mo1->ioopd[5] == $prx);
test($mo1->bos == array(false, true, false));
-
-
+
+
//
// Test generated struct and classes compare with $none
//
@@ -563,6 +563,11 @@ function allTests($communicator)
$p3 = $initial->opOneOptional($none, $p2);
test($p2 == $none && $p3 == $none);
+ if($initial->supportsNullOptional())
+ {
+ $p3 = $initial->opOneOptional(null, $p2);
+ test($p2 == null && $p3 == null);
+ }
$p1 = new $oocls(58);
$p3 = $initial->opOneOptional($p1, $p2);
test($p2->a == $p1->a && $p3->a == $p1->a);
@@ -842,7 +847,7 @@ function allTests($communicator)
return $initial;
}
-$communicator = $NS ? eval("return Ice\\initialize(\$argv);") :
+$communicator = $NS ? eval("return Ice\\initialize(\$argv);") :
eval("return Ice_initialize(\$argv);");
$initial = allTests($communicator);
diff --git a/python/test/Ice/optional/AllTests.py b/python/test/Ice/optional/AllTests.py
index ee5565db1b4..2e15b015fe6 100644
--- a/python/test/Ice/optional/AllTests.py
+++ b/python/test/Ice/optional/AllTests.py
@@ -117,7 +117,7 @@ def allTests(communicator):
test(mo1.ioopd[5] == communicator.stringToProxy("test"))
test(mo1.bos == [False, True, False])
-
+
#
# Test generated struct and classes compare with Ice.Unset
#
@@ -564,6 +564,9 @@ def allTests(communicator):
(p2, p3) = initial.opOneOptional(Ice.Unset)
test(p2 is Ice.Unset and p3 is Ice.Unset)
+ if initial.supportsNullOptional():
+ (p2, p3) = initial.opOneOptional(None)
+ test(p2 is None and p3 is None)
p1 = Test.OneOptional(58)
(p2, p3) = initial.opOneOptional(p1)
test(p2.a == p1.a and p3.a == p1.a)
diff --git a/ruby/test/Ice/optional/AllTests.rb b/ruby/test/Ice/optional/AllTests.rb
index 1aecb03179c..269b2d1361e 100644
--- a/ruby/test/Ice/optional/AllTests.rb
+++ b/ruby/test/Ice/optional/AllTests.rb
@@ -117,7 +117,7 @@ def allTests(communicator)
test(mo1.ioopd[5] == communicator.stringToProxy("test"))
test(mo1.bos == [false, true, false])
-
+
#
# Test generated struct and classes compare with Ice::Unset
#
@@ -527,6 +527,10 @@ def allTests(communicator)
p2, p3 = initial.opOneOptional(Ice::Unset)
test(p2 == Ice::Unset && p3 == Ice::Unset)
+ if initial.supportsNullOptional() then
+ p2, p3 = initial.opOneOptional(nil)
+ test(p2 == nil && p3 == nil)
+ end
p1 = Test::OneOptional.new(58)
p2, p3 = initial.opOneOptional(p1)
test(p2.a == p1.a && p3.a == p1.a)