diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-11-09 16:22:47 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-11-09 16:22:47 -0800 |
commit | 493caea19fd83663eb03b4eeaf7714f99ac07b97 (patch) | |
tree | 39f8b7dc983394288cb25961a0907ebe0b0f5847 /cpp/test/Ice/optional/AllTests.cpp | |
parent | ICE-4914 - Update Database/Oracle demos (diff) | |
download | ice-493caea19fd83663eb03b4eeaf7714f99ac07b97.tar.bz2 ice-493caea19fd83663eb03b4eeaf7714f99ac07b97.tar.xz ice-493caea19fd83663eb03b4eeaf7714f99ac07b97.zip |
ICE-4930 - fixes for scripting languages
Diffstat (limited to 'cpp/test/Ice/optional/AllTests.cpp')
-rw-r--r-- | cpp/test/Ice/optional/AllTests.cpp | 28 |
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; |