summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/exceptions/AllTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/exceptions/AllTests.cpp')
-rw-r--r--cpp/test/Ice/exceptions/AllTests.cpp112
1 files changed, 16 insertions, 96 deletions
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp
index 2a067ee3aec..91bb5df81a0 100644
--- a/cpp/test/Ice/exceptions/AllTests.cpp
+++ b/cpp/test/Ice/exceptions/AllTests.cpp
@@ -29,17 +29,15 @@ allTests(const Ice::CommunicatorPtr& communicator)
test(thrower == base);
cout << "ok" << endl;
- cout << "catching exact types by value... " << flush;
+ cout << "catching exact types... " << flush;
try
{
thrower->throwAasA(1);
test(false);
}
- catch(const APtrE& ex)
+ catch(const A& ex)
{
- test(ex->a == 1);
- const APtr& p = ex;
- test(p->a == 1);
+ test(ex.a == 1);
}
catch(...)
{
@@ -50,13 +48,10 @@ allTests(const Ice::CommunicatorPtr& communicator)
thrower->throwBasB(1, 2);
test(false);
}
- catch(const BPtrE& ex)
+ catch(const B& ex)
{
- test(ex->a == 1);
- test(ex->b == 2);
- const BPtr& p = ex;
- test(p->a == 1);
- test(p->b == 2);
+ test(ex.a == 1);
+ test(ex.b == 2);
}
catch(...)
{
@@ -67,15 +62,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
thrower->throwCasC(1, 2, 3);
test(false);
}
- catch(const CPtrE& ex)
+ catch(const C& ex)
{
- test(ex->a == 1);
- test(ex->b == 2);
- test(ex->c == 3);
- const CPtr& p = ex;
- test(p->a == 1);
- test(p->b == 2);
- test(p->c == 3);
+ test(ex.a == 1);
+ test(ex.b == 2);
+ test(ex.c == 3);
}
catch(...)
{
@@ -83,17 +74,15 @@ allTests(const Ice::CommunicatorPtr& communicator)
}
cout << "ok" << endl;
- cout << "catching base types by value... " << flush;
+ cout << "catching base types... " << flush;
try
{
thrower->throwBasB(1, 2);
test(false);
}
- catch(const APtrE& ex)
+ catch(const A& ex)
{
- test(ex->a == 1);
- const APtr& p = ex;
- test(p->a == 1);
+ test(ex.a == 1);
}
catch(...)
{
@@ -104,79 +93,10 @@ allTests(const Ice::CommunicatorPtr& communicator)
thrower->throwCasC(1, 2, 3);
test(false);
}
- catch(const BPtrE& ex)
- {
- test(ex->a == 1);
- test(ex->b == 2);
- const BPtr& p = ex;
- test(p->a == 1);
- test(p->b == 2);
- }
- catch(...)
- {
- assert(false);
- }
- cout << "ok" << endl;
-
- cout << "catching exact types by proxy... " << flush;
- try
- {
- thrower->throwAasAproxy();
- test(false);
- }
- catch(const APrxE&)
- {
- }
- catch(...)
- {
- assert(false);
- }
- try
- {
- thrower->throwBasBproxy();
- test(false);
- }
- catch(const BPrxE&)
- {
- }
- catch(...)
- {
- assert(false);
- }
- try
- {
- thrower->throwCasCproxy();
- test(false);
- }
- catch(const CPrxE&)
- {
- }
- catch(...)
- {
- assert(false);
- }
- cout << "ok" << endl;
-
- cout << "catching base types by proxy... " << flush;
- try
- {
- thrower->throwBasBproxy();
- test(false);
- }
- catch(const APrxE&)
- {
- }
- catch(...)
- {
- assert(false);
- }
- try
- {
- thrower->throwCasCproxy();
- test(false);
- }
- catch(const BPrxE&)
+ catch(const B& ex)
{
+ test(ex.a == 1);
+ test(ex.b == 2);
}
catch(...)
{