Skip to content

Commit

Permalink
Refs #21329: Update usages
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <[email protected]>
  • Loading branch information
JesusPoderoso committed Jul 10, 2024
1 parent 2d74dec commit 92ee5f0
Show file tree
Hide file tree
Showing 27 changed files with 44 additions and 43 deletions.
2 changes: 1 addition & 1 deletion examples/cpp/configuration/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/content_filter/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/custom_payload_pool/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ class CalculatorClient
request.x(x);
request.y(y);

if (request_writer_->write(static_cast<void*>(&request), listener_.write_params))
if (eprosima::fastdds::dds::RETCODE_OK ==
request_writer_->write(static_cast<void*>(&request), listener_.write_params))
{
std::unique_lock<std::mutex> lock(listener_.reception_mutex);
listener_.reception_cv.wait(lock, [&]()
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/delivery_mechanisms/PubSubApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ bool PubSubApp::publish()
DeliveryMechanisms* delivery_mechanisms_ = static_cast<DeliveryMechanisms*>(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;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/delivery_mechanisms/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ bool PublisherApp::publish()
DeliveryMechanisms* delivery_mechanisms_ = static_cast<DeliveryMechanisms*>(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;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/discovery_server/ClientPublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/hello_world/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/xtypes/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/api/dds-pim/PubSubParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions test/blackbox/api/dds-pim/PubSubWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<type>(*it);
it = msgs.erase(it);
Expand Down Expand Up @@ -553,15 +553,15 @@ 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(
type& msg,
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()
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/api/dds-pim/PubSubWriterReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
{
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
2 changes: 1 addition & 1 deletion test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
4 changes: 2 additions & 2 deletions test/blackbox/common/DDSBlackboxTestsBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/DDSBlackboxTestsDataReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
4 changes: 2 additions & 2 deletions test/blackbox/common/DDSBlackboxTestsMonitorService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<HelloWorld>(*it);
it = msgs.erase(it);
Expand All @@ -276,7 +276,7 @@ class MonitorServiceParticipant
{
if (!writers_.empty())
{
return writers_.back()->write(&sample);
return (RETCODE_OK == writers_.back()->write(&sample));
}

return false;
Expand Down
4 changes: 2 additions & 2 deletions test/performance/latency/LatencyTestPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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_)
Expand Down
8 changes: 4 additions & 4 deletions test/performance/latency/LatencyTestSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available(
std::chrono::duration<uint32_t, std::nano> bounce_time(end_time - start_time);
reinterpret_cast<LatencyType*>(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);
Expand Down Expand Up @@ -582,7 +582,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available(
reinterpret_cast<LatencyType*>(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");
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/performance/throughput/ThroughputPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ bool ThroughputPublisher::test(
// initialize and send the sample
static_cast<ThroughputType*>(data)->seqnum = ++seqnum;

if (!data_writer_->write(data))
if (RETCODE_OK != data_writer_->write(data))
{
data_writer_->discard_loan(data);
}
Expand Down
2 changes: 1 addition & 1 deletion test/performance/video/VideoTestPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion test/profiling/allocations/AllocTestPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
10 changes: 5 additions & 5 deletions test/realtime/UserThreadNonBlockedTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void*>(&sample));
bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast<void*>(&sample)));
auto end = std::chrono::steady_clock::now();
promise.set_value_at_thread_exit( std::pair<bool, std::chrono::microseconds>(returned_value,
std::chrono::duration_cast<std::chrono::microseconds>(end - now)));
Expand Down Expand Up @@ -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<void*>(&sample));
bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast<void*>(&sample)));
auto end = std::chrono::steady_clock::now();
promise.set_value_at_thread_exit( std::pair<bool, std::chrono::microseconds>(returned_value,
std::chrono::duration_cast<std::chrono::microseconds>(end - now)));
Expand Down Expand Up @@ -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<void*>(&sample));
bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast<void*>(&sample)));
auto end = std::chrono::steady_clock::now();
promise.set_value_at_thread_exit( std::pair<bool, std::chrono::microseconds>(returned_value,
std::chrono::duration_cast<std::chrono::microseconds>(end - now)));
Expand Down Expand Up @@ -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<void*>(&sample));
bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast<void*>(&sample)));
auto end = std::chrono::steady_clock::now();
promise.set_value_at_thread_exit( std::pair<bool, std::chrono::microseconds>(returned_value,
std::chrono::duration_cast<std::chrono::microseconds>(end - now)));
Expand Down Expand Up @@ -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<void*>(&sample));
bool returned_value = (RETCODE_OK == datawriter_->write(reinterpret_cast<void*>(&sample)));
auto end = std::chrono::steady_clock::now();
promise.set_value_at_thread_exit( std::pair<bool, std::chrono::microseconds>(returned_value,
std::chrono::duration_cast<std::chrono::microseconds>(end - now)));
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/dds/subscriber/DataReaderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));

Expand Down Expand Up @@ -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)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 92ee5f0

Please sign in to comment.