Test files: Replace BOOST_TRY/CATCH family macros with BOOST_INTERPROCESS_TRY/CATCH

This commit is contained in:
Ion Gaztañaga
2024-08-03 22:47:34 +02:00
parent 865573a821
commit 4a011349db
36 changed files with 218 additions and 222 deletions

View File

@@ -54,19 +54,19 @@ int intermodule_singleton_test()
bool exception_thrown = false;
bool exception_2_thrown = false;
BOOST_TRY{
BOOST_INTERPROCESS_TRY{
IntermoduleType<MyThrowingClass, true, false>::get();
}
BOOST_CATCH(int &){
BOOST_INTERPROCESS_CATCH(int &){
exception_thrown = true;
//Second try
BOOST_TRY{
BOOST_INTERPROCESS_TRY{
IntermoduleType<MyThrowingClass, true, false>::get();
}
BOOST_CATCH(interprocess_exception &){
BOOST_INTERPROCESS_CATCH(interprocess_exception &){
exception_2_thrown = true;
} BOOST_CATCH_END
} BOOST_CATCH_END
} BOOST_INTERPROCESS_CATCH_END
} BOOST_INTERPROCESS_CATCH_END
if(!exception_thrown || !exception_2_thrown){
return 1;
@@ -79,12 +79,12 @@ int intermodule_singleton_test()
//Second try
exception_2_thrown = false;
BOOST_TRY{
BOOST_INTERPROCESS_TRY{
IntermoduleType<MyThrowingClass, true, false>::get();
}
BOOST_CATCH(interprocess_exception &){
BOOST_INTERPROCESS_CATCH(interprocess_exception &){
exception_2_thrown = true;
} BOOST_CATCH_END
} BOOST_INTERPROCESS_CATCH_END
if(!exception_2_thrown){
return 1;
}
@@ -212,16 +212,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
BOOST_TRY{
BOOST_INTERPROCESS_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();
}
BOOST_CATCH(interprocess_exception &){
BOOST_INTERPROCESS_CATCH(interprocess_exception &){
//Correct behaviour
} BOOST_CATCH_END
} BOOST_INTERPROCESS_CATCH_END
}
};