summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/exceptions/AllTests.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2007-03-19 03:31:04 +0000
committerMichi Henning <michi@zeroc.com>2007-03-19 03:31:04 +0000
commit55538ff830b8f462a2a9cd8d9caf892f91803d8b (patch)
tree33b1244f198daf7da400156123629d85a198e577 /cpp/test/Ice/exceptions/AllTests.cpp
parentFixed bug 2005 (diff)
downloadice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.tar.bz2
ice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.tar.xz
ice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.zip
Bug 2048.
Diffstat (limited to 'cpp/test/Ice/exceptions/AllTests.cpp')
-rw-r--r--cpp/test/Ice/exceptions/AllTests.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp
index 2787dd81015..84efae4b113 100644
--- a/cpp/test/Ice/exceptions/AllTests.cpp
+++ b/cpp/test/Ice/exceptions/AllTests.cpp
@@ -570,6 +570,53 @@ typedef IceUtil::Handle<AMI_WrongOperation_noSuchOperationI> AMI_WrongOperation_
ThrowerPrx
allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
{
+ cout << "testing ice_print()/what()... " << flush;
+ {
+ A a;
+ string aMsg = "Test::A";
+
+ Ice::UnknownLocalException ule("thisFile", 99);
+ string uleMsg = "thisFile:99: Ice::UnknownLocalException:\nunknown local exception";
+
+ //
+ // Test ice_print().
+ //
+ {
+ stringstream str;
+ a.ice_print(str);
+ test(str.str() == aMsg);
+ }
+ {
+ stringstream str;
+ ule.ice_print(str);
+ test(str.str() == uleMsg);
+ }
+
+ //
+ // Test operator<<().
+ //
+ {
+ stringstream str;
+ str << a;
+ test(str.str() == aMsg);
+ }
+ {
+ stringstream str;
+ str << ule;
+ test(str.str() == uleMsg);
+ }
+
+ //
+ // Test what(). (Called twice because of lazy initialization in what().)
+ //
+ test(aMsg == a.what());
+ test(aMsg == a.what());
+
+ test(uleMsg == ule.what());
+ test(uleMsg == ule.what());
+ }
+ cout << "ok" << endl;
+
cout << "testing object adapter registration exceptions... " << flush;
{
Ice::ObjectAdapterPtr first;