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

@@ -153,14 +153,14 @@ bool test_serialize_db()
return false;
//Fill map1 until is full
BOOST_TRY{
BOOST_INTERPROCESS_TRY{
std::size_t i = 0;
while(1){
(*map1)[i] = i;
++i;
}
}
BOOST_CATCH(boost::interprocess::bad_alloc &){} BOOST_CATCH_END
BOOST_INTERPROCESS_CATCH(boost::interprocess::bad_alloc &){} BOOST_INTERPROCESS_CATCH_END
//Data control data sending through the message queue
std::size_t sent = 0;
@@ -305,13 +305,13 @@ static void multireceive()
{
char buff;
size_t size;
int received_msgs = 0;
//int received_msgs = 0;
unsigned int priority;
do {
global_queue->receive(&buff, 1, size, priority);
++received_msgs;
//++received_msgs;
} while (size > 0);
--received_msgs;
//--received_msgs;
//std::cout << "reader thread complete, read msgs: " << received_msgs << std::endl;
}
@@ -320,7 +320,7 @@ bool test_multi_sender_receiver()
{
bool ret = true;
//std::cout << "Testing multi-sender / multi-receiver " << std::endl;
BOOST_TRY {
BOOST_INTERPROCESS_TRY {
boost::interprocess::message_queue::remove(test::get_process_id_name());
boost::interprocess::message_queue mq
(boost::interprocess::open_or_create, test::get_process_id_name(), MULTI_QUEUE_SIZE, 1);
@@ -343,10 +343,10 @@ bool test_multi_sender_receiver()
//std::cout << "Joined thread " << i << std::endl;
}
}
BOOST_CATCH(std::exception &e) {
BOOST_INTERPROCESS_CATCH(std::exception &e) {
std::cout << "error " << e.what() << std::endl;
ret = false;
} BOOST_CATCH_END
} BOOST_INTERPROCESS_CATCH_END
boost::interprocess::message_queue::remove(test::get_process_id_name());
return ret;
}
@@ -402,7 +402,7 @@ class msg_queue_named_test_wrapper_w
int main ()
{
int ret = 0;
BOOST_TRY{
BOOST_INTERPROCESS_TRY{
message_queue::remove(test::get_process_id_name());
test::test_named_creation<msg_queue_named_test_wrapper>();
#if defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES)
@@ -425,10 +425,10 @@ int main ()
return 1;
}
}
BOOST_CATCH(std::exception &ex) {
BOOST_INTERPROCESS_CATCH(std::exception &ex) {
std::cout << ex.what() << std::endl;
ret = 1;
} BOOST_CATCH_END
} BOOST_INTERPROCESS_CATCH_END
message_queue::remove(test::get_process_id_name());
return ret;