summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/optional/AllTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/optional/AllTests.cpp')
-rw-r--r--cpp/test/Ice/optional/AllTests.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/cpp/test/Ice/optional/AllTests.cpp b/cpp/test/Ice/optional/AllTests.cpp
index 22c0d3cdb3c..6719dca601e 100644
--- a/cpp/test/Ice/optional/AllTests.cpp
+++ b/cpp/test/Ice/optional/AllTests.cpp
@@ -548,6 +548,19 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
in->endEncapsulation();
test(obj && dynamic_cast<TestObjectReader*>(obj.get()));
factory->setEnabled(false);
+
+ //
+ // Use the 1.0 encoding with operations whose only class parameters are optional.
+ //
+ IceUtil::Optional<OneOptionalPtr> oo(new OneOptional(53));
+ initial->sendOptionalClass(true, oo);
+ initial->ice_encodingVersion(Ice::Encoding_1_0)->sendOptionalClass(true, oo);
+
+ initial->returnOptionalClass(true, oo);
+ test(oo);
+ initial->ice_encodingVersion(Ice::Encoding_1_0)->returnOptionalClass(true, oo);
+ test(!oo);
+
cout << "ok" << endl;
cout << "testing marshalling of large containers with fixed size elements..." << flush;
@@ -1092,6 +1105,21 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
test(ex.b == string("test"));
test((*ex.o)->a = 53);
}
+
+ try
+ {
+ //
+ // Use the 1.0 encoding with an exception whose only class members are optional.
+ //
+ initial->ice_encodingVersion(Ice::Encoding_1_0)->
+ opOptionalException(30, string("test"), OneOptionalPtr(new OneOptional(53)));
+ }
+ catch(const OptionalException& ex)
+ {
+ test(!ex.a);
+ test(!ex.b);
+ test(!ex.o);
+ }
}
cout << "ok" << endl;