summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-12-07 22:17:44 +0000
committerMarc Laukien <marc@zeroc.com>2002-12-07 22:17:44 +0000
commitbec87e9b6a7edcbbfce5fadb520c41816143a8be (patch)
treed428b8bf9306090d456b198c87d34e0dd048a5cb /cpp/test
parentAMD exception cleanup (diff)
downloadice-bec87e9b6a7edcbbfce5fadb520c41816143a8be.tar.bz2
ice-bec87e9b6a7edcbbfce5fadb520c41816143a8be.tar.xz
ice-bec87e9b6a7edcbbfce5fadb520c41816143a8be.zip
more AMD exception fixes
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Ice/exceptions/AllTests.cpp66
-rw-r--r--cpp/test/Ice/exceptions/Test.ice1
-rw-r--r--cpp/test/Ice/exceptions/TestAMD.ice1
-rw-r--r--cpp/test/Ice/exceptions/TestAMDI.cpp18
-rw-r--r--cpp/test/Ice/exceptions/TestAMDI.h2
-rw-r--r--cpp/test/Ice/exceptions/TestI.cpp6
-rw-r--r--cpp/test/Ice/exceptions/TestI.h1
7 files changed, 37 insertions, 58 deletions
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp
index b8bbad1b017..0c800ad3fe1 100644
--- a/cpp/test/Ice/exceptions/AllTests.cpp
+++ b/cpp/test/Ice/exceptions/AllTests.cpp
@@ -1216,34 +1216,31 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
cout << "ok" << endl;
- if(thrower->supportsNonIceExceptions())
+ cout << "catching unknown non-Ice exception... " << flush;
+
+ try
{
- cout << "catching unknown non-Ice exception... " << flush;
-
- try
- {
- thrower->throwNonIceException();
- test(false);
- }
- catch(const Ice::UnknownException&)
- {
- //
- // We get the an unknown exception without collocation
- // optimization.
- //
- assert(!collocated);
- }
- catch(...)
- {
- //
- // We get the original exception with collocation
- // optimization.
- //
- assert(collocated);
- }
-
- cout << "ok" << endl;
+ thrower->throwNonIceException();
+ test(false);
}
+ catch(const Ice::UnknownException&)
+ {
+ //
+ // We get the an unknown exception without collocation
+ // optimization.
+ //
+ assert(!collocated);
+ }
+ catch(...)
+ {
+ //
+ // We get the original exception with collocation
+ // optimization.
+ //
+ assert(collocated);
+ }
+
+ cout << "ok" << endl;
if(!collocated) // If the server is collocated, exception factories are not needed.
{
@@ -1415,16 +1412,13 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
cout << "ok" << endl;
- if(thrower->supportsNonIceExceptions())
- {
- cout << "catching unknown non-Ice exception with AMI... " << flush;
-
- AMI_Thrower_throwNonIceExceptionIPtr cb = new AMI_Thrower_throwNonIceExceptionI;
- thrower->throwNonIceException_async(cb);
- test(cb->check());
-
- cout << "ok" << endl;
- }
+ cout << "catching unknown non-Ice exception with AMI... " << flush;
+
+ AMI_Thrower_throwNonIceExceptionIPtr cb = new AMI_Thrower_throwNonIceExceptionI;
+ thrower->throwNonIceException_async(cb);
+ test(cb->check());
+
+ cout << "ok" << endl;
communicator->removeUserExceptionFactory("::A");
communicator->removeUserExceptionFactory("::B");
diff --git a/cpp/test/Ice/exceptions/Test.ice b/cpp/test/Ice/exceptions/Test.ice
index ee59247da04..c447b24aaf3 100644
--- a/cpp/test/Ice/exceptions/Test.ice
+++ b/cpp/test/Ice/exceptions/Test.ice
@@ -45,7 +45,6 @@ exception D
{
void shutdown();
bool supportsUndeclaredExceptions();
- bool supportsNonIceExceptions();
void throwAasA(int a) throws A;
void throwAorDasAorD(int a) throws A, D;
diff --git a/cpp/test/Ice/exceptions/TestAMD.ice b/cpp/test/Ice/exceptions/TestAMD.ice
index 709469ae075..25933cff713 100644
--- a/cpp/test/Ice/exceptions/TestAMD.ice
+++ b/cpp/test/Ice/exceptions/TestAMD.ice
@@ -41,7 +41,6 @@ exception D
{
void shutdown();
bool supportsUndeclaredExceptions();
- bool supportsNonIceExceptions();
void throwAasA(int a) throws A;
void throwAorDasAorD(int a) throws A, D;
diff --git a/cpp/test/Ice/exceptions/TestAMDI.cpp b/cpp/test/Ice/exceptions/TestAMDI.cpp
index 75cca588a7c..ce0c737e60a 100644
--- a/cpp/test/Ice/exceptions/TestAMDI.cpp
+++ b/cpp/test/Ice/exceptions/TestAMDI.cpp
@@ -36,13 +36,6 @@ ThrowerI::supportsUndeclaredExceptions_async(const AMD_Thrower_supportsUndeclare
}
void
-ThrowerI::supportsNonIceExceptions_async(const AMD_Thrower_supportsNonIceExceptionsPtr& cb,
- const Ice::Current&)
-{
- cb->ice_response(false);
-}
-
-void
ThrowerI::throwAasA_async(const AMD_Thrower_throwAasAPtr& cb,
Ice::Int a, const Ice::Current&)
{
@@ -76,7 +69,8 @@ ThrowerI::throwBasA_async(const AMD_Thrower_throwBasAPtr& cb,
B ex;
ex.aMem = a;
ex.bMem = b;
- cb->ice_exception(ex);
+ throw ex;
+ //cb->ice_exception(ex);
}
void
@@ -97,7 +91,8 @@ ThrowerI::throwBasB_async(const AMD_Thrower_throwBasBPtr& cb,
B ex;
ex.aMem = a;
ex.bMem = b;
- cb->ice_exception(ex);
+ throw ex;
+ //cb->ice_exception(ex);
}
void
@@ -138,7 +133,8 @@ ThrowerI::throwUndeclaredB_async(const AMD_Thrower_throwUndeclaredBPtr& cb,
B ex;
ex.aMem = a;
ex.bMem = b;
- cb->ice_exception(ex);
+ throw ex;
+// cb->ice_exception(ex);
}
void
@@ -163,5 +159,5 @@ void
ThrowerI::throwNonIceException_async(const AMD_Thrower_throwNonIceExceptionPtr&,
const Ice::Current&)
{
- assert(false); // We cannot throw non-Ice exceptions with AMD.
+ throw int(12345);
}
diff --git a/cpp/test/Ice/exceptions/TestAMDI.h b/cpp/test/Ice/exceptions/TestAMDI.h
index e6b32ed95a5..b11181aaae5 100644
--- a/cpp/test/Ice/exceptions/TestAMDI.h
+++ b/cpp/test/Ice/exceptions/TestAMDI.h
@@ -27,8 +27,6 @@ public:
const Ice::Current&);
virtual void supportsUndeclaredExceptions_async(const AMD_Thrower_supportsUndeclaredExceptionsPtr&,
const Ice::Current&);
- virtual void supportsNonIceExceptions_async(const AMD_Thrower_supportsNonIceExceptionsPtr&,
- const Ice::Current&);
virtual void throwAasA_async(const AMD_Thrower_throwAasAPtr&,
Ice::Int, const Ice::Current&);
diff --git a/cpp/test/Ice/exceptions/TestI.cpp b/cpp/test/Ice/exceptions/TestI.cpp
index bea372fb4b5..8042ee0d22c 100644
--- a/cpp/test/Ice/exceptions/TestI.cpp
+++ b/cpp/test/Ice/exceptions/TestI.cpp
@@ -32,12 +32,6 @@ ThrowerI::supportsUndeclaredExceptions(const Ice::Current&)
return true;
}
-bool
-ThrowerI::supportsNonIceExceptions(const Ice::Current&)
-{
- return true;
-}
-
void
ThrowerI::throwAasA(Ice::Int a, const Ice::Current&)
{
diff --git a/cpp/test/Ice/exceptions/TestI.h b/cpp/test/Ice/exceptions/TestI.h
index 8abb9e16df8..8de265824bd 100644
--- a/cpp/test/Ice/exceptions/TestI.h
+++ b/cpp/test/Ice/exceptions/TestI.h
@@ -25,7 +25,6 @@ public:
virtual void shutdown(const Ice::Current&);
virtual bool supportsUndeclaredExceptions(const Ice::Current&);
- virtual bool supportsNonIceExceptions(const Ice::Current&);
virtual void throwAasA(Ice::Int, const Ice::Current&);
virtual void throwAorDasAorD(Ice::Int, const Ice::Current&);