diff --git a/examples/cpp/configuration/PublisherApp.cpp b/examples/cpp/configuration/PublisherApp.cpp index 53886342ce2..b5b3c7504a1 100644 --- a/examples/cpp/configuration/PublisherApp.cpp +++ b/examples/cpp/configuration/PublisherApp.cpp @@ -272,7 +272,7 @@ bool PublisherApp::publish() if (!is_stopped()) { configuration_.index(configuration_.index() + 1); - ret = writer_->write(&configuration_); + ret = (RETCODE_OK == writer_->write(&configuration_)); } return ret; } diff --git a/examples/cpp/content_filter/PublisherApp.cpp b/examples/cpp/content_filter/PublisherApp.cpp index f0f563c669b..c80d9d98f1e 100644 --- a/examples/cpp/content_filter/PublisherApp.cpp +++ b/examples/cpp/content_filter/PublisherApp.cpp @@ -175,7 +175,7 @@ bool PublisherApp::publish() if (!is_stopped()) { hello_.index(hello_.index() + 1); - ret = writer_->write(&hello_); + ret = (RETCODE_OK == writer_->write(&hello_)); } return ret; } diff --git a/examples/cpp/custom_payload_pool/PublisherApp.cpp b/examples/cpp/custom_payload_pool/PublisherApp.cpp index 3f80c9ae669..69c0b21aa65 100644 --- a/examples/cpp/custom_payload_pool/PublisherApp.cpp +++ b/examples/cpp/custom_payload_pool/PublisherApp.cpp @@ -158,7 +158,7 @@ bool PublisherApp::publish() if (!is_stopped()) { hello_.index(hello_.index() + 1); - ret = writer_->write(&hello_); + ret = (RETCODE_OK == writer_->write(&hello_)); } return ret; } diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp b/examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp index 0b784a5fc86..aaa3ca1df24 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp @@ -154,7 +154,8 @@ class CalculatorClient request.x(x); request.y(y); - if (request_writer_->write(static_cast(&request), listener_.write_params)) + if (eprosima::fastdds::dds::RETCODE_OK == + request_writer_->write(static_cast(&request), listener_.write_params)) { std::unique_lock lock(listener_.reception_mutex); listener_.reception_cv.wait(lock, [&]() diff --git a/examples/cpp/delivery_mechanisms/PubSubApp.cpp b/examples/cpp/delivery_mechanisms/PubSubApp.cpp index 1676078c57b..d2769564239 100644 --- a/examples/cpp/delivery_mechanisms/PubSubApp.cpp +++ b/examples/cpp/delivery_mechanisms/PubSubApp.cpp @@ -394,7 +394,7 @@ bool PubSubApp::publish() DeliveryMechanisms* delivery_mechanisms_ = static_cast(sample_); delivery_mechanisms_->index() = ++index_of_last_sample_sent_; memcpy(delivery_mechanisms_->message().data(), "Delivery mechanisms", sizeof("Delivery mechanisms")); - ret = writer_->write(sample_); + ret = (RETCODE_OK == writer_->write(sample_)); std::cout << "Sample: '" << delivery_mechanisms_->message().data() << "' with index: '" << delivery_mechanisms_->index() << "' SENT" << std::endl; } diff --git a/examples/cpp/delivery_mechanisms/PublisherApp.cpp b/examples/cpp/delivery_mechanisms/PublisherApp.cpp index b0478c99a9a..ee8a9e8b224 100644 --- a/examples/cpp/delivery_mechanisms/PublisherApp.cpp +++ b/examples/cpp/delivery_mechanisms/PublisherApp.cpp @@ -289,7 +289,7 @@ bool PublisherApp::publish() DeliveryMechanisms* delivery_mechanisms_ = static_cast(sample_); delivery_mechanisms_->index() = ++index_of_last_sample_sent_; memcpy(delivery_mechanisms_->message().data(), "Delivery mechanisms", sizeof("Delivery mechanisms")); - ret = writer_->write(sample_); + ret = (RETCODE_OK == writer_->write(sample_)); std::cout << "Sample: '" << delivery_mechanisms_->message().data() << "' with index: '" << delivery_mechanisms_->index() << "' SENT" << std::endl; } diff --git a/examples/cpp/discovery_server/ClientPublisherApp.cpp b/examples/cpp/discovery_server/ClientPublisherApp.cpp index d705aeb21cd..8fe63d5cef8 100644 --- a/examples/cpp/discovery_server/ClientPublisherApp.cpp +++ b/examples/cpp/discovery_server/ClientPublisherApp.cpp @@ -270,7 +270,7 @@ bool ClientPublisherApp::publish() if (!is_stopped()) { hello_.index(hello_.index() + 1); - ret = writer_->write(&hello_); + ret = (RETCODE_OK == writer_->write(&hello_)); } return ret; } diff --git a/examples/cpp/hello_world/PublisherApp.cpp b/examples/cpp/hello_world/PublisherApp.cpp index b2d804bbcf5..d2ec4140767 100644 --- a/examples/cpp/hello_world/PublisherApp.cpp +++ b/examples/cpp/hello_world/PublisherApp.cpp @@ -156,7 +156,7 @@ bool PublisherApp::publish() if (!is_stopped()) { hello_.index(hello_.index() + 1); - ret = writer_->write(&hello_); + ret = (RETCODE_OK == writer_->write(&hello_)); } return ret; } diff --git a/examples/cpp/xtypes/PublisherApp.cpp b/examples/cpp/xtypes/PublisherApp.cpp index 3dafccc83b1..3ed1d87b77e 100644 --- a/examples/cpp/xtypes/PublisherApp.cpp +++ b/examples/cpp/xtypes/PublisherApp.cpp @@ -210,7 +210,7 @@ bool PublisherApp::publish() set_uint32_value(hello_, "index", index); // Publish the sample - ret = writer_->write(&hello_); + ret = (RETCODE_OK == writer_->write(&hello_)); } return ret; } diff --git a/test/blackbox/api/dds-pim/PubSubParticipant.hpp b/test/blackbox/api/dds-pim/PubSubParticipant.hpp index b723b2df917..ab968fef730 100644 --- a/test/blackbox/api/dds-pim/PubSubParticipant.hpp +++ b/test/blackbox/api/dds-pim/PubSubParticipant.hpp @@ -416,7 +416,7 @@ class PubSubParticipant type& msg, unsigned int index = 0) { - return std::get<2>(publishers_[index])->write((void*)&msg); + return (eprosima::fastdds::dds::RETCODE_OK == std::get<2>(publishers_[index])->write((void*)&msg)); } void assert_liveliness_participant() diff --git a/test/blackbox/api/dds-pim/PubSubWriter.hpp b/test/blackbox/api/dds-pim/PubSubWriter.hpp index bcc14fc7abd..c87b4a38630 100644 --- a/test/blackbox/api/dds-pim/PubSubWriter.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriter.hpp @@ -513,7 +513,7 @@ class PubSubWriter while (it != msgs.end()) { - if (datawriter_->write((void*)&(*it))) + if (eprosima::fastdds::dds::RETCODE_OK == datawriter_->write((void*)&(*it))) { default_send_print(*it); it = msgs.erase(it); @@ -553,7 +553,7 @@ class PubSubWriter type& msg) { default_send_print(msg); - return datawriter_->write((void*)&msg); + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->write((void*)&msg)); } eprosima::fastdds::dds::ReturnCode_t send_sample( @@ -561,7 +561,7 @@ class PubSubWriter const eprosima::fastdds::dds::InstanceHandle_t& instance_handle) { default_send_print(msg); - return datawriter_->write((void*)&msg, instance_handle); + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->write((void*)&msg, instance_handle)); } void assert_liveliness() diff --git a/test/blackbox/api/dds-pim/PubSubWriterReader.hpp b/test/blackbox/api/dds-pim/PubSubWriterReader.hpp index b42b04bbaca..01b22e471ba 100644 --- a/test/blackbox/api/dds-pim/PubSubWriterReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriterReader.hpp @@ -547,7 +547,7 @@ class PubSubWriterReader while (it != msgs.end()) { - if (datawriter_->write((void*)&(*it))) + if (eprosima::fastdds::dds::RETCODE_OK == datawriter_->write((void*)&(*it))) { for (auto& tuple : entities_extra_) { diff --git a/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp b/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp index 20008369975..2b4689ce462 100644 --- a/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp +++ b/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp @@ -158,7 +158,7 @@ void ReqRepHelloWorldReplier::newNumber( hello.index(number); hello.message("GoodBye"); wparams.related_sample_identity(sample_identity); - ASSERT_EQ(reply_datawriter_->write((void*)&hello, wparams), true); + ASSERT_EQ(reply_datawriter_->write((void*)&hello, wparams), eprosima::fastdds::dds::RETCODE_OK); } void ReqRepHelloWorldReplier::wait_discovery() diff --git a/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp b/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp index f9a5d1e0fae..359bac358ce 100644 --- a/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp +++ b/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp @@ -239,7 +239,7 @@ void ReqRepHelloWorldRequester::send( current_number_ = number; } - ASSERT_EQ(request_datawriter_->write((void*)&hello, wparams), true); + ASSERT_EQ(request_datawriter_->write((void*)&hello, wparams), eprosima::fastdds::dds::RETCODE_OK); related_sample_identity_ = wparams.sample_identity(); ASSERT_NE(related_sample_identity_.sequence_number(), eprosima::fastdds::rtps::SequenceNumber_t()); } diff --git a/test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp b/test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp index b14023f1c68..eb9b91f60a8 100644 --- a/test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp +++ b/test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp @@ -194,7 +194,7 @@ void TCPReqRepHelloWorldReplier::newNumber( hello.index(number); hello.message("GoodBye"); wparams.related_sample_identity(sample_identity); - ASSERT_EQ(reply_datawriter_->write((void*)&hello, wparams), true); + ASSERT_EQ(reply_datawriter_->write((void*)&hello, wparams), RETCODE_OK); } void TCPReqRepHelloWorldReplier::wait_discovery( diff --git a/test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp b/test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp index 901ca78e6ba..47fb1274a77 100644 --- a/test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp +++ b/test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp @@ -331,7 +331,7 @@ void TCPReqRepHelloWorldRequester::send( current_number_ = number; } - ASSERT_EQ(request_datawriter_->write((void*)&hello, wparams), true); + ASSERT_EQ(request_datawriter_->write((void*)&hello, wparams), RETCODE_OK); related_sample_identity_ = wparams.sample_identity(); ASSERT_NE(related_sample_identity_.sequence_number(), SequenceNumber_t()); } diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index 5794ea93efa..9370a95c225 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -488,8 +488,8 @@ TEST(DDSBasic, PidRelatedSampleIdentity) write_params.related_sample_identity() = related_sample_identity_; // Publish the new value, deduce the instance handle - bool write_ret = native_writer.write((void*)&data, write_params); - ASSERT_EQ(true, write_ret); + ReturnCode_t write_ret = native_writer.write((void*)&data, write_params); + ASSERT_EQ(RETCODE_OK, write_ret); DataReader& native_reader = reliable_reader.get_native_reader(); diff --git a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp index b07679cb436..5337576f7df 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp @@ -388,7 +388,7 @@ TEST(DDSDataReader, ConsistentReliabilityWhenIntraprocess) auto writer = publisher->create_datawriter( topic, writer_qos ); auto data = HelloWorld{}; - ASSERT_TRUE(writer->write( &data )); + ASSERT_EQ(writer->write( &data ), eprosima::fastdds::dds::RETCODE_OK); std::this_thread::sleep_for(std::chrono::milliseconds(200)); diff --git a/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp b/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp index a066a6f8e5a..a7391d39571 100644 --- a/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp +++ b/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp @@ -253,7 +253,7 @@ class MonitorServiceParticipant { for (auto& writer : writers_) { - if (writer->write((void*)&(*it))) + if (RETCODE_OK == writer->write((void*)&(*it))) { default_send_print(*it); it = msgs.erase(it); @@ -276,7 +276,7 @@ class MonitorServiceParticipant { if (!writers_.empty()) { - return writers_.back()->write(&sample); + return (RETCODE_OK == writers_.back()->write(&sample)); } return false; diff --git a/test/performance/latency/LatencyTestPublisher.cpp b/test/performance/latency/LatencyTestPublisher.cpp index 2bb9fc3b6ce..5b428e5799c 100644 --- a/test/performance/latency/LatencyTestPublisher.cpp +++ b/test/performance/latency/LatencyTestPublisher.cpp @@ -766,7 +766,7 @@ bool LatencyTestPublisher::test( times_.clear(); TestCommandType command; command.m_command = READY; - if (!command_writer_->write(&command)) + if (RETCODE_OK != command_writer_->write(&command)) { EPROSIMA_LOG_ERROR(LatencyTest, "Publisher cannot publish READY command"); return false; @@ -852,7 +852,7 @@ bool LatencyTestPublisher::test( start_time_ = std::chrono::steady_clock::now(); // Data publishing - if (!data_writer_->write(data)) + if (RETCODE_OK != data_writer_->write(data)) { // return the loan if (data_loans_) diff --git a/test/performance/latency/LatencyTestSubscriber.cpp b/test/performance/latency/LatencyTestSubscriber.cpp index 31a4d8851fb..99a4fc856b1 100644 --- a/test/performance/latency/LatencyTestSubscriber.cpp +++ b/test/performance/latency/LatencyTestSubscriber.cpp @@ -548,7 +548,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( std::chrono::duration bounce_time(end_time - start_time); reinterpret_cast(echoed_loan)->bounce = bounce_time.count(); - if (!sub->data_writer_->write(echoed_loan)) + if (RETCODE_OK != sub->data_writer_->write(echoed_loan)) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem echoing Publisher test data with loan"); sub->data_writer_->discard_loan(echoed_loan); @@ -582,7 +582,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( reinterpret_cast(data)->bounce = 0; } - if (!sub->data_writer_->write(data)) + if (RETCODE_OK != sub->data_writer_->write(data)) { EPROSIMA_LOG_INFO(LatencyTest, "Problem echoing Publisher test data"); } @@ -707,7 +707,7 @@ bool LatencyTestSubscriber::test( received_ = 0; TestCommandType command; command.m_command = BEGIN; - if (!command_writer_->write(&command)) + if (RETCODE_OK != command_writer_->write(&command)) { EPROSIMA_LOG_ERROR(LatencyTest, "Subscriber fail to publish the BEGIN command"); return false; @@ -752,7 +752,7 @@ bool LatencyTestSubscriber::test( } command.m_command = END; - if (!command_writer_->write(&command)) + if (RETCODE_OK != command_writer_->write(&command)) { EPROSIMA_LOG_ERROR(LatencyTest, "Subscriber fail to publish the END command"); return false; diff --git a/test/performance/throughput/ThroughputPublisher.cpp b/test/performance/throughput/ThroughputPublisher.cpp index ccb101c3513..de5724e0b1d 100644 --- a/test/performance/throughput/ThroughputPublisher.cpp +++ b/test/performance/throughput/ThroughputPublisher.cpp @@ -754,7 +754,7 @@ bool ThroughputPublisher::test( // initialize and send the sample static_cast(data)->seqnum = ++seqnum; - if (!data_writer_->write(data)) + if (RETCODE_OK != data_writer_->write(data)) { data_writer_->discard_loan(data); } diff --git a/test/performance/video/VideoTestPublisher.cpp b/test/performance/video/VideoTestPublisher.cpp index 55ee1c9965b..8f27fb04cc0 100644 --- a/test/performance/video/VideoTestPublisher.cpp +++ b/test/performance/video/VideoTestPublisher.cpp @@ -591,7 +591,7 @@ GstFlowReturn VideoTestPublisher::new_sample( if (rand() % 100 > sub->m_dropRate) { - if (!sub->mp_data_dw->write((void*)sub->mp_video_out)) + if (RETCODE_OK != sub->mp_data_dw->write((void*)sub->mp_video_out)) { std::cout << "VideoPublication::run -> Cannot write video" << std::endl; } diff --git a/test/profiling/allocations/AllocTestPublisher.cpp b/test/profiling/allocations/AllocTestPublisher.cpp index d28555e19e1..119c0c71413 100644 --- a/test/profiling/allocations/AllocTestPublisher.cpp +++ b/test/profiling/allocations/AllocTestPublisher.cpp @@ -220,7 +220,7 @@ bool AllocTestPublisher::publish() if (is_matched()) { data_.index(data_.index() + 1); - ret = writer_->write(&data_); + ret = (RETCODE_OK == writer_->write(&data_)); } return ret; } diff --git a/test/realtime/UserThreadNonBlockedTest.cpp b/test/realtime/UserThreadNonBlockedTest.cpp index 7e564e13c77..9c0969408b3 100644 --- a/test/realtime/UserThreadNonBlockedTest.cpp +++ b/test/realtime/UserThreadNonBlockedTest.cpp @@ -243,7 +243,7 @@ TEST_F(UserThreadNonBlockedTest, remove_previous_sample_on_history) std::thread([&] { auto now = std::chrono::steady_clock::now(); - bool returned_value = datawriter_->write(reinterpret_cast(&sample)); + bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast(&sample))); auto end = std::chrono::steady_clock::now(); promise.set_value_at_thread_exit( std::pair(returned_value, std::chrono::duration_cast(end - now))); @@ -301,7 +301,7 @@ TEST_F(UserThreadNonBlockedTest, write_sample_besteffort) std::thread([&] { auto now = std::chrono::steady_clock::now(); - bool returned_value = datawriter_->write(reinterpret_cast(&sample)); + bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast(&sample))); auto end = std::chrono::steady_clock::now(); promise.set_value_at_thread_exit( std::pair(returned_value, std::chrono::duration_cast(end - now))); @@ -359,7 +359,7 @@ TEST_F(UserThreadNonBlockedTest, write_sample_reliable) std::thread([&] { auto now = std::chrono::steady_clock::now(); - bool returned_value = datawriter_->write(reinterpret_cast(&sample)); + bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast(&sample))); auto end = std::chrono::steady_clock::now(); promise.set_value_at_thread_exit( std::pair(returned_value, std::chrono::duration_cast(end - now))); @@ -418,7 +418,7 @@ TEST_F(UserThreadNonBlockedTest, write_async_sample_besteffort) std::thread([&] { auto now = std::chrono::steady_clock::now(); - bool returned_value = datawriter_->write(reinterpret_cast(&sample)); + bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast(&sample))); auto end = std::chrono::steady_clock::now(); promise.set_value_at_thread_exit( std::pair(returned_value, std::chrono::duration_cast(end - now))); @@ -477,7 +477,7 @@ TEST_F(UserThreadNonBlockedTest, write_async_sample_reliable) std::thread([&] { auto now = std::chrono::steady_clock::now(); - bool returned_value = datawriter_->write(reinterpret_cast(&sample)); + bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast(&sample))); auto end = std::chrono::steady_clock::now(); promise.set_value_at_thread_exit( std::pair(returned_value, std::chrono::duration_cast(end - now))); diff --git a/test/unittest/dds/subscriber/DataReaderTests.cpp b/test/unittest/dds/subscriber/DataReaderTests.cpp index 4867f7fb189..dad247d0f41 100644 --- a/test/unittest/dds/subscriber/DataReaderTests.cpp +++ b/test/unittest/dds/subscriber/DataReaderTests.cpp @@ -1686,7 +1686,7 @@ void lookup_instance_test( { // Send sample with key value 0 data.index(0); - EXPECT_TRUE(writer->write(&data)); + EXPECT_EQ(RETCODE_OK, writer->write(&data)); // Ensure it arrived to the DataReader EXPECT_TRUE(reader->wait_for_unread_message({ 1, 0 })); @@ -2529,7 +2529,7 @@ TEST_F(DataReaderTests, check_key_history_wholesomeness_on_unmatch) sample.index(0); sample.message(msg); - ASSERT_TRUE(data_writer_->write(&sample)); + ASSERT_EQ(RETCODE_OK, data_writer_->write(&sample)); // wait till the DataReader receives the data ASSERT_TRUE(data_reader_->wait_for_unread_message(Duration_t(3, 0))); diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp index 3e53c3d244a..eac13604d82 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp @@ -157,17 +157,17 @@ class DataWriterImpl : protected rtps::IReaderDataFilter return RETCODE_OK; } - bool write( + ReturnCode_t write( const void* const ) { - return true; + return RETCODE_OK; } - bool write( + ReturnCode_t write( const void* const, fastdds::rtps::WriteParams& ) { - return true; + return RETCODE_OK; } ReturnCode_t write(