summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/src/Slice/RubyUtil.cpp7
-rw-r--r--php/test/Ice/optional/Client.php12
-rw-r--r--python/test/Ice/optional/AllTests.py9
-rw-r--r--ruby/test/Ice/optional/AllTests.rb9
4 files changed, 31 insertions, 6 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index 6364e88133e..87b766009be 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -1005,13 +1005,10 @@ Slice::Ruby::CodeVisitor::visitStructStart(const StructPtr& p)
_out.inc();
_out << nl << "return false if";
_out.inc();
+ _out << " !other.is_a? " << getAbsolute(p, IdentToUpper);
for(MemberInfoList::iterator r = memberList.begin(); r != memberList.end(); ++r)
{
- if(r != memberList.begin())
- {
- _out << " or";
- }
- _out << nl << "@" << r->fixedName << " != other." << r->fixedName;
+ _out << " or" << nl << "@" << r->fixedName << " != other." << r->fixedName;
}
_out.dec();
_out << nl << "true";
diff --git a/php/test/Ice/optional/Client.php b/php/test/Ice/optional/Client.php
index 79076dd10ec..0d2e18be716 100644
--- a/php/test/Ice/optional/Client.php
+++ b/php/test/Ice/optional/Client.php
@@ -94,6 +94,8 @@ function allTests($communicator)
test($mo1->bos == Ice_Unset);
+ $sscls = $NS ? "Test\\SmallStruct" : "Test_SmallStruct";
+ $ss = new $sscls();
$fscls = $NS ? "Test\\FixedStruct" : "Test_FixedStruct";
$fs = new $fscls(78);
$vscls = $NS ? "Test\\VarStruct" : "Test_VarStruct";
@@ -143,6 +145,15 @@ function allTests($communicator)
test($mo1->ioopd[5] == $ooprx);
test($mo1->bos == array(false, true, false));
+
+
+ //
+ // Test generated struct and classes compare with Ice_Unset
+ //
+ test($ss != Ice_Unset);
+ test($fs != Ice_Unset);
+ test($vs != Ice_Unset);
+ test($mo1 != Ice_Unset);
echo "ok\n";
@@ -533,7 +544,6 @@ function allTests($communicator)
$p3 = $initial->opMyEnum($enum, $p2);
test($p2 == $enum && $p3 == $enum);
- $sscls = $NS ? "Test\\SmallStruct" : "Test_SmallStruct";
$p3 = $initial->opSmallStruct(Ice_Unset, $p2);
test($p2 == Ice_Unset && $p3 == Ice_Unset);
$p1 = new $sscls(56);
diff --git a/python/test/Ice/optional/AllTests.py b/python/test/Ice/optional/AllTests.py
index e2c20f64783..b347c10fccc 100644
--- a/python/test/Ice/optional/AllTests.py
+++ b/python/test/Ice/optional/AllTests.py
@@ -72,6 +72,7 @@ def allTests(communicator):
test(mo1.bos is Ice.Unset)
+ ss = Test.SmallStruct()
fs = Test.FixedStruct(78)
vs = Test.VarStruct("hello")
mo1 = Test.MultiOptional(15, True, 19, 78, 99, 5.5, 1.0, "test", Test.MyEnum.MyEnumMember, \
@@ -116,6 +117,14 @@ def allTests(communicator):
test(mo1.ioopd[5] == Test.OneOptionalPrx.uncheckedCast(communicator.stringToProxy("test")))
test(mo1.bos == [False, True, False])
+
+ #
+ # Test generated struct and classes compare with Ice.Unset
+ #
+ test(ss != Ice.Unset)
+ test(fs != Ice.Unset)
+ test(vs != Ice.Unset)
+ test(mo1 != Ice.Unset)
print("ok")
diff --git a/ruby/test/Ice/optional/AllTests.rb b/ruby/test/Ice/optional/AllTests.rb
index 167eddc9f37..de9a0c4e9d3 100644
--- a/ruby/test/Ice/optional/AllTests.rb
+++ b/ruby/test/Ice/optional/AllTests.rb
@@ -72,6 +72,7 @@ def allTests(communicator)
test(mo1.bos == Ice::Unset)
+ ss = Test::SmallStruct.new()
fs = Test::FixedStruct.new(78)
vs = Test::VarStruct.new("hello")
mo1 = Test::MultiOptional.new(15, true, 19, 78, 99, 5.5, 1.0, "test", Test::MyEnum::MyEnumMember, \
@@ -116,6 +117,14 @@ def allTests(communicator)
test(mo1.ioopd[5] == Test::OneOptionalPrx::uncheckedCast(communicator.stringToProxy("test")))
test(mo1.bos == [false, true, false])
+
+ #
+ # Test generated struct and classes compare with Ice::Unset
+ #
+ test(ss != Ice::Unset)
+ test(fs != Ice::Unset)
+ test(vs != Ice::Unset)
+ test(mo1 != Ice::Unset)
puts "ok"