Fixes #103 ("Use interprocess headers without exception handling")

This commit is contained in:
Ion Gaztañaga
2021-08-23 13:32:08 +02:00
parent f8d2da6a18
commit 4f0b3c2c93
68 changed files with 407 additions and 428 deletions

View File

@@ -53,19 +53,19 @@ int intermodule_singleton_test()
bool exception_thrown = false;
bool exception_2_thrown = false;
try{
BOOST_TRY{
IntermoduleType<MyThrowingClass, true, false>::get();
}
catch(int &){
BOOST_CATCH(int &){
exception_thrown = true;
//Second try
try{
BOOST_TRY{
IntermoduleType<MyThrowingClass, true, false>::get();
}
catch(interprocess_exception &){
BOOST_CATCH(interprocess_exception &){
exception_2_thrown = true;
}
}
} BOOST_CATCH_END
} BOOST_CATCH_END
if(!exception_thrown || !exception_2_thrown){
return 1;
@@ -78,12 +78,12 @@ int intermodule_singleton_test()
//Second try
exception_2_thrown = false;
try{
BOOST_TRY{
IntermoduleType<MyThrowingClass, true, false>::get();
}
catch(interprocess_exception &){
BOOST_CATCH(interprocess_exception &){
exception_2_thrown = true;
}
} BOOST_CATCH_END
if(!exception_2_thrown){
return 1;
}
@@ -211,16 +211,16 @@ class LogDeadReferenceUser
std::cout << "~LogDeadReferenceUser(), LogSingleton: " << typeid(LogSingleton).name() << "\n" << std::endl;
//Make sure the exception is thrown as we are
//trying to use a dead non-phoenix singleton
try{
BOOST_TRY{
LogSingleton::get().log_it();
std::string s("LogDeadReferenceUser failed for LogSingleton ");
s += typeid(LogSingleton).name();
std::cout << "~LogDeadReferenceUser(), error: " << s << std::endl;
std::abort();
}
catch(interprocess_exception &){
BOOST_CATCH(interprocess_exception &){
//Correct behaviour
}
} BOOST_CATCH_END
}
};