summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/interceptor/MyObjectI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-07-24 14:32:00 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-07-24 14:32:00 +0200
commit2d88aac37141b6649155bf7cefd926af944be132 (patch)
treea67642698dda213f0b212d6475992e02c3dcc4d7 /cpp/test/Ice/interceptor/MyObjectI.cpp
parentanother update to CHANGES for ICE-5515 (diff)
downloadice-2d88aac37141b6649155bf7cefd926af944be132.tar.bz2
ice-2d88aac37141b6649155bf7cefd926af944be132.tar.xz
ice-2d88aac37141b6649155bf7cefd926af944be132.zip
Fixed bug with system exceptions not being propagated correctly with collocation optimization + AMD
Diffstat (limited to 'cpp/test/Ice/interceptor/MyObjectI.cpp')
-rw-r--r--cpp/test/Ice/interceptor/MyObjectI.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/cpp/test/Ice/interceptor/MyObjectI.cpp b/cpp/test/Ice/interceptor/MyObjectI.cpp
index e4404fd0682..fbcef2ebadf 100644
--- a/cpp/test/Ice/interceptor/MyObjectI.cpp
+++ b/cpp/test/Ice/interceptor/MyObjectI.cpp
@@ -15,6 +15,33 @@
using namespace IceUtil;
using namespace std;
+MySystemException::MySystemException(const char* file, int line) :
+ Ice::SystemException(file, line)
+{
+}
+
+MySystemException::~MySystemException() throw()
+{
+}
+
+string
+MySystemException::ice_name() const
+{
+ return "MySystemException";
+}
+
+MySystemException*
+MySystemException::ice_clone() const
+{
+ return new MySystemException(*this);
+}
+
+void
+MySystemException::ice_throw() const
+{
+ throw *this;
+}
+
int
MyObjectI::add(int x, int y, const Ice::Current&)
{
@@ -48,10 +75,7 @@ MyObjectI::notExistAdd(int, int, const Ice::Current&)
int
MyObjectI::badSystemAdd(int, int, const Ice::Current&)
{
- throw Ice::InitializationException(__FILE__, __LINE__, "testing");
-#ifdef __SUNPRO_CC
- return 0;
-#endif
+ throw MySystemException(__FILE__, __LINE__);
}
@@ -186,7 +210,7 @@ MyObjectI::amdBadSystemAdd_async(const Test::AMD_MyObject_amdBadSystemAddPtr& cb
void run()
{
ThreadControl::sleep(Time::milliSeconds(10));
- _cb->ice_exception(Ice::InitializationException(__FILE__, __LINE__, "just testing"));
+ _cb->ice_exception(MySystemException(__FILE__, __LINE__));
}
private:
Test::AMD_MyObject_amdBadSystemAddPtr _cb;