diff options
author | Bernard Normier <bernard@zeroc.com> | 2004-03-01 20:13:14 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2004-03-01 20:13:14 +0000 |
commit | 5d33b030f2c0961d5dcfeffa944ade8ea0921ad0 (patch) | |
tree | 1e093d83820ea127374b690c79f1af256067923c /cpp/test/Ice/exceptions/AllTests.cpp | |
parent | changing version to 1.3.0 (diff) | |
download | ice-5d33b030f2c0961d5dcfeffa944ade8ea0921ad0.tar.bz2 ice-5d33b030f2c0961d5dcfeffa944ade8ea0921ad0.tar.xz ice-5d33b030f2c0961d5dcfeffa944ade8ea0921ad0.zip |
Nested exception support + test
Diffstat (limited to 'cpp/test/Ice/exceptions/AllTests.cpp')
-rw-r--r-- | cpp/test/Ice/exceptions/AllTests.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp index 14c05b32fd8..6ffa492e7a3 100644 --- a/cpp/test/Ice/exceptions/AllTests.cpp +++ b/cpp/test/Ice/exceptions/AllTests.cpp @@ -386,6 +386,39 @@ public: typedef IceUtil::Handle<AMI_Thrower_throwCasCI> AMI_Thrower_throwCasCIPtr; + +class AMI_Thrower_throwModAI : public AMI_Thrower_throwModA, public CallbackBase +{ +public: + + virtual void ice_response() + { + test(false); + } + + virtual void ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const Mod::A& ex) + { + test(ex.aMem == 1); + test(ex.a2Mem == 2); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Thrower_throwModAI> AMI_Thrower_throwModAIPtr; + + + class AMI_Thrower_throwUndeclaredAI : public AMI_Thrower_throwUndeclaredA, public CallbackBase { public: @@ -731,6 +764,22 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(false); } + try + { + thrower->throwModA(1, 2); + test(false); + } + catch(const Mod::A& ex) + { + test(ex.aMem == 1); + test(ex.a2Mem == 2); + } + catch(...) + { + test(false); + } + + cout << "ok" << endl; cout << "catching base types... " << flush; @@ -764,6 +813,20 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(false); } + try + { + thrower->throwModA(1, 2); + test(false); + } + catch(const A& ex) + { + test(ex.aMem == 1); + } + catch(...) + { + test(false); + } + cout << "ok" << endl; cout << "catching derived types... " << flush; @@ -1080,6 +1143,12 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(cb->check()); } + { + AMI_Thrower_throwModAIPtr cb = new AMI_Thrower_throwModAI; + thrower->throwModA_async(cb, 1, 2); + test(cb->check()); + } + cout << "ok" << endl; cout << "catching derived types... " << flush; |