summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/exceptions/AllTests.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-10-22 14:14:10 +0000
committerMarc Laukien <marc@zeroc.com>2001-10-22 14:14:10 +0000
commitba88e06fd6d4a10394913697033b5858773946f7 (patch)
treef80f306006c885eff2370450170df8731bf5b753 /cpp/test/Ice/exceptions/AllTests.cpp
parentfixes for STLport-4.5 (diff)
downloadice-ba88e06fd6d4a10394913697033b5858773946f7.tar.bz2
ice-ba88e06fd6d4a10394913697033b5858773946f7.tar.xz
ice-ba88e06fd6d4a10394913697033b5858773946f7.zip
removed truncation feature
Diffstat (limited to 'cpp/test/Ice/exceptions/AllTests.cpp')
-rw-r--r--cpp/test/Ice/exceptions/AllTests.cpp113
1 files changed, 58 insertions, 55 deletions
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp
index 041b3bbe147..f2b59201c11 100644
--- a/cpp/test/Ice/exceptions/AllTests.cpp
+++ b/cpp/test/Ice/exceptions/AllTests.cpp
@@ -46,7 +46,7 @@ public:
};
ThrowerPrx
-allTests(const Ice::CommunicatorPtr& communicator)
+allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
{
cout << "testing stringToProxy... " << flush;
string ref("thrower:tcp -p 12345 -t 2000");
@@ -170,61 +170,64 @@ allTests(const Ice::CommunicatorPtr& communicator)
cout << "ok" << endl;
- cout << "catching derived types w/o exception factories... " << flush;
-
- try
+ if (!collocated) // If the server is collocated, exception factories are not needed.
{
- thrower->throwBasA(1, 2);
- test(false);
- }
- catch (const A& ex)
- {
- test(ex.a == 1);
- }
- catch (...)
- {
- test(false);
- }
-
- try
- {
- thrower->throwCasA(1, 2, 3);
- test(false);
- }
- catch (const A& ex)
- {
- test(ex.a == 1);
- }
- catch (...)
- {
- test(false);
- }
-
- try
- {
- thrower->throwCasB(1, 2, 3);
- test(false);
- }
- catch (const B& ex)
- {
- test(ex.a == 1);
- test(ex.b == 2);
- }
- catch (...)
- {
- test(false);
- }
-
- cout << "ok" << endl;
-
- cout << "catching derived types w/ exception factories... " << flush;
-
- Ice::UserExceptionFactoryPtr factory = new MyExceptionFactory;
- communicator->addUserExceptionFactory(factory, "::A");
- communicator->addUserExceptionFactory(factory, "::B");
- communicator->addUserExceptionFactory(factory, "::C");
- communicator->addUserExceptionFactory(factory, "::D");
-
+ cout << "catching derived types w/o exception factories... " << flush;
+
+ try
+ {
+ thrower->throwBasA(1, 2);
+ test(false);
+ }
+ catch (const Ice::NoUserExceptionFactoryException&)
+ {
+ }
+ catch (...)
+ {
+ test(false);
+ }
+
+ try
+ {
+ thrower->throwCasA(1, 2, 3);
+ test(false);
+ }
+ catch (const Ice::NoUserExceptionFactoryException&)
+ {
+ }
+ catch (...)
+ {
+ test(false);
+ }
+
+ try
+ {
+ thrower->throwCasB(1, 2, 3);
+ test(false);
+ }
+ catch (const Ice::NoUserExceptionFactoryException&)
+ {
+ }
+ catch (...)
+ {
+ test(false);
+ }
+
+ cout << "ok" << endl;
+
+ cout << "catching derived types w/ exception factories... " << flush;
+
+ Ice::UserExceptionFactoryPtr factory = new MyExceptionFactory;
+ communicator->addUserExceptionFactory(factory, "::A");
+ communicator->addUserExceptionFactory(factory, "::B");
+ communicator->addUserExceptionFactory(factory, "::C");
+ communicator->addUserExceptionFactory(factory, "::D");
+ }
+ else
+ {
+ cout << "catching derived types... " << flush;
+ }
+
try
{
thrower->throwBasA(1, 2);