diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp index 807942606c4..db687700034 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp @@ -282,7 +282,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp b/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp index cd333888698..cecbba46ffd 100644 --- a/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp +++ b/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp @@ -254,7 +254,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp b/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp index 6c5f7702357..3c7bce92899 100644 --- a/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp +++ b/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp @@ -363,7 +363,7 @@ int main() } else if ( c == std::string("r")) { - while (EarlyReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (EarlyReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << "Sample Received! Index:" << std::to_string(my_sample.index()) << " Key:" << std::to_string(my_sample.key_value()) << std::endl; diff --git a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp index 1a91342c43c..ef22997f138 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp @@ -55,7 +55,7 @@ bool ContentFilteredTopicExampleSubscriber::init( if (custom_filter) { // Register the filter factory - if (ReturnCode_t::RETCODE_OK != + if (eprosima::fastdds::dds::RETCODE_OK != participant_->register_content_filter_factory("MY_CUSTOM_FILTER", &filter_factory)) { return false; @@ -159,7 +159,7 @@ void ContentFilteredTopicExampleSubscriber::on_data_available( { SampleInfo info; // Take next sample from DataReader's history - if (ReturnCode_t::RETCODE_OK == reader->take_next_sample(&hello_, &info)) + if (eprosima::fastdds::dds::RETCODE_OK == reader->take_next_sample(&hello_, &info)) { // Some samples only update the instance state. Only if it is a valid sample (with data) if (ALIVE_INSTANCE_STATE == info.instance_state) diff --git a/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp b/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp index deb86feca93..606a37d3226 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp @@ -22,11 +22,11 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto * @param filter_parameters Parameters required by the filter * @param filter_instance Instance of the filter to be evaluated * - * @return eprosima::fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER if the requirements for creating the + * @return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER if the requirements for creating the * ContentFilteredTopic using this factory are not met - * eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK if the ContentFilteredTopic is correctly created + * eprosima::fastdds::dds::RETCODE_OK if the ContentFilteredTopic is correctly created */ - eprosima::fastrtps::types::ReturnCode_t create_content_filter( + eprosima::fastdds::dds::ReturnCode_t create_content_filter( const char* filter_class_name, // My custom filter class name is 'MY_CUSTOM_FILTER'. const char* type_name, // This custom filter only supports one type: 'HelloWorld'. const eprosima::fastdds::dds::TopicDataType* /*data_type*/, // Not used in this implementation. @@ -41,7 +41,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Check that the two mandatory filter parameters were set. 2 != filter_parameters.length()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; } // If there is an update, delete previous instance. @@ -53,7 +53,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Instantiation of the Custom Filter. filter_instance = new MyCustomFilter(std::stoi(filter_parameters[0]), std::stoi(filter_parameters[1])); - return ReturnCode_t::RETCODE_OK; + return eprosima::fastdds::dds::RETCODE_OK; } /** @@ -62,11 +62,11 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto * @param filter_class_name Custom filter name * @param filter_instance Instance of the filter to be deleted. * After returning, the passed pointer becomes invalid. - * @return eprosima::fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER if the instance was created with another + * @return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER if the instance was created with another * factory - * eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK if correctly deleted + * eprosima::fastdds::dds::RETCODE_OK if correctly deleted */ - eprosima::fastrtps::types::ReturnCode_t delete_content_filter( + eprosima::fastdds::dds::ReturnCode_t delete_content_filter( const char* filter_class_name, eprosima::fastdds::dds::IContentFilter* filter_instance) override { @@ -75,7 +75,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Check the filter instance is valid nullptr != filter_instance) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; } // Deletion of the Custom Filter. @@ -84,7 +84,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto delete(dynamic_cast(filter_instance)); } - return ReturnCode_t::RETCODE_OK; + return eprosima::fastdds::dds::RETCODE_OK; } }; diff --git a/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp b/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp index b18b4dbf3bd..69c08b28c7b 100644 --- a/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp +++ b/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp @@ -84,7 +84,7 @@ void CustomDataReaderListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { @@ -152,7 +152,7 @@ void CustomDomainParticipantListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp index 5dc610964ac..874d4a44afa 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp @@ -151,7 +151,7 @@ void CustomPayloadPoolDataSubscriber::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx index 09d89827bac..0a893426857 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx @@ -124,7 +124,7 @@ void deadlinepayloadSubscriber::SubListener::on_data_available( { SampleInfo info; HelloMsg st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp index 72186e17663..38569a7fb77 100644 --- a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp +++ b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp @@ -129,7 +129,7 @@ void DisablePositiveACKsSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp index 9051bac5b5f..684998f780e 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp @@ -277,7 +277,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp index 753a1590e0d..f54b15bef0f 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp @@ -33,7 +33,6 @@ #include using namespace eprosima::fastdds::dds; -using eprosima::fastrtps::types::ReturnCode_t; HelloWorldSubscriber::HelloWorldSubscriber() : mp_participant(nullptr) @@ -58,7 +57,7 @@ bool HelloWorldSubscriber::init() { return false; } - if (mp_participant->enable() != ReturnCode_t::RETCODE_OK) + if (mp_participant->enable() != RETCODE_OK) { DomainParticipantFactory::get_instance()->delete_participant(mp_participant); return false; @@ -119,7 +118,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( { eprosima::fastrtps::types::DynamicData_ptr data = dit->second; SampleInfo info; - if (reader->take_next_sample(data.get(), &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(data.get(), &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx b/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx index 6a5f254046e..b2bbc02297f 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx +++ b/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx @@ -127,7 +127,7 @@ void FilteringExampleSubscriber::SubListener::on_data_available( { SampleInfo info; FilteringExample st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx index ffff981281c..4edeba1b574 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx @@ -124,7 +124,7 @@ void FlowControlExampleSubscriber::SubListener::on_data_available( { SampleInfo info; FlowControlExample st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp index 6823a32f4e6..38341899ba5 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp @@ -158,7 +158,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp index 4e0e1fa9c58..c1bf7f94048 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp @@ -131,7 +131,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp index 9afd1360353..77a438830bf 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp @@ -146,7 +146,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(hello_.get(), &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(hello_.get(), &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp index 4e63d3587da..631742147d9 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp @@ -179,7 +179,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/HistoryKind/pastsamples.cpp b/examples/cpp/dds/HistoryKind/pastsamples.cpp index 6561d835ede..25937ac9182 100644 --- a/examples/cpp/dds/HistoryKind/pastsamples.cpp +++ b/examples/cpp/dds/HistoryKind/pastsamples.cpp @@ -193,14 +193,14 @@ void pastsamples() //Read the contents of both histories: std::cout << "The Keep All Subscriber holds: " << std::endl; - while (myReader1->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader1->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } std::cout << std::endl; std::cout << "The Keep Last (Depth 10) Subscriber holds: " << std::endl; - while (myReader2->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader2->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/Keys/keys.cpp b/examples/cpp/dds/Keys/keys.cpp index d32c03e1513..9faba4e251d 100644 --- a/examples/cpp/dds/Keys/keys.cpp +++ b/examples/cpp/dds/Keys/keys.cpp @@ -141,7 +141,7 @@ class SubListener : public eprosima::fastdds::dds::DataReaderListener DataReader* reader) override { SampleInfo info; - if (reader->take_next_sample(&m_sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&m_sample, &info) == RETCODE_OK) { if (info.valid_data) { @@ -365,7 +365,7 @@ void keys() //Read the contents of both histories: std::vector< std::pair> sampleList; std::cout << "The Subscriber holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { sampleList.push_back(std::pair(my_sample.index(), my_sample.key_value())); } diff --git a/examples/cpp/dds/LateJoiners/latejoiners.cpp b/examples/cpp/dds/LateJoiners/latejoiners.cpp index 4566c146b45..4209ea5e835 100644 --- a/examples/cpp/dds/LateJoiners/latejoiners.cpp +++ b/examples/cpp/dds/LateJoiners/latejoiners.cpp @@ -177,13 +177,13 @@ void latejoiners() //Read the contents of both histories: std::cout << "The Transient Local Subscriber holds: " << std::endl; - while (myReader1->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader1->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } std::cout << std::endl; std::cout << "The Volatile Subscriber holds: " << std::endl; - while (myReader2->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader2->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp index 737f92b99f2..e7d9b96571f 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp @@ -130,7 +130,7 @@ void LifespanSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->read_next_sample(&hello, &info) == ReturnCode_t::RETCODE_OK) + if (reader->read_next_sample(&hello, &info) == RETCODE_OK) { if (info.valid_data) { @@ -160,7 +160,7 @@ void LifespanSubscriber::run( for ( uint32_t i = 0; i < listener.n_samples; i++ ) { - if (reader_->take_next_sample((void*) &data, &info) == ReturnCode_t::RETCODE_OK) + if (reader_->take_next_sample((void*) &data, &info) == RETCODE_OK) { std::cout << "Message " << data.message() << " " << data.index() << " read from history" << std::endl; } diff --git a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp index 6e94d9570e6..653e3e09d7c 100644 --- a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp +++ b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp @@ -138,7 +138,7 @@ void LivelinessSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&topic, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&topic, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx index 32fa0d9193d..bc9b21c0a4e 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx @@ -174,7 +174,7 @@ void OwnershipStrengthSubscriber::SubListener::on_data_available( { SampleInfo info; ExampleMessage st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data && m_hierarchy.IsMessageStrong(st, info)) { diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp b/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp index 9d3580e9a88..80fa6a39ab8 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp @@ -151,7 +151,7 @@ void safest() //Read the contents of both histories: std::cout << "The Reliable Subscriber holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " (key " << static_cast(my_sample.key_value()) << ")" << std::endl; diff --git a/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp b/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp index 97641f71866..72059ffa468 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp +++ b/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp @@ -156,7 +156,7 @@ void triggers() //Read the contents of both histories: std::cout << "The Subscriber holds: " << std::endl; - while (myReader->take_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->take_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp b/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp index 65e979b8bb7..f503f0daa63 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp @@ -149,7 +149,7 @@ void fastest() //Read the contents of both histories: std::cout << "The Reliable Subscriber (with a history depth of 5) holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp index 175eb640873..5d505897f4d 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp @@ -143,7 +143,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp index 278d65536c4..7b38e634fd5 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp @@ -128,7 +128,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp b/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp index 108822411d0..f4aa50285e9 100644 --- a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp +++ b/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp @@ -66,7 +66,7 @@ bool TypeLookupSubscriber::init() { return false; } - if (mp_participant->enable() != ReturnCode_t::RETCODE_OK) + if (mp_participant->enable() != RETCODE_OK) { DomainParticipantFactory::get_instance()->delete_participant(mp_participant); return false; @@ -147,7 +147,7 @@ void TypeLookupSubscriber::SubListener::on_data_available( { types::DynamicData_ptr data = dit->second; SampleInfo info; - if (reader->take_next_sample(data.get(), &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(data.get(), &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx index 44ec5a404fd..9407dce4f3d 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx @@ -140,7 +140,7 @@ void LoanableHelloWorldPublisher::run() if (ch == 'y') { void* sample = nullptr; - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { LoanableHelloWorld* data = static_cast(sample); data->index() = msgsent + 1; diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx index 6ebf7a6f077..dfa87a321bb 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx @@ -127,7 +127,7 @@ void LoanableHelloWorldSubscriber::SubListener::on_data_available( LoanableHelloWorld st; SampleInfo info; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx index 0854b6ebd47..e19c18d90ec 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx @@ -144,7 +144,7 @@ void LoanableHelloWorldPublisher::run() if (ch == 'y') { void* sample = nullptr; - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { std::cout << "Preparing sample at address " << sample << std::endl; LoanableHelloWorld* data = static_cast(sample); diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx index 67d9b286824..15fa0200bfd 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx @@ -130,7 +130,7 @@ void LoanableHelloWorldSubscriber::SubListener::on_data_available( DataSeq data; SampleInfoSeq infos; - while (ReturnCode_t::RETCODE_OK == reader->take(data, infos)) + while (RETCODE_OK == reader->take(data, infos)) { for (LoanableCollection::size_type i = 0; i < infos.length(); ++i) { diff --git a/include/fastdds/dds/core/Entity.hpp b/include/fastdds/dds/core/Entity.hpp index e4399624e80..677289dcef0 100644 --- a/include/fastdds/dds/core/Entity.hpp +++ b/include/fastdds/dds/core/Entity.hpp @@ -59,7 +59,7 @@ class Entity virtual fastrtps::types::ReturnCode_t enable() { enable_ = true; - return fastrtps::types::ReturnCode_t::RETCODE_OK; + return fastrtps::types::RETCODE_OK; } /** diff --git a/include/fastdds/dds/core/ReturnCode.hpp b/include/fastdds/dds/core/ReturnCode.hpp new file mode 100644 index 00000000000..607e091c670 --- /dev/null +++ b/include/fastdds/dds/core/ReturnCode.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ReturnCode.hpp + */ + +#ifndef _FASTDDS_DDS_CORE_RETURNCODE_HPP_ +#define _FASTDDS_DDS_CORE_RETURNCODE_HPP_ + +#include "detail/DDSReturnCode.hpp" +#include "detail/DDSSecurityReturnCode.hpp" + +#endif // _FASTDDS_DDS_CORE_RETURNCODE_HPP_ + diff --git a/include/fastdds/dds/core/detail/DDSReturnCode.hpp b/include/fastdds/dds/core/detail/DDSReturnCode.hpp new file mode 100644 index 00000000000..70d8df53a17 --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSReturnCode.hpp @@ -0,0 +1,82 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DDSReturnCode.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ +#define _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ + +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DDSRETURNCODE_SOURCE) +#define DDSRETURNCODE_DllAPI __declspec( dllexport ) +#else +#define DDSRETURNCODE_DllAPI __declspec( dllimport ) +#endif // DDSRETURNCODE_SOURCE +#else +#define DDSRETURNCODE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DDSRETURNCODE_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +typedef int32_t ReturnCode_t; + +const ReturnCode_t RETCODE_OK = 0; +const ReturnCode_t RETCODE_ERROR = 1; +const ReturnCode_t RETCODE_UNSUPPORTED = 2; +const ReturnCode_t RETCODE_BAD_PARAMETER = 3; +const ReturnCode_t RETCODE_PRECONDITION_NOT_MET = 4; +const ReturnCode_t RETCODE_OUT_OF_RESOURCES = 5; +const ReturnCode_t RETCODE_NOT_ENABLED = 6; +const ReturnCode_t RETCODE_IMMUTABLE_POLICY = 7; +const ReturnCode_t RETCODE_INCONSISTENT_POLICY = 8; +const ReturnCode_t RETCODE_ALREADY_DELETED = 9; +const ReturnCode_t RETCODE_TIMEOUT = 10; +const ReturnCode_t RETCODE_NO_DATA = 11; +const ReturnCode_t RETCODE_ILLEGAL_OPERATION = 12; + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ + diff --git a/include/fastdds/dds/core/detail/DDSReturnCode.idl b/include/fastdds/dds/core/detail/DDSReturnCode.idl new file mode 100644 index 00000000000..0d286676f0c --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSReturnCode.idl @@ -0,0 +1,25 @@ +// The content of this file, related to the DDS's return code values, was extracted from the omg idl +// https://www.omg.org/spec/DDS/20140501/dds_dcps.idl + +module DDS { + + typedef long ReturnCode_t; + + // ---------------------------------------------------------------------- + // Return codes + // ---------------------------------------------------------------------- + const ReturnCode_t RETCODE_OK = 0; + const ReturnCode_t RETCODE_ERROR = 1; + const ReturnCode_t RETCODE_UNSUPPORTED = 2; + const ReturnCode_t RETCODE_BAD_PARAMETER = 3; + const ReturnCode_t RETCODE_PRECONDITION_NOT_MET = 4; + const ReturnCode_t RETCODE_OUT_OF_RESOURCES = 5; + const ReturnCode_t RETCODE_NOT_ENABLED = 6; + const ReturnCode_t RETCODE_IMMUTABLE_POLICY = 7; + const ReturnCode_t RETCODE_INCONSISTENT_POLICY = 8; + const ReturnCode_t RETCODE_ALREADY_DELETED = 9; + const ReturnCode_t RETCODE_TIMEOUT = 10; + const ReturnCode_t RETCODE_NO_DATA = 11; + const ReturnCode_t RETCODE_ILLEGAL_OPERATION = 12; + +}; diff --git a/include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp new file mode 100644 index 00000000000..b7e1fd4ad1b --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp @@ -0,0 +1,70 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DDSSecurityReturnCode.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ +#define _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ + +#include + +#include "DDSReturnCode.hpp" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DDSSECURITYRETURNCODE_SOURCE) +#define DDSSECURITYRETURNCODE_DllAPI __declspec( dllexport ) +#else +#define DDSSECURITYRETURNCODE_DllAPI __declspec( dllimport ) +#endif // DDSSECURITYRETURNCODE_SOURCE +#else +#define DDSSECURITYRETURNCODE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DDSSECURITYRETURNCODE_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +const ReturnCode_t RETCODE_NOT_ALLOWED_BY_SECURITY = 1000; + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ + diff --git a/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl new file mode 100644 index 00000000000..3248239741c --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl @@ -0,0 +1,10 @@ +// The content of this file, related to the DDS Security's return code values, was extracted from the omg idl +// https://www.omg.org/spec/DDS-SECURITY/20170901/dds_security_plugins_spis.idl +#include "DDSReturnCode.idl" + +module DDS { + + // DDSSEC11-24 + const ReturnCode_t RETCODE_NOT_ALLOWED_BY_SECURITY = 1000; + +}; diff --git a/include/fastrtps/types/DynamicData.h b/include/fastrtps/types/DynamicData.h index 6020b46105f..95e85912ace 100644 --- a/include/fastrtps/types/DynamicData.h +++ b/include/fastrtps/types/DynamicData.h @@ -478,7 +478,7 @@ class DynamicData { return set_bool_value(value, id); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } RTPS_DllAPI ReturnCode_t get_string_value( @@ -519,9 +519,9 @@ class DynamicData RTPS_DllAPI uint64_t get_bitmask_value() const { uint64_t value; - if (get_bitmask_value(value) != ReturnCode_t::RETCODE_OK) + if (get_bitmask_value(value) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -545,9 +545,9 @@ class DynamicData MemberId id) const { int32_t value; - if (get_int32_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_int32_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -556,9 +556,9 @@ class DynamicData MemberId id) const { uint32_t value; - if (get_uint32_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_uint32_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -567,9 +567,9 @@ class DynamicData MemberId id) const { int16_t value; - if (get_int16_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_int16_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -578,9 +578,9 @@ class DynamicData MemberId id) const { uint16_t value; - if (get_uint16_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_uint16_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -589,9 +589,9 @@ class DynamicData MemberId id) const { int64_t value; - if (get_int64_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_int64_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -600,9 +600,9 @@ class DynamicData MemberId id) const { uint64_t value; - if (get_uint64_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_uint64_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -611,9 +611,9 @@ class DynamicData MemberId id) const { float value; - if (get_float32_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_float32_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -622,9 +622,9 @@ class DynamicData MemberId id) const { double value; - if (get_float64_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_float64_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -633,9 +633,9 @@ class DynamicData MemberId id) const { long double value; - if (get_float128_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_float128_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -644,9 +644,9 @@ class DynamicData MemberId id) const { char value; - if (get_char8_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_char8_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -655,9 +655,9 @@ class DynamicData MemberId id) const { wchar_t value; - if (get_char16_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_char16_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -666,9 +666,9 @@ class DynamicData MemberId id) const { octet value; - if (get_byte_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_byte_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -677,9 +677,9 @@ class DynamicData MemberId id) const { int8_t value; - if (get_int8_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_int8_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -688,9 +688,9 @@ class DynamicData MemberId id) const { uint8_t value; - if (get_uint8_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_uint8_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -699,9 +699,9 @@ class DynamicData MemberId id) const { bool value; - if (get_bool_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_bool_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -711,9 +711,9 @@ class DynamicData { MemberId id = get_member_id_by_name(name); bool value; - if (get_bool_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_bool_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -722,9 +722,9 @@ class DynamicData MemberId id) const { std::string value; - if (get_string_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_string_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -733,9 +733,9 @@ class DynamicData MemberId id) const { std::wstring value; - if (get_wstring_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_wstring_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -744,9 +744,9 @@ class DynamicData MemberId id) const { std::string value; - if (get_enum_value(value, id) != ReturnCode_t::RETCODE_OK) + if (get_enum_value(value, id) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } @@ -754,9 +754,9 @@ class DynamicData RTPS_DllAPI uint64_t get_union_label() const { uint64_t value; - if (get_union_label(value) != ReturnCode_t::RETCODE_OK) + if (get_union_label(value) != RETCODE_OK) { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; + throw RETCODE_BAD_PARAMETER; } return value; } diff --git a/include/fastrtps/types/TypesBase.h b/include/fastrtps/types/TypesBase.h index c5242e17ad6..2a1ec9cc378 100644 --- a/include/fastrtps/types/TypesBase.h +++ b/include/fastrtps/types/TypesBase.h @@ -24,6 +24,7 @@ #include #include +#include #include namespace eprosima { @@ -182,105 +183,20 @@ typedef std::array NameHash; // Selects T1, T2, O, M, K, D const uint16_t MemberFlagMinimalMask = 0x003f; -/*! - * @brief This class represents the enumeration ReturnCode_t. - */ - -class RTPS_DllAPI ReturnCode_t -{ - uint32_t value_; - -public: - - enum ReturnCodeValue - { - RETCODE_OK = 0, - RETCODE_ERROR = 1, - RETCODE_UNSUPPORTED = 2, - RETCODE_BAD_PARAMETER = 3, - RETCODE_PRECONDITION_NOT_MET = 4, - RETCODE_OUT_OF_RESOURCES = 5, - RETCODE_NOT_ENABLED = 6, - RETCODE_IMMUTABLE_POLICY = 7, - RETCODE_INCONSISTENT_POLICY = 8, - RETCODE_ALREADY_DELETED = 9, - RETCODE_TIMEOUT = 10, - RETCODE_NO_DATA = 11, - RETCODE_ILLEGAL_OPERATION = 12, - RETCODE_NOT_ALLOWED_BY_SECURITY = 13 - }; - - ReturnCode_t() - : value_(RETCODE_OK) - { - } - - ReturnCode_t( - uint32_t e) - { - value_ = e; - } - - bool operator ==( - const ReturnCode_t& c) const - { - return value_ == c.value_; - } - - bool operator !=( - const ReturnCode_t& c) const - { - return value_ != c.value_; - } - - explicit operator bool() = delete; - - uint32_t operator ()() const - { - return value_; - } - - bool operator !() const - { - return value_ != 0; - } - -}; - -RTPS_DllAPI inline bool operator ==( - ReturnCode_t::ReturnCodeValue a, - const ReturnCode_t& b) -{ - return b.operator ==( - a); -} - -RTPS_DllAPI inline bool operator !=( - ReturnCode_t::ReturnCodeValue a, - const ReturnCode_t& b) -{ - return b.operator !=( - a); -} - -RTPS_DllAPI inline bool operator ==( - uint32_t a, - const ReturnCode_t& b) -{ - return b.operator ==( - a); -} - -RTPS_DllAPI inline bool operator !=( - uint32_t a, - const ReturnCode_t& b) -{ - return b.operator !=( - a); -} - -// TODO Remove this alias when Fast-RTPS reaches version 2 -using ResponseCode = ReturnCode_t; +using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; +const ReturnCode_t RETCODE_OK = eprosima::fastdds::dds::RETCODE_OK; +const ReturnCode_t RETCODE_ERROR = eprosima::fastdds::dds::RETCODE_ERROR; +const ReturnCode_t RETCODE_UNSUPPORTED = eprosima::fastdds::dds::RETCODE_UNSUPPORTED; +const ReturnCode_t RETCODE_BAD_PARAMETER = eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; +const ReturnCode_t RETCODE_PRECONDITION_NOT_MET = eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; +const ReturnCode_t RETCODE_OUT_OF_RESOURCES = eprosima::fastdds::dds::RETCODE_OUT_OF_RESOURCES; +const ReturnCode_t RETCODE_NOT_ENABLED = eprosima::fastdds::dds::RETCODE_NOT_ENABLED; +const ReturnCode_t RETCODE_IMMUTABLE_POLICY = eprosima::fastdds::dds::RETCODE_IMMUTABLE_POLICY; +const ReturnCode_t RETCODE_INCONSISTENT_POLICY = eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY; +const ReturnCode_t RETCODE_ALREADY_DELETED = eprosima::fastdds::dds::RETCODE_ALREADY_DELETED; +const ReturnCode_t RETCODE_TIMEOUT = eprosima::fastdds::dds::RETCODE_TIMEOUT; +const ReturnCode_t RETCODE_NO_DATA = eprosima::fastdds::dds::RETCODE_NO_DATA; +const ReturnCode_t RETCODE_ILLEGAL_OPERATION = eprosima::fastdds::dds::RETCODE_ILLEGAL_OPERATION; typedef uint32_t MemberId; constexpr uint32_t MEMBER_ID_INVALID {0X0FFFFFFF}; diff --git a/src/cpp/dds/domain/DomainParticipant.cpp b/src/cpp/dds/domain/DomainParticipant.cpp index a6a040fb57f..fcd7ce64849 100644 --- a/src/cpp/dds/domain/DomainParticipant.cpp +++ b/src/cpp/dds/domain/DomainParticipant.cpp @@ -33,8 +33,8 @@ DomainParticipant::DomainParticipant( uint32_t did) : dds::core::Reference( eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->create_participant( - did, - eprosima::fastdds::dds::PARTICIPANT_QOS_DEFAULT)) + did, + eprosima::fastdds::dds::PARTICIPANT_QOS_DEFAULT)) { } @@ -77,15 +77,15 @@ void DomainParticipant::qos( const dds::domain::qos::DomainParticipantQos& qos) { ReturnCode_t code = this->delegate()->set_qos(qos); - if (code == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) + if (code == eprosima::fastdds::dds::RETCODE_IMMUTABLE_POLICY) { throw dds::core::ImmutablePolicyError("Immutable Qos"); } - else if ( code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + else if ( code == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) + else if (code == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported values on DomainParticipantQos"); } @@ -126,11 +126,11 @@ void DomainParticipant::default_participant_qos( { ReturnCode_t code = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_default_participant_qos( qos); - if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (code == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) + else if (code == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported values on DomainParticipantQos"); } @@ -145,11 +145,11 @@ DomainParticipant& DomainParticipant::default_publisher_qos( const ::dds::pub::qos::PublisherQos& qos) { ReturnCode_t code = this->delegate()->set_default_publisher_qos(qos); - if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (code == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) + else if (code == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported values on PublisherQos"); } @@ -165,11 +165,11 @@ DomainParticipant& DomainParticipant::default_subscriber_qos( const ::dds::sub::qos::SubscriberQos& qos) { ReturnCode_t result = delegate()->set_default_subscriber_qos(qos); - if (result == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (result == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - if (result == ReturnCode_t::RETCODE_UNSUPPORTED) + if (result == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported Qos"); } @@ -185,11 +185,11 @@ DomainParticipant& DomainParticipant::default_topic_qos( const dds::topic::qos::TopicQos& qos) { ReturnCode_t ret_code = this->delegate()->set_default_topic_qos(qos); - if (ret_code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (ret_code == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - else if (ret_code == ReturnCode_t::RETCODE_UNSUPPORTED) + else if (ret_code == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported values on TopicQos"); } diff --git a/src/cpp/dds/pub/AnyDataWriter.cpp b/src/cpp/dds/pub/AnyDataWriter.cpp index 0d4e4c1e96c..85bfc743a84 100644 --- a/src/cpp/dds/pub/AnyDataWriter.cpp +++ b/src/cpp/dds/pub/AnyDataWriter.cpp @@ -63,15 +63,15 @@ void TAnyDataWriter::qos( const qos::DataWriterQos& qos) { ReturnCode_t code = this->delegate()->set_qos(qos); - if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (code == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) + else if (code == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported values on DataWriterQos"); } - else if (code == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) + else if (code == eprosima::fastdds::dds::RETCODE_IMMUTABLE_POLICY) { throw dds::core::ImmutablePolicyError("Immutable Qos"); } diff --git a/src/cpp/dds/pub/Publisher.cpp b/src/cpp/dds/pub/Publisher.cpp index a6b2d2f8bc2..6650470c389 100644 --- a/src/cpp/dds/pub/Publisher.cpp +++ b/src/cpp/dds/pub/Publisher.cpp @@ -65,15 +65,15 @@ void Publisher::qos( const qos::PublisherQos& pqos) { ReturnCode_t code = this->delegate()->set_qos(pqos); - if (code == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) + if (code == eprosima::fastdds::dds::RETCODE_IMMUTABLE_POLICY) { throw dds::core::ImmutablePolicyError("Immutable Qos"); } - else if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + else if (code == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) + else if (code == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported values on DomainParticipantQos"); } @@ -97,11 +97,11 @@ Publisher& Publisher::default_datawriter_qos( const qos::DataWriterQos& dwqos) { ReturnCode_t code = this->delegate()->set_default_datawriter_qos(dwqos); - if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (code == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - if (code == ReturnCode_t::RETCODE_UNSUPPORTED) + if (code == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported values on DataWriterQos"); } diff --git a/src/cpp/dds/sub/Subscriber.cpp b/src/cpp/dds/sub/Subscriber.cpp index 69821b6d968..9ae808c9d40 100644 --- a/src/cpp/dds/sub/Subscriber.cpp +++ b/src/cpp/dds/sub/Subscriber.cpp @@ -65,15 +65,15 @@ void Subscriber::qos( const qos::SubscriberQos& pqos) { ReturnCode_t result = delegate()->set_qos(pqos); - if (result == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) + if (result == eprosima::fastdds::dds::RETCODE_IMMUTABLE_POLICY) { throw dds::core::ImmutablePolicyError("Immutable Qos"); } - else if (result == ReturnCode_t::RETCODE_UNSUPPORTED) + else if (result == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported Qos"); } - else if (result == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + else if (result == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } @@ -97,11 +97,11 @@ Subscriber& Subscriber::default_datareader_qos( const qos::DataReaderQos& drqos) { ReturnCode_t result = delegate()->set_default_datareader_qos(drqos); - if ( result == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if ( result == eprosima::fastdds::dds::RETCODE_INCONSISTENT_POLICY) { throw dds::core::InconsistentPolicyError("Inconsistent Qos"); } - if ( result == ReturnCode_t::RETCODE_UNSUPPORTED) + if ( result == eprosima::fastdds::dds::RETCODE_UNSUPPORTED) { throw dds::core::UnsupportedError("Unsupported Qos"); } diff --git a/src/cpp/dynamic-types/AnnotationDescriptor.cpp b/src/cpp/dynamic-types/AnnotationDescriptor.cpp index a51cf8401e3..0f23c9571c7 100644 --- a/src/cpp/dynamic-types/AnnotationDescriptor.cpp +++ b/src/cpp/dynamic-types/AnnotationDescriptor.cpp @@ -55,15 +55,15 @@ ReturnCode_t AnnotationDescriptor::copy_from( } catch (std::exception& /*e*/) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying AnnotationDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool AnnotationDescriptor::equals( @@ -112,16 +112,16 @@ ReturnCode_t AnnotationDescriptor::get_value( if (it != value_.end()) { value = it->second; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t AnnotationDescriptor::get_all_value( std::map& value) const { value = value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool AnnotationDescriptor::is_consistent() const @@ -146,7 +146,7 @@ ReturnCode_t AnnotationDescriptor::set_value( const std::string& value) { value_[key] = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } // namespace types diff --git a/src/cpp/dynamic-types/DynamicData.cpp b/src/cpp/dynamic-types/DynamicData.cpp index 34e229ab923..653ac818211 100644 --- a/src/cpp/dynamic-types/DynamicData.cpp +++ b/src/cpp/dynamic-types/DynamicData.cpp @@ -182,7 +182,7 @@ void DynamicData::create_members( DynamicType_ptr pType) { std::map members; - if (pType->get_all_members(members) == ReturnCode_t::RETCODE_OK) + if (pType->get_all_members(members) == RETCODE_OK) { if (pType->is_complex_kind()) { @@ -195,7 +195,7 @@ void DynamicData::create_members( for (auto it = members.begin(); it != members.end(); ++it) { MemberDescriptor* newDescriptor = new MemberDescriptor(); - if (it->second->get_descriptor(newDescriptor) == ReturnCode_t::RETCODE_OK) + if (it->second->get_descriptor(newDescriptor) == RETCODE_OK) { descriptors_.insert(std::make_pair(it->first, newDescriptor)); if (pType->get_kind() != TK_BITMASK && pType->get_kind() != TK_ENUM) @@ -264,12 +264,12 @@ ReturnCode_t DynamicData::get_descriptor( if (it != descriptors_.end()) { value.copy_from(it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting MemberDescriptor. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -280,12 +280,12 @@ ReturnCode_t DynamicData::set_descriptor( if (descriptors_.find(id) == descriptors_.end()) { descriptors_.insert(std::make_pair(id, new MemberDescriptor(value))); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error setting MemberDescriptor. MemberId found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -676,7 +676,7 @@ ReturnCode_t DynamicData::clear_all_values() { set_default_value(MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DynamicData::clean_members() @@ -881,7 +881,7 @@ ReturnCode_t DynamicData::clear_nonkey_values() set_default_value(MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DynamicData::clear_value( @@ -915,7 +915,7 @@ ReturnCode_t DynamicData::clear_value( { set_default_value(id); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void* DynamicData::clone_value( @@ -1747,7 +1747,7 @@ DynamicData* DynamicData::loan_value( } else if (get_kind() == TK_ARRAY) { - if (insert_array_data(id) == ReturnCode_t::RETCODE_OK) + if (insert_array_data(id) == RETCODE_OK) { loaned_values_.push_back(id); return complex_values_.at(id); @@ -1774,7 +1774,7 @@ DynamicData* DynamicData::loan_value( } else if (get_kind() == TK_ARRAY) { - if (insert_array_data(id) == ReturnCode_t::RETCODE_OK) + if (insert_array_data(id) == RETCODE_OK) { loaned_values_.push_back(id); return (DynamicData*)values_.at(id); @@ -1809,20 +1809,20 @@ ReturnCode_t DynamicData::return_loaned_value( if (it != complex_values_.end() && it->second == value) { loaned_values_.erase(loanIt); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #else auto it = values_.find(*loanIt); if (it != values_.end() && it->second == value) { loaned_values_.erase(loanIt); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // ifdef DYNAMIC_TYPES_CHECKING } EPROSIMA_LOG_ERROR(DYN_TYPES, "Error returning loaned Value. The value hasn't been loaned."); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t DynamicData::get_int32_value( @@ -1833,7 +1833,7 @@ ReturnCode_t DynamicData::get_int32_value( if (get_kind() == TK_INT32 && id == MEMBER_ID_INVALID) { value = int32_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -1850,7 +1850,7 @@ ReturnCode_t DynamicData::get_int32_value( return default_array_value_->get_int32_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -1858,7 +1858,7 @@ ReturnCode_t DynamicData::get_int32_value( if (get_kind() == TK_INT32 && id == MEMBER_ID_INVALID) { value = *((int32_t*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -1872,7 +1872,7 @@ ReturnCode_t DynamicData::get_int32_value( { return default_array_value_->get_int32_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -1884,7 +1884,7 @@ ReturnCode_t DynamicData::set_int32_value( if (get_kind() == TK_INT32 && id == MEMBER_ID_INVALID) { int32_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -1904,7 +1904,7 @@ ReturnCode_t DynamicData::set_int32_value( value &= mask; } ReturnCode_t result = it->second->set_int32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -1913,14 +1913,14 @@ ReturnCode_t DynamicData::set_int32_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_int32_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -1928,7 +1928,7 @@ ReturnCode_t DynamicData::set_int32_value( if (get_kind() == TK_INT32 && id == MEMBER_ID_INVALID) { *((int32_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -1937,7 +1937,7 @@ ReturnCode_t DynamicData::set_int32_value( { if (itDescriptor == descriptors_.end()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); int32_t mask = 0x00; @@ -1949,7 +1949,7 @@ ReturnCode_t DynamicData::set_int32_value( value &= mask; } ReturnCode_t result = ((DynamicData*)it->second)->set_int32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -1959,14 +1959,14 @@ ReturnCode_t DynamicData::set_int32_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_int32_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -1978,7 +1978,7 @@ ReturnCode_t DynamicData::get_uint32_value( if (get_kind() == TK_UINT32 && id == MEMBER_ID_INVALID) { value = uint32_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -1995,7 +1995,7 @@ ReturnCode_t DynamicData::get_uint32_value( return default_array_value_->get_uint32_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2003,7 +2003,7 @@ ReturnCode_t DynamicData::get_uint32_value( if (get_kind() == TK_UINT32 && id == MEMBER_ID_INVALID) { value = *((uint32_t*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2017,7 +2017,7 @@ ReturnCode_t DynamicData::get_uint32_value( { return default_array_value_->get_uint32_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2029,7 +2029,7 @@ ReturnCode_t DynamicData::set_uint32_value( if (get_kind() == TK_UINT32 && id == MEMBER_ID_INVALID) { uint32_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2049,7 +2049,7 @@ ReturnCode_t DynamicData::set_uint32_value( value &= mask; } ReturnCode_t result = it->second->set_uint32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2058,14 +2058,14 @@ ReturnCode_t DynamicData::set_uint32_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_uint32_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2073,7 +2073,7 @@ ReturnCode_t DynamicData::set_uint32_value( if (get_kind() == TK_UINT32 && id == MEMBER_ID_INVALID) { *((uint32_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2082,7 +2082,7 @@ ReturnCode_t DynamicData::set_uint32_value( { if (itDescriptor == descriptors_.end()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); uint32_t mask = 0x00; @@ -2094,7 +2094,7 @@ ReturnCode_t DynamicData::set_uint32_value( value &= mask; } ReturnCode_t result = ((DynamicData*)it->second)->set_uint32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2104,14 +2104,14 @@ ReturnCode_t DynamicData::set_uint32_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_uint32_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2123,7 +2123,7 @@ ReturnCode_t DynamicData::get_int16_value( if (get_kind() == TK_INT16 && id == MEMBER_ID_INVALID) { value = int16_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2140,7 +2140,7 @@ ReturnCode_t DynamicData::get_int16_value( return default_array_value_->get_int16_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2148,7 +2148,7 @@ ReturnCode_t DynamicData::get_int16_value( if (get_kind() == TK_INT16 && id == MEMBER_ID_INVALID) { value = *((int16_t*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2162,7 +2162,7 @@ ReturnCode_t DynamicData::get_int16_value( { return default_array_value_->get_int16_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2174,7 +2174,7 @@ ReturnCode_t DynamicData::set_int16_value( if (get_kind() == TK_INT16 && id == MEMBER_ID_INVALID) { int16_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2194,7 +2194,7 @@ ReturnCode_t DynamicData::set_int16_value( value &= mask; } ReturnCode_t result = it->second->set_int16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2203,14 +2203,14 @@ ReturnCode_t DynamicData::set_int16_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_int16_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2218,7 +2218,7 @@ ReturnCode_t DynamicData::set_int16_value( if (get_kind() == TK_INT16 && id == MEMBER_ID_INVALID) { *((int16_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2227,7 +2227,7 @@ ReturnCode_t DynamicData::set_int16_value( { if (itDescriptor == descriptors_.end()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); int16_t mask = 0x00; @@ -2239,7 +2239,7 @@ ReturnCode_t DynamicData::set_int16_value( value &= mask; } ReturnCode_t result = ((DynamicData*)it->second)->set_int16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2249,14 +2249,14 @@ ReturnCode_t DynamicData::set_int16_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_int16_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2268,7 +2268,7 @@ ReturnCode_t DynamicData::get_uint16_value( if (get_kind() == TK_UINT16 && id == MEMBER_ID_INVALID) { value = uint16_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2285,7 +2285,7 @@ ReturnCode_t DynamicData::get_uint16_value( return default_array_value_->get_uint16_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2293,7 +2293,7 @@ ReturnCode_t DynamicData::get_uint16_value( if (get_kind() == TK_UINT16 && id == MEMBER_ID_INVALID) { value = *((uint16_t*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2307,7 +2307,7 @@ ReturnCode_t DynamicData::get_uint16_value( { return default_array_value_->get_uint16_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2319,7 +2319,7 @@ ReturnCode_t DynamicData::set_uint16_value( if (get_kind() == TK_UINT16 && id == MEMBER_ID_INVALID) { uint16_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2339,7 +2339,7 @@ ReturnCode_t DynamicData::set_uint16_value( value &= mask; } ReturnCode_t result = it->second->set_uint16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2348,14 +2348,14 @@ ReturnCode_t DynamicData::set_uint16_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_uint16_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2363,7 +2363,7 @@ ReturnCode_t DynamicData::set_uint16_value( if (get_kind() == TK_UINT16 && id == MEMBER_ID_INVALID) { *((uint16_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2372,7 +2372,7 @@ ReturnCode_t DynamicData::set_uint16_value( { if (itDescriptor == descriptors_.end()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); uint16_t mask = 0x00; @@ -2384,7 +2384,7 @@ ReturnCode_t DynamicData::set_uint16_value( value &= mask; } ReturnCode_t result = ((DynamicData*)it->second)->set_uint16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2394,13 +2394,13 @@ ReturnCode_t DynamicData::set_uint16_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_uint16_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2412,7 +2412,7 @@ ReturnCode_t DynamicData::get_int64_value( if (get_kind() == TK_INT64 && id == MEMBER_ID_INVALID) { value = int64_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2429,7 +2429,7 @@ ReturnCode_t DynamicData::get_int64_value( return default_array_value_->get_int64_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2437,7 +2437,7 @@ ReturnCode_t DynamicData::get_int64_value( if (get_kind() == TK_INT64 && id == MEMBER_ID_INVALID) { value = *((int64_t*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2451,7 +2451,7 @@ ReturnCode_t DynamicData::get_int64_value( { return default_array_value_->get_int64_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2463,7 +2463,7 @@ ReturnCode_t DynamicData::set_int64_value( if (get_kind() == TK_INT64 && id == MEMBER_ID_INVALID) { int64_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2483,7 +2483,7 @@ ReturnCode_t DynamicData::set_int64_value( value &= mask; } ReturnCode_t result = it->second->set_int64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2492,14 +2492,14 @@ ReturnCode_t DynamicData::set_int64_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_int64_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2507,7 +2507,7 @@ ReturnCode_t DynamicData::set_int64_value( if (get_kind() == TK_INT64 && id == MEMBER_ID_INVALID) { *((int64_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2516,7 +2516,7 @@ ReturnCode_t DynamicData::set_int64_value( { if (itDescriptor == descriptors_.end()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); int64_t mask = 0x00; @@ -2528,7 +2528,7 @@ ReturnCode_t DynamicData::set_int64_value( value &= mask; } ReturnCode_t result = ((DynamicData*)it->second)->set_int64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2538,14 +2538,14 @@ ReturnCode_t DynamicData::set_int64_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_int64_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2557,7 +2557,7 @@ ReturnCode_t DynamicData::get_uint64_value( if ((get_kind() == TK_UINT64 || get_kind() == TK_BITMASK) && id == MEMBER_ID_INVALID) { value = uint64_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2574,7 +2574,7 @@ ReturnCode_t DynamicData::get_uint64_value( return default_array_value_->get_uint64_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2582,7 +2582,7 @@ ReturnCode_t DynamicData::get_uint64_value( if ((get_kind() == TK_UINT64 || get_kind() == TK_BITMASK) && id == MEMBER_ID_INVALID) { value = *((uint64_t*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2596,7 +2596,7 @@ ReturnCode_t DynamicData::get_uint64_value( { return default_array_value_->get_uint64_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2608,7 +2608,7 @@ ReturnCode_t DynamicData::set_uint64_value( if ((get_kind() == TK_UINT64 || get_kind() == TK_BITMASK) && id == MEMBER_ID_INVALID) { uint64_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2628,7 +2628,7 @@ ReturnCode_t DynamicData::set_uint64_value( value &= mask; } ReturnCode_t result = it->second->set_uint64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2637,14 +2637,14 @@ ReturnCode_t DynamicData::set_uint64_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_uint64_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2652,7 +2652,7 @@ ReturnCode_t DynamicData::set_uint64_value( if ((get_kind() == TK_UINT64 || get_kind() == TK_BITMASK) && id == MEMBER_ID_INVALID) { *((uint64_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2661,7 +2661,7 @@ ReturnCode_t DynamicData::set_uint64_value( { if (itDescriptor == descriptors_.end()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); uint64_t mask = 0x00; @@ -2673,7 +2673,7 @@ ReturnCode_t DynamicData::set_uint64_value( value &= mask; } ReturnCode_t result = ((DynamicData*)it->second)->set_uint64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2683,14 +2683,14 @@ ReturnCode_t DynamicData::set_uint64_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_uint64_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2702,7 +2702,7 @@ ReturnCode_t DynamicData::get_float32_value( if (get_kind() == TK_FLOAT32 && id == MEMBER_ID_INVALID) { value = float32_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2719,7 +2719,7 @@ ReturnCode_t DynamicData::get_float32_value( return default_array_value_->get_float32_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2727,7 +2727,7 @@ ReturnCode_t DynamicData::get_float32_value( if (get_kind() == TK_FLOAT32 && id == MEMBER_ID_INVALID) { value = *((float*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2741,7 +2741,7 @@ ReturnCode_t DynamicData::get_float32_value( { return default_array_value_->get_float32_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2753,7 +2753,7 @@ ReturnCode_t DynamicData::set_float32_value( if (get_kind() == TK_FLOAT32 && id == MEMBER_ID_INVALID) { float32_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2761,7 +2761,7 @@ ReturnCode_t DynamicData::set_float32_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_float32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2770,7 +2770,7 @@ ReturnCode_t DynamicData::set_float32_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_float32_value(value, id); } @@ -2778,7 +2778,7 @@ ReturnCode_t DynamicData::set_float32_value( } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2786,12 +2786,12 @@ ReturnCode_t DynamicData::set_float32_value( if (get_kind() == TK_FLOAT32 && id == MEMBER_ID_INVALID) { *((float*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)it->second)->set_float32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2801,14 +2801,14 @@ ReturnCode_t DynamicData::set_float32_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_float32_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2820,7 +2820,7 @@ ReturnCode_t DynamicData::get_float64_value( if (get_kind() == TK_FLOAT64 && id == MEMBER_ID_INVALID) { value = float64_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2837,7 +2837,7 @@ ReturnCode_t DynamicData::get_float64_value( return default_array_value_->get_float64_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2845,7 +2845,7 @@ ReturnCode_t DynamicData::get_float64_value( if (get_kind() == TK_FLOAT64 && id == MEMBER_ID_INVALID) { value = *((double*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2859,7 +2859,7 @@ ReturnCode_t DynamicData::get_float64_value( { return default_array_value_->get_float64_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2871,7 +2871,7 @@ ReturnCode_t DynamicData::set_float64_value( if (get_kind() == TK_FLOAT64 && id == MEMBER_ID_INVALID) { float64_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2879,7 +2879,7 @@ ReturnCode_t DynamicData::set_float64_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_float64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2888,14 +2888,14 @@ ReturnCode_t DynamicData::set_float64_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_float64_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2903,12 +2903,12 @@ ReturnCode_t DynamicData::set_float64_value( if (get_kind() == TK_FLOAT64 && id == MEMBER_ID_INVALID) { *((double*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)it->second)->set_float64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -2918,14 +2918,14 @@ ReturnCode_t DynamicData::set_float64_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_float64_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2937,7 +2937,7 @@ ReturnCode_t DynamicData::get_float128_value( if (get_kind() == TK_FLOAT128 && id == MEMBER_ID_INVALID) { value = float128_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2954,7 +2954,7 @@ ReturnCode_t DynamicData::get_float128_value( return default_array_value_->get_float128_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -2962,7 +2962,7 @@ ReturnCode_t DynamicData::get_float128_value( if (get_kind() == TK_FLOAT128 && id == MEMBER_ID_INVALID) { value = *((long double*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2976,7 +2976,7 @@ ReturnCode_t DynamicData::get_float128_value( { return default_array_value_->get_float128_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -2988,7 +2988,7 @@ ReturnCode_t DynamicData::set_float128_value( if (get_kind() == TK_FLOAT128 && id == MEMBER_ID_INVALID) { float128_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -2996,7 +2996,7 @@ ReturnCode_t DynamicData::set_float128_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_float128_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3005,14 +3005,14 @@ ReturnCode_t DynamicData::set_float128_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_float128_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3020,12 +3020,12 @@ ReturnCode_t DynamicData::set_float128_value( if (get_kind() == TK_FLOAT128 && id == MEMBER_ID_INVALID) { *((long double*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)it->second)->set_float128_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3035,14 +3035,14 @@ ReturnCode_t DynamicData::set_float128_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_float128_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3054,7 +3054,7 @@ ReturnCode_t DynamicData::get_char8_value( if (get_kind() == TK_CHAR8 && id == MEMBER_ID_INVALID) { value = char8_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3071,7 +3071,7 @@ ReturnCode_t DynamicData::get_char8_value( return default_array_value_->get_char8_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3079,7 +3079,7 @@ ReturnCode_t DynamicData::get_char8_value( if (get_kind() == TK_CHAR8 && id == MEMBER_ID_INVALID) { value = *((char*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3093,7 +3093,7 @@ ReturnCode_t DynamicData::get_char8_value( { return default_array_value_->get_char8_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3105,7 +3105,7 @@ ReturnCode_t DynamicData::set_char8_value( if (get_kind() == TK_CHAR8 && id == MEMBER_ID_INVALID) { char8_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3113,7 +3113,7 @@ ReturnCode_t DynamicData::set_char8_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_char8_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3122,14 +3122,14 @@ ReturnCode_t DynamicData::set_char8_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_char8_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3137,12 +3137,12 @@ ReturnCode_t DynamicData::set_char8_value( if (get_kind() == TK_CHAR8 && id == MEMBER_ID_INVALID) { *((char*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)it->second)->set_char8_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3152,14 +3152,14 @@ ReturnCode_t DynamicData::set_char8_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_char8_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3171,7 +3171,7 @@ ReturnCode_t DynamicData::get_char16_value( if (get_kind() == TK_CHAR16 && id == MEMBER_ID_INVALID) { value = char16_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3188,7 +3188,7 @@ ReturnCode_t DynamicData::get_char16_value( return default_array_value_->get_char16_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3196,7 +3196,7 @@ ReturnCode_t DynamicData::get_char16_value( if (get_kind() == TK_CHAR16 && id == MEMBER_ID_INVALID) { value = *((wchar_t*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3210,7 +3210,7 @@ ReturnCode_t DynamicData::get_char16_value( { return default_array_value_->get_char16_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3222,7 +3222,7 @@ ReturnCode_t DynamicData::set_char16_value( if (get_kind() == TK_CHAR16 && id == MEMBER_ID_INVALID) { char16_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3230,7 +3230,7 @@ ReturnCode_t DynamicData::set_char16_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_char16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3239,7 +3239,7 @@ ReturnCode_t DynamicData::set_char16_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_char16_value(value, id); } @@ -3247,7 +3247,7 @@ ReturnCode_t DynamicData::set_char16_value( } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3255,12 +3255,12 @@ ReturnCode_t DynamicData::set_char16_value( if (get_kind() == TK_CHAR16 && id == MEMBER_ID_INVALID) { *((wchar_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)it->second)->set_char16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3270,14 +3270,14 @@ ReturnCode_t DynamicData::set_char16_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_char16_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3289,7 +3289,7 @@ ReturnCode_t DynamicData::get_byte_value( if (get_kind() == TK_BYTE && id == MEMBER_ID_INVALID) { value = byte_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3306,7 +3306,7 @@ ReturnCode_t DynamicData::get_byte_value( return default_array_value_->get_byte_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3314,7 +3314,7 @@ ReturnCode_t DynamicData::get_byte_value( if (get_kind() == TK_BYTE && id == MEMBER_ID_INVALID) { value = *((octet*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3328,7 +3328,7 @@ ReturnCode_t DynamicData::get_byte_value( { return default_array_value_->get_byte_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3340,7 +3340,7 @@ ReturnCode_t DynamicData::set_byte_value( if (get_kind() == TK_BYTE && id == MEMBER_ID_INVALID) { byte_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3360,7 +3360,7 @@ ReturnCode_t DynamicData::set_byte_value( value &= mask; } ReturnCode_t result = it->second->set_byte_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3369,14 +3369,14 @@ ReturnCode_t DynamicData::set_byte_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_byte_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3384,7 +3384,7 @@ ReturnCode_t DynamicData::set_byte_value( if (get_kind() == TK_BYTE && id == MEMBER_ID_INVALID) { *((octet*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3393,7 +3393,7 @@ ReturnCode_t DynamicData::set_byte_value( { if (itDescriptor == descriptors_.end()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); octet mask = 0x00; @@ -3405,7 +3405,7 @@ ReturnCode_t DynamicData::set_byte_value( value &= mask; } ReturnCode_t result = ((DynamicData*)it->second)->set_byte_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3415,14 +3415,14 @@ ReturnCode_t DynamicData::set_byte_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_byte_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3434,12 +3434,12 @@ ReturnCode_t DynamicData::get_bool_value( if (get_kind() == TK_BOOLEAN && id == MEMBER_ID_INVALID) { value = bool_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (get_kind() == TK_BITMASK && id < type_->get_bounds()) { value = (uint64_value_ & ((uint64_t)1 << id)) != 0; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3456,7 +3456,7 @@ ReturnCode_t DynamicData::get_bool_value( return default_array_value_->get_bool_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.end(); if (get_kind() == TK_BITMASK) @@ -3472,7 +3472,7 @@ ReturnCode_t DynamicData::get_bool_value( if (get_kind() == TK_BOOLEAN && id == MEMBER_ID_INVALID) { value = *((bool*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (get_kind() == TK_BITMASK && id < type_->get_bounds()) { @@ -3480,7 +3480,7 @@ ReturnCode_t DynamicData::get_bool_value( MemberDescriptor* member = m_id->second; uint16_t position = member->annotation_get_position(); value = (*((uint64_t*)it->second) & ((uint64_t)1 << position)) != 0; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3494,7 +3494,7 @@ ReturnCode_t DynamicData::get_bool_value( { return default_array_value_->get_bool_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3506,7 +3506,7 @@ ReturnCode_t DynamicData::set_bool_value( if (get_kind() == TK_BOOLEAN && id == MEMBER_ID_INVALID) { bool_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (get_kind() == TK_BITMASK) { @@ -3531,12 +3531,12 @@ ReturnCode_t DynamicData::set_bool_value( { uint64_value_ &= ~((uint64_t)1 << id); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting bool value. The given index is greater than the limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else if (id != MEMBER_ID_INVALID) @@ -3545,7 +3545,7 @@ ReturnCode_t DynamicData::set_bool_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_bool_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3554,14 +3554,14 @@ ReturnCode_t DynamicData::set_bool_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_bool_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.end(); if (get_kind() == TK_BITMASK) @@ -3578,7 +3578,7 @@ ReturnCode_t DynamicData::set_bool_value( if (get_kind() == TK_BOOLEAN && id == MEMBER_ID_INVALID) { *((bool*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (get_kind() == TK_BITMASK) { @@ -3592,7 +3592,7 @@ ReturnCode_t DynamicData::set_bool_value( { *((uint64_t*)it->second) = 0; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (type_->get_bounds() == BOUND_UNLIMITED || id < type_->get_bounds()) { @@ -3607,18 +3607,18 @@ ReturnCode_t DynamicData::set_bool_value( { *((uint64_t*)it->second) &= ~((uint64_t)1 << position); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting bool value. The given index is greater than the limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)it->second)->set_bool_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3628,14 +3628,14 @@ ReturnCode_t DynamicData::set_bool_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_bool_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3647,7 +3647,7 @@ ReturnCode_t DynamicData::get_string_value( if (get_kind() == TK_STRING8 && id == MEMBER_ID_INVALID) { value = string_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3664,7 +3664,7 @@ ReturnCode_t DynamicData::get_string_value( return default_array_value_->get_string_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3672,7 +3672,7 @@ ReturnCode_t DynamicData::get_string_value( if (get_kind() == TK_STRING8 && id == MEMBER_ID_INVALID) { value = *((std::string*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3686,7 +3686,7 @@ ReturnCode_t DynamicData::get_string_value( { return default_array_value_->get_string_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3700,13 +3700,13 @@ ReturnCode_t DynamicData::set_string_value( if (value.length() <= type_->get_bounds()) { string_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting string value. The given string is greater than the length limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else if (id != MEMBER_ID_INVALID) @@ -3715,7 +3715,7 @@ ReturnCode_t DynamicData::set_string_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_string_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3724,14 +3724,14 @@ ReturnCode_t DynamicData::set_string_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_string_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3741,19 +3741,19 @@ ReturnCode_t DynamicData::set_string_value( if (value.length() <= type_->get_bounds()) { *((std::string*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting string value. The given string is greater than the length limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)it->second)->set_string_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3763,14 +3763,14 @@ ReturnCode_t DynamicData::set_string_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_string_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3845,14 +3845,14 @@ ReturnCode_t DynamicData::set_union_id( } } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting union id. The kind: " << get_kind() << " doesn't support it."); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DynamicData::get_wstring_value( @@ -3863,7 +3863,7 @@ ReturnCode_t DynamicData::get_wstring_value( if (get_kind() == TK_STRING16 && id == MEMBER_ID_INVALID) { value = wstring_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3880,7 +3880,7 @@ ReturnCode_t DynamicData::get_wstring_value( return default_array_value_->get_wstring_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3888,7 +3888,7 @@ ReturnCode_t DynamicData::get_wstring_value( if (get_kind() == TK_STRING16 && id == MEMBER_ID_INVALID) { value = *((std::wstring*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -3902,7 +3902,7 @@ ReturnCode_t DynamicData::get_wstring_value( { return default_array_value_->get_wstring_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3916,13 +3916,13 @@ ReturnCode_t DynamicData::set_wstring_value( if (value.length() <= type_->get_bounds()) { wstring_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting wstring value. The given string is greater than the length limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else if (id != MEMBER_ID_INVALID) @@ -3931,7 +3931,7 @@ ReturnCode_t DynamicData::set_wstring_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_wstring_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3940,14 +3940,14 @@ ReturnCode_t DynamicData::set_wstring_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_wstring_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) @@ -3957,19 +3957,19 @@ ReturnCode_t DynamicData::set_wstring_value( if (value.length() <= type_->get_bounds()) { *((std::wstring*)it->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting wstring value. The given string is greater than the length limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)it->second)->set_wstring_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -3979,14 +3979,14 @@ ReturnCode_t DynamicData::set_wstring_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_wstring_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -3998,7 +3998,7 @@ ReturnCode_t DynamicData::get_enum_value( if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) { value = uint32_value_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -4015,7 +4015,7 @@ ReturnCode_t DynamicData::get_enum_value( return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto itValue = values_.find(id); if (itValue != values_.end()) @@ -4023,7 +4023,7 @@ ReturnCode_t DynamicData::get_enum_value( if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) { value = *((uint32_t*)itValue->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else if (id != MEMBER_ID_INVALID) { @@ -4037,7 +4037,7 @@ ReturnCode_t DynamicData::get_enum_value( { return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -4051,7 +4051,7 @@ ReturnCode_t DynamicData::set_enum_value( if (descriptors_.find(value) != descriptors_.end()) { uint32_value_ = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } else if (id != MEMBER_ID_INVALID) @@ -4060,7 +4060,7 @@ ReturnCode_t DynamicData::set_enum_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_enum_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -4069,14 +4069,14 @@ ReturnCode_t DynamicData::set_enum_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_enum_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto itValue = values_.find(id); if (itValue != values_.end()) @@ -4086,13 +4086,13 @@ ReturnCode_t DynamicData::set_enum_value( if (descriptors_.find(value) != descriptors_.end()) { *((uint32_t*)itValue->second) = value; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)itValue->second)->set_enum_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -4102,14 +4102,14 @@ ReturnCode_t DynamicData::set_enum_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_enum_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -4124,7 +4124,7 @@ ReturnCode_t DynamicData::get_enum_value( if (it != descriptors_.end()) { value = it->second->get_name(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } else if (id != MEMBER_ID_INVALID) @@ -4142,7 +4142,7 @@ ReturnCode_t DynamicData::get_enum_value( return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto itValue = values_.find(id); if (itValue != values_.end()) @@ -4153,7 +4153,7 @@ ReturnCode_t DynamicData::get_enum_value( if (it != descriptors_.end()) { value = it->second->get_name(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } else if (id != MEMBER_ID_INVALID) @@ -4168,7 +4168,7 @@ ReturnCode_t DynamicData::get_enum_value( { return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -4184,7 +4184,7 @@ ReturnCode_t DynamicData::set_enum_value( if (it->second->get_name() == value) { uint32_value_ = it->first; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } } @@ -4194,7 +4194,7 @@ ReturnCode_t DynamicData::set_enum_value( if (it != complex_values_.end()) { ReturnCode_t result = it->second->set_enum_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -4203,14 +4203,14 @@ ReturnCode_t DynamicData::set_enum_value( else if (get_kind() == TK_ARRAY) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_enum_value(value, id); } return insertResult; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto itValue = values_.find(id); if (itValue != values_.end()) @@ -4222,14 +4222,14 @@ ReturnCode_t DynamicData::set_enum_value( if (it->second->get_name() == value) { *((uint32_t*)itValue->second) = it->first; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } } else if (id != MEMBER_ID_INVALID) { ReturnCode_t result = ((DynamicData*)itValue->second)->set_enum_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) + if (result == RETCODE_OK && get_kind() == TK_UNION) { set_union_id(id); } @@ -4239,14 +4239,14 @@ ReturnCode_t DynamicData::set_enum_value( else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) { ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) + if (insertResult == RETCODE_OK) { return set_enum_value(value, id); } return insertResult; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } @@ -4257,7 +4257,7 @@ ReturnCode_t DynamicData::set_bitmask_value( { return set_uint64_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DynamicData::get_bitmask_value( @@ -4267,7 +4267,7 @@ ReturnCode_t DynamicData::get_bitmask_value( { return get_uint64_value(value, MEMBER_ID_INVALID); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } void DynamicData::sort_member_ids( @@ -4356,7 +4356,7 @@ ReturnCode_t DynamicData::insert_array_data( } DynamicData* value = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); complex_values_.insert(std::make_pair(indexId, value)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #else if (indexId < type_->get_total_bounds()) @@ -4369,7 +4369,7 @@ ReturnCode_t DynamicData::insert_array_data( } DynamicData* value = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); values_.insert(std::make_pair(indexId, value)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // ifdef DYNAMIC_TYPES_CHECKING else @@ -4382,7 +4382,7 @@ ReturnCode_t DynamicData::insert_array_data( EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The kind " << get_kind() << " doesn't support this method"); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DynamicData::clear_array_data( @@ -4399,7 +4399,7 @@ ReturnCode_t DynamicData::clear_array_data( DynamicDataFactory::get_instance()->delete_data(it->second); complex_values_.erase(it); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #else if (indexId < type_->get_total_bounds()) @@ -4410,7 +4410,7 @@ ReturnCode_t DynamicData::clear_array_data( DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); values_.erase(it); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // ifdef DYNAMIC_TYPES_CHECKING else @@ -4422,7 +4422,7 @@ ReturnCode_t DynamicData::clear_array_data( { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. The kind " << get_kind() << " doesn't support this method"); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DynamicData::insert_int32_value( @@ -4432,7 +4432,7 @@ ReturnCode_t DynamicData::insert_int32_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_INT32) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_int32_value(value, outId); } @@ -4441,7 +4441,7 @@ ReturnCode_t DynamicData::insert_int32_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4452,7 +4452,7 @@ ReturnCode_t DynamicData::insert_uint32_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_UINT32) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_uint32_value(value, outId); } @@ -4461,7 +4461,7 @@ ReturnCode_t DynamicData::insert_uint32_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4472,7 +4472,7 @@ ReturnCode_t DynamicData::insert_int16_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_INT16) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_int16_value(value, outId); } @@ -4481,7 +4481,7 @@ ReturnCode_t DynamicData::insert_int16_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4492,7 +4492,7 @@ ReturnCode_t DynamicData::insert_uint16_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_UINT16) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_uint16_value(value, outId); } @@ -4501,7 +4501,7 @@ ReturnCode_t DynamicData::insert_uint16_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4512,7 +4512,7 @@ ReturnCode_t DynamicData::insert_int64_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_INT64) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_int64_value(value, outId); } @@ -4521,7 +4521,7 @@ ReturnCode_t DynamicData::insert_int64_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4532,7 +4532,7 @@ ReturnCode_t DynamicData::insert_uint64_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_UINT64) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_uint64_value(value, outId); } @@ -4541,7 +4541,7 @@ ReturnCode_t DynamicData::insert_uint64_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4552,7 +4552,7 @@ ReturnCode_t DynamicData::insert_float32_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_FLOAT32) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_float32_value(value, outId); } @@ -4561,7 +4561,7 @@ ReturnCode_t DynamicData::insert_float32_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4572,7 +4572,7 @@ ReturnCode_t DynamicData::insert_float64_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_FLOAT64) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_float64_value(value, outId); } @@ -4581,7 +4581,7 @@ ReturnCode_t DynamicData::insert_float64_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4592,7 +4592,7 @@ ReturnCode_t DynamicData::insert_float128_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_FLOAT128) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_float128_value(value, outId); } @@ -4601,7 +4601,7 @@ ReturnCode_t DynamicData::insert_float128_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4612,7 +4612,7 @@ ReturnCode_t DynamicData::insert_char8_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_CHAR8) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_char8_value(value, outId); } @@ -4621,7 +4621,7 @@ ReturnCode_t DynamicData::insert_char8_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4632,7 +4632,7 @@ ReturnCode_t DynamicData::insert_char16_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_CHAR16) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_char16_value(value, outId); } @@ -4641,7 +4641,7 @@ ReturnCode_t DynamicData::insert_char16_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4652,7 +4652,7 @@ ReturnCode_t DynamicData::insert_byte_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_BYTE) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_byte_value(value, outId); } @@ -4661,7 +4661,7 @@ ReturnCode_t DynamicData::insert_byte_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4672,7 +4672,7 @@ ReturnCode_t DynamicData::insert_bool_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_BOOLEAN) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_bool_value(value, outId); } @@ -4681,7 +4681,7 @@ ReturnCode_t DynamicData::insert_bool_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4692,7 +4692,7 @@ ReturnCode_t DynamicData::insert_string_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_STRING8) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_string_value(value, outId); } @@ -4701,7 +4701,7 @@ ReturnCode_t DynamicData::insert_string_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4712,7 +4712,7 @@ ReturnCode_t DynamicData::insert_wstring_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_STRING16) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_wstring_value(value, outId); } @@ -4721,7 +4721,7 @@ ReturnCode_t DynamicData::insert_wstring_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4732,7 +4732,7 @@ ReturnCode_t DynamicData::insert_enum_value( if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_ENUM) { ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) + if (result == RETCODE_OK) { result = set_enum_value(value, outId); } @@ -4741,7 +4741,7 @@ ReturnCode_t DynamicData::insert_enum_value( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4756,23 +4756,23 @@ ReturnCode_t DynamicData::insert_complex_value( #ifdef DYNAMIC_TYPES_CHECKING outId = static_cast(complex_values_.size()); complex_values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value))); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #else outId = static_cast(values_.size()); values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value))); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4787,23 +4787,23 @@ ReturnCode_t DynamicData::insert_complex_value( #ifdef DYNAMIC_TYPES_CHECKING outId = static_cast(complex_values_.size()); complex_values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value.get()))); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #else outId = static_cast(values_.size()); values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value.get()))); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4818,23 +4818,23 @@ ReturnCode_t DynamicData::insert_complex_value( #ifdef DYNAMIC_TYPES_CHECKING outId = static_cast(complex_values_.size()); complex_values_.insert(std::make_pair(outId, value)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #else outId = static_cast(values_.size()); values_.insert(std::make_pair(outId, value)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4850,25 +4850,25 @@ ReturnCode_t DynamicData::insert_sequence_data( DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); outId = static_cast(complex_values_.size()); complex_values_.insert(std::make_pair(outId, new_element)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #else DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); outId = static_cast(values_.size()); values_.insert(std::make_pair(outId, new_element)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The kind " << get_kind() << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4884,7 +4884,7 @@ ReturnCode_t DynamicData::remove_sequence_data( DynamicDataFactory::get_instance()->delete_data(it->second); complex_values_.erase(it); sort_member_ids(id); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #else auto it = values_.find(id); @@ -4893,17 +4893,17 @@ ReturnCode_t DynamicData::remove_sequence_data( DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); values_.erase(it); sort_member_ids(id); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // ifdef DYNAMIC_TYPES_CHECKING EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. Member not found"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. The current Kind " << get_kind() << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DynamicData::insert_map_data( @@ -4921,7 +4921,7 @@ ReturnCode_t DynamicData::insert_map_data( if (it->second->key_element_ && it->second->equals(key)) { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } outKeyId = static_cast(complex_values_.size()); @@ -4932,14 +4932,14 @@ ReturnCode_t DynamicData::insert_map_data( DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); outValueId = static_cast(complex_values_.size()); complex_values_.insert(std::make_pair(outValueId, new_element)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #else for (auto it = values_.begin(); it != values_.end(); ++it) { if (((DynamicData*)it->second)->key_element_ && ((DynamicData*)it->second)->equals(key)) { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } outKeyId = static_cast(values_.size()); @@ -4950,20 +4950,20 @@ ReturnCode_t DynamicData::insert_map_data( DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); outValueId = static_cast(values_.size()); values_.insert(std::make_pair(outValueId, new_element)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -4984,7 +4984,7 @@ ReturnCode_t DynamicData::insert_map_data( if (it->second->key_element_ && it->second->equals(key)) { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } outKey = static_cast(complex_values_.size()); @@ -4994,14 +4994,14 @@ ReturnCode_t DynamicData::insert_map_data( outValue = static_cast(complex_values_.size()); complex_values_.insert(std::make_pair(outValue, value)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #else for (auto it = values_.begin(); it != values_.end(); ++it) { if (it->second == key) { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } outKey = static_cast(values_.size()); @@ -5011,20 +5011,20 @@ ReturnCode_t DynamicData::insert_map_data( outValue = static_cast(values_.size()); values_.insert(std::make_pair(outValue, value)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -5045,7 +5045,7 @@ ReturnCode_t DynamicData::insert_map_data( if (it->second->key_element_ && it->second->equals(key)) { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } outKey = static_cast(complex_values_.size()); @@ -5056,14 +5056,14 @@ ReturnCode_t DynamicData::insert_map_data( outValue = static_cast(complex_values_.size()); DynamicData* valueCopy = DynamicDataFactory::get_instance()->create_copy(value); complex_values_.insert(std::make_pair(outValue, valueCopy)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #else for (auto it = values_.begin(); it != values_.end(); ++it) { if (it->second == key) { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } outKey = static_cast(values_.size()); @@ -5074,20 +5074,20 @@ ReturnCode_t DynamicData::insert_map_data( outValue = static_cast(values_.size()); DynamicData* valueCopy = DynamicDataFactory::get_instance()->create_copy(value); values_.insert(std::make_pair(outValue, valueCopy)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -5115,7 +5115,7 @@ ReturnCode_t DynamicData::remove_map_data( complex_values_.erase(itKey); complex_values_.erase(itValue); sort_member_ids(keyId); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #else auto itKey = values_.find(keyId); @@ -5127,20 +5127,20 @@ ReturnCode_t DynamicData::remove_map_data( values_.erase(itKey); values_.erase(itValue); sort_member_ids(keyId); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // ifdef DYNAMIC_TYPES_CHECKING else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing from map. Invalid input KeyId"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing from map. The current Kind " << get_kind() << " doesn't support this method"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -5161,13 +5161,13 @@ ReturnCode_t DynamicData::clear_data() } values_.clear(); #endif // ifdef DYNAMIC_TYPES_CHECKING - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } EPROSIMA_LOG_ERROR(DYN_TYPES, "Error clearing data. The current Kind " << get_kind() << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DynamicData::get_complex_value( @@ -5183,23 +5183,23 @@ ReturnCode_t DynamicData::get_complex_value( if (it != complex_values_.end()) { *value = DynamicDataFactory::get_instance()->create_copy(it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #else auto it = values_.find(id); if (it != values_.end()) { *value = DynamicDataFactory::get_instance()->create_copy((DynamicData*)it->second); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error settings complex value. The kind " << get_kind() << "doesn't support it"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -5222,7 +5222,7 @@ ReturnCode_t DynamicData::set_complex_value( if (get_kind() == TK_MAP && it->second->key_element_) { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. They given id is a Key value."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } else { @@ -5242,7 +5242,7 @@ ReturnCode_t DynamicData::set_complex_value( else if (get_kind() == TK_ARRAY) { complex_values_.insert(std::make_pair(id, value)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #else @@ -5252,7 +5252,7 @@ ReturnCode_t DynamicData::set_complex_value( if (get_kind() == TK_MAP && ((DynamicData*)it->second)->key_element_) { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. They given id is a Key value."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } else { @@ -5271,21 +5271,21 @@ ReturnCode_t DynamicData::set_complex_value( else if (get_kind() == TK_ARRAY) { values_.insert(std::make_pair(id, value)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // ifdef DYNAMIC_TYPES_CHECKING } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. id out of bounds."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error settings complex value. The kind " << get_kind() << "doesn't support it"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -5297,18 +5297,18 @@ ReturnCode_t DynamicData::get_union_label( if (union_id_ != MEMBER_ID_INVALID) { value = union_label_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting union label. There isn't any label selected"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting union label. The kind " << get_kind() << "doesn't support it"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } diff --git a/src/cpp/dynamic-types/DynamicDataFactory.cpp b/src/cpp/dynamic-types/DynamicDataFactory.cpp index a33fbd56738..57fcefcb58b 100644 --- a/src/cpp/dynamic-types/DynamicDataFactory.cpp +++ b/src/cpp/dynamic-types/DynamicDataFactory.cpp @@ -50,9 +50,9 @@ ReturnCode_t DynamicDataFactory::delete_instance() { delete s_instance; s_instance = nullptr; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } DynamicDataFactory::DynamicDataFactory() @@ -189,9 +189,9 @@ ReturnCode_t DynamicDataFactory::create_members( { create_members(pData, pType->get_base_type()); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DynamicDataFactory::delete_data( @@ -209,12 +209,12 @@ ReturnCode_t DynamicDataFactory::delete_data( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error deleting DynamicData. It isn't registered in the factory"); - return ReturnCode_t::RETCODE_ALREADY_DELETED; + return RETCODE_ALREADY_DELETED; } #endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK delete pData; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DynamicDataFactory::is_empty() const diff --git a/src/cpp/dynamic-types/DynamicPubSubType.cpp b/src/cpp/dynamic-types/DynamicPubSubType.cpp index 8e6910e8412..64e5d936f91 100644 --- a/src/cpp/dynamic-types/DynamicPubSubType.cpp +++ b/src/cpp/dynamic-types/DynamicPubSubType.cpp @@ -66,12 +66,12 @@ ReturnCode_t DynamicPubSubType::SetDynamicType( { dynamic_type_ = pData->type_; UpdateDynamicTypeInfo(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error Setting the dynamic type. There is already a registered type"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -82,12 +82,12 @@ ReturnCode_t DynamicPubSubType::SetDynamicType( { dynamic_type_ = pType; UpdateDynamicTypeInfo(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error Setting the dynamic type. There is already a registered type"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } diff --git a/src/cpp/dynamic-types/DynamicType.cpp b/src/cpp/dynamic-types/DynamicType.cpp index 5d3db62706e..6fc37c96efb 100644 --- a/src/cpp/dynamic-types/DynamicType.cpp +++ b/src/cpp/dynamic-types/DynamicType.cpp @@ -83,12 +83,12 @@ ReturnCode_t DynamicType::apply_annotation( pNewDescriptor->copy_from(&descriptor); descriptor_->annotation_.push_back(pNewDescriptor); is_key_defined_ = key_annotation(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -111,7 +111,7 @@ ReturnCode_t DynamicType::apply_annotation( descriptor_->annotation_.push_back(pNewDescriptor); is_key_defined_ = key_annotation(); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DynamicType::apply_annotation_to_member( @@ -124,18 +124,18 @@ ReturnCode_t DynamicType::apply_annotation_to_member( if (it != member_by_id_.end()) { it->second->apply_annotation(descriptor); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -149,12 +149,12 @@ ReturnCode_t DynamicType::apply_annotation_to_member( if (it != member_by_id_.end()) { it->second->apply_annotation(annotation_name, key, value); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -196,12 +196,12 @@ ReturnCode_t DynamicType::copy_from_builder( member_by_name_.insert(std::make_pair(newMember->get_name(), newMember)); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicType, invalid input type"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -224,12 +224,12 @@ ReturnCode_t DynamicType::get_descriptor( if (descriptor != nullptr) { descriptor->copy_from(descriptor_); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting TypeDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -334,12 +334,12 @@ ReturnCode_t DynamicType::get_member_by_name( if (it != member_by_name_.end()) { member = it->second; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting member by name, member not found."); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -347,7 +347,7 @@ ReturnCode_t DynamicType::get_all_members_by_name( std::map& members) { members = member_by_name_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DynamicType::get_member( @@ -358,12 +358,12 @@ ReturnCode_t DynamicType::get_member( if (it != member_by_id_.end()) { member = it->second; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting member, member not found."); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -371,7 +371,7 @@ ReturnCode_t DynamicType::get_all_members( std::map& members) { members = member_by_id_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } uint32_t DynamicType::get_annotation_count() @@ -386,12 +386,12 @@ ReturnCode_t DynamicType::get_annotation( if (idx < descriptor_->annotation_.size()) { descriptor = *descriptor_->annotation_[idx]; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting annotation, annotation not found."); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } diff --git a/src/cpp/dynamic-types/DynamicTypeBuilder.cpp b/src/cpp/dynamic-types/DynamicTypeBuilder.cpp index e4c06c29100..c87dbbe14c8 100644 --- a/src/cpp/dynamic-types/DynamicTypeBuilder.cpp +++ b/src/cpp/dynamic-types/DynamicTypeBuilder.cpp @@ -98,7 +98,7 @@ ReturnCode_t DynamicTypeBuilder::add_empty_member( if (index >= descriptor_->get_bounds(0)) { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, out of bounds."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } descriptor.annotation_set_position(static_cast(descriptor.get_index())); } @@ -148,25 +148,25 @@ ReturnCode_t DynamicTypeBuilder::add_member( delete newMember; } ++current_member_id_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, invalid union parameters."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, there is other member with the same name."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, the current type " << descriptor_->get_kind() << " doesn't support members."); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } else @@ -179,7 +179,7 @@ ReturnCode_t DynamicTypeBuilder::add_member( { EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, The input descriptor isn't consistent."); } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -338,7 +338,7 @@ ReturnCode_t DynamicTypeBuilder::copy_from( clear(); ReturnCode_t res = copy_from_builder(other); - if (res == ReturnCode_t::RETCODE_OK) + if (res == RETCODE_OK) { current_member_id_ = other->current_member_id_; } @@ -347,7 +347,7 @@ ReturnCode_t DynamicTypeBuilder::copy_from( else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicTypeBuilder. Invalid input parameter."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -369,12 +369,12 @@ ReturnCode_t DynamicTypeBuilder::copy_from_builder( member_by_name_.insert(std::make_pair(newMember->get_name(), newMember)); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicType, invalid input type"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -414,7 +414,7 @@ ReturnCode_t DynamicTypeBuilder::get_all_members( std::map& members) { members = member_by_id_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } std::string DynamicTypeBuilder::get_name() const @@ -456,7 +456,7 @@ ReturnCode_t DynamicTypeBuilder::set_name( descriptor_->set_name(name); } name_ = name; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DynamicTypeBuilder::_apply_annotation_to_member( @@ -469,18 +469,18 @@ ReturnCode_t DynamicTypeBuilder::_apply_annotation_to_member( if (it != member_by_id_.end()) { it->second->apply_annotation(descriptor); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -494,12 +494,12 @@ ReturnCode_t DynamicTypeBuilder::_apply_annotation_to_member( if (it != member_by_id_.end()) { it->second->apply_annotation(annotation_name, key, value); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } diff --git a/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp b/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp index 5f02c0a0e8c..d4c7fd2bb93 100644 --- a/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp +++ b/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp @@ -113,9 +113,9 @@ ReturnCode_t DynamicTypeBuilderFactory::delete_instance() { delete g_instance; g_instance = nullptr; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } DynamicTypeBuilderFactory::DynamicTypeBuilderFactory() @@ -804,13 +804,13 @@ ReturnCode_t DynamicTypeBuilderFactory::delete_builder( else { EPROSIMA_LOG_WARNING(DYN_TYPES, "The given type has been deleted previously."); - return ReturnCode_t::RETCODE_ALREADY_DELETED; + return RETCODE_ALREADY_DELETED; } #else delete builder; #endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DynamicTypeBuilderFactory::delete_type( @@ -820,7 +820,7 @@ ReturnCode_t DynamicTypeBuilderFactory::delete_type( { delete type; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DynamicType_ptr DynamicTypeBuilderFactory::get_primitive_type( diff --git a/src/cpp/dynamic-types/DynamicTypeMember.cpp b/src/cpp/dynamic-types/DynamicTypeMember.cpp index f2f05085b43..9a39d58ee32 100644 --- a/src/cpp/dynamic-types/DynamicTypeMember.cpp +++ b/src/cpp/dynamic-types/DynamicTypeMember.cpp @@ -97,9 +97,9 @@ ReturnCode_t DynamicTypeMember::get_annotation( if (idx < descriptor_.annotation_.size()) { descriptor.copy_from(descriptor_.annotation_[idx]); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } uint32_t DynamicTypeMember::get_annotation_count() @@ -123,12 +123,12 @@ ReturnCode_t DynamicTypeMember::get_descriptor( if (descriptor != nullptr) { descriptor->copy_from(&descriptor_); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting MemberDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } diff --git a/src/cpp/dynamic-types/MemberDescriptor.cpp b/src/cpp/dynamic-types/MemberDescriptor.cpp index c5f170757d8..e87faf9771b 100644 --- a/src/cpp/dynamic-types/MemberDescriptor.cpp +++ b/src/cpp/dynamic-types/MemberDescriptor.cpp @@ -159,17 +159,17 @@ ReturnCode_t MemberDescriptor::copy_from( index_ = other->index_; default_label_ = other->default_label_; labels_ = other->labels_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } catch (std::exception& /*e*/) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying MemberDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -448,7 +448,7 @@ bool MemberDescriptor::annotation_is_optional() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value == CONST_TRUE; } @@ -471,7 +471,7 @@ bool MemberDescriptor::annotation_get_key() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value == CONST_TRUE; } @@ -485,7 +485,7 @@ bool MemberDescriptor::annotation_is_must_understand() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value == CONST_TRUE; } @@ -499,7 +499,7 @@ bool MemberDescriptor::annotation_is_non_serialized() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value == CONST_TRUE; } @@ -529,7 +529,7 @@ std::string MemberDescriptor::annotation_get_value() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value; } @@ -543,7 +543,7 @@ std::string MemberDescriptor::annotation_get_default() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value; } @@ -557,7 +557,7 @@ uint16_t MemberDescriptor::annotation_get_position() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return static_cast(std::stoi(value)); } @@ -699,7 +699,7 @@ uint16_t MemberDescriptor::annotation_get_bit_bound() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return static_cast(std::stoi(value)); } @@ -730,12 +730,12 @@ ReturnCode_t MemberDescriptor::apply_annotation( AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); pNewDescriptor->copy_from(&descriptor); annotation_.push_back(pNewDescriptor); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -757,7 +757,7 @@ ReturnCode_t MemberDescriptor::apply_annotation( pNewDescriptor->set_value(key, value); annotation_.push_back(pNewDescriptor); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } AnnotationDescriptor* MemberDescriptor::get_annotation( diff --git a/src/cpp/dynamic-types/TypeDescriptor.cpp b/src/cpp/dynamic-types/TypeDescriptor.cpp index 21b7264522c..7b673c5c968 100644 --- a/src/cpp/dynamic-types/TypeDescriptor.cpp +++ b/src/cpp/dynamic-types/TypeDescriptor.cpp @@ -124,17 +124,17 @@ ReturnCode_t TypeDescriptor::copy_from( bound_ = descriptor->bound_; element_type_ = descriptor->element_type_; key_element_type_ = descriptor->key_element_type_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } catch (std::exception& /*e*/) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying TypeDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -330,12 +330,12 @@ ReturnCode_t TypeDescriptor::apply_annotation( AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); pNewDescriptor->copy_from(&descriptor); annotation_.push_back(pNewDescriptor); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -357,7 +357,7 @@ ReturnCode_t TypeDescriptor::apply_annotation( pNewDescriptor->set_value(key, value); annotation_.push_back(pNewDescriptor); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } AnnotationDescriptor* TypeDescriptor::get_annotation( @@ -399,7 +399,7 @@ bool TypeDescriptor::annotation_is_mutable() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value.compare(EXTENSIBILITY_MUTABLE) == 0; } @@ -420,7 +420,7 @@ bool TypeDescriptor::annotation_is_final() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value.compare(EXTENSIBILITY_FINAL) == 0; } @@ -441,7 +441,7 @@ bool TypeDescriptor::annotation_is_appendable() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value.compare(EXTENSIBILITY_APPENDABLE) == 0; } @@ -471,7 +471,7 @@ bool TypeDescriptor::annotation_is_non_serialized() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value == CONST_TRUE; } @@ -486,7 +486,7 @@ std::string TypeDescriptor::annotation_get_extensibility() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value; } @@ -500,7 +500,7 @@ bool TypeDescriptor::annotation_get_nested() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value == CONST_TRUE; } @@ -518,7 +518,7 @@ bool TypeDescriptor::annotation_get_key() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return value == CONST_TRUE; } @@ -532,7 +532,7 @@ uint16_t TypeDescriptor::annotation_get_bit_bound() const if (ann != nullptr) { std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) + if (ann->get_value(value) == RETCODE_OK) { return static_cast(std::stoi(value)); } diff --git a/src/cpp/dynamic-types/TypeObjectFactory.cpp b/src/cpp/dynamic-types/TypeObjectFactory.cpp index 9f24d1dc235..2a06c05c43c 100644 --- a/src/cpp/dynamic-types/TypeObjectFactory.cpp +++ b/src/cpp/dynamic-types/TypeObjectFactory.cpp @@ -62,9 +62,9 @@ ReturnCode_t TypeObjectFactory::delete_instance() { delete g_instance; g_instance = nullptr; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } TypeObjectFactory::TypeObjectFactory() diff --git a/src/cpp/fastdds/core/condition/GuardCondition.cpp b/src/cpp/fastdds/core/condition/GuardCondition.cpp index 43eaa8a7313..5f5fd242c87 100644 --- a/src/cpp/fastdds/core/condition/GuardCondition.cpp +++ b/src/cpp/fastdds/core/condition/GuardCondition.cpp @@ -47,7 +47,7 @@ ReturnCode_t GuardCondition::set_trigger_value( notifier_->notify(); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } // namespace dds diff --git a/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp b/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp index 61f0e6cde2f..623df4f19f3 100644 --- a/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp +++ b/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp @@ -61,7 +61,7 @@ ReturnCode_t StatusConditionImpl::set_enabled_statuses( { notifier_->notify(); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const StatusMask& StatusConditionImpl::get_enabled_statuses() const diff --git a/src/cpp/fastdds/core/condition/WaitSetImpl.cpp b/src/cpp/fastdds/core/condition/WaitSetImpl.cpp index d74115a1d58..cf4053b0bbf 100644 --- a/src/cpp/fastdds/core/condition/WaitSetImpl.cpp +++ b/src/cpp/fastdds/core/condition/WaitSetImpl.cpp @@ -81,7 +81,7 @@ ReturnCode_t WaitSetImpl::attach_condition( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t WaitSetImpl::detach_condition( @@ -99,11 +99,11 @@ ReturnCode_t WaitSetImpl::detach_condition( { // Inform the notifier we are not interested anymore. condition.get_notifier()->detach_from(this); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } // Condition not found - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t WaitSetImpl::wait( @@ -114,7 +114,7 @@ ReturnCode_t WaitSetImpl::wait( if (is_waiting_) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } auto fill_active_conditions = [&]() @@ -146,7 +146,7 @@ ReturnCode_t WaitSetImpl::wait( } is_waiting_ = false; - return condition_value ? ReturnCode_t::RETCODE_OK : ReturnCode_t::RETCODE_TIMEOUT; + return condition_value ? RETCODE_OK : RETCODE_TIMEOUT; } ReturnCode_t WaitSetImpl::get_conditions( @@ -159,7 +159,7 @@ ReturnCode_t WaitSetImpl::get_conditions( { attached_conditions.push_back(const_cast(c)); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void WaitSetImpl::wake_up() diff --git a/src/cpp/fastdds/domain/DomainParticipant.cpp b/src/cpp/fastdds/domain/DomainParticipant.cpp index 693380368af..76c73812d58 100644 --- a/src/cpp/fastdds/domain/DomainParticipant.cpp +++ b/src/cpp/fastdds/domain/DomainParticipant.cpp @@ -91,7 +91,7 @@ ReturnCode_t DomainParticipant::set_listener( const std::chrono::seconds timeout) { ReturnCode_t ret_val = impl_->set_listener(listener, timeout); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -103,12 +103,12 @@ ReturnCode_t DomainParticipant::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } enable_ = true; ReturnCode_t ret_code = impl_->enable(); - enable_ = !!ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -227,7 +227,7 @@ ReturnCode_t DomainParticipant::delete_multitopic( const MultiTopic* a_multitopic) { static_cast (a_multitopic); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::register_content_filter_factory( @@ -278,21 +278,21 @@ ReturnCode_t DomainParticipant::ignore_topic( const InstanceHandle_t& handle) { static_cast (handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::ignore_publication( const InstanceHandle_t& handle) { static_cast (handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::ignore_subscription( const InstanceHandle_t& handle) { static_cast (handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } DomainId_t DomainParticipant::get_domain_id() const @@ -325,7 +325,7 @@ ReturnCode_t DomainParticipant::get_default_publisher_qos( PublisherQos& qos) const { qos = impl_->get_default_publisher_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipant::get_publisher_qos_from_profile( @@ -350,7 +350,7 @@ ReturnCode_t DomainParticipant::get_default_subscriber_qos( SubscriberQos& qos) const { qos = impl_->get_default_subscriber_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipant::get_subscriber_qos_from_profile( @@ -375,7 +375,7 @@ ReturnCode_t DomainParticipant::get_default_topic_qos( TopicQos& qos) const { qos = impl_->get_default_topic_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipant::get_topic_qos_from_profile( @@ -389,7 +389,7 @@ ReturnCode_t DomainParticipant::get_discovered_participants( std::vector& participant_handles) const { static_cast (participant_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::get_discovered_participant_data( @@ -398,14 +398,14 @@ ReturnCode_t DomainParticipant::get_discovered_participant_data( { static_cast (participant_data); static_cast (participant_handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::get_discovered_topics( std::vector& topic_handles) const { static_cast (topic_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::get_discovered_topic_data( @@ -414,7 +414,7 @@ ReturnCode_t DomainParticipant::get_discovered_topic_data( { static_cast (topic_data); static_cast (topic_handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } bool DomainParticipant::contains_entity( diff --git a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp index bb9457b8bd4..dc20851f6cf 100644 --- a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp @@ -119,7 +119,7 @@ ReturnCode_t DomainParticipantFactory::delete_participant( #endif // ifdef FASTDDS_STATISTICS if (part->has_active_entities()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } VectorIt vit = participants_.find(part->get_domain_id()); @@ -146,10 +146,10 @@ ReturnCode_t DomainParticipantFactory::delete_participant( { participants_.erase(vit); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } DomainParticipant* DomainParticipantFactory::create_participant( @@ -190,7 +190,7 @@ DomainParticipant* DomainParticipantFactory::create_participant( if (factory_qos_.entity_factory().autoenable_created_entities) { - if (ReturnCode_t::RETCODE_OK != dom_part->enable()) + if (RETCODE_OK != dom_part->enable()) { delete_participant(dom_part); return nullptr; @@ -282,7 +282,7 @@ ReturnCode_t DomainParticipantFactory::get_default_participant_qos( DomainParticipantQos& qos) const { qos = default_participant_qos_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipantQos& DomainParticipantFactory::get_default_participant_qos() const @@ -296,16 +296,16 @@ ReturnCode_t DomainParticipantFactory::set_default_participant_qos( if (&qos == &PARTICIPANT_QOS_DEFAULT) { reset_default_participant_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = DomainParticipantImpl::check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } DomainParticipantImpl::set_qos(default_participant_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::get_participant_qos_from_profile( @@ -317,10 +317,10 @@ ReturnCode_t DomainParticipantFactory::get_participant_qos_from_profile( { qos = default_participant_qos_; utils::set_qos_from_attributes(qos, attr.rtps); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DomainParticipantFactory::load_profiles() @@ -353,7 +353,7 @@ ReturnCode_t DomainParticipantFactory::load_profiles() RTPSDomain::set_filewatch_thread_config(factory_qos_.file_watch_threads(), factory_qos_.file_watch_threads()); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::load_XML_profiles_file( @@ -362,9 +362,9 @@ ReturnCode_t DomainParticipantFactory::load_XML_profiles_file( if (XMLP_ret::XML_ERROR == XMLProfileManager::loadXMLFile(xml_profile_file)) { EPROSIMA_LOG_ERROR(DOMAIN, "Problem loading XML file '" << xml_profile_file << "'"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::load_XML_profiles_string( @@ -374,9 +374,9 @@ ReturnCode_t DomainParticipantFactory::load_XML_profiles_string( if (XMLP_ret::XML_ERROR == XMLProfileManager::loadXMLString(data, length)) { EPROSIMA_LOG_ERROR(DOMAIN, "Problem loading XML string"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::check_xml_static_discovery( @@ -386,32 +386,32 @@ ReturnCode_t DomainParticipantFactory::check_xml_static_discovery( if (XMLP_ret::XML_OK != parser.loadXMLFile(xml_file)) { EPROSIMA_LOG_ERROR(DOMAIN, "Error parsing xml file"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::get_qos( DomainParticipantFactoryQos& qos) const { qos = factory_qos_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::set_qos( const DomainParticipantFactoryQos& qos) { ReturnCode_t ret_val = check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } if (!can_qos_be_updated(factory_qos_, qos)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(factory_qos_, qos, false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantFactory::reset_default_participant_qos() @@ -443,7 +443,7 @@ ReturnCode_t DomainParticipantFactory::check_qos( { (void) qos; //There is no restriction by the moment with the contained Qos - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DomainParticipantFactory::can_qos_be_updated( diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp index 56e4023b637..2f7cc675ef7 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp @@ -145,7 +145,7 @@ DomainParticipantImpl::DomainParticipantImpl( if (nullptr != property_value && property_value->empty()) { std::string username = "unknown"; - if (ReturnCode_t::RETCODE_OK == SystemInfo::get_username(username)) + if (RETCODE_OK == SystemInfo::get_username(username)) { property_value->assign(username); } @@ -279,7 +279,7 @@ ReturnCode_t DomainParticipantImpl::enable() if (part == nullptr) { EPROSIMA_LOG_ERROR(DOMAIN_PARTICIPANT, "Problem creating RTPSParticipant"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -333,7 +333,7 @@ ReturnCode_t DomainParticipantImpl::enable() part->enable(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantImpl::set_qos( @@ -355,7 +355,7 @@ ReturnCode_t DomainParticipantImpl::set_qos( if (&qos != &PARTICIPANT_QOS_DEFAULT) { ReturnCode_t ret_val = check_qos(qos_to_set); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } @@ -363,7 +363,7 @@ ReturnCode_t DomainParticipantImpl::set_qos( if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } qos_should_be_updated = set_qos(qos_, qos_to_set, !enabled); @@ -387,7 +387,7 @@ ReturnCode_t DomainParticipantImpl::set_qos( rtps_participant->update_attributes(patt); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantImpl::get_qos( @@ -395,7 +395,7 @@ ReturnCode_t DomainParticipantImpl::get_qos( { std::lock_guard _(mtx_gs_); qos = qos_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipantQos& DomainParticipantImpl::get_qos() const @@ -409,7 +409,7 @@ ReturnCode_t DomainParticipantImpl::delete_publisher( { if (get_participant() != pub->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_pubs_); auto pit = publishers_.find(const_cast(pub)); @@ -420,16 +420,16 @@ ReturnCode_t DomainParticipantImpl::delete_publisher( && "The publisher instance handle does not match the publisher implementation instance handle"); if (pub->has_datawriters()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } pit->second->set_listener(nullptr); publishers_by_handle_.erase(publishers_by_handle_.find(pit->second->get_instance_handle())); delete pit->second; publishers_.erase(pit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } ReturnCode_t DomainParticipantImpl::delete_subscriber( @@ -437,7 +437,7 @@ ReturnCode_t DomainParticipantImpl::delete_subscriber( { if (get_participant() != sub->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_subs_); auto sit = subscribers_.find(const_cast(sub)); @@ -448,16 +448,16 @@ ReturnCode_t DomainParticipantImpl::delete_subscriber( && "The subscriber instance handle does not match the subscriber implementation instance handle"); if (sub->has_datareaders()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } sit->second->set_listener(nullptr); subscribers_by_handle_.erase(subscribers_by_handle_.find(sit->second->get_instance_handle())); delete sit->second; subscribers_.erase(sit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } Topic* DomainParticipantImpl::find_topic( @@ -512,7 +512,7 @@ ReturnCode_t DomainParticipantImpl::delete_topic( { if (topic == nullptr) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } std::lock_guard lock(mtx_topics_); @@ -530,7 +530,7 @@ ReturnCode_t DomainParticipantImpl::delete_topic( TopicProxy* proxy = dynamic_cast(topic->get_impl()); assert(nullptr != proxy); auto ret_code = it->second->delete_topic(proxy); - if (ReturnCode_t::RETCODE_OK == ret_code) + if (RETCODE_OK == ret_code) { topics_by_handle_.erase(handle); @@ -544,7 +544,7 @@ ReturnCode_t DomainParticipantImpl::delete_topic( return ret_code; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ContentFilteredTopic* DomainParticipantImpl::create_contentfilteredtopic( @@ -613,7 +613,7 @@ ContentFilteredTopic* DomainParticipantImpl::create_contentfilteredtopic( // Tell filter factory to compile the expression IContentFilter* filter_instance = nullptr; - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != filter_factory->create_content_filter(filter_class_name, related_topic->get_type_name().c_str(), type.get(), filter_expression.c_str(), filter_parameters, filter_instance)) { @@ -641,7 +641,7 @@ ReturnCode_t DomainParticipantImpl::delete_contentfilteredtopic( { if (topic == nullptr) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } std::lock_guard lock(mtx_topics_); @@ -651,13 +651,13 @@ ReturnCode_t DomainParticipantImpl::delete_contentfilteredtopic( { if (it->second->get_impl()->is_referenced()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } filtered_topics_.erase(it); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t DomainParticipantImpl::register_content_filter_factory( @@ -666,18 +666,18 @@ ReturnCode_t DomainParticipantImpl::register_content_filter_factory( { if (nullptr == filter_factory || nullptr == filter_class_name || strlen(filter_class_name) > 255) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } std::lock_guard lock(mtx_topics_); auto it = filter_factories_.find(filter_class_name); if ((it != filter_factories_.end()) || (0 == strcmp(filter_class_name, FASTDDS_SQLFILTER_NAME))) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } filter_factories_[filter_class_name] = filter_factory; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } IContentFilterFactory* DomainParticipantImpl::lookup_content_filter_factory( @@ -702,21 +702,21 @@ ReturnCode_t DomainParticipantImpl::unregister_content_filter_factory( { if (nullptr == filter_class_name) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } std::lock_guard lock(mtx_topics_); auto it = filter_factories_.find(filter_class_name); if ((it == filter_factories_.end()) || (it->first == FASTDDS_SQLFILTER_NAME)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } for (auto& topic : filtered_topics_) { if (topic.second->impl_->filter_property.filter_class_name == filter_class_name) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } @@ -733,7 +733,7 @@ ReturnCode_t DomainParticipantImpl::unregister_content_filter_factory( filter_factories_.erase(it); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } IContentFilterFactory* DomainParticipantImpl::find_content_filter_factory( @@ -777,9 +777,9 @@ Publisher* DomainParticipantImpl::create_publisher( PublisherListener* listener, const StatusMask& mask) { - if (!PublisherImpl::check_qos(qos)) + if (RETCODE_OK != PublisherImpl::check_qos(qos)) { - // The PublisherImpl::check_qos() function is not yet implemented and always returns ReturnCode_t::RETCODE_OK. + // The PublisherImpl::check_qos() function is not yet implemented and always returns RETCODE_OK. // It will be implemented in future releases of Fast DDS. // EPROSIMA_LOG_ERROR(PARTICIPANT, "PublisherQos inconsistent or not supported"); // return nullptr; @@ -806,7 +806,7 @@ Publisher* DomainParticipantImpl::create_publisher( if (enabled && qos_.entity_factory().autoenable_created_entities) { ReturnCode_t ret_publisher_enable = pub->enable(); - assert(ReturnCode_t::RETCODE_OK == ret_publisher_enable); + assert(RETCODE_OK == ret_publisher_enable); (void)ret_publisher_enable; } @@ -853,9 +853,9 @@ PublisherImpl* DomainParticipantImpl::create_publisher_impl( ReturnCode_t DomainParticipantImpl::ignore_participant( const InstanceHandle_t& handle) { - return (nullptr == rtps_participant_) ? ReturnCode_t::RETCODE_NOT_ENABLED : - rtps_participant_->ignore_participant(iHandle2GUID(handle).guidPrefix) ? ReturnCode_t::RETCODE_OK : - ReturnCode_t::RETCODE_BAD_PARAMETER; + return (nullptr == rtps_participant_) ? RETCODE_NOT_ENABLED : + rtps_participant_->ignore_participant(iHandle2GUID(handle).guidPrefix) ? RETCODE_OK : + RETCODE_BAD_PARAMETER; } /* TODO @@ -900,7 +900,7 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() can_be_deleted = subscriber.second->can_be_deleted(); if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } @@ -913,18 +913,18 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() can_be_deleted = publisher.second->can_be_deleted(); if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } - ReturnCode_t ret_code = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret_code = RETCODE_OK; for (auto& subscriber : subscribers_) { ret_code = subscriber.first->delete_contained_entities(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -940,9 +940,9 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() for (auto& publisher : publishers_) { ret_code = publisher.first->delete_contained_entities(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -967,7 +967,7 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() it_topics = topics_.erase(it_topics); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantImpl::assert_liveliness() @@ -975,21 +975,21 @@ ReturnCode_t DomainParticipantImpl::assert_liveliness() fastrtps::rtps::RTPSParticipant* rtps_participant = get_rtps_participant(); if (rtps_participant == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (rtps_participant->wlp() != nullptr) { if (rtps_participant->wlp()->assert_liveliness_manual_by_participant()) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } else { EPROSIMA_LOG_ERROR(PARTICIPANT, "Invalid WLP, cannot assert liveliness of participant"); } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } ReturnCode_t DomainParticipantImpl::set_default_publisher_qos( @@ -998,18 +998,18 @@ ReturnCode_t DomainParticipantImpl::set_default_publisher_qos( if (&qos == &PUBLISHER_QOS_DEFAULT) { reset_default_publisher_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = PublisherImpl::check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { - // The PublisherImpl::check_qos() function is not yet implemented and always returns ReturnCode_t::RETCODE_OK. + // The PublisherImpl::check_qos() function is not yet implemented and always returns RETCODE_OK. // It will be implemented in future releases of Fast DDS. // return ret_val; } PublisherImpl::set_qos(default_pub_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantImpl::reset_default_publisher_qos() @@ -1026,7 +1026,7 @@ const PublisherQos& DomainParticipantImpl::get_default_publisher_qos() const return default_pub_qos_; } -const ReturnCode_t DomainParticipantImpl::get_publisher_qos_from_profile( +ReturnCode_t DomainParticipantImpl::get_publisher_qos_from_profile( const std::string& profile_name, PublisherQos& qos) const { @@ -1035,10 +1035,10 @@ const ReturnCode_t DomainParticipantImpl::get_publisher_qos_from_profile( { qos = default_pub_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DomainParticipantImpl::set_default_subscriber_qos( @@ -1047,17 +1047,17 @@ ReturnCode_t DomainParticipantImpl::set_default_subscriber_qos( if (&qos == &SUBSCRIBER_QOS_DEFAULT) { reset_default_subscriber_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t check_result = SubscriberImpl::check_qos(qos); - if (!check_result) + if (RETCODE_OK != check_result) { - // The SubscriberImpl::check_qos() function is not yet implemented and always returns ReturnCode_t::RETCODE_OK. + // The SubscriberImpl::check_qos() function is not yet implemented and always returns RETCODE_OK. // It will be implemented in future releases of Fast DDS. // return check_result; } SubscriberImpl::set_qos(default_sub_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantImpl::reset_default_subscriber_qos() @@ -1074,7 +1074,7 @@ const SubscriberQos& DomainParticipantImpl::get_default_subscriber_qos() const return default_sub_qos_; } -const ReturnCode_t DomainParticipantImpl::get_subscriber_qos_from_profile( +ReturnCode_t DomainParticipantImpl::get_subscriber_qos_from_profile( const std::string& profile_name, SubscriberQos& qos) const { @@ -1083,10 +1083,10 @@ const ReturnCode_t DomainParticipantImpl::get_subscriber_qos_from_profile( { qos = default_sub_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DomainParticipantImpl::set_default_topic_qos( @@ -1095,17 +1095,17 @@ ReturnCode_t DomainParticipantImpl::set_default_topic_qos( if (&qos == &TOPIC_QOS_DEFAULT) { reset_default_topic_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = TopicImpl::check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } TopicImpl::set_qos(default_topic_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantImpl::reset_default_topic_qos() @@ -1122,7 +1122,7 @@ const TopicQos& DomainParticipantImpl::get_default_topic_qos() const return default_topic_qos_; } -const ReturnCode_t DomainParticipantImpl::get_topic_qos_from_profile( +ReturnCode_t DomainParticipantImpl::get_topic_qos_from_profile( const std::string& profile_name, TopicQos& qos) const { @@ -1131,10 +1131,10 @@ const ReturnCode_t DomainParticipantImpl::get_topic_qos_from_profile( { qos = default_topic_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } /* TODO @@ -1230,7 +1230,7 @@ ReturnCode_t DomainParticipantImpl::get_current_time( current_time.seconds = static_cast(seconds.count()); current_time.nanosec = static_cast(nanos.count()); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } std::vector DomainParticipantImpl::get_participant_names() const @@ -1247,9 +1247,9 @@ Subscriber* DomainParticipantImpl::create_subscriber( SubscriberListener* listener, const StatusMask& mask) { - if (!SubscriberImpl::check_qos(qos)) + if (RETCODE_OK != SubscriberImpl::check_qos(qos)) { - // The SubscriberImpl::check_qos() function is not yet implemented and always returns ReturnCode_t::RETCODE_OK. + // The SubscriberImpl::check_qos() function is not yet implemented and always returns RETCODE_OK. // It will be implemented in future releases of Fast DDS. // EPROSIMA_LOG_ERROR(PARTICIPANT, "SubscriberQos inconsistent or not supported"); // return nullptr; @@ -1278,7 +1278,7 @@ Subscriber* DomainParticipantImpl::create_subscriber( if (enabled && qos_.entity_factory().autoenable_created_entities) { ReturnCode_t ret_subscriber_enable = sub->enable(); - assert(ReturnCode_t::RETCODE_OK == ret_subscriber_enable); + assert(RETCODE_OK == ret_subscriber_enable); (void)ret_subscriber_enable; } @@ -1324,7 +1324,7 @@ Topic* DomainParticipantImpl::create_topic( return nullptr; } - if (!TopicImpl::check_qos_including_resource_limits(qos, type_support)) + if (RETCODE_OK != TopicImpl::check_qos_including_resource_limits(qos, type_support)) { EPROSIMA_LOG_ERROR(PARTICIPANT, "TopicQos inconsistent or not supported"); return nullptr; @@ -1358,7 +1358,7 @@ Topic* DomainParticipantImpl::create_topic( if (enabled && qos_.entity_factory().autoenable_created_entities) { ReturnCode_t ret_topic_enable = topic->enable(); - assert(ReturnCode_t::RETCODE_OK == ret_topic_enable); + assert(RETCODE_OK == ret_topic_enable); (void)ret_topic_enable; } @@ -1428,7 +1428,7 @@ ReturnCode_t DomainParticipantImpl::register_type( if (type_name.size() <= 0) { EPROSIMA_LOG_ERROR(PARTICIPANT, "Registered Type must have a name"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } TypeSupport t = find_type(type_name); @@ -1437,11 +1437,11 @@ ReturnCode_t DomainParticipantImpl::register_type( { if (t == type) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } EPROSIMA_LOG_ERROR(PARTICIPANT, "Another type with the same name '" << type_name << "' is already registered."); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } EPROSIMA_LOG_INFO(PARTICIPANT, "Type " << type_name << " registered."); @@ -1453,7 +1453,7 @@ ReturnCode_t DomainParticipantImpl::register_type( register_dynamic_type_to_factories(type); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DomainParticipantImpl::register_dynamic_type_to_factories( @@ -1507,14 +1507,14 @@ ReturnCode_t DomainParticipantImpl::unregister_type( if (type_name.size() <= 0) { EPROSIMA_LOG_ERROR(PARTICIPANT, "Registered Type must have a name"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } TypeSupport t = find_type(type_name); if (t.empty()) { - return ReturnCode_t::RETCODE_OK; // Not registered, so unregistering complete. + return RETCODE_OK; // Not registered, so unregistering complete. } { @@ -1525,7 +1525,7 @@ ReturnCode_t DomainParticipantImpl::unregister_type( { if (sit.second->type_in_use(type_name)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; // Is in use + return RETCODE_PRECONDITION_NOT_MET; // Is in use } } } @@ -1538,7 +1538,7 @@ ReturnCode_t DomainParticipantImpl::unregister_type( { if (pit.second->type_in_use(type_name)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; // Is in use + return RETCODE_PRECONDITION_NOT_MET; // Is in use } } } @@ -1546,7 +1546,7 @@ ReturnCode_t DomainParticipantImpl::unregister_type( std::lock_guard lock(mtx_types_); types_.erase(type_name); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantImpl::MyRTPSParticipantListener::onParticipantDiscovery( @@ -1712,7 +1712,7 @@ ReturnCode_t DomainParticipantImpl::register_remote_type( if (get_rtps_participant() == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } TypeObjectFactory* factory = TypeObjectFactory::get_instance(); @@ -1801,9 +1801,9 @@ ReturnCode_t DomainParticipantImpl::register_remote_type( // Move the filled vector to the map parent_requests_.emplace(std::make_pair(requestId, std::move(vector))); - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } bool DomainParticipantImpl::check_get_type_request( @@ -1828,7 +1828,7 @@ bool DomainParticipantImpl::check_get_type_request( if (nullptr != dyn_type) { dyn_type->set_name(name); - if (register_dynamic_type(dyn_type) == ReturnCode_t::RETCODE_OK) + if (register_dynamic_type(dyn_type) == RETCODE_OK) { callback(name, dyn_type); remove_parent_request(requestId); @@ -1849,7 +1849,7 @@ bool DomainParticipantImpl::check_get_type_request( if (nullptr != dynamic) { - if (register_dynamic_type(dynamic) == ReturnCode_t::RETCODE_OK) + if (register_dynamic_type(dynamic) == RETCODE_OK) { callback(name, dynamic); remove_parent_request(requestId); @@ -2194,9 +2194,9 @@ fastrtps::types::ReturnCode_t DomainParticipantImpl::check_qos( if (qos.allocation().data_limits.max_user_data == 0 || qos.allocation().data_limits.max_user_data > qos.user_data().getValue().size()) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } bool DomainParticipantImpl::can_qos_be_updated( diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.hpp b/src/cpp/fastdds/domain/DomainParticipantImpl.hpp index 2586b77d737..f6eefadf8f1 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.hpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.hpp @@ -125,12 +125,12 @@ class DomainParticipantImpl return !(rtps_listener_.callback_counter_ > 0); })) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } rtps_listener_.callback_counter_ = (listener == nullptr) ? -1 : 0; listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainParticipantListener* get_listener() const @@ -376,7 +376,7 @@ class DomainParticipantImpl const PublisherQos& get_default_publisher_qos() const; - const ReturnCode_t get_publisher_qos_from_profile( + ReturnCode_t get_publisher_qos_from_profile( const std::string& profile_name, PublisherQos& qos) const; @@ -387,7 +387,7 @@ class DomainParticipantImpl const SubscriberQos& get_default_subscriber_qos() const; - const ReturnCode_t get_subscriber_qos_from_profile( + ReturnCode_t get_subscriber_qos_from_profile( const std::string& profile_name, SubscriberQos& qos) const; @@ -398,7 +398,7 @@ class DomainParticipantImpl const TopicQos& get_default_topic_qos() const; - const ReturnCode_t get_topic_qos_from_profile( + ReturnCode_t get_topic_qos_from_profile( const std::string& profile_name, TopicQos& qos) const; diff --git a/src/cpp/fastdds/publisher/DataWriter.cpp b/src/cpp/fastdds/publisher/DataWriter.cpp index 92e10412200..3d23d222817 100644 --- a/src/cpp/fastdds/publisher/DataWriter.cpp +++ b/src/cpp/fastdds/publisher/DataWriter.cpp @@ -52,16 +52,16 @@ ReturnCode_t DataWriter::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (false == impl_->get_publisher()->is_enabled()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t ret_code = impl_->enable(); - enable_ = ReturnCode_t::RETCODE_OK == ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -114,7 +114,7 @@ ReturnCode_t DataWriter::write_w_timestamp( static_cast (data); static_cast (handle); static_cast (timestamp); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } InstanceHandle_t DataWriter::register_instance( @@ -163,7 +163,7 @@ ReturnCode_t DataWriter::unregister_instance_w_timestamp( static_cast (instance); static_cast (handle); static_cast (timestamp); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DataWriter::get_key_value( @@ -226,7 +226,7 @@ ReturnCode_t DataWriter::get_qos( DataWriterQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriter::set_listener( @@ -240,7 +240,7 @@ ReturnCode_t DataWriter::set_listener( const StatusMask& mask) { ReturnCode_t ret_val = impl_->set_listener(listener); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -304,7 +304,7 @@ ReturnCode_t DataWriter::get_matched_subscription_data( { static_cast (subscription_data); static_cast (subscription_handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_subscription_data(subscription_data, subscription_handle); */ @@ -314,7 +314,7 @@ ReturnCode_t DataWriter::get_matched_subscriptions( std::vector& subscription_handles) const { static_cast (subscription_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_subscription_data(subscription_handles); */ @@ -324,7 +324,7 @@ ReturnCode_t DataWriter::get_matched_subscriptions( std::vector& subscription_handles) const { static_cast (subscription_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_subscription_data(subscription_handles); */ diff --git a/src/cpp/fastdds/publisher/DataWriterImpl.cpp b/src/cpp/fastdds/publisher/DataWriterImpl.cpp index 9a0d43d20a4..8e2a19595b8 100644 --- a/src/cpp/fastdds/publisher/DataWriterImpl.cpp +++ b/src/cpp/fastdds/publisher/DataWriterImpl.cpp @@ -282,7 +282,7 @@ ReturnCode_t DataWriterImpl::enable() } ReturnCode_t ret_code = check_datasharing_compatible(w_att, is_data_sharing_compatible_); - if (ret_code != ReturnCode_t::RETCODE_OK) + if (ret_code != RETCODE_OK) { return ret_code; } @@ -320,14 +320,14 @@ ReturnCode_t DataWriterImpl::enable() if (!change_pool) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Problem creating change pool for associated Writer"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } auto pool = get_payload_pool(); if (!pool) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Problem creating payload pool for associated Writer"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } RTPSWriter* writer = RTPSDomainImpl::create_rtps_writer( @@ -353,7 +353,7 @@ ReturnCode_t DataWriterImpl::enable() if (!pool) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Problem creating payload pool for associated Writer"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } writer = RTPSDomainImpl::create_rtps_writer( @@ -369,7 +369,7 @@ ReturnCode_t DataWriterImpl::enable() { release_payload_pool(); EPROSIMA_LOG_ERROR(DATA_WRITER, "Problem creating associated Writer"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } writer_ = writer; @@ -423,7 +423,7 @@ ReturnCode_t DataWriterImpl::enable() } publisher_->rtps_participant()->registerWriter(writer_, get_topic_attributes(qos_, *topic_, type_), wqos); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DataWriterImpl::disable() @@ -439,10 +439,10 @@ ReturnCode_t DataWriterImpl::check_delete_preconditions() { if (loans_ && !loans_->is_empty()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DataWriterImpl::~DataWriterImpl() @@ -471,20 +471,20 @@ ReturnCode_t DataWriterImpl::loan_sample( // Type should be plain and have space for the representation header if (!type_->is_plain() || SerializedPayload_t::representation_header_size > type_->m_typeSize) { - return ReturnCode_t::RETCODE_ILLEGAL_OPERATION; + return RETCODE_ILLEGAL_OPERATION; } // Writer should be enabled if (nullptr == writer_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } #if HAVE_STRICT_REALTIME std::unique_lock lock(writer_->getMutex(), std::defer_lock); if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else static_cast(max_blocking_time); @@ -499,7 +499,7 @@ ReturnCode_t DataWriterImpl::loan_sample( return size; }, payload)) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } // Leave payload state as if serialization has already been performed @@ -516,7 +516,7 @@ ReturnCode_t DataWriterImpl::loan_sample( { sample = nullptr; return_payload_to_pool(payload); - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } switch (initialization) @@ -543,12 +543,12 @@ ReturnCode_t DataWriterImpl::loan_sample( check_and_remove_loan(sample, payload); return_payload_to_pool(payload); sample = nullptr; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } break; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::discard_loan( @@ -557,13 +557,13 @@ ReturnCode_t DataWriterImpl::discard_loan( // Type should be plain and have space for the representation header if (!type_->is_plain() || SerializedPayload_t::representation_header_size > type_->m_typeSize) { - return ReturnCode_t::RETCODE_ILLEGAL_OPERATION; + return RETCODE_ILLEGAL_OPERATION; } // Writer should be enabled if (nullptr == writer_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } std::lock_guard lock(writer_->getMutex()); @@ -572,14 +572,14 @@ ReturnCode_t DataWriterImpl::discard_loan( PayloadInfo_t payload; if ((nullptr == sample) || !check_and_remove_loan(sample, payload)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } // Return payload to pool return_payload_to_pool(payload); sample = nullptr; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataWriterImpl::write( @@ -591,7 +591,7 @@ bool DataWriterImpl::write( } EPROSIMA_LOG_INFO(DATA_WRITER, "Writing new data"); - return ReturnCode_t::RETCODE_OK == create_new_change(ALIVE, data); + return RETCODE_OK == create_new_change(ALIVE, data); } bool DataWriterImpl::write( @@ -604,7 +604,7 @@ bool DataWriterImpl::write( } EPROSIMA_LOG_INFO(DATA_WRITER, "Writing new data with WriteParams"); - return ReturnCode_t::RETCODE_OK == create_new_change_with_params(ALIVE, data, params); + return RETCODE_OK == create_new_change_with_params(ALIVE, data, params); } ReturnCode_t DataWriterImpl::check_write_preconditions( @@ -614,7 +614,7 @@ ReturnCode_t DataWriterImpl::check_write_preconditions( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (type_.get()->m_isGetKeyDefined) @@ -630,10 +630,10 @@ ReturnCode_t DataWriterImpl::check_write_preconditions( //does not correspond with the instance referred by the data if (handle.isDefined() && handle != instance_handle) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::write( @@ -642,7 +642,7 @@ ReturnCode_t DataWriterImpl::write( { InstanceHandle_t instance_handle; ReturnCode_t ret = check_write_preconditions(data, handle, instance_handle); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { EPROSIMA_LOG_INFO(DATA_WRITER, "Writing new data with Handle"); WriteParams wparams; @@ -658,18 +658,18 @@ ReturnCode_t DataWriterImpl::write_w_timestamp( const fastrtps::Time_t& timestamp) { InstanceHandle_t instance_handle; - ReturnCode_t ret = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret = RETCODE_OK; if (timestamp.is_infinite() || timestamp.seconds < 0) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = check_write_preconditions(data, handle, instance_handle); } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { EPROSIMA_LOG_INFO(DATA_WRITER, "Writing new data with Handle and timestamp"); WriteParams wparams; @@ -687,19 +687,19 @@ ReturnCode_t DataWriterImpl::check_instance_preconditions( { if (nullptr == writer_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (nullptr == data) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data pointer not valid"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (!type_->m_isGetKeyDefined) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Topic is NO_KEY, operation not permitted"); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } instance_handle = handle; @@ -719,11 +719,11 @@ ReturnCode_t DataWriterImpl::check_instance_preconditions( if (handle.isDefined() && instance_handle != handle) { EPROSIMA_LOG_ERROR(DATA_WRITER, "handle differs from data's key."); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } #endif // if !defined(NDEBUG) - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } InstanceHandle_t DataWriterImpl::register_instance( @@ -731,7 +731,7 @@ InstanceHandle_t DataWriterImpl::register_instance( { /// Preconditions InstanceHandle_t instance_handle; - if (ReturnCode_t::RETCODE_OK != check_instance_preconditions(key, HANDLE_NIL, instance_handle)) + if (RETCODE_OK != check_instance_preconditions(key, HANDLE_NIL, instance_handle)) { return HANDLE_NIL; } @@ -747,7 +747,7 @@ InstanceHandle_t DataWriterImpl::register_instance_w_timestamp( /// Preconditions InstanceHandle_t instance_handle; if (timestamp.is_infinite() || timestamp.seconds < 0 || - (ReturnCode_t::RETCODE_OK != check_instance_preconditions(key, HANDLE_NIL, instance_handle))) + (RETCODE_OK != check_instance_preconditions(key, HANDLE_NIL, instance_handle))) { return HANDLE_NIL; } @@ -811,13 +811,13 @@ ReturnCode_t DataWriterImpl::unregister_instance( // Preconditions InstanceHandle_t ih; ReturnCode_t returned_value = check_instance_preconditions(instance, handle, ih); - if (ReturnCode_t::RETCODE_OK == returned_value && !history_.is_key_registered(ih)) + if (RETCODE_OK == returned_value && !history_.is_key_registered(ih)) { - returned_value = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + returned_value = RETCODE_PRECONDITION_NOT_MET; } // Operation - if (ReturnCode_t::RETCODE_OK == returned_value) + if (RETCODE_OK == returned_value) { WriteParams wparams; ChangeKind_t change_kind = unregister_change_kind(dispose, qos_); @@ -835,22 +835,22 @@ ReturnCode_t DataWriterImpl::unregister_instance_w_timestamp( { // Preconditions InstanceHandle_t instance_handle; - ReturnCode_t ret = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret = RETCODE_OK; if (timestamp.is_infinite() || timestamp.seconds < 0) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = check_instance_preconditions(instance, handle, instance_handle); } - if (ReturnCode_t::RETCODE_OK == ret && !history_.is_key_registered(instance_handle)) + if (RETCODE_OK == ret && !history_.is_key_registered(instance_handle)) { - ret = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + ret = RETCODE_PRECONDITION_NOT_MET; } // Operation - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { WriteParams wparams; wparams.source_timestamp(timestamp); @@ -869,18 +869,18 @@ ReturnCode_t DataWriterImpl::get_key_value( if (key_holder == nullptr || !handle.isDefined()) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Key holder pointer not valid"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (!type_->m_isGetKeyDefined) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Topic is NO_KEY, operation not permitted"); - return ReturnCode_t::RETCODE_ILLEGAL_OPERATION; + return RETCODE_ILLEGAL_OPERATION; } if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } // Block lowlevel writer @@ -890,7 +890,7 @@ ReturnCode_t DataWriterImpl::get_key_value( std::unique_lock lock(writer_->getMutex(), std::defer_lock); if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else std::lock_guard lock(writer_->getMutex()); @@ -899,11 +899,11 @@ ReturnCode_t DataWriterImpl::get_key_value( SerializedPayload_t* payload = history_.get_key_value(handle); if (nullptr == payload) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } type_->deserialize(payload, key_holder); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::create_new_change( @@ -922,7 +922,7 @@ ReturnCode_t DataWriterImpl::check_new_change_preconditions( if (data == nullptr) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data pointer not valid"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (change_kind == NOT_ALIVE_UNREGISTERED @@ -932,11 +932,11 @@ ReturnCode_t DataWriterImpl::check_new_change_preconditions( if (!type_->m_isGetKeyDefined) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Topic is NO_KEY, operation not permitted"); - return ReturnCode_t::RETCODE_ILLEGAL_OPERATION; + return RETCODE_ILLEGAL_OPERATION; } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::perform_create_new_change( @@ -953,7 +953,7 @@ ReturnCode_t DataWriterImpl::perform_create_new_change( std::unique_lock lock(writer_->getMutex(), std::defer_lock); if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else std::unique_lock lock(writer_->getMutex()); @@ -965,14 +965,14 @@ ReturnCode_t DataWriterImpl::perform_create_new_change( { if (!get_free_payload_from_pool(type_->getSerializedSizeProvider(data), payload)) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } if ((ALIVE == change_kind) && !type_->serialize(data, &payload.payload, data_representation_)) { EPROSIMA_LOG_WARNING(DATA_WRITER, "Data serialization returned false"); return_payload_to_pool(payload); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -1005,7 +1005,7 @@ ReturnCode_t DataWriterImpl::perform_create_new_change( add_loan(data, payload); } writer_->release_change(ch); - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } if (qos_.deadline().period != c_TimeInfinite) @@ -1037,10 +1037,10 @@ ReturnCode_t DataWriterImpl::perform_create_new_change( lifespan_timer_->restart_timer(); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } ReturnCode_t DataWriterImpl::create_new_change_with_params( @@ -1049,7 +1049,7 @@ ReturnCode_t DataWriterImpl::create_new_change_with_params( WriteParams& wparams) { ReturnCode_t ret_code = check_new_change_preconditions(changeKind, data); - if (!ret_code) + if (RETCODE_OK != ret_code) { return ret_code; } @@ -1074,7 +1074,7 @@ ReturnCode_t DataWriterImpl::create_new_change_with_params( const InstanceHandle_t& handle) { ReturnCode_t ret_code = check_new_change_preconditions(changeKind, data); - if (!ret_code) + if (RETCODE_OK != ret_code) { return ret_code; } @@ -1090,7 +1090,7 @@ bool DataWriterImpl::remove_min_seq_change() ReturnCode_t DataWriterImpl::clear_history( size_t* removed) { - return (history_.removeAllChange(removed) ? ReturnCode_t::RETCODE_OK : ReturnCode_t::RETCODE_ERROR); + return (history_.removeAllChange(removed) ? RETCODE_OK : RETCODE_ERROR); } ReturnCode_t DataWriterImpl::get_sending_locators( @@ -1098,11 +1098,11 @@ ReturnCode_t DataWriterImpl::get_sending_locators( { if (nullptr == writer_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } writer_->getRTPSParticipant()->get_sending_locators(locators); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const GUID_t& DataWriterImpl::guid() const @@ -1136,7 +1136,7 @@ ReturnCode_t DataWriterImpl::set_qos( if (&qos != &DATAWRITER_QOS_DEFAULT) { ReturnCode_t ret_val = check_qos_including_resource_limits(qos_to_set, type_); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } @@ -1145,13 +1145,13 @@ ReturnCode_t DataWriterImpl::set_qos( publisher_->get_participant()->get_qos().allocation().data_limits.max_user_data < qos_to_set.user_data().getValue().size()) { - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } } if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos_to_set, !enabled); @@ -1199,7 +1199,7 @@ ReturnCode_t DataWriterImpl::set_qos( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataWriterQos& DataWriterImpl::get_qos() const @@ -1212,7 +1212,7 @@ ReturnCode_t DataWriterImpl::set_listener( { std::lock_guard scoped_lock(listener_mutex_); listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataWriterListener* DataWriterImpl::get_listener() const @@ -1241,7 +1241,7 @@ void DataWriterImpl::InnerDataWriterListener::onWriterMatched( if (listener != nullptr) { PublicationMatchedStatus callback_status; - if (ReturnCode_t::RETCODE_OK == data_writer_->get_publication_matched_status(callback_status)) + if (RETCODE_OK == data_writer_->get_publication_matched_status(callback_status)) { listener->on_publication_matched(data_writer_->user_datawriter_, callback_status); } @@ -1259,7 +1259,7 @@ void DataWriterImpl::InnerDataWriterListener::on_offered_incompatible_qos( if (listener != nullptr) { OfferedIncompatibleQosStatus callback_status; - if (data_writer_->get_offered_incompatible_qos_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_writer_->get_offered_incompatible_qos_status(callback_status) == RETCODE_OK) { listener->on_offered_incompatible_qos(data_writer_->user_datawriter_, callback_status); } @@ -1298,7 +1298,7 @@ void DataWriterImpl::InnerDataWriterListener::on_liveliness_lost( if (listener != nullptr) { LivelinessLostStatus callback_status; - if (ReturnCode_t::RETCODE_OK == data_writer_->get_liveliness_lost_status(callback_status)) + if (RETCODE_OK == data_writer_->get_liveliness_lost_status(callback_status)) { listener->on_liveliness_lost(data_writer_->user_datawriter_, callback_status); } @@ -1357,14 +1357,14 @@ ReturnCode_t DataWriterImpl::wait_for_acknowledgments( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (writer_->wait_for_all_acked(max_wait)) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } ReturnCode_t DataWriterImpl::wait_for_acknowledgments( @@ -1375,7 +1375,7 @@ ReturnCode_t DataWriterImpl::wait_for_acknowledgments( // Preconditions InstanceHandle_t ih; ReturnCode_t returned_value = check_instance_preconditions(instance, handle, ih); - if (ReturnCode_t::RETCODE_OK != returned_value) + if (RETCODE_OK != returned_value) { return returned_value; } @@ -1388,7 +1388,7 @@ ReturnCode_t DataWriterImpl::wait_for_acknowledgments( std::unique_lock lock(writer_->getMutex(), std::defer_lock); if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else std::unique_lock lock(writer_->getMutex()); @@ -1396,15 +1396,15 @@ ReturnCode_t DataWriterImpl::wait_for_acknowledgments( if (!history_.is_key_registered(ih)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } if (history_.wait_for_acknowledgement_last_change(ih, lock, max_blocking_time)) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } void DataWriterImpl::update_publication_matched_status( @@ -1426,7 +1426,7 @@ ReturnCode_t DataWriterImpl::get_publication_matched_status( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1438,7 +1438,7 @@ ReturnCode_t DataWriterImpl::get_publication_matched_status( } user_datawriter_->get_statuscondition().get_impl()->set_status(StatusMask::publication_matched(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataWriterImpl::deadline_timer_reschedule() @@ -1497,7 +1497,7 @@ ReturnCode_t DataWriterImpl::get_offered_deadline_missed_status( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1508,7 +1508,7 @@ ReturnCode_t DataWriterImpl::get_offered_deadline_missed_status( } user_datawriter_->get_statuscondition().get_impl()->set_status(StatusMask::offered_deadline_missed(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::get_offered_incompatible_qos_status( @@ -1516,7 +1516,7 @@ ReturnCode_t DataWriterImpl::get_offered_incompatible_qos_status( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1527,7 +1527,7 @@ ReturnCode_t DataWriterImpl::get_offered_incompatible_qos_status( } user_datawriter_->get_statuscondition().get_impl()->set_status(StatusMask::offered_incompatible_qos(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataWriterImpl::lifespan_expired() @@ -1577,7 +1577,7 @@ ReturnCode_t DataWriterImpl::get_liveliness_lost_status( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1588,14 +1588,14 @@ ReturnCode_t DataWriterImpl::get_liveliness_lost_status( } user_datawriter_->get_statuscondition().get_impl()->set_status(StatusMask::liveliness_lost(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::assert_liveliness() { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (!publisher_->rtps_participant()->wlp()->assert_liveliness( @@ -1604,7 +1604,7 @@ ReturnCode_t DataWriterImpl::assert_liveliness() writer_->get_liveliness_lease_duration())) { EPROSIMA_LOG_ERROR(DATAWRITER, "Could not assert liveliness of writer " << writer_->getGuid()); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } if (qos_.liveliness().kind == MANUAL_BY_TOPIC_LIVELINESS_QOS) @@ -1619,7 +1619,7 @@ ReturnCode_t DataWriterImpl::assert_liveliness() stateful_writer->send_periodic_heartbeat(true, true); } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } fastrtps::TopicAttributes DataWriterImpl::get_topic_attributes( @@ -1816,7 +1816,7 @@ ReturnCode_t DataWriterImpl::check_qos_including_resource_limits( const TypeSupport& type) { ReturnCode_t check_qos_return = check_qos(qos); - if (ReturnCode_t::RETCODE_OK == check_qos_return && + if (RETCODE_OK == check_qos_return && type->m_isGetKeyDefined) { check_qos_return = check_allocation_consistency(qos); @@ -1830,17 +1830,17 @@ ReturnCode_t DataWriterImpl::check_qos( if (qos.durability().kind == PERSISTENT_DURABILITY_QOS) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "PERSISTENT Durability not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (qos.destination_order().kind == BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "BY SOURCE TIMESTAMP DestinationOrder not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (nullptr != PropertyPolicyHelper::find_property(qos.properties(), "fastdds.unique_network_flows")) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "Unique network flows not supported on writers"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } bool is_pull_mode = qos_has_pull_mode_request(qos); if (is_pull_mode) @@ -1848,12 +1848,12 @@ ReturnCode_t DataWriterImpl::check_qos( if (BEST_EFFORT_RELIABILITY_QOS == qos.reliability().kind) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "BEST_EFFORT incompatible with pull mode"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if (c_TimeInfinite == qos.reliable_writer_qos().times.heartbeatPeriod) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "Infinite heartbeat period incompatible with pull mode"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } } if (qos.liveliness().kind == AUTOMATIC_LIVELINESS_QOS || @@ -1863,7 +1863,7 @@ ReturnCode_t DataWriterImpl::check_qos( qos.liveliness().lease_duration <= qos.liveliness().announcement_period) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "WRITERQOS: LeaseDuration <= announcement period."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } } if (qos.data_sharing().kind() == DataSharingKind::ON && @@ -1871,9 +1871,9 @@ ReturnCode_t DataWriterImpl::check_qos( qos.endpoint().history_memory_policy != PREALLOCATED_WITH_REALLOC_MEMORY_MODE)) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "DATA_SHARING cannot be used with memory policies other than PREALLOCATED."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::check_allocation_consistency( @@ -1885,16 +1885,16 @@ ReturnCode_t DataWriterImpl::check_allocation_consistency( { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be greater than max_instances * max_samples_per_instance"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if ((qos.resource_limits().max_instances <= 0 || qos.resource_limits().max_samples_per_instance <= 0) && (qos.resource_limits().max_samples > 0)) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be infinite when max_instances or max_samples_per_instance are infinite"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataWriterImpl::can_qos_be_updated( @@ -2097,19 +2097,19 @@ ReturnCode_t DataWriterImpl::check_datasharing_compatible( switch (qos_.data_sharing().kind()) { case DataSharingKind::OFF: - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; case DataSharingKind::ON: if (is_custom_payload_pool_) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Custom payload pool detected. Cannot force Data sharing usage."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } #if HAVE_SECURITY if (has_security_enabled) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data sharing cannot be used with security protection."); - return ReturnCode_t::RETCODE_NOT_ALLOWED_BY_SECURITY; + return RETCODE_NOT_ALLOWED_BY_SECURITY; } #endif // HAVE_SECURITY @@ -2117,29 +2117,29 @@ ReturnCode_t DataWriterImpl::check_datasharing_compatible( { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data sharing cannot be used with " << (type_.is_bounded() ? "memory policies other than PREALLOCATED" : "unbounded data types")); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (has_key) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data sharing cannot be used with keyed data types"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } is_datasharing_compatible = true; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; case DataSharingKind::AUTO: if (is_custom_payload_pool_) { EPROSIMA_LOG_INFO(DATA_WRITER, "Custom payload pool detected. Data Sharing disabled."); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #if HAVE_SECURITY if (has_security_enabled) { EPROSIMA_LOG_INFO(DATA_WRITER, "Data sharing disabled due to security configuration."); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // HAVE_SECURITY @@ -2147,21 +2147,21 @@ ReturnCode_t DataWriterImpl::check_datasharing_compatible( { EPROSIMA_LOG_INFO(DATA_WRITER, "Data sharing disabled because " << (type_.is_bounded() ? "memory policy is not PREALLOCATED" : "data type is not bounded")); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (has_key) { EPROSIMA_LOG_INFO(DATA_WRITER, "Data sharing disabled because data type is keyed"); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } is_datasharing_compatible = true; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; default: EPROSIMA_LOG_ERROR(DATA_WRITER, "Unknown data sharing kind."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } diff --git a/src/cpp/fastdds/publisher/Publisher.cpp b/src/cpp/fastdds/publisher/Publisher.cpp index 0cc285cd0ff..12abd7ce50a 100644 --- a/src/cpp/fastdds/publisher/Publisher.cpp +++ b/src/cpp/fastdds/publisher/Publisher.cpp @@ -52,17 +52,17 @@ ReturnCode_t Publisher::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (false == impl_->get_participant()->is_enabled()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } enable_ = true; ReturnCode_t ret_code = impl_->enable(); - enable_ = ReturnCode_t::RETCODE_OK == ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -75,7 +75,7 @@ ReturnCode_t Publisher::get_qos( PublisherQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Publisher::set_qos( @@ -100,7 +100,7 @@ ReturnCode_t Publisher::set_listener( const StatusMask& mask) { ReturnCode_t ret_val = impl_->set_listener(listener); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -142,7 +142,7 @@ DataWriter* Publisher::lookup_datawriter( ReturnCode_t Publisher::suspend_publications() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->suspend_publications(); */ @@ -150,7 +150,7 @@ ReturnCode_t Publisher::suspend_publications() ReturnCode_t Publisher::resume_publications() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->resume_publications(); */ @@ -158,7 +158,7 @@ ReturnCode_t Publisher::resume_publications() ReturnCode_t Publisher::begin_coherent_changes() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->begin_coherent_changes(); */ @@ -166,7 +166,7 @@ ReturnCode_t Publisher::begin_coherent_changes() ReturnCode_t Publisher::end_coherent_changes() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->end_coherent_changes(); */ @@ -203,7 +203,7 @@ ReturnCode_t Publisher::get_default_datawriter_qos( DataWriterQos& qos) const { qos = impl_->get_default_datawriter_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Publisher::copy_from_topic_qos( @@ -212,7 +212,7 @@ ReturnCode_t Publisher::copy_from_topic_qos( { static_cast (writer_qos); static_cast (topic_qos); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->copy_from_topic_qos(writer_qos, topic_qos); */ diff --git a/src/cpp/fastdds/publisher/PublisherImpl.cpp b/src/cpp/fastdds/publisher/PublisherImpl.cpp index e4cfb15900a..1a0ed61a6ca 100644 --- a/src/cpp/fastdds/publisher/PublisherImpl.cpp +++ b/src/cpp/fastdds/publisher/PublisherImpl.cpp @@ -85,7 +85,7 @@ ReturnCode_t PublisherImpl::enable() } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void PublisherImpl::disable() @@ -137,7 +137,7 @@ ReturnCode_t PublisherImpl::set_qos( if (&qos != &PUBLISHER_QOS_DEFAULT) { ReturnCode_t ret_val = check_qos(qos_to_set); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } @@ -145,7 +145,7 @@ ReturnCode_t PublisherImpl::set_qos( if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos_to_set, !enabled); @@ -161,7 +161,7 @@ ReturnCode_t PublisherImpl::set_qos( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const PublisherListener* PublisherImpl::get_listener() const @@ -173,7 +173,7 @@ ReturnCode_t PublisherImpl::set_listener( PublisherListener* listener) { listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void PublisherImpl::PublisherWriterListener::on_publication_matched( @@ -235,7 +235,7 @@ DataWriter* PublisherImpl::create_datawriter( return nullptr; } - if (!DataWriterImpl::check_qos_including_resource_limits(qos, type_support)) + if (RETCODE_OK != DataWriterImpl::check_qos_including_resource_limits(qos, type_support)) { return nullptr; } @@ -261,7 +261,7 @@ DataWriter* PublisherImpl::create_datawriter( if (user_publisher_->is_enabled() && qos_.entity_factory().autoenable_created_entities) { - if (ReturnCode_t::RETCODE_OK != writer->enable()) + if (RETCODE_OK != writer->enable()) { delete_datawriter(writer); return nullptr; @@ -295,7 +295,7 @@ ReturnCode_t PublisherImpl::delete_datawriter( { if (user_publisher_ != writer->get_publisher()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::unique_lock lock(mtx_writers_); auto vit = writers_.find(writer->get_topic()->get_name()); @@ -307,7 +307,7 @@ ReturnCode_t PublisherImpl::delete_datawriter( //First extract the writer from the maps to free the mutex DataWriterImpl* writer_impl = *dw_it; ReturnCode_t ret_code = writer_impl->check_delete_preconditions(); - if (!ret_code) + if (RETCODE_OK != ret_code) { return ret_code; } @@ -322,10 +322,10 @@ ReturnCode_t PublisherImpl::delete_datawriter( //Now we can delete it writer_impl->get_topic()->get_impl()->dereference(); delete (writer_impl); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } DataWriter* PublisherImpl::lookup_datawriter( @@ -420,16 +420,16 @@ ReturnCode_t PublisherImpl::set_default_datawriter_qos( if (&qos == &DATAWRITER_QOS_DEFAULT) { reset_default_datawriter_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = DataWriterImpl::check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } DataWriterImpl::set_qos(default_datawriter_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void PublisherImpl::reset_default_datawriter_qos() @@ -446,7 +446,7 @@ const DataWriterQos& PublisherImpl::get_default_datawriter_qos() const return default_datawriter_qos_; } -const ReturnCode_t PublisherImpl::get_datawriter_qos_from_profile( +ReturnCode_t PublisherImpl::get_datawriter_qos_from_profile( const std::string& profile_name, DataWriterQos& qos) const { @@ -455,10 +455,10 @@ const ReturnCode_t PublisherImpl::get_datawriter_qos_from_profile( { qos = default_datawriter_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } /* TODO @@ -482,20 +482,20 @@ ReturnCode_t PublisherImpl::wait_for_acknowledgments( for (DataWriterImpl* dw : vit.second) { participant_->get_current_time(begin); - if (!dw->wait_for_acknowledgments(current)) + if (RETCODE_OK != dw->wait_for_acknowledgments(current)) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } // Check ellapsed time and decrement participant_->get_current_time(end); current = current - (end - begin); if (current < fastrtps::c_TimeZero) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipant* PublisherImpl::get_participant() const @@ -511,7 +511,7 @@ const Publisher* PublisherImpl::get_publisher() const ReturnCode_t PublisherImpl::delete_contained_entities() { // Let's be optimistic - ReturnCode_t result = ReturnCode_t::RETCODE_OK; + ReturnCode_t result = RETCODE_OK; bool can_be_deleted = true; @@ -520,10 +520,10 @@ ReturnCode_t PublisherImpl::delete_contained_entities() { for (DataWriterImpl* dw: writer.second) { - can_be_deleted = dw->check_delete_preconditions() == ReturnCode_t::RETCODE_OK; + can_be_deleted = dw->check_delete_preconditions() == RETCODE_OK; if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } @@ -536,9 +536,9 @@ ReturnCode_t PublisherImpl::delete_contained_entities() auto it = writer_iterator->second.begin(); DataWriterImpl* writer_impl = *it; ReturnCode_t ret_code = writer_impl->check_delete_preconditions(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } writer_impl->set_listener(nullptr); it = writer_iterator->second.erase(it); @@ -562,7 +562,7 @@ bool PublisherImpl::can_be_deleted() { for (DataWriterImpl* dw : topic_writers.second) { - can_be_deleted = can_be_deleted && (dw->check_delete_preconditions() == ReturnCode_t::RETCODE_OK); + can_be_deleted = can_be_deleted && (dw->check_delete_preconditions() == RETCODE_OK); if (!can_be_deleted) { return can_be_deleted; @@ -625,7 +625,7 @@ ReturnCode_t PublisherImpl::check_qos( const PublisherQos& qos) { (void) qos; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool PublisherImpl::can_qos_be_updated( diff --git a/src/cpp/fastdds/publisher/PublisherImpl.hpp b/src/cpp/fastdds/publisher/PublisherImpl.hpp index deed3110d5b..d71965d66cf 100644 --- a/src/cpp/fastdds/publisher/PublisherImpl.hpp +++ b/src/cpp/fastdds/publisher/PublisherImpl.hpp @@ -169,7 +169,7 @@ class PublisherImpl const DataWriterQos& get_default_datawriter_qos() const; - const ReturnCode_t get_datawriter_qos_from_profile( + ReturnCode_t get_datawriter_qos_from_profile( const std::string& profile_name, DataWriterQos& qos) const; diff --git a/src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp b/src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp index a1c6684f42b..7872722c1ee 100644 --- a/src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp +++ b/src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp @@ -309,7 +309,7 @@ class ReaderFilterCollection filter_parameters, new_filter); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { return false; } diff --git a/src/cpp/fastdds/subscriber/DataReader.cpp b/src/cpp/fastdds/subscriber/DataReader.cpp index fecd31a07e1..93defebd8a0 100644 --- a/src/cpp/fastdds/subscriber/DataReader.cpp +++ b/src/cpp/fastdds/subscriber/DataReader.cpp @@ -59,16 +59,16 @@ ReturnCode_t DataReader::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (false == impl_->get_subscriber()->is_enabled()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t ret_code = impl_->enable(); - enable_ = ReturnCode_t::RETCODE_OK == ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -97,7 +97,7 @@ ReturnCode_t DataReader::read_w_condition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } return read( @@ -144,7 +144,7 @@ ReturnCode_t DataReader::read_next_instance_w_condition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } return read_next_instance( @@ -176,7 +176,7 @@ ReturnCode_t DataReader::take_w_condition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } return take( @@ -223,7 +223,7 @@ ReturnCode_t DataReader::take_next_instance_w_condition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } return take_next_instance( @@ -249,7 +249,7 @@ ReturnCode_t DataReader::get_key_value( { static_cast (key_holder); static_cast (handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } InstanceHandle_t DataReader::lookup_instance( @@ -319,7 +319,7 @@ ReturnCode_t DataReader::get_qos( DataReaderQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReader::get_requested_deadline_missed_status( @@ -345,7 +345,7 @@ ReturnCode_t DataReader::set_listener( const StatusMask& mask) { ReturnCode_t ret_val = impl_->set_listener(listener); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -397,7 +397,7 @@ ReturnCode_t DataReader::get_matched_publication_data( { static_cast (publication_data); static_cast (publication_handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_publication_data(publication_data, publication_handle); */ @@ -407,7 +407,7 @@ ReturnCode_t DataReader::get_matched_publications( std::vector& publication_handles) const { static_cast (publication_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_publication_data(publication_handles); */ @@ -460,7 +460,7 @@ ReturnCode_t DataReader::wait_for_historical_data( const Duration_t& max_wait) const { static_cast (max_wait); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->wait_for_historical_data(a_condition); */ diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl.cpp b/src/cpp/fastdds/subscriber/DataReaderImpl.cpp index 29e41e9935f..6a0be056a9e 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl.cpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl.cpp @@ -197,7 +197,7 @@ ReturnCode_t DataReaderImpl::enable() bool is_datasharing_compatible = false; ReturnCode_t ret_code = check_datasharing_compatible(att, is_datasharing_compatible); - if (ret_code != ReturnCode_t::RETCODE_OK) + if (ret_code != RETCODE_OK) { return ret_code; } @@ -229,7 +229,7 @@ ReturnCode_t DataReaderImpl::enable() { release_payload_pool(); EPROSIMA_LOG_ERROR(DATA_READER, "Problem creating associated Reader"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } auto content_topic = dynamic_cast(topic_->get_impl()); @@ -285,10 +285,10 @@ ReturnCode_t DataReaderImpl::enable() reader_->setListener(nullptr); stop(); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DataReaderImpl::disable() @@ -384,7 +384,7 @@ ReturnCode_t DataReaderImpl::check_collection_preconditions_and_calc_max_samples // Properties should be the same on both collections if (!collections_have_same_properties(data_values, sample_infos)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } // Check if a loan is required @@ -393,7 +393,7 @@ ReturnCode_t DataReaderImpl::check_collection_preconditions_and_calc_max_samples // Loan not required, input collections should not be already loaned if (false == data_values.has_ownership()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } int32_t collection_max = data_values.maximum(); @@ -408,7 +408,7 @@ ReturnCode_t DataReaderImpl::check_collection_preconditions_and_calc_max_samples { if (max_samples > collection_max) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } @@ -419,7 +419,7 @@ ReturnCode_t DataReaderImpl::check_collection_preconditions_and_calc_max_samples max_samples = qos_.reader_resource_limits().max_samples_per_read; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::prepare_loan( @@ -430,7 +430,7 @@ ReturnCode_t DataReaderImpl::prepare_loan( if (0 < data_values.maximum()) { // A loan was not requested - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (max_samples > 0) @@ -439,7 +439,7 @@ ReturnCode_t DataReaderImpl::prepare_loan( size_t num_infos = sample_info_pool_.num_allocated(); if (num_infos == qos_.reader_resource_limits().sample_infos_allocation.maximum) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } // Limit max_samples to available sample_infos @@ -462,7 +462,7 @@ ReturnCode_t DataReaderImpl::prepare_loan( } if (num_samples == max_resource_samples) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } // Limit max_samples to available samples @@ -476,12 +476,12 @@ ReturnCode_t DataReaderImpl::prepare_loan( // Check if there are enough loans ReturnCode_t code = loan_manager_.get_loan(data_values, sample_infos); - if (!code) + if (RETCODE_OK != code) { return code; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::read_or_take( @@ -498,11 +498,11 @@ ReturnCode_t DataReaderImpl::read_or_take( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } ReturnCode_t code = check_collection_preconditions_and_calc_max_samples(data_values, sample_infos, max_samples); - if (!code) + if (RETCODE_OK != code) { return code; } @@ -514,7 +514,7 @@ ReturnCode_t DataReaderImpl::read_or_take( if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else std::lock_guard _(reader_->getMutex()); @@ -527,16 +527,16 @@ ReturnCode_t DataReaderImpl::read_or_take( { if (exact_instance && !history_.is_instance_present(handle)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } else { - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } } code = prepare_loan(data_values, sample_infos, max_samples); - if (!code) + if (RETCODE_OK != code) { return code; } @@ -647,26 +647,26 @@ ReturnCode_t DataReaderImpl::return_loan( if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } // Properties should be the same on both collections if (!collections_have_same_properties(data_values, sample_infos)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } // They should have a loan if (data_values.has_ownership() == true) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(reader_->getMutex()); // Check if they were loaned by this reader ReturnCode_t code = loan_manager_.return_loan(data_values, sample_infos); - if (!code) + if (RETCODE_OK != code) { return code; } @@ -687,7 +687,7 @@ ReturnCode_t DataReaderImpl::return_loan( data_values.unloan(); sample_infos.unloan(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::read_or_take_next_sample( @@ -697,12 +697,12 @@ ReturnCode_t DataReaderImpl::read_or_take_next_sample( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (history_.getHistorySize() == 0) { - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } #if HAVE_STRICT_REALTIME @@ -712,7 +712,7 @@ ReturnCode_t DataReaderImpl::read_or_take_next_sample( if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else @@ -724,7 +724,7 @@ ReturnCode_t DataReaderImpl::read_or_take_next_sample( auto it = history_.lookup_available_instance(HANDLE_NIL, false); if (!it.first) { - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } StackAllocatedSequence data_values; @@ -739,7 +739,7 @@ ReturnCode_t DataReaderImpl::read_or_take_next_sample( } ReturnCode_t code = cmd.return_value(); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { *info = sample_infos[0]; } @@ -768,14 +768,14 @@ ReturnCode_t DataReaderImpl::get_first_untaken_info( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (history_.get_first_untaken_info(*info)) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } uint64_t DataReaderImpl::get_unread_count( @@ -834,11 +834,11 @@ ReturnCode_t DataReaderImpl::set_qos( subscriber_->get_participant()->get_qos().allocation().data_limits.max_user_data < qos_to_set.user_data().getValue().size()) { - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } ReturnCode_t check_result = check_qos_including_resource_limits(qos_to_set, type_); - if (!check_result) + if (RETCODE_OK != check_result) { return check_result; } @@ -846,7 +846,7 @@ ReturnCode_t DataReaderImpl::set_qos( if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos_to_set, !enabled); @@ -880,7 +880,7 @@ ReturnCode_t DataReaderImpl::set_qos( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataReaderQos& DataReaderImpl::get_qos() const @@ -933,7 +933,7 @@ void DataReaderImpl::InnerDataReaderListener::onReaderMatched( if (listener != nullptr) { SubscriptionMatchedStatus callback_status; - if (ReturnCode_t::RETCODE_OK == data_reader_->get_subscription_matched_status(callback_status)) + if (RETCODE_OK == data_reader_->get_subscription_matched_status(callback_status)) { listener->on_subscription_matched(data_reader_->user_datareader_, callback_status); } @@ -951,7 +951,7 @@ void DataReaderImpl::InnerDataReaderListener::on_liveliness_changed( if (listener != nullptr) { LivelinessChangedStatus callback_status; - if (data_reader_->get_liveliness_changed_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_reader_->get_liveliness_changed_status(callback_status) == RETCODE_OK) { listener->on_liveliness_changed(data_reader_->user_datareader_, callback_status); } @@ -974,7 +974,7 @@ void DataReaderImpl::InnerDataReaderListener::on_requested_incompatible_qos( if (listener != nullptr) { RequestedIncompatibleQosStatus callback_status; - if (data_reader_->get_requested_incompatible_qos_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_reader_->get_requested_incompatible_qos_status(callback_status) == RETCODE_OK) { listener->on_requested_incompatible_qos(data_reader_->user_datareader_, callback_status); } @@ -997,7 +997,7 @@ void DataReaderImpl::InnerDataReaderListener::on_sample_lost( if (listener != nullptr) { SampleLostStatus callback_status; - if (data_reader_->get_sample_lost_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_reader_->get_sample_lost_status(callback_status) == RETCODE_OK) { listener->on_sample_lost(data_reader_->user_datareader_, callback_status); } @@ -1021,7 +1021,7 @@ void DataReaderImpl::InnerDataReaderListener::on_sample_rejected( if (listener != nullptr) { SampleRejectedStatus callback_status; - if (data_reader_->get_sample_rejected_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_reader_->get_sample_rejected_status(callback_status) == RETCODE_OK) { listener->on_sample_rejected(data_reader_->user_datareader_, callback_status); } @@ -1165,7 +1165,7 @@ ReturnCode_t DataReaderImpl::get_subscription_matched_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1177,7 +1177,7 @@ ReturnCode_t DataReaderImpl::get_subscription_matched_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::subscription_matched(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataReaderImpl::deadline_timer_reschedule() @@ -1236,7 +1236,7 @@ ReturnCode_t DataReaderImpl::get_requested_deadline_missed_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1247,7 +1247,7 @@ ReturnCode_t DataReaderImpl::get_requested_deadline_missed_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::requested_deadline_missed(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataReaderImpl::lifespan_expired() @@ -1299,7 +1299,7 @@ ReturnCode_t DataReaderImpl::set_listener( { std::lock_guard _(listener_mutex_); listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataReaderListener* DataReaderImpl::get_listener() const @@ -1325,7 +1325,7 @@ ReturnCode_t DataReaderImpl::get_liveliness_changed_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1337,7 +1337,7 @@ ReturnCode_t DataReaderImpl::get_liveliness_changed_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::liveliness_changed(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::get_requested_incompatible_qos_status( @@ -1345,7 +1345,7 @@ ReturnCode_t DataReaderImpl::get_requested_incompatible_qos_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1356,7 +1356,7 @@ ReturnCode_t DataReaderImpl::get_requested_incompatible_qos_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::requested_incompatible_qos(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::get_sample_lost_status( @@ -1364,7 +1364,7 @@ ReturnCode_t DataReaderImpl::get_sample_lost_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1375,7 +1375,7 @@ ReturnCode_t DataReaderImpl::get_sample_lost_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::sample_lost(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::get_sample_rejected_status( @@ -1383,7 +1383,7 @@ ReturnCode_t DataReaderImpl::get_sample_rejected_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1394,7 +1394,7 @@ ReturnCode_t DataReaderImpl::get_sample_rejected_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::sample_rejected(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const Subscriber* DataReaderImpl::get_subscriber() const @@ -1470,7 +1470,7 @@ ReturnCode_t DataReaderImpl::check_qos_including_resource_limits( const TypeSupport& type) { ReturnCode_t check_qos_return = check_qos(qos); - if (ReturnCode_t::RETCODE_OK == check_qos_return && + if (RETCODE_OK == check_qos_return && type->m_isGetKeyDefined) { check_qos_return = check_allocation_consistency(qos); @@ -1484,24 +1484,24 @@ ReturnCode_t DataReaderImpl::check_qos( if (qos.durability().kind == PERSISTENT_DURABILITY_QOS) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "PERSISTENT Durability not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (qos.destination_order().kind == BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "BY SOURCE TIMESTAMP DestinationOrder not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (qos.reader_resource_limits().max_samples_per_read <= 0) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples_per_read should be strictly possitive"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if (qos_has_unique_network_request(qos) && qos_has_specific_locators(qos)) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "unique_network_request cannot be set along specific locators"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::check_allocation_consistency( @@ -1513,16 +1513,16 @@ ReturnCode_t DataReaderImpl::check_allocation_consistency( { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be greater than max_instances * max_samples_per_instance"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if ((qos.resource_limits().max_instances <= 0 || qos.resource_limits().max_samples_per_instance <= 0) && (qos.resource_limits().max_samples > 0)) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be infinite when max_instances or max_samples_per_instance are infinite"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataReaderImpl::can_qos_be_updated( @@ -1826,58 +1826,58 @@ ReturnCode_t DataReaderImpl::check_datasharing_compatible( switch (qos_.data_sharing().kind()) { case DataSharingKind::OFF: - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; case DataSharingKind::ON: #if HAVE_SECURITY if (has_security_enabled) { EPROSIMA_LOG_ERROR(DATA_READER, "Data sharing cannot be used with security protection."); - return ReturnCode_t::RETCODE_NOT_ALLOWED_BY_SECURITY; + return RETCODE_NOT_ALLOWED_BY_SECURITY; } #endif // if HAVE_SECURITY if (!type_.is_bounded()) { EPROSIMA_LOG_INFO(DATA_READER, "Data sharing cannot be used with unbounded data types"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (has_key) { EPROSIMA_LOG_ERROR(DATA_READER, "Data sharing cannot be used with keyed data types"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } is_datasharing_compatible = true; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; case DataSharingKind::AUTO: #if HAVE_SECURITY if (has_security_enabled) { EPROSIMA_LOG_INFO(DATA_READER, "Data sharing disabled due to security configuration."); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // if HAVE_SECURITY if (!type_.is_bounded()) { EPROSIMA_LOG_INFO(DATA_READER, "Data sharing disabled because data type is not bounded"); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (has_key) { EPROSIMA_LOG_INFO(DATA_READER, "Data sharing disabled because data type is keyed"); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } is_datasharing_compatible = true; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; default: EPROSIMA_LOG_ERROR(DATA_WRITER, "Unknown data sharing kind."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -1893,12 +1893,12 @@ ReturnCode_t DataReaderImpl::get_listening_locators( { if (nullptr == reader_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } locators.assign(reader_->getAttributes().unicastLocatorList); locators.push_back(reader_->getAttributes().multicastLocatorList); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::delete_contained_entities() @@ -1918,7 +1918,7 @@ ReturnCode_t DataReaderImpl::delete_contained_entities() // release the colection read_conditions_.clear(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DataReaderImpl::filter_has_been_updated() @@ -2042,7 +2042,7 @@ ReadCondition* DataReaderImpl::create_readcondition( auto ret_code = impl->attach_condition(cond); // attach cannot fail in this scenario - assert(!!ret_code); + assert(RETCODE_OK == ret_code); (void)ret_code; return cond; @@ -2053,14 +2053,14 @@ ReturnCode_t DataReaderImpl::delete_readcondition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } detail::ReadConditionImpl* impl = a_condition->get_impl(); if ( nullptr == impl ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard _(get_conditions_mutex()); @@ -2071,7 +2071,7 @@ ReturnCode_t DataReaderImpl::delete_readcondition( if ( it == read_conditions_.end()) { // The ReadCondition is unknown to this DataReader - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } # ifdef __cpp_lib_enable_shared_from_this @@ -2084,7 +2084,7 @@ ReturnCode_t DataReaderImpl::delete_readcondition( // Detach from the implementation object auto ret_code = impl->detach_condition(a_condition); - if (!!ret_code) + if (RETCODE_OK == ret_code) { // delete the condition delete a_condition; diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/DataReaderLoanManager.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/DataReaderLoanManager.hpp index b563e94bbf0..aad9ccfa2cc 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/DataReaderLoanManager.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/DataReaderLoanManager.hpp @@ -84,7 +84,7 @@ struct DataReaderLoanManager result = used_loans_.push_back(tmp); if (nullptr == result) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } result->data_values = new LoanableCollection::element_type[max_samples_]; @@ -100,7 +100,7 @@ struct DataReaderLoanManager data_values.loan(result->data_values, max_samples_, 0); sample_infos.loan(result->sample_infos, max_samples_, 0); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t return_loan( @@ -113,13 +113,13 @@ struct DataReaderLoanManager if (!used_loans_.remove(tmp)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } OutstandingLoanItem* result = free_loans_.push_back(tmp); static_cast(result); assert(result != nullptr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } private: diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp index 02f892ea62e..067227c807f 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp @@ -90,7 +90,7 @@ struct ReadTakeCommand ~ReadTakeCommand() { - if (!data_values_.has_ownership() && ReturnCode_t::RETCODE_NO_DATA == return_value_) + if (!data_values_.has_ownership() && RETCODE_NO_DATA == return_value_) { loan_manager_.return_loan(data_values_, sample_infos_); data_values_.unloan(); @@ -274,7 +274,7 @@ struct ReadTakeCommand bool loop_for_data_; bool finished_ = false; - ReturnCode_t return_value_ = ReturnCode_t::RETCODE_NO_DATA; + ReturnCode_t return_value_ = RETCODE_NO_DATA; LoanableCollection::size_type current_slot_ = 0; @@ -345,7 +345,7 @@ struct ReadTakeCommand } // Mark that some data is available - return_value_ = ReturnCode_t::RETCODE_OK; + return_value_ = RETCODE_OK; ++current_slot_; --remaining_samples_; ret_val = true; diff --git a/src/cpp/fastdds/subscriber/ReadConditionImpl.hpp b/src/cpp/fastdds/subscriber/ReadConditionImpl.hpp index 4a7d99ba7e4..8ab254d9780 100644 --- a/src/cpp/fastdds/subscriber/ReadConditionImpl.hpp +++ b/src/cpp/fastdds/subscriber/ReadConditionImpl.hpp @@ -149,7 +149,7 @@ class ReadConditionImpl : public std::enable_shared_from_this else if ( *it == pRC ) { // already there - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } else { @@ -163,7 +163,7 @@ class ReadConditionImpl : public std::enable_shared_from_this // associate pRC->impl_ = shared_from_this(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } /** @@ -191,7 +191,7 @@ class ReadConditionImpl : public std::enable_shared_from_this { conditions_.erase_after(pit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { @@ -199,7 +199,7 @@ class ReadConditionImpl : public std::enable_shared_from_this } } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } void set_trigger_value( diff --git a/src/cpp/fastdds/subscriber/Subscriber.cpp b/src/cpp/fastdds/subscriber/Subscriber.cpp index d62f4adab00..ee27357893f 100644 --- a/src/cpp/fastdds/subscriber/Subscriber.cpp +++ b/src/cpp/fastdds/subscriber/Subscriber.cpp @@ -46,17 +46,17 @@ ReturnCode_t Subscriber::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (false == impl_->get_participant()->is_enabled()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } enable_ = true; ReturnCode_t ret_code = impl_->enable(); - enable_ = ReturnCode_t::RETCODE_OK == ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -69,7 +69,7 @@ ReturnCode_t Subscriber::get_qos( SubscriberQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Subscriber::set_qos( @@ -94,7 +94,7 @@ ReturnCode_t Subscriber::set_listener( const StatusMask& mask) { ReturnCode_t ret_val = impl_->set_listener(listener); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -150,7 +150,7 @@ ReturnCode_t Subscriber::get_datareaders( static_cast (sample_states); static_cast (view_states); static_cast (instance_states); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_datareaders(readers); */ @@ -163,7 +163,7 @@ bool Subscriber::has_datareaders() const ReturnCode_t Subscriber::begin_access() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->begin_access(); */ @@ -171,7 +171,7 @@ ReturnCode_t Subscriber::begin_access() ReturnCode_t Subscriber::end_access() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->end_access(); */ @@ -207,7 +207,7 @@ ReturnCode_t Subscriber::get_default_datareader_qos( DataReaderQos& qos) const { qos = impl_->get_default_datareader_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Subscriber::get_datareader_qos_from_profile( @@ -223,7 +223,7 @@ ReturnCode_t Subscriber::copy_from_topic_qos( { static_cast (reader_qos); static_cast (topic_qos); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->copy_from_topic_qos(reader_qos, topic_qos); */ diff --git a/src/cpp/fastdds/subscriber/SubscriberImpl.cpp b/src/cpp/fastdds/subscriber/SubscriberImpl.cpp index 9e3b93cb9a1..71ab3498ee0 100644 --- a/src/cpp/fastdds/subscriber/SubscriberImpl.cpp +++ b/src/cpp/fastdds/subscriber/SubscriberImpl.cpp @@ -85,7 +85,7 @@ ReturnCode_t SubscriberImpl::enable() } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void SubscriberImpl::disable() @@ -136,7 +136,7 @@ ReturnCode_t SubscriberImpl::set_qos( if (&qos != &SUBSCRIBER_QOS_DEFAULT) { ReturnCode_t check_result = check_qos(qos_to_set); - if (!check_result) + if (RETCODE_OK != check_result) { return check_result; } @@ -144,7 +144,7 @@ ReturnCode_t SubscriberImpl::set_qos( if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos_to_set, !enabled); @@ -160,7 +160,7 @@ ReturnCode_t SubscriberImpl::set_qos( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const SubscriberListener* SubscriberImpl::get_listener() const @@ -172,7 +172,7 @@ ReturnCode_t SubscriberImpl::set_listener( SubscriberListener* listener) { listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DataReaderImpl* SubscriberImpl::create_datareader_impl( @@ -204,7 +204,7 @@ DataReader* SubscriberImpl::create_datareader( return nullptr; } - if (!DataReaderImpl::check_qos_including_resource_limits(qos, type_support)) + if (RETCODE_OK != DataReaderImpl::check_qos_including_resource_limits(qos, type_support)) { return nullptr; } @@ -222,7 +222,7 @@ DataReader* SubscriberImpl::create_datareader( if (user_subscriber_->is_enabled() && qos_.entity_factory().autoenable_created_entities) { - if (ReturnCode_t::RETCODE_OK != reader->enable()) + if (RETCODE_OK != reader->enable()) { delete_datareader(reader); return nullptr; @@ -256,7 +256,7 @@ ReturnCode_t SubscriberImpl::delete_datareader( { if (user_subscriber_ != reader->get_subscriber()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::unique_lock lock(mtx_readers_); auto it = readers_.find(reader->impl_->get_topicdescription()->get_name()); @@ -269,7 +269,7 @@ ReturnCode_t SubscriberImpl::delete_datareader( DataReaderImpl* reader_impl = *dr_it; if (!reader_impl->can_be_deleted(false)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } it->second.erase(dr_it); @@ -282,10 +282,10 @@ ReturnCode_t SubscriberImpl::delete_datareader( //Now we can delete it reader_impl->get_topicdescription()->get_impl()->dereference(); delete (reader_impl); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } DataReader* SubscriberImpl::lookup_datareader( @@ -311,7 +311,7 @@ ReturnCode_t SubscriberImpl::get_datareaders( readers.push_back(dr->user_datareader_); } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool SubscriberImpl::has_datareaders() const @@ -348,7 +348,7 @@ ReturnCode_t SubscriberImpl::notify_datareaders() const dr->listener_->on_data_available(dr->user_datareader_); } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t SubscriberImpl::set_default_datareader_qos( @@ -357,17 +357,17 @@ ReturnCode_t SubscriberImpl::set_default_datareader_qos( if (&qos == &DATAREADER_QOS_DEFAULT) { reset_default_datareader_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t check_result = DataReaderImpl::check_qos(qos); - if (!check_result) + if (RETCODE_OK != check_result) { return check_result; } DataReaderImpl::set_qos(default_datareader_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void SubscriberImpl::reset_default_datareader_qos() @@ -407,7 +407,7 @@ bool SubscriberImpl::contains_entity( return false; } -const ReturnCode_t SubscriberImpl::get_datareader_qos_from_profile( +ReturnCode_t SubscriberImpl::get_datareader_qos_from_profile( const std::string& profile_name, DataReaderQos& qos) const { @@ -416,10 +416,10 @@ const ReturnCode_t SubscriberImpl::get_datareader_qos_from_profile( { qos = default_datareader_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } /* TODO @@ -581,7 +581,7 @@ ReturnCode_t SubscriberImpl::check_qos( const SubscriberQos& qos) { (void) qos; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool SubscriberImpl::can_qos_be_updated( @@ -607,7 +607,7 @@ SubscriberListener* SubscriberImpl::get_listener_for( ReturnCode_t SubscriberImpl::delete_contained_entities() { // Let's be optimistic - ReturnCode_t result = ReturnCode_t::RETCODE_OK; + ReturnCode_t result = RETCODE_OK; std::lock_guard lock(mtx_readers_); for (auto reader: readers_) @@ -616,7 +616,7 @@ ReturnCode_t SubscriberImpl::delete_contained_entities() { if (!dr->can_be_deleted()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } @@ -631,7 +631,7 @@ ReturnCode_t SubscriberImpl::delete_contained_entities() bool ret_code = reader_impl->can_be_deleted(); if (!ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } reader_impl->set_listener(nullptr); it = reader_iterator->second.erase(it); diff --git a/src/cpp/fastdds/subscriber/SubscriberImpl.hpp b/src/cpp/fastdds/subscriber/SubscriberImpl.hpp index f5766ebefbc..1fc53253556 100644 --- a/src/cpp/fastdds/subscriber/SubscriberImpl.hpp +++ b/src/cpp/fastdds/subscriber/SubscriberImpl.hpp @@ -148,7 +148,7 @@ class SubscriberImpl DataReaderQos& get_default_datareader_qos(); - const ReturnCode_t get_datareader_qos_from_profile( + ReturnCode_t get_datareader_qos_from_profile( const std::string& profile_name, DataReaderQos& qos) const; diff --git a/src/cpp/fastdds/topic/ContentFilteredTopic.cpp b/src/cpp/fastdds/topic/ContentFilteredTopic.cpp index 8320ce0ccef..16f12db6071 100644 --- a/src/cpp/fastdds/topic/ContentFilteredTopic.cpp +++ b/src/cpp/fastdds/topic/ContentFilteredTopic.cpp @@ -72,7 +72,7 @@ ReturnCode_t ContentFilteredTopic::get_expression_parameters( { expression_parameters.emplace_back(param.c_str()); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ContentFilteredTopic::set_expression_parameters( diff --git a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp index d8658019b84..0ea6a2b2f6b 100644 --- a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp +++ b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp @@ -70,7 +70,7 @@ ReturnCode_t ContentFilteredTopicImpl::set_expression_parameters( EPROSIMA_LOG_ERROR(CONTENT_FILTERED_TOPIC, "Number of expression parameters exceeds maximum allocation limit: " << new_expression_parameters.size() << " > " << pqos.allocation().content_filter.expression_parameters.maximum); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } LoanableSequence::size_type n_params; @@ -88,7 +88,7 @@ ReturnCode_t ContentFilteredTopicImpl::set_expression_parameters( related_topic->get_type_name().c_str(), type.get(), new_expression, filter_parameters, filter_instance); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { filter_property.expression_parameters.assign(new_expression_parameters.begin(), new_expression_parameters.end()); diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp index 836ab5c73b7..714f407ae34 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp @@ -62,11 +62,11 @@ static IContentFilterFactory::ReturnCode_t transform_enum( { value->kind = DDSFilterValue::ValueKind::SIGNED_INTEGER; value->signed_integer_value = enum_value.common().value(); - return IContentFilterFactory::ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return IContentFilterFactory::ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } static IContentFilterFactory::ReturnCode_t transform_enums( @@ -87,7 +87,7 @@ static IContentFilterFactory::ReturnCode_t transform_enums( return transform_enum(left_value, right_type, left_value->string_value); } - return IContentFilterFactory::ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } static bool check_value_compatibility( @@ -237,7 +237,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree= state.filter_parameters.length()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (state.filter->parameters[node.parameter_index]) @@ -249,13 +249,13 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree(); if (!param_value->set_value(state.filter_parameters[node.parameter_index])) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } value = state.filter->parameters[node.parameter_index] = param_value; } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } template<> @@ -267,10 +267,10 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree left; std::shared_ptr right; ReturnCode_t ret = convert_tree(state, left, node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = convert_tree(state, right, node.right()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { bool ignore_enum = false; if (node.is() || node.is()) @@ -279,7 +279,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree() && (DDSFilterValue::ValueKind::STRING == left->kind)) || (node.right().is() && (DDSFilterValue::ValueKind::STRING == right->kind)))) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ignore_enum = true; @@ -289,16 +289,16 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_treekind, right->kind, ignore_enum)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ret = transform_enums(left, node.left().type_id, right, node.right().type_id); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { condition.reset(new DDSFilterPredicate(get_predicate_op(node), left, right)); } @@ -325,7 +325,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( std::shared_ptr field; ReturnCode_t ret = convert_tree(state, field, node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { const parser::ParseNode& and_node = node.right(); assert(and_node.is()); @@ -334,28 +334,28 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( std::shared_ptr op2; ret = convert_tree(state, op1, and_node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = convert_tree(state, op2, and_node.right()); } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { if (!check_value_compatibility(field->kind, op1->kind, false) || !check_value_compatibility(field->kind, op2->kind, false) || !check_value_compatibility(op1->kind, op2->kind, false)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ret = transform_enums(field, node.left().type_id, op1, and_node.left().type_id); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = transform_enums(field, node.left().type_id, op2, and_node.right().type_id); } } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { DDSFilterPredicate::OperationKind binary_op = node.is() ? DDSFilterPredicate::OperationKind::LESS_EQUAL : @@ -380,7 +380,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree& condition, const parser::ParseNode& node) { - ReturnCode_t ret = ReturnCode_t::RETCODE_UNSUPPORTED; + ReturnCode_t ret = RETCODE_UNSUPPORTED; DDSFilterCompoundCondition::OperationKind op = DDSFilterCompoundCondition::OperationKind::NOT; std::unique_ptr left; std::unique_ptr right; @@ -394,7 +394,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree(state, left, node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = convert_tree(state, right, node.right()); } @@ -403,7 +403,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree(state, left, node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = convert_tree(state, right, node.right()); } @@ -413,7 +413,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree(data_type); - ReturnCode_t ret = ReturnCode_t::RETCODE_UNSUPPORTED; + ReturnCode_t ret = RETCODE_UNSUPPORTED; if (nullptr == filter_expression) { if (nullptr == filter_instance) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } else { - ret = ReturnCode_t::RETCODE_OK; + ret = RETCODE_OK; if (&empty_expression_ != filter_instance) { auto expr = static_cast(filter_instance); auto n_params = static_cast(expr->parameters.size()); if (filter_parameters.length() < n_params) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } else { std::vector old_values(n_params); LoanableCollection::size_type n = n_params; - while ((n > 0) && (ReturnCode_t::RETCODE_OK == ret)) + while ((n > 0) && (RETCODE_OK == ret)) { --n; if (expr->parameters[n]) @@ -492,12 +492,12 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( old_values[n].copy_from(*(expr->parameters[n]), true); if (!expr->parameters[n]->set_value(filter_parameters[n])) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } } } - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { while (n < n_params) { @@ -513,7 +513,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( { delete_content_filter(filter_class_name, filter_instance); filter_instance = &empty_expression_; - ret = ReturnCode_t::RETCODE_OK; + ret = RETCODE_OK; } else { @@ -521,7 +521,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( if (!type_object) { EPROSIMA_LOG_ERROR(DDSSQLFILTER, "No TypeObject found for type " << type_name); - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } else { @@ -540,7 +540,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( } ExpressionParsingState state{ type_object, filter_parameters, expr }; ret = convert_tree(state, expr->root, *(node->children[0])); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { delete_content_filter(filter_class_name, filter_instance); filter_instance = expr; @@ -552,7 +552,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( } else { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } } } @@ -568,7 +568,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::delete_content_filter( if (nullptr == filter_instance) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (&empty_expression_ != filter_instance) @@ -577,7 +577,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::delete_content_filter( expr->clear(); expression_pool_.put(expr); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } // namespace DDSSQLFilter diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp index b83651d0ab1..5edb96f4eb0 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp @@ -171,7 +171,7 @@ bool DDSFilterField::set_value( case EK_COMPLETE: { uint32_t enum_value; - ret = !!data->get_enum_value(enum_value, member_id); + ret = RETCODE_OK == data->get_enum_value(enum_value, member_id); signed_integer_value = enum_value; break; } diff --git a/src/cpp/fastdds/topic/Topic.cpp b/src/cpp/fastdds/topic/Topic.cpp index ed8975170b5..58f88aa9fbf 100644 --- a/src/cpp/fastdds/topic/Topic.cpp +++ b/src/cpp/fastdds/topic/Topic.cpp @@ -64,7 +64,7 @@ ReturnCode_t Topic::get_qos( TopicQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Topic::set_qos( @@ -83,7 +83,7 @@ ReturnCode_t Topic::set_listener( const StatusMask& mask) { impl_->set_listener(listener, mask); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainParticipant* Topic::get_participant() const @@ -96,7 +96,7 @@ ReturnCode_t Topic::get_inconsistent_topic_status( { // TODO: return impl_->get_inconsistent_topic_status(status); (void)status; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } TopicDescriptionImpl* Topic::get_impl() const diff --git a/src/cpp/fastdds/topic/TopicImpl.cpp b/src/cpp/fastdds/topic/TopicImpl.cpp index 4ab7b3e493d..a7b5dc72274 100644 --- a/src/cpp/fastdds/topic/TopicImpl.cpp +++ b/src/cpp/fastdds/topic/TopicImpl.cpp @@ -55,7 +55,7 @@ ReturnCode_t TopicImpl::check_qos_including_resource_limits( const TypeSupport& type) { ReturnCode_t check_qos_return = check_qos(qos); - if (ReturnCode_t::RETCODE_OK == check_qos_return && + if (RETCODE_OK == check_qos_return && type->m_isGetKeyDefined) { check_qos_return = check_allocation_consistency(qos); @@ -69,12 +69,12 @@ ReturnCode_t TopicImpl::check_qos( if (PERSISTENT_DURABILITY_QOS == qos.durability().kind) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "PERSISTENT Durability not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS == qos.destination_order().kind) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "BY SOURCE TIMESTAMP DestinationOrder not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (AUTOMATIC_LIVELINESS_QOS == qos.liveliness().kind || MANUAL_BY_PARTICIPANT_LIVELINESS_QOS == qos.liveliness().kind) @@ -83,10 +83,10 @@ ReturnCode_t TopicImpl::check_qos( qos.liveliness().lease_duration <= qos.liveliness().announcement_period) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "lease_duration <= announcement period."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t TopicImpl::check_allocation_consistency( @@ -98,16 +98,16 @@ ReturnCode_t TopicImpl::check_allocation_consistency( { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be greater than max_instances * max_samples_per_instance"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if ((qos.resource_limits().max_instances <= 0 || qos.resource_limits().max_samples_per_instance <= 0) && (qos.resource_limits().max_samples > 0)) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be infinite when max_instances or max_samples_per_instance are infinite"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void TopicImpl::set_qos( @@ -144,26 +144,26 @@ ReturnCode_t TopicImpl::set_qos( const TopicQos& default_qos = participant_->get_default_topic_qos(); if (!can_qos_be_updated(qos_, default_qos)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, default_qos, false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = check_qos_including_resource_limits(qos, type_support_); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } if (!can_qos_be_updated(qos_, qos)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos, false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const TopicListener* TopicImpl::get_listener() const diff --git a/src/cpp/fastdds/topic/TopicProxyFactory.cpp b/src/cpp/fastdds/topic/TopicProxyFactory.cpp index dd5e1af58f5..e4e89d6d036 100644 --- a/src/cpp/fastdds/topic/TopicProxyFactory.cpp +++ b/src/cpp/fastdds/topic/TopicProxyFactory.cpp @@ -43,10 +43,10 @@ ReturnCode_t TopicProxyFactory::delete_topic( if (it != proxies_.end() && !proxy->is_referenced()) { proxies_.erase(it); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } TopicProxy* TopicProxyFactory::get_topic() diff --git a/src/cpp/security/artifact_providers/Pkcs11Provider.cpp b/src/cpp/security/artifact_providers/Pkcs11Provider.cpp index c7598f86ff5..483d5ce0f1c 100644 --- a/src/cpp/security/artifact_providers/Pkcs11Provider.cpp +++ b/src/cpp/security/artifact_providers/Pkcs11Provider.cpp @@ -100,7 +100,7 @@ Pkcs11Provider::Pkcs11Provider() // Load the PIN from the environment std::string pin; - if (ReturnCode_t::RETCODE_OK == SystemInfo::get_env(FASTDDS_PKCS11_PIN, pin)) + if (fastdds::dds::RETCODE_OK == SystemInfo::get_env(FASTDDS_PKCS11_PIN, pin)) { if (!ENGINE_ctrl_cmd_string( pkcs11_, "PIN", pin.c_str(), 0)) { diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp b/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp index a260fac8c29..b025233aae3 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp @@ -39,7 +39,7 @@ ReturnCode_t DomainParticipant::enable_statistics_datawriter( (void) topic_name; (void) dwqos; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #else return static_cast(impl_)->enable_statistics_datawriter(topic_name, dwqos); #endif // FASTDDS_STATISTICS @@ -53,7 +53,7 @@ ReturnCode_t DomainParticipant::enable_statistics_datawriter_with_profile( (void) profile_name; (void) topic_name; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #else return static_cast(impl_)->enable_statistics_datawriter_with_profile(profile_name, topic_name); @@ -66,7 +66,7 @@ ReturnCode_t DomainParticipant::disable_statistics_datawriter( #ifndef FASTDDS_STATISTICS (void) topic_name; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #else return static_cast(impl_)->disable_statistics_datawriter(topic_name); #endif // FASTDDS_STATISTICS diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp index 7440faa2d6d..08253e5b33a 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp @@ -120,12 +120,12 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( EventKind event_kind; if (!transform_and_check_topic_name(topic_name, use_topic_name, event_kind)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return efd::RETCODE_BAD_PARAMETER; } - if (!efd::DataWriterImpl::check_qos(dwqos)) + if (efd::RETCODE_OK != efd::DataWriterImpl::check_qos(dwqos)) { - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return efd::RETCODE_INCONSISTENT_POLICY; } // Register type and topic @@ -147,7 +147,7 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( // Remove topic and type delete_topic_and_type(use_topic_name); EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, topic_name << " DataWriter creation has failed"); - return ReturnCode_t::RETCODE_ERROR; + return efd::RETCODE_ERROR; } if (PHYSICAL_DATA_TOPIC == use_topic_name) @@ -156,7 +156,7 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( notification.participant_guid(*reinterpret_cast(&guid())); notification.host(asio::ip::host_name() + ":" + std::to_string(efd::utils::default_domain_id())); std::string username; - if (ReturnCode_t::RETCODE_OK == SystemInfo::get_username(username)) + if (efd::RETCODE_OK == SystemInfo::get_username(username)) { notification.user(username); } @@ -173,9 +173,9 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( rtps_participant_->set_enabled_statistics_writers_mask(statistics_listener_->enabled_writers_mask()); } } - return ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return efd::RETCODE_ERROR; } ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter_with_profile( @@ -189,17 +189,17 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter_with_profile( efd::utils::set_qos_from_attributes(datawriter_qos, attr); ReturnCode_t ret = enable_statistics_datawriter(topic_name, datawriter_qos); - // case RETCODE_ERROR is checked and logged in enable_statistics_datawriter. - // case RETCODE_INCONSISTENT_POLICY could happen if profile defined in XML is inconsistent. - // case RETCODE_UNSUPPORTED cannot happen because this method is only called if FASTDDS_STATISTICS + // case efd::RETCODE_ERROR is checked and logged in enable_statistics_datawriter. + // case efd::RETCODE_INCONSISTENT_POLICY could happen if profile defined in XML is inconsistent. + // case efd::RETCODE_UNSUPPORTED cannot happen because this method is only called if FASTDDS_STATISTICS // CMake option is enabled - if (ret == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (ret == efd::RETCODE_INCONSISTENT_POLICY) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Statistics DataWriter QoS from profile name " << profile_name << " are not consistent/compatible"); } - assert(ret != ReturnCode_t::RETCODE_UNSUPPORTED); - if (ret == ReturnCode_t::RETCODE_BAD_PARAMETER) + assert(ret != efd::RETCODE_UNSUPPORTED); + if (ret == efd::RETCODE_BAD_PARAMETER) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Profile name " << profile_name << " is not a valid statistics topic name/alias"); @@ -208,18 +208,18 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter_with_profile( } EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Profile name " << profile_name << " has not been found"); - return ReturnCode_t::RETCODE_ERROR; + return efd::RETCODE_ERROR; } ReturnCode_t DomainParticipantImpl::disable_statistics_datawriter( const std::string& topic_name) { - ReturnCode_t ret = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret = efd::RETCODE_OK; std::string use_topic_name; EventKind event_kind; if (!transform_and_check_topic_name(topic_name, use_topic_name, event_kind)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return efd::RETCODE_BAD_PARAMETER; } // Delete statistics DataWriter @@ -232,18 +232,18 @@ ReturnCode_t DomainParticipantImpl::disable_statistics_datawriter( rtps_participant_->set_enabled_statistics_writers_mask(statistics_listener_->enabled_writers_mask()); // Delete the DataWriter - if (ReturnCode_t::RETCODE_OK != builtin_publisher_->delete_datawriter(writer)) + if (efd::RETCODE_OK != builtin_publisher_->delete_datawriter(writer)) { // Restore writer on listener before returning the error statistics_listener_->set_datawriter(event_kind, writer); rtps_participant_->set_enabled_statistics_writers_mask(statistics_listener_->enabled_writers_mask()); - ret = ReturnCode_t::RETCODE_ERROR; + ret = efd::RETCODE_ERROR; } // Deregister type and delete topic if (!delete_topic_and_type(use_topic_name)) { - ret = ReturnCode_t::RETCODE_ERROR; + ret = efd::RETCODE_ERROR; } } return ret; @@ -253,7 +253,7 @@ ReturnCode_t DomainParticipantImpl::enable() { ReturnCode_t ret = efd::DomainParticipantImpl::enable(); - if (ReturnCode_t::RETCODE_OK == ret) + if (efd::RETCODE_OK == ret) { rtps_participant_->add_statistics_listener(statistics_listener_, participant_statistics_mask); create_statistics_builtin_entities(); @@ -289,7 +289,7 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() { ReturnCode_t ret = efd::DomainParticipantImpl::delete_contained_entities(); - if (ret == ReturnCode_t::RETCODE_OK) + if (ret == efd::RETCODE_OK) { builtin_publisher_impl_ = nullptr; builtin_publisher_ = nullptr; @@ -446,17 +446,17 @@ void DomainParticipantImpl::enable_statistics_builtin_datawriters( } ReturnCode_t ret = enable_statistics_datawriter(topic, datawriter_qos); - // case RETCODE_ERROR is checked and logged in enable_statistics_datawriter. - // case RETCODE_INCONSISTENT_POLICY could happen if profile defined in XML is inconsistent. - // case RETCODE_UNSUPPORTED cannot happen because this method is only called if FASTDDS_STATISTICS + // case efd::RETCODE_ERROR is checked and logged in enable_statistics_datawriter. + // case efd::RETCODE_INCONSISTENT_POLICY could happen if profile defined in XML is inconsistent. + // case efd::RETCODE_UNSUPPORTED cannot happen because this method is only called if FASTDDS_STATISTICS // CMake option is enabled - if (ret == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (ret == efd::RETCODE_INCONSISTENT_POLICY) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Statistics DataWriter QoS from topic " << topic << " are not consistent/compatible"); } - assert(ret != ReturnCode_t::RETCODE_UNSUPPORTED); - if (ret == ReturnCode_t::RETCODE_BAD_PARAMETER) + assert(ret != efd::RETCODE_UNSUPPORTED); + if (ret == efd::RETCODE_BAD_PARAMETER) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Topic " << topic << " is not a valid statistics topic name/alias"); @@ -590,7 +590,7 @@ bool DomainParticipantImpl::find_or_create_topic_and_type( } else { - if (ReturnCode_t::RETCODE_PRECONDITION_NOT_MET == register_type(type, type->getName())) + if (efd::RETCODE_PRECONDITION_NOT_MET == register_type(type, type->getName())) { // No log because it is already logged within register_type return false; @@ -612,7 +612,7 @@ bool DomainParticipantImpl::delete_topic_and_type( std::string type_name = topic->get_type_name(); // delete_topic can fail if the topic is referenced by any other entity. This case could happen even if // it should not. It also fails if topic is a nullptr (dynamic_cast failure). - if (ReturnCode_t::RETCODE_OK != delete_topic(topic)) + if (efd::RETCODE_OK != delete_topic(topic)) { return false; } diff --git a/src/cpp/statistics/fastdds/publisher/DataWriterImpl.hpp b/src/cpp/statistics/fastdds/publisher/DataWriterImpl.hpp index b91f9855dcf..15ea45073fe 100644 --- a/src/cpp/statistics/fastdds/publisher/DataWriterImpl.hpp +++ b/src/cpp/statistics/fastdds/publisher/DataWriterImpl.hpp @@ -69,12 +69,12 @@ class DataWriterImpl : public efd::DataWriterImpl { if (nullptr != writer_) { - return ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } ReturnCode_t ret = BaseType::enable(); - if (ReturnCode_t::RETCODE_OK == ret && statistics_listener_) + if (efd::RETCODE_OK == ret && statistics_listener_) { writer_->add_statistics_listener(statistics_listener_); } diff --git a/src/cpp/statistics/fastdds/subscriber/DataReaderImpl.hpp b/src/cpp/statistics/fastdds/subscriber/DataReaderImpl.hpp index 0454c08bb50..60470fd5b52 100644 --- a/src/cpp/statistics/fastdds/subscriber/DataReaderImpl.hpp +++ b/src/cpp/statistics/fastdds/subscriber/DataReaderImpl.hpp @@ -59,12 +59,12 @@ class DataReaderImpl : public efd::DataReaderImpl { if (nullptr != reader_) { - return ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } ReturnCode_t ret = BaseType::enable(); - if (ReturnCode_t::RETCODE_OK == ret && + if (efd::RETCODE_OK == ret && !DomainParticipantImpl::is_statistics_topic_name(topic_->get_name())) { reader_->add_statistics_listener(statistics_listener_); diff --git a/src/cpp/utils/SystemInfo.cpp b/src/cpp/utils/SystemInfo.cpp index 14a2e190b7d..fcdec338ef6 100644 --- a/src/cpp/utils/SystemInfo.cpp +++ b/src/cpp/utils/SystemInfo.cpp @@ -39,8 +39,6 @@ namespace eprosima { -using ReturnCode_t = fastrtps::types::ReturnCode_t; - SystemInfo::SystemInfo() { // From ctime(3) linux man page: @@ -54,19 +52,19 @@ SystemInfo::SystemInfo() // defined(_POSIX_SOURCE) || defined(__unix__) } -ReturnCode_t SystemInfo::get_env( +fastdds::dds::ReturnCode_t SystemInfo::get_env( const std::string& env_name, std::string& env_value) { if (env_name.empty()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return fastdds::dds::RETCODE_BAD_PARAMETER; } // Try to read environment variable from file - if (!environment_file_.empty() && ReturnCode_t::RETCODE_OK == get_env(environment_file_, env_name, env_value)) + if (!environment_file_.empty() && fastdds::dds::RETCODE_OK == get_env(environment_file_, env_name, env_value)) { - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; } char* data; @@ -78,13 +76,13 @@ ReturnCode_t SystemInfo::get_env( } else { - return ReturnCode_t::RETCODE_NO_DATA; + return fastdds::dds::RETCODE_NO_DATA; } - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; } -ReturnCode_t SystemInfo::get_env( +fastdds::dds::ReturnCode_t SystemInfo::get_env( const std::string& filename, const std::string& env_name, std::string& env_value) @@ -92,7 +90,7 @@ ReturnCode_t SystemInfo::get_env( // Check that the file exists if (!SystemInfo::file_exists(filename)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return fastdds::dds::RETCODE_BAD_PARAMETER; } // Read json file @@ -105,7 +103,7 @@ ReturnCode_t SystemInfo::get_env( } catch (const nlohmann::json::exception&) { - return ReturnCode_t::RETCODE_ERROR; + return fastdds::dds::RETCODE_ERROR; } try @@ -114,12 +112,12 @@ ReturnCode_t SystemInfo::get_env( } catch (const nlohmann::json::exception&) { - return ReturnCode_t::RETCODE_NO_DATA; + return fastdds::dds::RETCODE_NO_DATA; } - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; } -ReturnCode_t SystemInfo::get_username( +fastdds::dds::ReturnCode_t SystemInfo::get_username( std::string& username) { #ifdef _WIN32 @@ -128,10 +126,10 @@ ReturnCode_t SystemInfo::get_username( DWORD bufCharCount = INFO_BUFFER_SIZE; if (!GetUserNameA(user, &bufCharCount)) { - return ReturnCode_t::RETCODE_ERROR; + return fastdds::dds::RETCODE_ERROR; } username = user; - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; #else uid_t user_id = geteuid(); struct passwd* pwd = getpwuid(user_id); @@ -140,10 +138,10 @@ ReturnCode_t SystemInfo::get_username( username = pwd->pw_name; if (!username.empty()) { - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; } } - return ReturnCode_t::RETCODE_ERROR; + return fastdds::dds::RETCODE_ERROR; #endif // _WIN32 } @@ -202,7 +200,7 @@ bool SystemInfo::wait_for_file_closure( return std::chrono::system_clock::now() - start < timeout; } -ReturnCode_t SystemInfo::set_environment_file() +fastdds::dds::ReturnCode_t SystemInfo::set_environment_file() { return SystemInfo::get_env(FASTDDS_ENVIRONMENT_FILE_ENV_VAR, SystemInfo::environment_file_); } diff --git a/test/blackbox/api/dds-pim/PubSubParticipant.hpp b/test/blackbox/api/dds-pim/PubSubParticipant.hpp index 180edcdeca9..7ef8cf01d91 100644 --- a/test/blackbox/api/dds-pim/PubSubParticipant.hpp +++ b/test/blackbox/api/dds-pim/PubSubParticipant.hpp @@ -132,7 +132,7 @@ class PubSubParticipant type data; eprosima::fastdds::dds::SampleInfo info; - while (ReturnCode_t::RETCODE_OK == reader->take_next_sample(&data, &info)) + while (eprosima::fastdds::dds::RETCODE_OK == reader->take_next_sample(&data, &info)) { participant_->data_received(); } @@ -644,7 +644,7 @@ class PubSubParticipant // Update QoS before updating user data as statistics properties might have changed internally participant_qos_ = participant_->get_qos(); participant_qos_.user_data().data_vec(user_data); - return ReturnCode_t::RETCODE_OK == participant_->set_qos(participant_qos_); + return eprosima::fastdds::dds::RETCODE_OK == participant_->set_qos(participant_qos_); } PubSubParticipant& wire_protocol( @@ -659,7 +659,7 @@ class PubSubParticipant { eprosima::fastdds::dds::DomainParticipantQos participant_qos = participant_qos_; participant_qos.wire_protocol() = wire_protocol; - if (ReturnCode_t::RETCODE_OK == participant_->set_qos(participant_qos)) + if (eprosima::fastdds::dds::RETCODE_OK == participant_->set_qos(participant_qos)) { participant_qos_ = participant_qos; return true; @@ -775,7 +775,7 @@ class PubSubParticipant qos = std::get<2>(subscribers_[index])->get_qos(); qos.deadline().period = deadline_period; - return ReturnCode_t::RETCODE_OK == std::get<2>(subscribers_[index])->set_qos(qos); + return eprosima::fastdds::dds::RETCODE_OK == std::get<2>(subscribers_[index])->set_qos(qos); } void pub_liveliness_lost() diff --git a/test/blackbox/api/dds-pim/PubSubReader.hpp b/test/blackbox/api/dds-pim/PubSubReader.hpp index a14754e2c4d..525db262326 100644 --- a/test/blackbox/api/dds-pim/PubSubReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubReader.hpp @@ -398,7 +398,7 @@ class PubSubReader type_.reset(new type_support()); // Register type - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); // Create topic topic_ = @@ -453,7 +453,7 @@ class PubSubReader bool delete_datareader() { - ReturnCode_t ret(ReturnCode_t::RETCODE_ERROR); + ReturnCode_t ret(eprosima::fastdds::dds::RETCODE_ERROR); if (subscriber_ && datareader_) { @@ -461,7 +461,7 @@ class PubSubReader datareader_ = nullptr; } - return (ReturnCode_t::RETCODE_OK == ret); + return (eprosima::fastdds::dds::RETCODE_OK == ret); } virtual void destroy() @@ -614,7 +614,7 @@ class PubSubReader eprosima::fastdds::dds::ANY_VIEW_STATE, eprosima::fastdds::dds::ANY_INSTANCE_STATE); - if (ReturnCode_t::RETCODE_OK == success) + if (eprosima::fastdds::dds::RETCODE_OK == success) { for (eprosima::fastdds::dds::LoanableCollection::size_type n = 0; n < info_seq.length(); ++n) { @@ -902,7 +902,7 @@ class PubSubReader datareader_->get_qos(datareader_qos); datareader_qos.deadline().period = deadline_period; - return (datareader_->set_qos(datareader_qos) == ReturnCode_t::RETCODE_OK); + return (datareader_->set_qos(datareader_qos) == eprosima::fastdds::dds::RETCODE_OK); } PubSubReader& liveliness_kind( @@ -1577,13 +1577,13 @@ class PubSubReader { subscriber_qos_.partition().clear(); subscriber_qos_.partition().push_back(partition.c_str()); - return (ReturnCode_t::RETCODE_OK == subscriber_->set_qos(subscriber_qos_)); + return (eprosima::fastdds::dds::RETCODE_OK == subscriber_->set_qos(subscriber_qos_)); } bool clear_partitions() { subscriber_qos_.partition().clear(); - return (ReturnCode_t::RETCODE_OK == subscriber_->set_qos(subscriber_qos_)); + return (eprosima::fastdds::dds::RETCODE_OK == subscriber_->set_qos(subscriber_qos_)); } /*** Function for discovery callback ***/ @@ -1624,7 +1624,7 @@ class PubSubReader collection data_seq(buf, 1); info_seq_type info_seq(1); - if (ReturnCode_t::RETCODE_OK == datareader_->take(data_seq, info_seq)) + if (eprosima::fastdds::dds::RETCODE_OK == datareader_->take(data_seq, info_seq)) { current_processed_count_++; return true; @@ -1636,7 +1636,7 @@ class PubSubReader void* data) { eprosima::fastdds::dds::SampleInfo dds_info; - if (datareader_->take_next_sample(data, &dds_info) == ReturnCode_t::RETCODE_OK) + if (datareader_->take_next_sample(data, &dds_info) == eprosima::fastdds::dds::RETCODE_OK) { current_processed_count_++; return true; @@ -1838,7 +1838,7 @@ class PubSubReader ReturnCode_t success = take_ ? datareader->take_next_sample((void*)&data, &info) : datareader->read_next_sample((void*)&data, &info); - if (ReturnCode_t::RETCODE_OK == success) + if (eprosima::fastdds::dds::RETCODE_OK == success) { returnedValue = true; @@ -1874,7 +1874,7 @@ class PubSubReader datareader->take(datas, infos) : datareader->read(datas, infos); - if (!success) + if (eprosima::fastdds::dds::RETCODE_OK != success) { returnedValue = false; return; @@ -2126,7 +2126,7 @@ class PubSubReaderWithWaitsets : public PubSubReader { lock.unlock(); auto wait_result = waitset_.wait(active_conditions_, timeout_); - if (wait_result == ReturnCode_t::RETCODE_TIMEOUT) + if (wait_result == eprosima::fastdds::dds::RETCODE_TIMEOUT) { reader_.on_waitset_timeout(); } @@ -2218,14 +2218,14 @@ class PubSubReaderWithWaitsets : public PubSubReader if (triggered_statuses.is_active(eprosima::fastdds::dds::StatusMask::sample_lost())) { eprosima::fastdds::dds::SampleLostStatus status; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, reader_.datareader_->get_sample_lost_status(status)); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, reader_.datareader_->get_sample_lost_status(status)); reader_.set_sample_lost_status(status); } if (triggered_statuses.is_active(eprosima::fastdds::dds::StatusMask::sample_rejected())) { eprosima::fastdds::dds::SampleRejectedStatus status; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, reader_.datareader_->get_sample_rejected_status(status)); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, reader_.datareader_->get_sample_rejected_status(status)); reader_.set_sample_rejected_status(status); } diff --git a/test/blackbox/api/dds-pim/PubSubWriter.hpp b/test/blackbox/api/dds-pim/PubSubWriter.hpp index 6fa2e3f5ab4..627fc222973 100644 --- a/test/blackbox/api/dds-pim/PubSubWriter.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriter.hpp @@ -383,7 +383,7 @@ class PubSubWriter type_.reset(new type_support()); // Register type - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); // Create topic topic_ = participant_->create_topic(topic_name_, type_->getName(), @@ -521,14 +521,14 @@ class PubSubWriter type& msg, const eprosima::fastrtps::rtps::InstanceHandle_t& instance_handle) { - return ReturnCode_t::RETCODE_OK == datawriter_->unregister_instance((void*)&msg, instance_handle); + return eprosima::fastdds::dds::RETCODE_OK == datawriter_->unregister_instance((void*)&msg, instance_handle); } bool dispose( type& msg, const eprosima::fastrtps::rtps::InstanceHandle_t& instance_handle) { - return ReturnCode_t::RETCODE_OK == datawriter_->dispose((void*)&msg, instance_handle); + return eprosima::fastdds::dds::RETCODE_OK == datawriter_->dispose((void*)&msg, instance_handle); } bool send_sample( @@ -754,7 +754,7 @@ class PubSubWriter nsecs -= secs; eprosima::fastrtps::Duration_t timeout {static_cast(secs.count()), static_cast(nsecs.count())}; - return (ReturnCode_t::RETCODE_OK == + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->wait_for_acknowledgments(timeout)); } @@ -771,7 +771,7 @@ class PubSubWriter nsecs -= secs; eprosima::fastrtps::Duration_t timeout {static_cast(secs.count()), static_cast(nsecs.count())}; - return (ReturnCode_t::RETCODE_OK == + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->wait_for_acknowledgments(data, instance_handle, timeout)); } @@ -1541,18 +1541,18 @@ class PubSubWriter { publisher_qos_.partition().clear(); publisher_qos_.partition().push_back(partition.c_str()); - return (ReturnCode_t::RETCODE_OK == publisher_->set_qos(publisher_qos_)); + return (eprosima::fastdds::dds::RETCODE_OK == publisher_->set_qos(publisher_qos_)); } bool set_qos() { - return (ReturnCode_t::RETCODE_OK == datawriter_->set_qos(datawriter_qos_)); + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->set_qos(datawriter_qos_)); } bool set_qos( const eprosima::fastdds::dds::DataWriterQos& att) { - return (ReturnCode_t::RETCODE_OK == datawriter_->set_qos(att)); + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->set_qos(att)); } eprosima::fastdds::dds::DataWriterQos get_qos() @@ -1563,7 +1563,7 @@ class PubSubWriter bool remove_all_changes( size_t* number_of_changes_removed) { - return (ReturnCode_t::RETCODE_OK == datawriter_->clear_history(number_of_changes_removed)); + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->clear_history(number_of_changes_removed)); } bool is_matched() const @@ -2047,7 +2047,7 @@ class PubSubWriterWithWaitsets : public PubSubWriter { lock.unlock(); auto wait_result = waitset_.wait(active_conditions_, timeout_); - if (wait_result == ReturnCode_t::RETCODE_TIMEOUT) + if (wait_result == eprosima::fastdds::dds::RETCODE_TIMEOUT) { writer_.on_waitset_timeout(); } diff --git a/test/blackbox/api/dds-pim/PubSubWriterReader.hpp b/test/blackbox/api/dds-pim/PubSubWriterReader.hpp index ab9b4a80d5e..4d790b5eaf1 100644 --- a/test/blackbox/api/dds-pim/PubSubWriterReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriterReader.hpp @@ -389,7 +389,7 @@ class PubSubWriterReader type_.reset(new type_support()); // Register type - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); //Create publisher publisher_ = participant_->create_publisher(eprosima::fastdds::dds::PUBLISHER_QOS_DEFAULT); @@ -525,7 +525,7 @@ class PubSubWriterReader topic_ = nullptr; } ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant_), ReturnCode_t::RETCODE_OK); + participant_), eprosima::fastdds::dds::RETCODE_OK); participant_ = nullptr; } @@ -906,7 +906,7 @@ class PubSubWriterReader type data; eprosima::fastdds::dds::SampleInfo info; - if ((ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&data, &info))) + if ((eprosima::fastdds::dds::RETCODE_OK == datareader->take_next_sample((void*)&data, &info))) { returnedValue = true; diff --git a/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp b/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp index 6aa9b77f5e4..fd4e40d97ee 100644 --- a/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp +++ b/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp @@ -97,7 +97,7 @@ void ReqRepHelloWorldReplier::init() // Register type type_.reset(new HelloWorldPubSubType()); - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); configDatareader("Request"); request_topic_ = participant_->create_topic(datareader_topicname_, @@ -193,7 +193,7 @@ void ReqRepHelloWorldReplier::ReplyListener::on_data_available( HelloWorld hello; eprosima::fastdds::dds::SampleInfo info; - if (ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) + if (eprosima::fastdds::dds::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) { if (info.valid_data) { diff --git a/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp b/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp index 67120847944..59488b21a26 100644 --- a/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp +++ b/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp @@ -95,7 +95,7 @@ void ReqRepHelloWorldRequester::init() // Register type type_.reset(new HelloWorldPubSubType()); - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); reply_subscriber_ = participant_->create_subscriber(eprosima::fastdds::dds::SUBSCRIBER_QOS_DEFAULT); ASSERT_NE(reply_subscriber_, nullptr); @@ -217,7 +217,7 @@ void ReqRepHelloWorldRequester::ReplyListener::on_data_available( HelloWorld hello; eprosima::fastdds::dds::SampleInfo info; - if (ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) + if (eprosima::fastdds::dds::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) { if (info.valid_data) { diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index bf626cfdb0f..6733e3bd663 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -54,8 +54,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - /** * This test checks whether it is safe to delete not enabled DDS entities * */ @@ -68,7 +66,7 @@ TEST(DDSBasic, DeleteDisabledEntities) ASSERT_NE(nullptr, factory); factory->set_qos(factory_qos); DomainParticipantFactoryQos factory_qos_check; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, factory->get_qos(factory_qos_check)); + ASSERT_EQ(RETCODE_OK, factory->get_qos(factory_qos_check)); ASSERT_EQ(false, factory_qos_check.entity_factory().autoenable_created_entities); // Create a disabled DomainParticipant, setting it to in turn create disable entities @@ -77,7 +75,7 @@ TEST(DDSBasic, DeleteDisabledEntities) DomainParticipant* participant = factory->create_participant((uint32_t)GET_PID() % 230, participant_qos); ASSERT_NE(nullptr, participant); DomainParticipantQos participant_qos_check; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->get_qos(participant_qos_check)); + ASSERT_EQ(RETCODE_OK, participant->get_qos(participant_qos_check)); ASSERT_EQ(false, participant_qos_check.entity_factory().autoenable_created_entities); // Create a disabled Publisher, setting it to in turn create disable entities @@ -86,7 +84,7 @@ TEST(DDSBasic, DeleteDisabledEntities) Publisher* publisher = participant->create_publisher(publisher_qos); ASSERT_NE(nullptr, publisher); PublisherQos publisher_qos_check; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, publisher->get_qos(publisher_qos_check)); + ASSERT_EQ(RETCODE_OK, publisher->get_qos(publisher_qos_check)); ASSERT_EQ(false, publisher_qos_check.entity_factory().autoenable_created_entities); // Create a disabled Subscriber, setting it to in turn create disable entities @@ -95,7 +93,7 @@ TEST(DDSBasic, DeleteDisabledEntities) Subscriber* subscriber = participant->create_subscriber(subscriber_qos); ASSERT_NE(nullptr, subscriber); SubscriberQos subscriber_qos_check; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, subscriber->get_qos(subscriber_qos_check)); + ASSERT_EQ(RETCODE_OK, subscriber->get_qos(subscriber_qos_check)); ASSERT_EQ(false, subscriber_qos_check.entity_factory().autoenable_created_entities); // Register type @@ -167,7 +165,7 @@ TEST(DDSBasic, MultithreadedPublisherCreation) } /* Delete publisher */ - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_publisher(publisher)); + ASSERT_EQ(RETCODE_OK, participant->delete_publisher(publisher)); }; { @@ -193,7 +191,7 @@ TEST(DDSBasic, MultithreadedPublisherCreation) } /* Clean up */ - ASSERT_EQ(ReturnCode_t::RETCODE_OK, factory->delete_participant(participant)); + ASSERT_EQ(RETCODE_OK, factory->delete_participant(participant)); } TEST(DDSBasic, MultithreadedReaderCreationDoesNotDeadlock) @@ -254,7 +252,7 @@ TEST(DDSBasic, MultithreadedReaderCreationDoesNotDeadlock) return should_finish; }); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, subscriber->delete_datareader(reader)); + ASSERT_EQ(RETCODE_OK, subscriber->delete_datareader(reader)); }; { @@ -276,11 +274,11 @@ TEST(DDSBasic, MultithreadedReaderCreationDoesNotDeadlock) } } - ASSERT_EQ(ReturnCode_t::RETCODE_OK, publisher->delete_datawriter(writer)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_publisher(publisher)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_subscriber(subscriber)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_topic(topic)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, factory->delete_participant(participant)); + ASSERT_EQ(RETCODE_OK, publisher->delete_datawriter(writer)); + ASSERT_EQ(RETCODE_OK, participant->delete_publisher(publisher)); + ASSERT_EQ(RETCODE_OK, participant->delete_subscriber(subscriber)); + ASSERT_EQ(RETCODE_OK, participant->delete_topic(topic)); + ASSERT_EQ(RETCODE_OK, factory->delete_participant(participant)); } /** @@ -457,7 +455,7 @@ TEST(DDSBasic, PidRelatedSampleIdentity) { } - ASSERT_EQ(eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK, + ASSERT_EQ(eprosima::fastrtps::types::RETCODE_OK, native_reader.take_next_sample((void*)&read_data, &info)); ASSERT_TRUE(exists_pid_related_sample_identity); diff --git a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp index e18f9f24e8d..cdd1be00cbd 100644 --- a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp @@ -201,13 +201,13 @@ class DDSContentFilter : public testing::TestWithParam { if (participant_ && subscriber_) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber_->delete_contained_entities()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_subscriber(subscriber_)); + EXPECT_EQ(RETCODE_OK, subscriber_->delete_contained_entities()); + EXPECT_EQ(RETCODE_OK, participant_->delete_subscriber(subscriber_)); } if (participant_ && filtered_topic_) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_contentfilteredtopic(filtered_topic_)); + EXPECT_EQ(RETCODE_OK, participant_->delete_contentfilteredtopic(filtered_topic_)); } } @@ -281,14 +281,14 @@ class DDSContentFilter : public testing::TestWithParam void delete_reader( DataReader* reader) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber_->delete_datareader(reader)); + EXPECT_EQ(RETCODE_OK, subscriber_->delete_datareader(reader)); } void set_filter_expression( const std::string& filter_expression, const std::vector& expression_parameters) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, filtered_topic_->set_filter_expression(filter_expression, expression_parameters)); // Avoid discovery race condition std::this_thread::sleep_for(std::chrono::milliseconds(250)); @@ -297,7 +297,7 @@ class DDSContentFilter : public testing::TestWithParam void set_expression_parameters( const std::vector& expression_parameters) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, filtered_topic_->set_expression_parameters(expression_parameters)); + EXPECT_EQ(RETCODE_OK, filtered_topic_->set_expression_parameters(expression_parameters)); // Avoid discovery race condition std::this_thread::sleep_for(std::chrono::milliseconds(250)); } @@ -347,7 +347,7 @@ class DDSContentFilter : public testing::TestWithParam SampleInfoSeq recv_info; ReturnCode_t expected_ret; - expected_ret = expected_samples == 0 ? ReturnCode_t::RETCODE_NO_DATA : ReturnCode_t::RETCODE_OK; + expected_ret = expected_samples == 0 ? RETCODE_NO_DATA : RETCODE_OK; EXPECT_EQ(expected_ret, reader->take(recv_data, recv_info)); EXPECT_EQ(recv_data.length(), expected_samples); for (HelloWorldSeq::size_type i = 0; @@ -358,7 +358,7 @@ class DDSContentFilter : public testing::TestWithParam } if (expected_samples > 0) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, reader->return_loan(recv_data, recv_info)); + EXPECT_EQ(RETCODE_OK, reader->return_loan(recv_data, recv_info)); } // Ensure writer ends in clean state @@ -404,7 +404,7 @@ class DDSContentFilter : public testing::TestWithParam HelloWorldSeq recv_data; SampleInfoSeq recv_info; - while (ReturnCode_t::RETCODE_OK == reader.take(recv_data, recv_info)) + while (RETCODE_OK == reader.take(recv_data, recv_info)) { reader.return_loan(recv_data, recv_info); } @@ -589,7 +589,7 @@ TEST(DDSContentFilter, CorrectlyHandleAliasOtherHeader) auto ret = type.register_type(participant); - if (ret != ReturnCode_t::RETCODE_OK) + if (ret != RETCODE_OK) { throw std::runtime_error("Failed to register type"); } diff --git a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp index 46778700c49..e7045b3d785 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp @@ -197,7 +197,7 @@ TEST_P(DDSDataReader, ConsistentTotalUnreadAfterGetFirstUntakenInfo) eprosima::fastdds::dds::DataReader& reader = pubsub_reader.get_native_reader(); eprosima::fastdds::dds::SampleInfo info; - EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, reader.get_first_untaken_info(&info)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, reader.get_first_untaken_info(&info)); // Wait for discovery. pubsub_reader.wait_discovery(); @@ -218,7 +218,7 @@ TEST_P(DDSDataReader, ConsistentTotalUnreadAfterGetFirstUntakenInfo) //! Checks whether total_unread_ is consistent with //! the number of unread changes in history //! This API call should NOT modify the history - EXPECT_EQ(ReturnCode_t::RETCODE_OK, reader.get_first_untaken_info(&info)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, reader.get_first_untaken_info(&info)); HelloWorld msg; eprosima::fastdds::dds::SampleInfo sinfo; @@ -227,7 +227,7 @@ TEST_P(DDSDataReader, ConsistentTotalUnreadAfterGetFirstUntakenInfo) auto result = reader.take_next_sample((void*)&msg, &sinfo); //! Assert last operation - ASSERT_EQ(result, ReturnCode_t::RETCODE_OK) << "Reader's unread count is: " << reader.get_unread_count(); + ASSERT_EQ(result, eprosima::fastdds::dds::RETCODE_OK) << "Reader's unread count is: " << reader.get_unread_count(); } //! Regression test for Issues #3822 Github #3875 @@ -248,7 +248,7 @@ TEST(DDSDataReader, ConsistentReliabilityWhenIntraprocess) eprosima::fastdds::dds::StatusMask::none()); eprosima::fastdds::dds::TypeSupport t_type{ new HelloWorldPubSubType() }; - ASSERT_TRUE(t_type.register_type( participant ) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(t_type.register_type( participant ) == eprosima::fastdds::dds::RETCODE_OK); auto topic = participant->create_topic( TEST_TOPIC_NAME, t_type.get_type_name(), participant->get_default_topic_qos()); diff --git a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp index 3a6ff7194f5..7df3b3dc131 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp @@ -162,40 +162,40 @@ TEST_P(DDSDataWriter, GetKeyValue) DataWriter* instance_datawriter = &keyed_writer.get_native_writer(); // 1. Check nullptr on key_holder - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->get_key_value(nullptr, wrong_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(nullptr, wrong_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, datawriter->get_key_value(nullptr, wrong_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(nullptr, wrong_handle)); // 2. Check HANDLE_NIL - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->get_key_value(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, HANDLE_NIL)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, datawriter->get_key_value(&data, HANDLE_NIL)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, HANDLE_NIL)); // 3. Check type should have keys - EXPECT_EQ(ReturnCode_t::RETCODE_ILLEGAL_OPERATION, datawriter->get_key_value(&data, wrong_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ILLEGAL_OPERATION, datawriter->get_key_value(&data, wrong_handle)); - // 4. Calling get_key_value with a key not yet registered returns RETCODE_BAD_PARAMETER - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, wrong_handle)); + // 4. Calling get_key_value with a key not yet registered returns eprosima::fastdds::dds::RETCODE_BAD_PARAMETER + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, wrong_handle)); // 5. Calling get_key_value on a registered instance should work. valid_handle = instance_datawriter->register_instance(&valid_data); EXPECT_NE(HANDLE_NIL, valid_handle); data.key(0); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); EXPECT_EQ(valid_data.key(), data.key()); - // 6. Calling get_key_value on an unregistered instance should return RETCODE_BAD_PARAMETER. - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance(&valid_data, valid_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, valid_handle)); + // 6. Calling get_key_value on an unregistered instance should return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER. + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->unregister_instance(&valid_data, valid_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, valid_handle)); // 7. Calling get_key_value with a valid instance should work - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&valid_data, HANDLE_NIL)); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->write(&valid_data, HANDLE_NIL)); data.key(0); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); EXPECT_EQ(valid_data.key(), data.key()); // 8. Calling get_key_value on a disposed instance should work. - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose(&valid_data, valid_handle)); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->dispose(&valid_data, valid_handle)); data.key(0); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); EXPECT_EQ(valid_data.key(), data.key()); } @@ -230,7 +230,7 @@ TEST_P(DDSDataWriter, WithTimestampOperations) DataWriter& datawriter = writer.get_native_writer(); DataWriterQos qos = datawriter.get_qos(); qos.writer_data_lifecycle().autodispose_unregistered_instances = false; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.set_qos(qos)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.set_qos(qos)); // Wait discovery, since we are going to unregister an instance reader.wait_discovery(); @@ -245,16 +245,17 @@ TEST_P(DDSDataWriter, WithTimestampOperations) ts.nanosec--; // Write with custom timestamp ts.nanosec++; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.write_w_timestamp(&valid_data, HANDLE_NIL, ts)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.write_w_timestamp(&valid_data, HANDLE_NIL, ts)); // Dispose with custom timestamp ts.nanosec++; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.dispose_w_timestamp(&valid_data, HANDLE_NIL, ts)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.dispose_w_timestamp(&valid_data, HANDLE_NIL, ts)); // Write with custom timestamp ts.nanosec++; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.write_w_timestamp(&valid_data, HANDLE_NIL, ts)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.write_w_timestamp(&valid_data, HANDLE_NIL, ts)); // Unregister with custom timestamp ts.nanosec++; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.unregister_instance_w_timestamp(&valid_data, HANDLE_NIL, ts)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.unregister_instance_w_timestamp(&valid_data, HANDLE_NIL, + ts)); // Wait and take all data auto num_samples = ts.nanosec; @@ -266,7 +267,7 @@ TEST_P(DDSDataWriter, WithTimestampOperations) FASTDDS_CONST_SEQUENCE(DataSeq, KeyedHelloWorld); SampleInfoSeq infos; DataSeq datas; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datareader.take(datas, infos)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datareader.take(datas, infos)); // Check received timestamps ts.seconds = 0; @@ -278,7 +279,7 @@ TEST_P(DDSDataWriter, WithTimestampOperations) ts.nanosec++; } - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datareader.return_loan(datas, infos)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datareader.return_loan(datas, infos)); } /** diff --git a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp index 75dfc3dd1cd..8e60242eaa2 100644 --- a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp @@ -703,18 +703,18 @@ TEST(DDSDiscovery, WriterAndReaderMatchUsingDynamicReusableMemoryMode) /** * This test checks the missing file case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckMissingFileXmlStaticDiscoveryFile) { std::string file = "MissingFile.xml"; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the correct data case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_OK + * method and checks it returns eprosima::fastdds::dds::RETCODE_OK */ TEST(DDSDiscovery, CheckCorrectXmlStaticDiscoveryFile) { @@ -747,12 +747,12 @@ TEST(DDSDiscovery, CheckCorrectXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_OK); } /** * This test checks the incorrect case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectStaticdiscoveryXmlStaticDiscoveryFile) { @@ -785,12 +785,12 @@ TEST(DDSDiscovery, CheckIncorrectStaticdiscoveryXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectParticipantXmlStaticDiscoveryFile) { @@ -823,12 +823,12 @@ TEST(DDSDiscovery, CheckIncorrectParticipantXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderXmlStaticDiscoveryFile) { @@ -861,12 +861,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderUserIDXmlStaticDiscoveryFile) { @@ -899,11 +899,11 @@ TEST(DDSDiscovery, CheckIncorrectReaderUserIDXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderEntityIDXmlStaticDiscoveryFile) { @@ -936,12 +936,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderEntityIDXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderTopicNameXmlStaticDiscoveryFile) { @@ -974,12 +974,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderTopicNameXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect data case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderTopicDataTypeXmlStaticDiscoveryFile) { @@ -1012,12 +1012,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderTopicDataTypeXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderTopicKindXmlStaticDiscoveryFile) { @@ -1050,12 +1050,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderTopicKindXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderPartitionQosXmlStaticDiscoveryFile) { @@ -1088,12 +1088,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderPartitionQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderReliabilityQosXmlStaticDiscoveryFile) { @@ -1126,12 +1126,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderReliabilityQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderDurabilityQosXmlStaticDiscoveryFile) { @@ -1164,12 +1164,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderDurabilityQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderMulticastLocatorXmlStaticDiscoveryFile) { @@ -1202,12 +1202,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderMulticastLocatorXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterXmlStaticDiscoveryFile) { @@ -1240,12 +1240,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterUserIDXmlStaticDiscoveryFile) { @@ -1278,12 +1278,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterUserIDXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterEntityIDXmlStaticDiscoveryFile) { @@ -1316,12 +1316,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterEntityIDXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterTopicNameXmlStaticDiscoveryFile) { @@ -1354,12 +1354,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterTopicNameXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterTopicDataTypeXmlStaticDiscoveryFile) { @@ -1392,12 +1392,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterTopicDataTypeXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterTopicKindXmlStaticDiscoveryFile) { @@ -1430,12 +1430,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterTopicKindXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterPartitionQosXmlStaticDiscoveryFile) { @@ -1468,12 +1468,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterPartitionQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterReliabilityQosXmlStaticDiscoveryFile) { @@ -1506,12 +1506,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterReliabilityQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterDurabilityQosXmlStaticDiscoveryFile) { @@ -1544,7 +1544,7 @@ TEST(DDSDiscovery, CheckIncorrectWriterDurabilityQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** @@ -1571,7 +1571,7 @@ static void test_DDSDiscovery_WaitSetMatchedStatus( ASSERT_NE(participant, nullptr); fastdds::dds::TypeSupport type(new HelloWorldPubSubType()); - EXPECT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(type.register_type(participant), eprosima::fastdds::dds::RETCODE_OK); auto topic = participant->create_topic(TEST_TOPIC_NAME, type->getName(), fastdds::dds::TOPIC_QOS_DEFAULT); ASSERT_NE(topic, nullptr); @@ -1595,7 +1595,7 @@ static void test_DDSDiscovery_WaitSetMatchedStatus( while (1 > matched_status.current_count) { ReturnCode_t ret_code = wait_set.wait(triggered_conditions, fastrtps::c_TimeInfinite); - if (ReturnCode_t::RETCODE_OK != ret_code) + if (eprosima::fastdds::dds::RETCODE_OK != ret_code) { continue; } diff --git a/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp b/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp index eb207896720..801b7e2477a 100644 --- a/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp @@ -42,8 +42,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class DDSFindTopicTest : public testing::Test { /** @@ -363,27 +361,27 @@ TEST_F(DDSFindTopicTest, find_topic_delete_topic) // Steps 1-4. { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_topic(topic_3)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_1)); + EXPECT_EQ(RETCODE_OK, participant_->delete_topic(topic_3)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_2)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_1)); EXPECT_EQ(nullptr, create_test_topic()); } // Steps 5-9. { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, publisher->delete_datawriter(data_writer)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_3)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_topic(topic_1)); + EXPECT_EQ(RETCODE_OK, publisher->delete_datawriter(data_writer)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_3)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_2)); + EXPECT_EQ(RETCODE_OK, participant_->delete_topic(topic_1)); EXPECT_EQ(nullptr, create_test_topic()); } // Steps 10-14. { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber->delete_datareader(data_reader)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_3)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_topic(topic_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_1)); + EXPECT_EQ(RETCODE_OK, subscriber->delete_datareader(data_reader)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_3)); + EXPECT_EQ(RETCODE_OK, participant_->delete_topic(topic_2)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_1)); EXPECT_NE(nullptr, create_test_topic()); } } diff --git a/test/blackbox/common/DDSBlackboxTestsStatistics.cpp b/test/blackbox/common/DDSBlackboxTestsStatistics.cpp index a9dcd8ebcbb..193545f28d0 100644 --- a/test/blackbox/common/DDSBlackboxTestsStatistics.cpp +++ b/test/blackbox/common/DDSBlackboxTestsStatistics.cpp @@ -65,7 +65,6 @@ using namespace eprosima::fastdds; using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps::types; struct GenericType { @@ -79,7 +78,7 @@ static DataReader* enable_statistics( { auto qos = statistics::dds::STATISTICS_DATAWRITER_QOS; qos.history().depth = 10; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable_statistics_datawriter( + EXPECT_EQ(RETCODE_OK, participant->enable_statistics_datawriter( topic_name, qos)); auto topic_desc = participant->lookup_topicdescription(topic_name); @@ -94,8 +93,8 @@ static void disable_statistics( DataReader* reader, const std::string& topic_name) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber->delete_datareader(reader)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->disable_statistics_datawriter(topic_name)); + EXPECT_EQ(RETCODE_OK, subscriber->delete_datareader(reader)); + EXPECT_EQ(RETCODE_OK, participant->disable_statistics_datawriter(topic_name)); } static void wait_statistics( @@ -120,7 +119,7 @@ static void wait_statistics( LoanableSequence data_seq; SampleInfoSeq info_seq; - if (ReturnCode_t::RETCODE_OK == reader->take(data_seq, info_seq)) + if (RETCODE_OK == reader->take(data_seq, info_seq)) { total_samples += info_seq.length(); reader->return_loan(data_seq, info_seq); @@ -226,7 +225,7 @@ void test_discovery_topic_physical_data( ASSERT_NE(nullptr, statistics_p1); Publisher* publisher_p1 = p1->create_publisher(PUBLISHER_QOS_DEFAULT); ASSERT_NE(nullptr, publisher_p1); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, statistics_p1->enable_statistics_datawriter(statistics::DISCOVERY_TOPIC, statistics::dds::STATISTICS_DATAWRITER_QOS)); @@ -301,7 +300,7 @@ void test_discovery_topic_physical_data( /* Create waitset for the DataReader */ WaitSet waitset; StatusCondition& condition = discovery_data_reader->get_statuscondition(); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, condition.set_enabled_statuses(StatusMask::data_available())); + ASSERT_EQ(RETCODE_OK, condition.set_enabled_statuses(StatusMask::data_available())); ASSERT_EQ(false, condition.get_trigger_value()); waitset.attach_condition(condition); @@ -331,7 +330,7 @@ void test_discovery_topic_physical_data( LoanableSequence discovery_time_seq; SampleInfoSeq info_seq; - while (ReturnCode_t::RETCODE_OK == discovery_data_reader->take(discovery_time_seq, info_seq)) + while (RETCODE_OK == discovery_data_reader->take(discovery_time_seq, info_seq)) { for (LoanableSequence::size_type n = 0; n < info_seq.length(); n++) { @@ -612,8 +611,8 @@ TEST(DDSStatistics, statistics_with_partition_on_user) auto user_pub_1 = p1->create_publisher(pub_qos); // We enable the participants - ASSERT_EQ(ReturnCode_t::RETCODE_OK, p1->enable()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, p2->enable()); + ASSERT_EQ(RETCODE_OK, p1->enable()); + ASSERT_EQ(RETCODE_OK, p2->enable()); auto statistics_p1 = statistics::dds::DomainParticipant::narrow(p1); auto statistics_p2 = statistics::dds::DomainParticipant::narrow(p2); diff --git a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp index 4be3ef5f5f1..d8d6edb8f23 100644 --- a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp +++ b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp @@ -416,7 +416,7 @@ TEST(StatisticsDomainParticipant, CreateParticipant) physical_data_reader.destroy(); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + eprosima::fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } @@ -585,6 +585,6 @@ TEST(StatisticsDomainParticipant, CreateParticipantUsingXML) sample_datas_reader.destroy(); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + eprosima::fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } diff --git a/test/dds/communication/PublisherModule.cpp b/test/dds/communication/PublisherModule.cpp index 99d1bb437b1..aae82d508eb 100644 --- a/test/dds/communication/PublisherModule.cpp +++ b/test/dds/communication/PublisherModule.cpp @@ -144,7 +144,7 @@ void PublisherModule::run( { if (zero_copy_) { - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { FixedSized* data = static_cast(sample); data->index(index); diff --git a/test/dds/communication/SubscriberDynamic.cpp b/test/dds/communication/SubscriberDynamic.cpp index f3276601d90..ef78ff73a4a 100644 --- a/test/dds/communication/SubscriberDynamic.cpp +++ b/test/dds/communication/SubscriberDynamic.cpp @@ -366,7 +366,7 @@ int main( types::DynamicData_ptr sample(static_cast(pst.createData())); eprosima::fastdds::dds::SampleInfo info; - if (!!reader->take_next_sample(sample.get(), &info)) + if (RETCODE_OK == reader->take_next_sample(sample.get(), &info)) { if (info.valid_data) { @@ -396,7 +396,7 @@ int main( if (participant != nullptr) { - if (!participant->delete_contained_entities() && !result) + if (RETCODE_OK != participant->delete_contained_entities() && !result) { std::cout << "ERROR: precondition not met on participant entities removal" << std::endl; result = 1; diff --git a/test/dds/communication/SubscriberModule.cpp b/test/dds/communication/SubscriberModule.cpp index e08b024c6d4..4e7c5e1a6b5 100644 --- a/test/dds/communication/SubscriberModule.cpp +++ b/test/dds/communication/SubscriberModule.cpp @@ -261,7 +261,7 @@ void SubscriberModule::on_data_available( LoanableSequence l_sample; LoanableSequence l_info; - if (ReturnCode_t::RETCODE_OK == reader->take_next_instance(l_sample, l_info)) + if (RETCODE_OK == reader->take_next_instance(l_sample, l_info)) { SampleInfo info = l_info[0]; @@ -288,7 +288,7 @@ void SubscriberModule::on_data_available( if (fixed_type_) { FixedSized sample; - if (reader->take_next_sample((void*)&sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample((void*)&sample, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { @@ -305,7 +305,7 @@ void SubscriberModule::on_data_available( else { HelloWorld sample; - if (reader->take_next_sample((void*)&sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample((void*)&sample, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp b/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp index 65bab00e4d2..6ea2b9b03c3 100644 --- a/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp +++ b/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp @@ -48,8 +48,6 @@ #include #include -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { @@ -118,13 +116,13 @@ class DomainParticipantImpl rtps_participant_ = eprosima::fastrtps::rtps::RTPSDomain::createParticipant( domain_id_, false, rtps_attr, &rtps_listener_); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_qos( DomainParticipantQos& /*qos*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipantQos& get_qos() const @@ -135,20 +133,20 @@ class DomainParticipantImpl ReturnCode_t set_qos( const DomainParticipantQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_listener( DomainParticipantListener* /*listener*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_listener( DomainParticipantListener* /*listener*/, const std::chrono::seconds /*timeout*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipantListener* get_listener() const @@ -199,7 +197,7 @@ class DomainParticipantImpl { if (participant_ != pub->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_pubs_); auto pit = publishers_.find(const_cast(pub)); @@ -207,13 +205,13 @@ class DomainParticipantImpl { if (pub->has_datawriters()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } delete pit->second; publishers_.erase(pit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } Subscriber* create_subscriber( @@ -244,7 +242,7 @@ class DomainParticipantImpl { if (participant_ != sub->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_subs_); auto sit = subscribers_.find(const_cast(sub)); @@ -252,13 +250,13 @@ class DomainParticipantImpl { if (sub->has_datareaders()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } delete sit->second; subscribers_.erase(sit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } Topic* create_topic( @@ -273,7 +271,7 @@ class DomainParticipantImpl { return nullptr; } - if (!TopicImpl::check_qos(qos)) + if (RETCODE_OK != TopicImpl::check_qos(qos)) { return nullptr; } @@ -323,15 +321,15 @@ class DomainParticipantImpl if (delete_topic_mock()) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } if (nullptr == topic) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (participant_ != topic->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_topics_); @@ -340,7 +338,7 @@ class DomainParticipantImpl { if (it->second->is_referenced()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } delete it->second; topics_.erase(it); @@ -349,9 +347,9 @@ class DomainParticipantImpl delete topics_impl_[topic_name]; topics_impl_.erase(topic_name); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } MOCK_METHOD5(create_contentfilteredtopic, ContentFilteredTopic * ( @@ -398,20 +396,20 @@ class DomainParticipantImpl { if (type_name.size() <= 0) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } TypeSupport t = find_type(type_name); if (!t.empty()) { if (t == type) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_types_); types_.insert(std::make_pair(type_name, type)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t unregister_type( @@ -419,12 +417,12 @@ class DomainParticipantImpl { if (type_name.size() <= 0) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } TypeSupport t = find_type(type_name); if (t.empty()) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } { std::lock_guard lock(mtx_subs_); @@ -432,7 +430,7 @@ class DomainParticipantImpl { if (sit.second->type_in_use(type_name)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } @@ -442,13 +440,13 @@ class DomainParticipantImpl { if (pit.second->type_in_use(type_name)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } std::lock_guard lock(mtx_types_); types_.erase(type_name); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainId_t get_domain_id() const @@ -458,13 +456,13 @@ class DomainParticipantImpl ReturnCode_t assert_liveliness() { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_default_publisher_qos( const PublisherQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const PublisherQos& get_default_publisher_qos() const @@ -472,17 +470,17 @@ class DomainParticipantImpl return default_pub_qos_; } - const ReturnCode_t get_publisher_qos_from_profile( + ReturnCode_t get_publisher_qos_from_profile( const std::string& /*profile_name*/, PublisherQos& /*qos*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_default_subscriber_qos( const SubscriberQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const SubscriberQos& get_default_subscriber_qos() const @@ -490,17 +488,17 @@ class DomainParticipantImpl return default_sub_qos_; } - const ReturnCode_t get_subscriber_qos_from_profile( + ReturnCode_t get_subscriber_qos_from_profile( const std::string& /*profile_name*/, SubscriberQos& /*qos*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_default_topic_qos( const TopicQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const TopicQos& get_default_topic_qos() const @@ -508,11 +506,11 @@ class DomainParticipantImpl return default_topic_qos_; } - const ReturnCode_t get_topic_qos_from_profile( + ReturnCode_t get_topic_qos_from_profile( const std::string& /*profile_name*/, TopicQos& /*qos*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool contains_entity( @@ -525,7 +523,7 @@ class DomainParticipantImpl ReturnCode_t get_current_time( fastrtps::Time_t& /*current_time*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainParticipant* get_participant() const @@ -595,7 +593,7 @@ class DomainParticipantImpl const std::string& /*type_name*/, std::function& /*callback*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } virtual void disable() @@ -641,7 +639,7 @@ class DomainParticipantImpl can_be_deleted = subscriber.second->can_be_deleted(); if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } @@ -654,18 +652,18 @@ class DomainParticipantImpl can_be_deleted = publisher.second->can_be_deleted(); if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } - ReturnCode_t ret_code = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret_code = RETCODE_OK; for (auto& subscriber : subscribers_) { ret_code = subscriber.first->delete_contained_entities(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -680,9 +678,9 @@ class DomainParticipantImpl for (auto& publisher : publishers_) { ret_code = publisher.first->delete_contained_entities(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -704,7 +702,7 @@ class DomainParticipantImpl it_topics = topics_.erase(it_topics); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainParticipantListener* get_listener_for( @@ -782,7 +780,7 @@ class DomainParticipantImpl static ReturnCode_t check_qos( const DomainParticipantQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } }; diff --git a/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp b/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp index 7fe3b490627..3b19b3375c6 100644 --- a/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp +++ b/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp @@ -29,8 +29,6 @@ #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { @@ -76,7 +74,7 @@ class Publisher : public Entity ReturnCode_t enable() override { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const PublisherQos& get_qos() const @@ -87,7 +85,7 @@ class Publisher : public Entity ReturnCode_t set_listener( PublisherListener* /*listener*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DataWriter* create_datawriter( @@ -108,7 +106,7 @@ class Publisher : public Entity { if (delete_datawriter_mock()) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } return impl_->delete_datawriter(writer); } diff --git a/test/performance/latency/LatencyTestPublisher.cpp b/test/performance/latency/LatencyTestPublisher.cpp index 45cac09b1eb..29ad2bc71a3 100644 --- a/test/performance/latency/LatencyTestPublisher.cpp +++ b/test/performance/latency/LatencyTestPublisher.cpp @@ -43,7 +43,6 @@ using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; LatencyTestPublisher::LatencyTestPublisher() : latency_command_type_(new TestCommandDataType()) @@ -168,7 +167,7 @@ bool LatencyTestPublisher::init( // Load XML configuration if (xml_config_file_.length() > 0) { - if ( ReturnCode_t::RETCODE_OK != + if ( RETCODE_OK != DomainParticipantFactory::get_instance()-> get_participant_qos_from_profile( participant_profile_name, @@ -220,7 +219,7 @@ bool LatencyTestPublisher::init( } // Register the command type - if (ReturnCode_t::RETCODE_OK != latency_command_type_.register_type(participant_)) + if (RETCODE_OK != latency_command_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR registering the COMMAND type"); return false; @@ -250,14 +249,14 @@ bool LatencyTestPublisher::init( std::string pub_profile_name = "pub_publisher_profile"; std::string sub_profile_name = "pub_subscriber_profile"; - if (ReturnCode_t::RETCODE_OK != publisher_->get_datawriter_qos_from_profile(pub_profile_name, dw_qos_)) + if (RETCODE_OK != publisher_->get_datawriter_qos_from_profile(pub_profile_name, dw_qos_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR unable to retrive the " << pub_profile_name << "from XML file"); return false; } - if (ReturnCode_t::RETCODE_OK != subscriber_->get_datareader_qos_from_profile(sub_profile_name, dr_qos_)) + if (RETCODE_OK != subscriber_->get_datareader_qos_from_profile(sub_profile_name, dr_qos_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR unable to retrive the " << sub_profile_name << "from XML file"); @@ -508,7 +507,7 @@ void LatencyTestPublisher::CommandReaderListener::on_data_available( SampleInfo info; if (reader->take_next_sample( - &command, &info) == ReturnCode_t::RETCODE_OK + &command, &info) == RETCODE_OK && info.valid_data) { if (command.m_command == BEGIN @@ -537,7 +536,7 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( if (pub->data_loans_) { - if (ReturnCode_t::RETCODE_OK != reader->take(data_seq, infos, 1)) + if (RETCODE_OK != reader->take(data_seq, infos, 1)) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem reading Subscriber echoed loaned test data"); return; @@ -552,7 +551,7 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( // Retrieved echoed data if (reader->take_next_sample( - data, &info) != ReturnCode_t::RETCODE_OK + data, &info) != RETCODE_OK || !info.valid_data) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem reading Subscriber echoed test data"); @@ -632,7 +631,7 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( // release the loan if any if (pub->data_loans_ - && ReturnCode_t::RETCODE_OK != reader->return_loan(data_seq, infos)) + && RETCODE_OK != reader->return_loan(data_seq, infos)) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem returning loaned test data"); } @@ -703,26 +702,28 @@ bool LatencyTestPublisher::test( if (dynamic_types_) { - dynamic_data_in_ = static_cast(dynamic_pub_sub_type_->createData()); - dynamic_data_out_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_in_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_out_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_in_) { - EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "Iteration failed: Failed to create Dynamic Data In"); + EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, + "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data In"); return false; } if (nullptr == dynamic_data_out_) { - EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "Iteration failed: Failed to create Dynamic Data Out"); + EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, + "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data Out"); return false; } - MemberId id_in; - MemberId id_out; - DynamicData* data_in = dynamic_data_in_->loan_value( + eprosima::fastrtps::types::MemberId id_in; + eprosima::fastrtps::types::MemberId id_out; + eprosima::fastrtps::types::DynamicData* data_in = dynamic_data_in_->loan_value( dynamic_data_in_->get_member_id_at_index(1)); - DynamicData* data_out = dynamic_data_out_->loan_value( + eprosima::fastrtps::types::DynamicData* data_out = dynamic_data_out_->loan_value( dynamic_data_out_->get_member_id_at_index(1)); // fill until complete the desired payload size @@ -808,7 +809,7 @@ bool LatencyTestPublisher::test( while (trials-- != 0 && !loaned) { - loaned = (ReturnCode_t::RETCODE_OK + loaned = (RETCODE_OK == data_writer_->loan_sample( data, DataWriter::LoanInitializationKind::NO_LOAN_INITIALIZATION)); @@ -892,8 +893,8 @@ bool LatencyTestPublisher::test( // Delete Data Sample if (dynamic_types_) { - DynamicDataFactory::get_instance()->delete_data(dynamic_data_in_); - DynamicDataFactory::get_instance()->delete_data(dynamic_data_out_); + eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_in_); + eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_out_); } else { @@ -1067,17 +1068,22 @@ bool LatencyTestPublisher::init_dynamic_types() // Dummy type registration // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + eprosima::fastrtps::types::DynamicTypeBuilder_ptr struct_type_builder(eprosima::fastrtps::types:: + DynamicTypeBuilderFactory::get_instance()-> + create_struct_builder()); // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), BOUND_UNLIMITED)); + struct_type_builder->add_member(0, "seqnum", + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); + struct_type_builder->add_member(1, "data", + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_byte_type(), + eprosima::fastrtps::types::BOUND_UNLIMITED)); struct_type_builder->set_name(LatencyDataType::type_name_); - dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); + dynamic_pub_sub_type_.reset(new eprosima::fastrtps::types::DynamicPubSubType(struct_type_builder->build())); // Register the data type - if (ReturnCode_t::RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) + if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR registering the DYNAMIC DATA type"); return false; @@ -1109,7 +1115,7 @@ bool LatencyTestPublisher::init_static_types( // Create the static type latency_data_type_.reset(new LatencyDataType(padding)); // Register the static type - if (ReturnCode_t::RETCODE_OK != latency_data_type_.register_type(participant_)) + if (RETCODE_OK != latency_data_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR registering the STATIC DATA type"); return false; @@ -1218,7 +1224,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() // Delete the endpoints if (nullptr == data_writer_ - || ReturnCode_t::RETCODE_OK != publisher_->delete_datawriter(data_writer_)) + || RETCODE_OK != publisher_->delete_datawriter(data_writer_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR destroying the DataWriter"); return false; @@ -1227,7 +1233,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() data_writer_listener_.reset(); if (nullptr == data_reader_ - || ReturnCode_t::RETCODE_OK != subscriber_->delete_datareader(data_reader_)) + || RETCODE_OK != subscriber_->delete_datareader(data_reader_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR destroying the DataReader"); return false; @@ -1237,7 +1243,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() // Delete the Topics if (nullptr == latency_data_pub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(latency_data_pub_topic_)) + || RETCODE_OK != participant_->delete_topic(latency_data_pub_topic_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR destroying the DATA PUB topic"); return false; @@ -1245,7 +1251,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() latency_data_pub_topic_ = nullptr; if (nullptr == latency_data_sub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(latency_data_sub_topic_)) + || RETCODE_OK != participant_->delete_topic(latency_data_sub_topic_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR destroying the DATA SUB topic"); return false; @@ -1253,7 +1259,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() latency_data_sub_topic_ = nullptr; // Delete the Type - if (ReturnCode_t::RETCODE_OK != participant_->unregister_type(LatencyDataType::type_name_)) + if (RETCODE_OK != participant_->unregister_type(LatencyDataType::type_name_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR unregistering the DATA type"); return false; @@ -1261,7 +1267,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() latency_data_type_.reset(); dynamic_pub_sub_type_.reset(); - DynamicTypeBuilderFactory::delete_instance(); + eprosima::fastrtps::types::DynamicTypeBuilderFactory::delete_instance(); return true; } diff --git a/test/performance/latency/LatencyTestSubscriber.cpp b/test/performance/latency/LatencyTestSubscriber.cpp index f6e34bca42a..feca5c597db 100644 --- a/test/performance/latency/LatencyTestSubscriber.cpp +++ b/test/performance/latency/LatencyTestSubscriber.cpp @@ -34,7 +34,6 @@ #include using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; using namespace eprosima::fastdds::dds; LatencyTestSubscriber::LatencyTestSubscriber() @@ -122,7 +121,7 @@ bool LatencyTestSubscriber::init( // Load XML configuration if (xml_config_file_.length() > 0) { - if ( ReturnCode_t::RETCODE_OK != + if ( RETCODE_OK != DomainParticipantFactory::get_instance()-> get_participant_qos_from_profile( participant_profile_name, @@ -172,7 +171,7 @@ bool LatencyTestSubscriber::init( } // Register the command type - if (ReturnCode_t::RETCODE_OK != latency_command_type_.register_type(participant_)) + if (RETCODE_OK != latency_command_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR registering the COMMAND type"); return false; @@ -201,14 +200,14 @@ bool LatencyTestSubscriber::init( std::string sub_profile_name = "sub_subscriber_profile"; std::string pub_profile_name = "sub_publisher_profile"; - if ( ReturnCode_t::RETCODE_OK != publisher_->get_datawriter_qos_from_profile(pub_profile_name, dw_qos_)) + if ( RETCODE_OK != publisher_->get_datawriter_qos_from_profile(pub_profile_name, dw_qos_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR unable to retrieve the " << pub_profile_name << "from XML file"); return false; } - if ( ReturnCode_t::RETCODE_OK != subscriber_->get_datareader_qos_from_profile(sub_profile_name, dr_qos_)) + if ( RETCODE_OK != subscriber_->get_datareader_qos_from_profile(sub_profile_name, dr_qos_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR unable to retrieve the " << sub_profile_name); return false; @@ -444,7 +443,7 @@ void LatencyTestSubscriber::CommandReaderListener::on_data_available( bool notify = false; if (reader->take_next_sample( - &command, &info) == ReturnCode_t::RETCODE_OK + &command, &info) == RETCODE_OK && info.valid_data) { std::unique_lock lock(latency_subscriber_->mutex_); @@ -504,7 +503,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( // writer loan buffer void* echoed_loan = nullptr; - if (ReturnCode_t::RETCODE_OK != reader->take(data_seq, infos, 1)) + if (RETCODE_OK != reader->take(data_seq, infos, 1)) { EPROSIMA_LOG_INFO(LatencyTest, "Problem reading Subscriber echoed loaned test data"); return; @@ -528,7 +527,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( data_type->copy_data(*echoed_data, *sub->latency_data_); // release the reader loan - if (ReturnCode_t::RETCODE_OK != reader->return_loan(data_seq, infos)) + if (RETCODE_OK != reader->return_loan(data_seq, infos)) { EPROSIMA_LOG_INFO(LatencyTest, "Problem returning loaned test data"); return; @@ -539,7 +538,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( bool loaned = false; while (trials-- != 0 && !loaned) { - loaned = (ReturnCode_t::RETCODE_OK + loaned = (RETCODE_OK == sub->data_writer_->loan_sample( echoed_loan, DataWriter::LoanInitializationKind::NO_LOAN_INITIALIZATION)); @@ -577,7 +576,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( else { // release the loan - if (ReturnCode_t::RETCODE_OK != reader->return_loan(data_seq, infos)) + if (RETCODE_OK != reader->return_loan(data_seq, infos)) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem returning loaned test data"); } @@ -591,7 +590,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( (void*)sub->latency_data_; if (reader->take_next_sample( - data, &info) == ReturnCode_t::RETCODE_OK + data, &info) == RETCODE_OK && info.valid_data) { if (sub->echo_) @@ -652,17 +651,18 @@ bool LatencyTestSubscriber::test( if (dynamic_types_) { // Create the data sample - MemberId id; - dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); + eprosima::fastrtps::types::MemberId id; + dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { - EPROSIMA_LOG_ERROR(LatencyTest, "Iteration failed: Failed to create Dynamic Data"); + EPROSIMA_LOG_ERROR(LatencyTest, + "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data"); return false; } // Modify the data Sample - DynamicData* member_data = dynamic_data_->loan_value( + eprosima::fastrtps::types::DynamicData* member_data = dynamic_data_->loan_value( dynamic_data_->get_member_id_at_index(1)); // fill until complete the desired payload size @@ -720,7 +720,7 @@ bool LatencyTestSubscriber::test( if (dynamic_types_) { dynamic_pub_sub_type_->deleteData(dynamic_data_); - // DynamicDataFactory::get_instance()->delete_data(dynamic_data_); + // eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_); // // Reset history for the new test size_t removed; @@ -752,7 +752,7 @@ bool LatencyTestSubscriber::test( } // prevent the LatencyTestSubscriber from been destroyed while LatencyTestPublisher is waitin for the END command. - if ( ReturnCode_t::RETCODE_OK != command_writer_->wait_for_acknowledgments(eprosima::fastrtps::c_TimeInfinite)) + if ( RETCODE_OK != command_writer_->wait_for_acknowledgments(eprosima::fastrtps::c_TimeInfinite)) { EPROSIMA_LOG_ERROR(LatencyTest, "Subscriber fail to acknowledge the END command"); return false; @@ -795,17 +795,22 @@ bool LatencyTestSubscriber::init_dynamic_types() // Dummy type registration // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + eprosima::fastrtps::types::DynamicTypeBuilder_ptr struct_type_builder(eprosima::fastrtps::types:: + DynamicTypeBuilderFactory::get_instance()-> + create_struct_builder()); // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), BOUND_UNLIMITED)); + struct_type_builder->add_member(0, "seqnum", + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); + struct_type_builder->add_member(1, "data", + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_byte_type(), + eprosima::fastrtps::types::BOUND_UNLIMITED)); struct_type_builder->set_name(LatencyDataType::type_name_); - dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); + dynamic_pub_sub_type_.reset(new eprosima::fastrtps::types::DynamicPubSubType(struct_type_builder->build())); // Register the data type - if (ReturnCode_t::RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) + if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR registering the DYNAMIC DATA type"); return false; @@ -837,7 +842,7 @@ bool LatencyTestSubscriber::init_static_types( // Create the static type latency_data_type_.reset(new LatencyDataType(padding)); // Register the static type - if (ReturnCode_t::RETCODE_OK != latency_data_type_.register_type(participant_)) + if (RETCODE_OK != latency_data_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR registering the STATIC DATA type"); return false; @@ -941,7 +946,7 @@ bool LatencyTestSubscriber::destroy_data_endpoints() // Delete the endpoints if (nullptr == data_writer_ - || ReturnCode_t::RETCODE_OK != publisher_->delete_datawriter(data_writer_)) + || RETCODE_OK != publisher_->delete_datawriter(data_writer_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR destroying the DataWriter"); return false; @@ -950,7 +955,7 @@ bool LatencyTestSubscriber::destroy_data_endpoints() data_writer_listener_.reset(); if (nullptr == data_reader_ - || ReturnCode_t::RETCODE_OK != subscriber_->delete_datareader(data_reader_)) + || RETCODE_OK != subscriber_->delete_datareader(data_reader_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR destroying the DataReader"); return false; @@ -960,14 +965,14 @@ bool LatencyTestSubscriber::destroy_data_endpoints() // Delete the Topics if (nullptr == latency_data_pub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(latency_data_pub_topic_)) + || RETCODE_OK != participant_->delete_topic(latency_data_pub_topic_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR destroying the DATA pub topic"); return false; } latency_data_pub_topic_ = nullptr; if (nullptr == latency_data_sub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(latency_data_sub_topic_)) + || RETCODE_OK != participant_->delete_topic(latency_data_sub_topic_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR destroying the DATA sub topic"); return false; @@ -975,7 +980,7 @@ bool LatencyTestSubscriber::destroy_data_endpoints() latency_data_sub_topic_ = nullptr; // Delete the Type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != participant_->unregister_type(LatencyDataType::type_name_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR unregistering the DATA type"); @@ -984,7 +989,7 @@ bool LatencyTestSubscriber::destroy_data_endpoints() latency_data_type_.reset(); dynamic_pub_sub_type_.reset(); - DynamicTypeBuilderFactory::delete_instance(); + eprosima::fastrtps::types::DynamicTypeBuilderFactory::delete_instance(); return true; } diff --git a/test/performance/throughput/ThroughputPublisher.cpp b/test/performance/throughput/ThroughputPublisher.cpp index ba56678fde8..05da14e768a 100644 --- a/test/performance/throughput/ThroughputPublisher.cpp +++ b/test/performance/throughput/ThroughputPublisher.cpp @@ -39,7 +39,6 @@ using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; // ******************************************************************************************* // ********************************* DATA WRITER LISTENER ************************************ @@ -155,7 +154,7 @@ bool ThroughputPublisher::init( // Load XML configuration if (xml_config_file_.length() > 0) { - if ( ReturnCode_t::RETCODE_OK != + if ( RETCODE_OK != DomainParticipantFactory::get_instance()-> get_participant_qos_from_profile( participant_profile_name, @@ -212,7 +211,7 @@ bool ThroughputPublisher::init( throughput_command_type_.reset(new ThroughputCommandDataType()); // Register the command data type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != throughput_command_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR registering command type"); @@ -239,7 +238,7 @@ bool ThroughputPublisher::init( std::string profile_name = "publisher_profile"; if (xml_config_file_.length() > 0 - && ReturnCode_t::RETCODE_OK != publisher_->get_datawriter_qos_from_profile(profile_name, dw_qos_)) + && RETCODE_OK != publisher_->get_datawriter_qos_from_profile(profile_name, dw_qos_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR unable to retrieve the " << profile_name); return false; @@ -547,18 +546,19 @@ void ThroughputPublisher::run( { assert(nullptr == dynamic_data_); // Create the data sample - MemberId id; - dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); + eprosima::fastrtps::types::MemberId id; + dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { - EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "Iteration failed: Failed to create Dynamic Data"); + EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, + "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data"); return; } // Modify the data Sample dynamic_data_->set_uint32_value(0, 0); - DynamicData* member_data = dynamic_data_->loan_value( + eprosima::fastrtps::types::DynamicData* member_data = dynamic_data_->loan_value( dynamic_data_->get_member_id_at_index(1)); for (int i = 0; i < msg_size; ++i) @@ -641,7 +641,7 @@ void ThroughputPublisher::run( // Delete the Data Sample if (dynamic_types_) { - DynamicDataFactory::get_instance()->delete_data(dynamic_data_); + eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_); dynamic_data_ = nullptr; } else @@ -683,7 +683,7 @@ void ThroughputPublisher::run( return; } - bool all_acked = command_writer_->wait_for_acknowledgments({20, 0}) == ReturnCode_t::RETCODE_OK; + bool all_acked = command_writer_->wait_for_acknowledgments({20, 0}) == RETCODE_OK; print_results(results_); if (!all_acked) @@ -716,7 +716,7 @@ bool ThroughputPublisher::test( // If the subscriber does not acknowledge the TEST_STARTS in time, we consider something went wrong. std::chrono::steady_clock::time_point test_start_sent_tp = std::chrono::steady_clock::now(); - if (ReturnCode_t::RETCODE_OK != command_writer_->wait_for_acknowledgments({20, 0})) + if (RETCODE_OK != command_writer_->wait_for_acknowledgments({20, 0})) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "Something went wrong: The subscriber has not acknowledged the TEST_STARTS command."); @@ -745,7 +745,7 @@ bool ThroughputPublisher::test( { // Try loan a sample void* data = nullptr; - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK == data_writer_->loan_sample( data, DataWriter::LoanInitializationKind::NO_LOAN_INITIALIZATION)) @@ -797,7 +797,7 @@ bool ThroughputPublisher::test( command_writer_->write(&command_sample); // If the subscriber does not acknowledge the TEST_ENDS in time, we consider something went wrong. - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != command_writer_->wait_for_acknowledgments({20, 0})) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, @@ -811,7 +811,7 @@ bool ThroughputPublisher::test( while ( !results_error && num_results_received < subscribers_ ) { if (command_reader_->wait_for_unread_message({20, 0}) - && ReturnCode_t::RETCODE_OK == command_reader_->take_next_sample(&command_sample, &info) + && RETCODE_OK == command_reader_->take_next_sample(&command_sample, &info) && info.valid_data) { if (command_sample.m_command == TEST_RESULTS) @@ -1042,17 +1042,22 @@ bool ThroughputPublisher::init_dynamic_types() // Dummy type registration // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + eprosima::fastrtps::types::DynamicTypeBuilder_ptr struct_type_builder(eprosima::fastrtps::types:: + DynamicTypeBuilderFactory::get_instance()-> + create_struct_builder()); // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), BOUND_UNLIMITED)); + struct_type_builder->add_member(0, "seqnum", + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); + struct_type_builder->add_member(1, "data", + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_byte_type(), + eprosima::fastrtps::types::BOUND_UNLIMITED)); struct_type_builder->set_name(ThroughputDataType::type_name_); - dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); + dynamic_pub_sub_type_.reset(new eprosima::fastrtps::types::DynamicPubSubType(struct_type_builder->build())); // Register the data type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR registering the DYNAMIC DATA topic"); @@ -1082,7 +1087,7 @@ bool ThroughputPublisher::init_static_types( // Create the static type throughput_data_type_.reset(new ThroughputDataType(payload)); // Register the static type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != throughput_data_type_.register_type(participant_)) { return false; @@ -1146,7 +1151,7 @@ bool ThroughputPublisher::destroy_data_endpoints() // Delete the endpoint if (nullptr == data_writer_ - || ReturnCode_t::RETCODE_OK != publisher_->delete_datawriter(data_writer_)) + || RETCODE_OK != publisher_->delete_datawriter(data_writer_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR destroying the DataWriter"); return false; @@ -1156,7 +1161,7 @@ bool ThroughputPublisher::destroy_data_endpoints() // Delete the Topic if (nullptr == data_pub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(data_pub_topic_)) + || RETCODE_OK != participant_->delete_topic(data_pub_topic_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR destroying the DATA topic"); return false; @@ -1164,7 +1169,7 @@ bool ThroughputPublisher::destroy_data_endpoints() data_pub_topic_ = nullptr; // Delete the Type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != participant_->unregister_type(ThroughputDataType::type_name_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR unregistering the DATA type"); diff --git a/test/performance/throughput/ThroughputSubscriber.cpp b/test/performance/throughput/ThroughputSubscriber.cpp index 70f326bc5c5..d52f913efdd 100644 --- a/test/performance/throughput/ThroughputSubscriber.cpp +++ b/test/performance/throughput/ThroughputSubscriber.cpp @@ -37,7 +37,6 @@ using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; // ******************************************************************************************* // ************************************ DATA SUB LISTENER ************************************ @@ -98,7 +97,7 @@ void ThroughputSubscriber::DataReaderListener::on_data_available( SampleInfoSeq infos; LoanableSequence data_seq; - if (ReturnCode_t::RETCODE_OK != reader->take(data_seq, infos)) + if (RETCODE_OK != reader->take(data_seq, infos)) { EPROSIMA_LOG_INFO(ThroughputTest, "Problem reading Subscriber echoed loaned test data"); return; @@ -132,7 +131,7 @@ void ThroughputSubscriber::DataReaderListener::on_data_available( last_seq_num_ = last_seq_num; // release the reader loan - if (ReturnCode_t::RETCODE_OK != reader->return_loan(data_seq, infos)) + if (RETCODE_OK != reader->return_loan(data_seq, infos)) { EPROSIMA_LOG_INFO(ThroughputTest, "Problem returning loaned test data"); return; @@ -143,7 +142,7 @@ void ThroughputSubscriber::DataReaderListener::on_data_available( void* data = sub.dynamic_types_ ? (void*)sub.dynamic_data_ : (void*)sub.throughput_data_; assert(nullptr != data); - while (ReturnCode_t::RETCODE_OK == reader->take_next_sample(data, &info_)) + while (RETCODE_OK == reader->take_next_sample(data, &info_)) { if (info_.valid_data) { @@ -296,7 +295,7 @@ bool ThroughputSubscriber::init( // Load XML configuration if (xml_config_file_.length() > 0) { - if ( ReturnCode_t::RETCODE_OK != + if ( RETCODE_OK != DomainParticipantFactory::get_instance()-> get_participant_qos_from_profile( participant_profile_name, @@ -352,7 +351,7 @@ bool ThroughputSubscriber::init( throughput_command_type_.reset(new ThroughputCommandDataType()); // Register the command data type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != throughput_command_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR registering command type"); @@ -379,7 +378,7 @@ bool ThroughputSubscriber::init( std::string profile_name = "subscriber_profile"; if (xml_config_file_.length() > 0 - && ReturnCode_t::RETCODE_OK != subscriber_->get_datareader_qos_from_profile(profile_name, dr_qos_)) + && RETCODE_OK != subscriber_->get_datareader_qos_from_profile(profile_name, dr_qos_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR unable to retrieve the " << profile_name); return false; @@ -523,7 +522,7 @@ int ThroughputSubscriber::process_message() if (command_reader_->wait_for_unread_message({100, 0})) { - if (ReturnCode_t::RETCODE_OK == command_reader_->take_next_sample( + if (RETCODE_OK == command_reader_->take_next_sample( (void*)&command, &info)) { @@ -546,17 +545,19 @@ int ThroughputSubscriber::process_message() assert(nullptr == dynamic_data_); // Create the data sample - MemberId id; - dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); + eprosima::fastrtps::types::MemberId id; + dynamic_data_ = + static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { - EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "Iteration failed: Failed to create Dynamic Data"); + EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, + "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data"); return 2; } // Modify the data Sample - DynamicData* member_data = dynamic_data_->loan_value( + eprosima::fastrtps::types::DynamicData* member_data = dynamic_data_->loan_value( dynamic_data_->get_member_id_at_index(1)); for (uint32_t i = 0; i < command.m_size; ++i) @@ -640,9 +641,9 @@ int ThroughputSubscriber::process_message() // Consume history while (data_reader_->wait_for_unread_message({0, 1000000})) { - while (ReturnCode_t::RETCODE_OK == data_reader_->take(data_seq, infos)) + while (RETCODE_OK == data_reader_->take(data_seq, infos)) { - if (ReturnCode_t::RETCODE_OK != data_reader_->return_loan(data_seq, infos)) + if (RETCODE_OK != data_reader_->return_loan(data_seq, infos)) { EPROSIMA_LOG_INFO(ThroughputTest, "Problem returning loan"); } @@ -673,7 +674,7 @@ int ThroughputSubscriber::process_message() // Remove the dynamic_data_ object, protect form ongoing callbacks if (dynamic_types_) { - DynamicDataFactory::get_instance()->delete_data(dynamic_data_); + eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_); dynamic_data_ = nullptr; } else @@ -816,17 +817,22 @@ bool ThroughputSubscriber::init_dynamic_types() // Dummy type registration // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + eprosima::fastrtps::types::DynamicTypeBuilder_ptr struct_type_builder(eprosima::fastrtps::types:: + DynamicTypeBuilderFactory::get_instance()-> + create_struct_builder()); // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), BOUND_UNLIMITED)); + struct_type_builder->add_member(0, "seqnum", + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); + struct_type_builder->add_member(1, "data", + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( + eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_byte_type(), + eprosima::fastrtps::types::BOUND_UNLIMITED)); struct_type_builder->set_name(ThroughputDataType::type_name_); - dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); + dynamic_pub_sub_type_.reset(new eprosima::fastrtps::types::DynamicPubSubType(struct_type_builder->build())); // Register the data type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR registering the DYNAMIC DATA topic"); @@ -856,7 +862,7 @@ bool ThroughputSubscriber::init_static_types( // Create the static type throughput_data_type_.reset(new ThroughputDataType(payload)); // Register the static type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != throughput_data_type_.register_type(participant_)) { return false; @@ -920,7 +926,7 @@ bool ThroughputSubscriber::destroy_data_endpoints() // Delete the endpoint if (nullptr == data_reader_ - || ReturnCode_t::RETCODE_OK != subscriber_->delete_datareader(data_reader_)) + || RETCODE_OK != subscriber_->delete_datareader(data_reader_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR destroying the DataWriter"); return false; @@ -930,7 +936,7 @@ bool ThroughputSubscriber::destroy_data_endpoints() // Delete the Topic if (nullptr == data_sub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(data_sub_topic_)) + || RETCODE_OK != participant_->delete_topic(data_sub_topic_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR destroying the DATA topic"); return false; @@ -938,7 +944,7 @@ bool ThroughputSubscriber::destroy_data_endpoints() data_sub_topic_ = nullptr; // Delete the Type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != participant_->unregister_type(ThroughputDataType::type_name_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR unregistering the DATA type"); diff --git a/test/unittest/dds/core/condition/ConditionTests.cpp b/test/unittest/dds/core/condition/ConditionTests.cpp index 61bae7efaad..2e62dcc5452 100644 --- a/test/unittest/dds/core/condition/ConditionTests.cpp +++ b/test/unittest/dds/core/condition/ConditionTests.cpp @@ -98,7 +98,7 @@ TEST_F(ConditionTests, waitset_condition_management) WaitSet wait_set; // WaitSet should be created without conditions - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // This scope allows checking the wait_set behavior when the condition is destroyed @@ -106,36 +106,36 @@ TEST_F(ConditionTests, waitset_condition_management) GuardCondition condition; // Trying to detach without having attached - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); // Adding the same condition several times should always succeed and keep the list with a single condition for (int i = 0; i < 2; ++i) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); } // Detaching the condition once should succeed - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.detach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Detaching a second time should fail - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Attach the condition again - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); } // After the condition is destroyed, the wait_set should be empty - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); } @@ -147,33 +147,33 @@ TEST_F(ConditionTests, waitset_wait) const eprosima::fastrtps::Duration_t timeout{ 1, 0 }; // Waiting on empty wait set should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); // Attach condition - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); // Waiting on untriggered condition should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); // Waiting on already triggered condition should inmediately return condition - EXPECT_EQ(ReturnCode_t::RETCODE_OK, condition.set_trigger_value(true)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_OK, condition.set_trigger_value(true)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, timeout)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); // Adding a non-triggered condition while waiting should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_OK, condition.set_trigger_value(false)); + EXPECT_EQ(RETCODE_OK, condition.set_trigger_value(false)); { GuardCondition non_triggered_condition; std::thread thr_add_non_triggered([&]() { std::this_thread::sleep_for(std::chrono::milliseconds(200)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(non_triggered_condition)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(non_triggered_condition)); }); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); thr_add_non_triggered.join(); } @@ -183,27 +183,27 @@ TEST_F(ConditionTests, waitset_wait) std::thread thr_set_trigger([&]() { std::this_thread::sleep_for(std::chrono::milliseconds(200)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, condition.set_trigger_value(true)); + EXPECT_EQ(RETCODE_OK, condition.set_trigger_value(true)); }); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, timeout)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); thr_set_trigger.join(); } // Two threads are not allowed to wait at the same time - EXPECT_EQ(ReturnCode_t::RETCODE_OK, condition.set_trigger_value(false)); + EXPECT_EQ(RETCODE_OK, condition.set_trigger_value(false)); { std::thread thr_second_wait([&wait_set, &timeout]() { std::this_thread::sleep_for(std::chrono::milliseconds(200)); ConditionSeq conds; - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.wait(conds, timeout)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.wait(conds, timeout)); EXPECT_TRUE(conds.empty()); }); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); thr_second_wait.join(); } @@ -211,7 +211,7 @@ TEST_F(ConditionTests, waitset_wait) // Waiting forever and adding a triggered condition should wake and only return the added condition { GuardCondition triggered_condition; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, triggered_condition.set_trigger_value(true)); + EXPECT_EQ(RETCODE_OK, triggered_condition.set_trigger_value(true)); std::thread thr_add_triggered([&]() { @@ -219,7 +219,7 @@ TEST_F(ConditionTests, waitset_wait) wait_set.attach_condition(triggered_condition); }); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); EXPECT_EQ(1u, conditions.size()); EXPECT_EQ(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &triggered_condition)); @@ -232,9 +232,9 @@ TEST_F(ConditionTests, guard_condition_methods) GuardCondition cond; EXPECT_FALSE(cond.get_trigger_value()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_trigger_value(true)); + EXPECT_EQ(RETCODE_OK, cond.set_trigger_value(true)); EXPECT_TRUE(cond.get_trigger_value()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_trigger_value(false)); + EXPECT_EQ(RETCODE_OK, cond.set_trigger_value(false)); EXPECT_FALSE(cond.get_trigger_value()); } @@ -252,11 +252,11 @@ TEST_F(ConditionTests, status_condition_methods) // According to the DDS standard, StatusCondition should start with all statuses enabled EXPECT_EQ(mask_all.to_string(), cond.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(mask_single)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(mask_single)); EXPECT_EQ(mask_single.to_string(), cond.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(mask_none)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(mask_none)); EXPECT_EQ(mask_none.to_string(), cond.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(mask_all)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(mask_all)); EXPECT_EQ(mask_all.to_string(), cond.get_enabled_statuses().to_string()); } @@ -275,7 +275,7 @@ TEST_F(ConditionTests, status_condition_trigger) auto wait_for_trigger = [&]() { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); EXPECT_EQ(1u, conditions.size()); EXPECT_EQ(&cond, conditions[0]); EXPECT_TRUE(cond.get_trigger_value()); @@ -284,13 +284,13 @@ TEST_F(ConditionTests, status_condition_trigger) auto expect_no_trigger = [&]() { EXPECT_FALSE(cond.get_trigger_value()); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); }; ASSERT_NE(nullptr, cond.get_impl()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(cond)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(cond)); // Condition should be untriggered upon creation EXPECT_EQ(mask_all.to_string(), cond.get_enabled_statuses().to_string()); @@ -305,7 +305,7 @@ TEST_F(ConditionTests, status_condition_trigger) } // Setting mask to one_mask should untrigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), cond.get_enabled_statuses().to_string()); expect_no_trigger(); @@ -344,7 +344,7 @@ TEST_F(ConditionTests, status_condition_trigger) // Setting mask to other_mask should trigger { std::thread wait_thr(wait_for_trigger); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(other_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(other_mask)); EXPECT_EQ(other_mask.to_string(), cond.get_enabled_statuses().to_string()); wait_thr.join(); } @@ -354,7 +354,7 @@ TEST_F(ConditionTests, status_condition_trigger) wait_for_trigger(); // Setting mask to one_mask should not affect trigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), cond.get_enabled_statuses().to_string()); wait_for_trigger(); @@ -363,12 +363,12 @@ TEST_F(ConditionTests, status_condition_trigger) wait_for_trigger(); // Setting mask to other_mask should untrigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(other_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(other_mask)); EXPECT_EQ(other_mask.to_string(), cond.get_enabled_statuses().to_string()); expect_no_trigger(); // Setting mask to one_mask should trigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), cond.get_enabled_statuses().to_string()); EXPECT_TRUE(cond.get_trigger_value()); wait_for_trigger(); diff --git a/test/unittest/dds/core/condition/StatusConditionImplTests.cpp b/test/unittest/dds/core/condition/StatusConditionImplTests.cpp index 90b42f2d149..aa67696ec97 100644 --- a/test/unittest/dds/core/condition/StatusConditionImplTests.cpp +++ b/test/unittest/dds/core/condition/StatusConditionImplTests.cpp @@ -39,11 +39,11 @@ TEST(StatusConditionImplTests, enabled_status_management) // According to the DDS standard, StatusCondition should start with all statuses enabled EXPECT_EQ(mask_all.to_string(), uut.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(mask_single)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(mask_single)); EXPECT_EQ(mask_single.to_string(), uut.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(mask_none)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(mask_none)); EXPECT_EQ(mask_none.to_string(), uut.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(mask_all)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(mask_all)); EXPECT_EQ(mask_all.to_string(), uut.get_enabled_statuses().to_string()); } @@ -71,7 +71,7 @@ TEST(StatusConditionImplTests, notify_trigger) EXPECT_TRUE(uut.get_trigger_value()); // Setting mask to one_mask should untrigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), uut.get_enabled_statuses().to_string()); EXPECT_FALSE(uut.get_trigger_value()); @@ -113,7 +113,7 @@ TEST(StatusConditionImplTests, notify_trigger) // Setting mask to other_mask should trigger auto& call3 = EXPECT_CALL(notifier, notify()).Times(1).After(call2); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(other_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(other_mask)); EXPECT_EQ(other_mask.to_string(), uut.get_enabled_statuses().to_string()); // Triggering one_mask should not affect trigger @@ -122,7 +122,7 @@ TEST(StatusConditionImplTests, notify_trigger) EXPECT_TRUE(uut.get_trigger_value()); // Setting mask to one_mask should not affect trigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), uut.get_enabled_statuses().to_string()); EXPECT_TRUE(uut.get_trigger_value()); @@ -132,13 +132,13 @@ TEST(StatusConditionImplTests, notify_trigger) EXPECT_TRUE(uut.get_trigger_value()); // Setting mask to other_mask should untrigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(other_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(other_mask)); EXPECT_EQ(other_mask.to_string(), uut.get_enabled_statuses().to_string()); EXPECT_FALSE(uut.get_trigger_value()); // Setting mask to one_mask should trigger EXPECT_CALL(notifier, notify()).Times(1).After(call3); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), uut.get_enabled_statuses().to_string()); EXPECT_TRUE(uut.get_trigger_value()); } diff --git a/test/unittest/dds/core/condition/WaitSetImplTests.cpp b/test/unittest/dds/core/condition/WaitSetImplTests.cpp index 798a6355103..a9e23ddcf66 100644 --- a/test/unittest/dds/core/condition/WaitSetImplTests.cpp +++ b/test/unittest/dds/core/condition/WaitSetImplTests.cpp @@ -58,40 +58,40 @@ TEST(WaitSetImplTests, condition_management) EXPECT_CALL(*notifier, will_be_deleted(_)).Times(1); // WaitSetImpl should be created without conditions - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Trying to detach without having attached - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); // Adding the same condition several times should always succeed and keep the list with a single condition for (int i = 0; i < 2; ++i) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); } // Detaching the condition once should succeed - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.detach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Detaching a second time should fail - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Attach the condition again - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); // Calling will_be_deleted should detach the condition wait_set.will_be_deleted(condition); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); } @@ -111,19 +111,19 @@ TEST(WaitSetImplTests, wait) EXPECT_CALL(*notifier, will_be_deleted(_)).Times(1); // Waiting on empty wait set should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); // Attach condition - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); // Waiting on untriggered condition should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); // Waiting on already triggered condition should inmediately return condition condition.trigger_value = true; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, timeout)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); @@ -135,7 +135,7 @@ TEST(WaitSetImplTests, wait) std::this_thread::sleep_for(std::chrono::milliseconds(200)); wait_set.wake_up(); }); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); notify_without_trigger.join(); } @@ -148,7 +148,7 @@ TEST(WaitSetImplTests, wait) condition.trigger_value = true; wait_set.wake_up(); }); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, timeout)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); trigger_and_notify.join(); @@ -160,12 +160,12 @@ TEST(WaitSetImplTests, wait) { std::this_thread::sleep_for(std::chrono::milliseconds(200)); ConditionSeq conds; - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.wait(conds, timeout)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.wait(conds, timeout)); EXPECT_TRUE(conds.empty()); }); condition.trigger_value = false; - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); second_wait_thread.join(); } @@ -186,7 +186,7 @@ TEST(WaitSetImplTests, wait) wait_set.attach_condition(triggered_condition); }); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); EXPECT_EQ(1u, conditions.size()); EXPECT_EQ(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &triggered_condition)); @@ -237,7 +237,7 @@ TEST(WaitSetImplTests, fix_wait_notification_lost) std::promise promise; std::future future = promise.get_future(); - ReturnCode_t ret = ReturnCode_t::RETCODE_ERROR; + ReturnCode_t ret = RETCODE_ERROR; std::thread wait_conditions([&]() { // Not to use `WaitSetImpl::wait` with a timeout value, because the @@ -253,7 +253,7 @@ TEST(WaitSetImplTests, fix_wait_notification_lost) // Expecting get notification after wake_up, otherwise output error within 5 seconds. future.wait_for(std::chrono::seconds(5)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &triggered_condition)); diff --git a/test/unittest/dds/core/entity/EntityTests.cpp b/test/unittest/dds/core/entity/EntityTests.cpp index 79a425dcaf8..34e4a1db995 100644 --- a/test/unittest/dds/core/entity/EntityTests.cpp +++ b/test/unittest/dds/core/entity/EntityTests.cpp @@ -106,7 +106,7 @@ TEST_F(EntityTests, entity_enable) Entity entity; ASSERT_FALSE(entity.is_enabled()); - ASSERT_EQ(entity.enable(), eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + ASSERT_EQ(entity.enable(), eprosima::fastrtps::types::RETCODE_OK); ASSERT_TRUE(entity.is_enabled()); entity.close(); ASSERT_FALSE(entity.is_enabled()); diff --git a/test/unittest/dds/participant/ParticipantTests.cpp b/test/unittest/dds/participant/ParticipantTests.cpp index 98a24b7b4a4..46af4ce3ecc 100644 --- a/test/unittest/dds/participant/ParticipantTests.cpp +++ b/test/unittest/dds/participant/ParticipantTests.cpp @@ -357,7 +357,7 @@ TEST(ParticipantTests, ChangeDomainParticipantFactoryQos) entity_factory.autoenable_created_entities = false; qos.entity_factory(entity_factory); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_qos(qos) == RETCODE_OK); DomainParticipantFactoryQos fqos; DomainParticipantFactory::get_instance()->get_qos(fqos); @@ -367,7 +367,7 @@ TEST(ParticipantTests, ChangeDomainParticipantFactoryQos) entity_factory.autoenable_created_entities = true; qos.entity_factory(entity_factory); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_qos(qos) == RETCODE_OK); DomainParticipantFactory::get_instance()->get_qos(fqos); ASSERT_EQ(qos, fqos); @@ -383,7 +383,7 @@ TEST(ParticipantTests, CreateDomainParticipant) ASSERT_NE(participant, nullptr); EXPECT_EQ(participant->get_listener(), nullptr); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -501,7 +501,7 @@ TEST(ParticipantTests, CreateDomainParticipantWithProfile) ASSERT_EQ(default_participant->get_domain_id(), domain_id); //Keep the DID given to the method, not the one on the profile check_participant_with_profile(default_participant, "test_default_participant_profile"); ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( - default_participant) == ReturnCode_t::RETCODE_OK); + default_participant) == RETCODE_OK); //participant using non-default profile DomainParticipant* participant = @@ -510,7 +510,7 @@ TEST(ParticipantTests, CreateDomainParticipantWithProfile) ASSERT_NE(participant, nullptr); ASSERT_EQ(participant->get_domain_id(), domain_id); //Keep the DID given to the method, not the one on the profile check_participant_with_profile(participant, "test_participant_profile"); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, GetParticipantProfileQos) @@ -519,7 +519,7 @@ TEST(ParticipantTests, GetParticipantProfileQos) DomainParticipantQos qos; EXPECT_EQ( DomainParticipantFactory::get_instance()->get_participant_qos_from_profile("test_participant_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); // Extract ParticipantQos from profile DomainParticipant* participant = @@ -532,10 +532,10 @@ TEST(ParticipantTests, GetParticipantProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( DomainParticipantFactory::get_instance()->get_participant_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } @@ -553,7 +553,7 @@ TEST(ParticipantTests, DeleteDomainParticipant) DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, DeleteDomainParticipantWithEntities) @@ -566,9 +566,9 @@ TEST(ParticipantTests, DeleteDomainParticipantWithEntities) ASSERT_NE(subscriber, nullptr); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + participant), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); participant = DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); @@ -576,9 +576,9 @@ TEST(ParticipantTests, DeleteDomainParticipantWithEntities) ASSERT_NE(publisher, nullptr); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + participant), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); participant = DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); @@ -589,9 +589,9 @@ TEST(ParticipantTests, DeleteDomainParticipantWithEntities) ASSERT_NE(topic, nullptr); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + participant), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(ParticipantTests, ChangeDefaultParticipantQos) @@ -605,7 +605,7 @@ TEST(ParticipantTests, ChangeDefaultParticipantQos) entity_factory.autoenable_created_entities = false; qos.entity_factory(entity_factory); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_default_participant_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_default_participant_qos(qos) == RETCODE_OK); DomainParticipantQos pqos; DomainParticipantFactory::get_instance()->get_default_participant_qos(pqos); @@ -613,7 +613,7 @@ TEST(ParticipantTests, ChangeDefaultParticipantQos) ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_default_participant_qos( - PARTICIPANT_QOS_DEFAULT) == ReturnCode_t::RETCODE_OK); + PARTICIPANT_QOS_DEFAULT) == RETCODE_OK); } TEST(ParticipantTests, ChangePSMDefaultParticipantQos) @@ -648,7 +648,7 @@ TEST(ParticipantTests, ChangeDomainParticipantQos) check_equivalent_qos(qos, PARTICIPANT_QOS_DEFAULT); qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_OK); DomainParticipantQos pqos; participant->get_qos(pqos); @@ -656,7 +656,7 @@ TEST(ParticipantTests, ChangeDomainParticipantQos) ASSERT_EQ(qos, pqos); ASSERT_EQ(qos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -904,9 +904,9 @@ TEST(ParticipantTests, SimpleParticipantRemoteServerListConfiguration) DomainParticipantQos result_qos = participant->get_qos(); EXPECT_EQ(result_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers, qos_output); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } @@ -1047,7 +1047,7 @@ TEST(ParticipantTests, SimpleParticipantRemoteServerListConfigurationDNS) }; EXPECT_TRUE(udpv6_check(attributes)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } /** @@ -1098,8 +1098,8 @@ TEST(ParticipantTests, SimpleParticipantDynamicAdditionRemoteServers) EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output); #endif // APPLE DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1123,8 +1123,8 @@ TEST(ParticipantTests, ClientParticipantRemoteServerListConfiguration) EXPECT_EQ(attributes.builtin.discovery_config.discoveryProtocol, fastrtps::rtps::DiscoveryProtocol::CLIENT); EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, qos_output); DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } /** @@ -1152,8 +1152,8 @@ TEST(ParticipantTests, ServerParticipantEnvironmentConfiguration) EXPECT_EQ(attributes.builtin.discovery_config.discoveryProtocol, fastrtps::rtps::DiscoveryProtocol::SERVER); EXPECT_TRUE(attributes.builtin.discovery_config.m_DiscoveryServers.empty()); DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } /** @@ -1182,8 +1182,8 @@ TEST(ParticipantTests, ServerParticipantRemoteServerListConfiguration) EXPECT_EQ(attributes.builtin.discovery_config.discoveryProtocol, fastrtps::rtps::DiscoveryProtocol::SERVER); EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, qos_output); DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } /** @@ -1235,8 +1235,8 @@ TEST(ParticipantTests, ServerParticipantInconsistentRemoteServerListConfiguratio helper_wait_for_at_least_entries(mockConsumer, 1); #endif // APPLE DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1285,8 +1285,8 @@ TEST(ParticipantTests, ServerParticipantInconsistentLocatorsRemoteServerListConf EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output); #endif // APPLE DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1311,7 +1311,7 @@ TEST(ParticipantTests, RepeatEnvironmentFileConfiguration) set_and_check_with_environment_file(participant, {"172.17.0.5:64863", "192.168.1.133:4321", "192.168.5.15:1234"}, filename); #endif // APPLE - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1379,11 +1379,11 @@ TEST(ParticipantTests, ServerParticipantCorrectRemoteServerListConfiguration) get_rtps_attributes(participant, attributes); EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output); result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); // Add new server using API result_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server); // RTPS layer issues a Warning because a server has been removed. However, DDS layer returns OK - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); server.clear(); fastrtps::rtps::IPLocator::setIPv4(locator, "192.168.1.133"); locator.port = 64863; @@ -1396,14 +1396,14 @@ TEST(ParticipantTests, ServerParticipantCorrectRemoteServerListConfiguration) server.metatrafficUnicastLocatorList.push_back(locator); get_server_client_default_guidPrefix(3, server.guidPrefix); result_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); output.push_back(server); get_rtps_attributes(participant, attributes); EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output); #endif // APPLE result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1440,35 +1440,35 @@ TEST(ParticipantTests, ChangeWireProtocolQos) server_2.metatrafficUnicastLocatorList.push_back(locator_2); qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server_2); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_OK); DomainParticipantQos set_qos; participant->get_qos(set_qos); ASSERT_EQ(set_qos, qos); // Check that removing one server is NOT OK qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.pop_front(); - ASSERT_FALSE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(participant->set_qos(qos) == RETCODE_OK); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check that removing all servers is NOT OK fastdds::rtps::RemoteServerList_t servers; qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers = servers; - ASSERT_FALSE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(participant->set_qos(qos) == RETCODE_OK); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().prefix is NOT OK participant->get_qos(qos); std::istringstream("44.53.00.5f.45.50.52.4f.53.49.4d.41") >> qos.wire_protocol().prefix; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().participant_id is NOT OK participant->get_qos(qos); qos.wire_protocol().participant_id = 7; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1476,7 +1476,7 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); fastrtps::rtps::ThroughputControllerDescriptor controller{300000, 1000}; qos.wire_protocol().throughput_controller = controller; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1486,56 +1486,56 @@ TEST(ParticipantTests, ChangeWireProtocolQos) fastrtps::rtps::IPLocator::setIPv4(loc, "192.0.0.0"); loc.port = static_cast(12); qos.wire_protocol().default_unicast_locator_list.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().default_multicast_locator_list is NOT OK participant->get_qos(qos); qos.wire_protocol().default_multicast_locator_list.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.use_WriterLivelinessProtocol is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.use_WriterLivelinessProtocol ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.typelookup_config.use_client is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.typelookup_config.use_client ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.typelookup_config.use_server is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.typelookup_config.use_server ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.metatrafficUnicastLocatorList is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.metatrafficMulticastLocatorList is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.metatrafficMulticastLocatorList.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.initialPeersList is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.initialPeersList.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1543,14 +1543,14 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); qos.wire_protocol().builtin.readerHistoryMemoryPolicy = fastrtps::rtps::MemoryManagementPolicy_t::DYNAMIC_RESERVE_MEMORY_MODE; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.readerPayloadSize is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.readerPayloadSize = 27; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1558,70 +1558,70 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); qos.wire_protocol().builtin.writerHistoryMemoryPolicy = fastrtps::rtps::MemoryManagementPolicy_t::DYNAMIC_RESERVE_MEMORY_MODE; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.writerPayloadSize is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.writerPayloadSize = 27; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.mutation_tries is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.mutation_tries = 27; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.avoid_builtin_multicast is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.avoid_builtin_multicast ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.discoveryProtocol is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.discoveryProtocol = fastrtps::rtps::DiscoveryProtocol_t::NONE; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.use_STATIC_EndpointDiscoveryProtocol is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.use_STATIC_EndpointDiscoveryProtocol ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.discoveryServer_client_syncperiod is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.discoveryServer_client_syncperiod = { 27, 27}; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.leaseDuration is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.leaseDuration = { 27, 27}; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod = { 27, 27}; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1629,7 +1629,7 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.initial_announcements.count = 27; qos.wire_protocol().builtin.discovery_config.initial_announcements.period = {27, 27}; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1643,7 +1643,7 @@ TEST(ParticipantTests, ChangeWireProtocolQos) qos.wire_protocol().builtin.discovery_config.m_simpleEDP. enable_builtin_secure_subscriptions_writer_and_publications_reader ^= true; #endif // if HAVE_SECURITY - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1662,7 +1662,7 @@ TEST(ParticipantTests, ChangeWireProtocolQos) "" \ ""; qos.wire_protocol().builtin.discovery_config.static_edp_xml_config(static_xml.c_str()); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1670,11 +1670,11 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.ignoreParticipantFlags = fastrtps::rtps::ParticipantFilteringFlags::FILTER_DIFFERENT_HOST; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, EntityFactoryBehavior) @@ -1685,7 +1685,7 @@ TEST(ParticipantTests, EntityFactoryBehavior) DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(factory->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(factory->set_qos(qos) == RETCODE_OK); } // Ensure that participant is created disabled. @@ -1697,7 +1697,7 @@ TEST(ParticipantTests, EntityFactoryBehavior) // Participant is disabled. This means we can change an inmutable qos. DomainParticipantQos qos = PARTICIPANT_QOS_DEFAULT; qos.wire_protocol().builtin.avoid_builtin_multicast = !qos.wire_protocol().builtin.avoid_builtin_multicast; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(qos)); // Creating lower entities should create them disabled Publisher* pub = participant->create_publisher(PUBLISHER_QOS_DEFAULT); @@ -1715,13 +1715,13 @@ TEST(ParticipantTests, EntityFactoryBehavior) EXPECT_FALSE(topic->is_enabled()); // Enabling should fail on lower entities until participant is enabled - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, pub->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, sub->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, pub->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, sub->enable()); // Enable participant and check idempotency of enable - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); EXPECT_TRUE(participant->is_enabled()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); // As the participant was created with the default value for ENTITY_FACTORY, // lower entities should have been automatically enabled. @@ -1729,7 +1729,7 @@ TEST(ParticipantTests, EntityFactoryBehavior) EXPECT_TRUE(sub->is_enabled()); // Now that participant is enabled, we should not be able change an inmutable qos. - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, participant->set_qos(PARTICIPANT_QOS_DEFAULT)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, participant->set_qos(PARTICIPANT_QOS_DEFAULT)); // Created entities should now be automatically enabled Subscriber* sub2 = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT); @@ -1738,7 +1738,7 @@ TEST(ParticipantTests, EntityFactoryBehavior) // We can change ENTITY_FACTORY on the participant qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(qos)); + ASSERT_EQ(RETCODE_OK, participant->set_qos(qos)); // Lower entities should now be created disabled Publisher* pub2 = participant->create_publisher(PUBLISHER_QOS_DEFAULT); @@ -1746,22 +1746,22 @@ TEST(ParticipantTests, EntityFactoryBehavior) EXPECT_FALSE(pub2->is_enabled()); // But could be enabled afterwards - EXPECT_EQ(ReturnCode_t::RETCODE_OK, pub2->enable()); + EXPECT_EQ(RETCODE_OK, pub2->enable()); EXPECT_TRUE(pub2->is_enabled()); // Check idempotency of enable on entities - EXPECT_EQ(ReturnCode_t::RETCODE_OK, pub->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, pub2->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, sub->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, sub2->enable()); + EXPECT_EQ(RETCODE_OK, pub->enable()); + EXPECT_EQ(RETCODE_OK, pub2->enable()); + EXPECT_EQ(RETCODE_OK, sub->enable()); + EXPECT_EQ(RETCODE_OK, sub2->enable()); // Delete lower entities - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_subscriber(sub2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_publisher(pub2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_subscriber(sub)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_publisher(pub)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_topic(topic)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->delete_subscriber(sub2)); + EXPECT_EQ(RETCODE_OK, participant->delete_publisher(pub2)); + EXPECT_EQ(RETCODE_OK, participant->delete_subscriber(sub)); + EXPECT_EQ(RETCODE_OK, participant->delete_publisher(pub)); + EXPECT_EQ(RETCODE_OK, participant->delete_topic(topic)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } TEST(ParticipantTests, CreatePublisher) @@ -1773,8 +1773,8 @@ TEST(ParticipantTests, CreatePublisher) ASSERT_NE(publisher, nullptr); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void check_publisher_with_profile ( @@ -1807,15 +1807,15 @@ TEST(ParticipantTests, CreatePublisherWithProfile) Publisher* default_publisher = participant->create_publisher(PUBLISHER_QOS_DEFAULT); ASSERT_NE(default_publisher, nullptr); check_publisher_with_profile(default_publisher, "test_default_publisher_profile"); - ASSERT_TRUE(participant->delete_publisher(default_publisher) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(default_publisher) == RETCODE_OK); //participant using non-default profile Publisher* publisher = participant->create_publisher_with_profile("test_publisher_profile"); ASSERT_NE(publisher, nullptr); check_publisher_with_profile(publisher, "test_publisher_profile"); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, CreatePSMPublisher) @@ -1833,24 +1833,24 @@ TEST(ParticipantTests, ChangeDefaultPublisherQos) DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ASSERT_TRUE(participant->set_default_publisher_qos(PUBLISHER_QOS_DEFAULT) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_default_publisher_qos(PUBLISHER_QOS_DEFAULT) == RETCODE_OK); PublisherQos qos; - ASSERT_TRUE(participant->get_default_publisher_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->get_default_publisher_qos(qos) == RETCODE_OK); ASSERT_EQ(qos, PUBLISHER_QOS_DEFAULT); qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(participant->set_default_publisher_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_default_publisher_qos(qos) == RETCODE_OK); PublisherQos pqos; - ASSERT_TRUE(participant->get_default_publisher_qos(pqos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->get_default_publisher_qos(pqos) == RETCODE_OK); ASSERT_TRUE(qos == pqos); ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, ChangePSMDefaultPublisherQos) @@ -1878,8 +1878,8 @@ TEST(ParticipantTests, CreateSubscriber) Subscriber* subscriber = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT); ASSERT_NE(subscriber, nullptr); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void check_subscriber_with_profile ( @@ -1913,7 +1913,7 @@ TEST(ParticipantTests, GetSubscriberProfileQos) SubscriberQos qos; EXPECT_EQ( participant->get_subscriber_qos_from_profile("test_subscriber_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); Subscriber* subscriber = participant->create_subscriber(qos); ASSERT_NE(subscriber, nullptr); @@ -1923,11 +1923,11 @@ TEST(ParticipantTests, GetSubscriberProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( participant->get_subscriber_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(ParticipantTests, CreateSubscriberWithProfile) @@ -1941,15 +1941,15 @@ TEST(ParticipantTests, CreateSubscriberWithProfile) Subscriber* default_subscriber = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT); ASSERT_NE(default_subscriber, nullptr); check_subscriber_with_profile(default_subscriber, "test_default_subscriber_profile"); - ASSERT_TRUE(participant->delete_subscriber(default_subscriber) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(default_subscriber) == RETCODE_OK); //participant using non-default profile Subscriber* subscriber = participant->create_subscriber_with_profile("test_subscriber_profile"); ASSERT_NE(subscriber, nullptr); check_subscriber_with_profile(subscriber, "test_subscriber_profile"); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, GetPublisherProfileQos) @@ -1964,7 +1964,7 @@ TEST(ParticipantTests, GetPublisherProfileQos) PublisherQos qos; EXPECT_EQ( participant->get_publisher_qos_from_profile("test_publisher_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); Publisher* publisher = participant->create_publisher(qos); ASSERT_NE(publisher, nullptr); @@ -1974,11 +1974,11 @@ TEST(ParticipantTests, GetPublisherProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( participant->get_publisher_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } @@ -2001,8 +2001,8 @@ TEST(ParticipantTests, DeletePublisher) Publisher* publisher = participant->create_publisher(PUBLISHER_QOS_DEFAULT); ASSERT_NE(publisher, nullptr); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, DeleteSubscriber) @@ -2014,8 +2014,8 @@ TEST(ParticipantTests, DeleteSubscriber) Subscriber* subscriber = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT); ASSERT_NE(subscriber, nullptr); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, ChangeDefaultSubscriberQos) @@ -2024,24 +2024,24 @@ TEST(ParticipantTests, ChangeDefaultSubscriberQos) DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ASSERT_EQ(participant->set_default_subscriber_qos(SUBSCRIBER_QOS_DEFAULT), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_default_subscriber_qos(SUBSCRIBER_QOS_DEFAULT), RETCODE_OK); SubscriberQos qos; - ASSERT_EQ(participant->get_default_subscriber_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->get_default_subscriber_qos(qos), RETCODE_OK); ASSERT_EQ(qos, SUBSCRIBER_QOS_DEFAULT); qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(participant->set_default_subscriber_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_default_subscriber_qos(qos), RETCODE_OK); SubscriberQos pqos; - ASSERT_EQ(participant->get_default_subscriber_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->get_default_subscriber_qos(pqos), RETCODE_OK); ASSERT_TRUE(pqos == qos); ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, ChangePSMDefaultSubscriberQos) @@ -2066,7 +2066,7 @@ TEST(ParticipantTests, ChangeDefaultTopicQos) DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ASSERT_TRUE(participant->set_default_topic_qos(TOPIC_QOS_DEFAULT) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_default_topic_qos(TOPIC_QOS_DEFAULT) == RETCODE_OK); TopicQos qos; participant->get_default_topic_qos(qos); @@ -2075,7 +2075,7 @@ TEST(ParticipantTests, ChangeDefaultTopicQos) qos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS; - ASSERT_TRUE(participant->set_default_topic_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_default_topic_qos(qos) == RETCODE_OK); TopicQos tqos; participant->get_default_topic_qos(tqos); @@ -2084,9 +2084,9 @@ TEST(ParticipantTests, ChangeDefaultTopicQos) ASSERT_EQ(tqos.reliability().kind, BEST_EFFORT_RELIABILITY_QOS); qos.durability().kind = PERSISTENT_DURABILITY_QOS; - ASSERT_FALSE(participant->set_default_topic_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(participant->set_default_topic_qos(qos) == RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, ChangePSMDefaultTopicQos) @@ -2134,7 +2134,7 @@ TEST(ParticipantTests, GetTopicProfileQos) TopicQos qos; EXPECT_EQ( participant->get_topic_qos_from_profile("test_topic_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); Topic* topic = participant->create_topic("footopic", type.get_type_name(), qos); ASSERT_NE(topic, nullptr); @@ -2145,11 +2145,11 @@ TEST(ParticipantTests, GetTopicProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( participant->get_topic_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(ParticipantTests, CreateTopic) @@ -2170,15 +2170,15 @@ TEST(ParticipantTests, CreateTopic) Topic* topic_duplicated = participant->create_topic("footopic", "footype", TOPIC_QOS_DEFAULT); ASSERT_EQ(topic_duplicated, nullptr); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); // Topic using non-default profile Topic* topic_profile = participant->create_topic_with_profile("footopic", "footype", "test_topic_profile"); ASSERT_NE(topic_profile, nullptr); check_topic_with_profile(topic_profile, "test_topic_profile"); - ASSERT_TRUE(participant->delete_topic(topic_profile) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic_profile) == RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } // Test that creating a Topic with a Data Type name different from the Type Support is possible as long @@ -2201,7 +2201,7 @@ TEST(ParticipantTests, CreateTopicWithDifferentTypeName) Topic* topic_duplicated = participant->create_topic("footopic", type_name, TOPIC_QOS_DEFAULT); ASSERT_EQ(topic_duplicated, nullptr); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); } // Test that creating a Topic with a Data Type name different from the data type is not possible @@ -2262,11 +2262,11 @@ TEST(ParticipantTests, DeleteTopic) Topic* topic = participant->create_topic("footopic", "footype", TOPIC_QOS_DEFAULT); - ASSERT_TRUE(participant->delete_topic(nullptr) == ReturnCode_t::RETCODE_BAD_PARAMETER); - ASSERT_TRUE(participant2->delete_topic(topic) == ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(nullptr) == RETCODE_BAD_PARAMETER); + ASSERT_TRUE(participant2->delete_topic(topic) == RETCODE_PRECONDITION_NOT_MET); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant2) == RETCODE_OK); } TEST(ParticipantTests, LookupTopicDescription) @@ -2290,10 +2290,10 @@ TEST(ParticipantTests, LookupTopicDescription) ASSERT_EQ(participant->lookup_topicdescription(topic_name), topic); // After topic deletion, should return nil - EXPECT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); + EXPECT_TRUE(participant->delete_topic(topic) == RETCODE_OK); ASSERT_EQ(participant->lookup_topicdescription(topic_name), nullptr); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, DeleteTopicInUse) @@ -2317,13 +2317,13 @@ TEST(ParticipantTests, DeleteTopicInUse) DataReader* data_reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(data_reader, nullptr); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant->delete_contentfilteredtopic(content_filtered_topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_contentfilteredtopic(content_filtered_topic), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); topic = participant->create_topic("footopic", "footype", TOPIC_QOS_DEFAULT); @@ -2333,13 +2333,13 @@ TEST(ParticipantTests, DeleteTopicInUse) DataWriter* data_writer = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(data_writer, nullptr); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(publisher->delete_datawriter(data_writer), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(data_writer), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Check that the constraints on maximum expression parameter size are honored @@ -2374,10 +2374,10 @@ TEST(ParticipantTests, ExpressionParameterLimits) ASSERT_NE(content_filtered_topic_default_valid_parameters, nullptr); ASSERT_EQ(participant_default_max_parameters->delete_contentfilteredtopic( - content_filtered_topic_default_valid_parameters), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant_default_max_parameters->delete_topic(topic_default_max_parameters), ReturnCode_t::RETCODE_OK); + content_filtered_topic_default_valid_parameters), RETCODE_OK); + ASSERT_EQ(participant_default_max_parameters->delete_topic(topic_default_max_parameters), RETCODE_OK); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant_default_max_parameters), ReturnCode_t::RETCODE_OK); + participant_default_max_parameters), RETCODE_OK); // Test user defined limits pqos.allocation().content_filter.expression_parameters.maximum = 1; @@ -2397,14 +2397,14 @@ TEST(ParticipantTests, ExpressionParameterLimits) topic, "", {"Parameter1"}); ASSERT_NE(content_filtered_topic, nullptr); - ASSERT_EQ(fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER, content_filtered_topic->set_expression_parameters( + ASSERT_EQ(fastrtps::types::RETCODE_BAD_PARAMETER, content_filtered_topic->set_expression_parameters( {"Parameter1", "Parameter2"})); - ASSERT_EQ(participant->delete_contentfilteredtopic(content_filtered_topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_contentfilteredtopic(content_filtered_topic), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } @@ -2413,7 +2413,7 @@ void set_listener_test ( DomainParticipantListener* listener, StatusMask mask) { - ASSERT_EQ(participant->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(participant->get_status_mask(), mask); } @@ -2472,7 +2472,7 @@ TEST(ParticipantTests, SetListener) std::get<2>(testing_case)); } - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } class CustomListener2 : public DomainParticipantListener @@ -2526,10 +2526,10 @@ TEST(ParticipantTests, FailingSetListener) // Wait for callback trigger listener.get_future().wait(); - ASSERT_EQ(participant->set_listener(nullptr, std::chrono::seconds(1)), ReturnCode_t::RETCODE_ERROR); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_listener(nullptr, std::chrono::seconds(1)), RETCODE_ERROR); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant_to_discover), ReturnCode_t::RETCODE_OK); + participant_to_discover), RETCODE_OK); } /* @@ -2549,7 +2549,7 @@ TEST(ParticipantTests, CheckDomainParticipantQos) DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(factory->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(factory->set_qos(qos) == RETCODE_OK); } // Create the participant @@ -2559,25 +2559,25 @@ TEST(ParticipantTests, CheckDomainParticipantQos) // Get the participant qos DomainParticipantQos qos; - ASSERT_TRUE(participant->get_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->get_qos(qos) == RETCODE_OK); // Change the user data qos.user_data().set_max_size(5); std::vector my_data {0, 1, 2, 3, 4}; qos.user_data().setValue(my_data); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_OK); // Change the ParticipantResourceLimitsQos to a maximum user data value less than the current user data size // This should return an Inconsistent Policy error code qos.allocation().data_limits.max_user_data = 1; ASSERT_EQ(qos.allocation().data_limits.max_user_data, 1ul); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_INCONSISTENT_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_INCONSISTENT_POLICY); // Enable the participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); // Remove the participant - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } /* @@ -2590,7 +2590,7 @@ TEST(ParticipantTests, ChangeAllocationDomainParticipantQos) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos pfqos; pfqos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(factory->set_qos(pfqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->set_qos(pfqos), RETCODE_OK); DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant( @@ -2602,7 +2602,7 @@ TEST(ParticipantTests, ChangeAllocationDomainParticipantQos) check_equivalent_qos(qos, PARTICIPANT_QOS_DEFAULT); qos.allocation().data_limits.max_properties = 10; - ASSERT_EQ(participant->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_qos(qos), RETCODE_OK); DomainParticipantQos pqos; participant->get_qos(pqos); @@ -2614,9 +2614,9 @@ TEST(ParticipantTests, ChangeAllocationDomainParticipantQos) ASSERT_TRUE(participant->is_enabled()); participant->get_qos(pqos); pqos.allocation().data_limits.max_properties = 20; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2629,7 +2629,7 @@ TEST(ParticipantTests, ChangeDomainParcipantName) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos pfqos; pfqos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(factory->set_qos(pfqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->set_qos(pfqos), RETCODE_OK); DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant( @@ -2641,7 +2641,7 @@ TEST(ParticipantTests, ChangeDomainParcipantName) check_equivalent_qos(qos, PARTICIPANT_QOS_DEFAULT); qos.name() = "part1"; - ASSERT_EQ(participant->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_qos(qos), RETCODE_OK); DomainParticipantQos pqos; participant->get_qos(pqos); @@ -2653,9 +2653,9 @@ TEST(ParticipantTests, ChangeDomainParcipantName) ASSERT_TRUE(participant->is_enabled()); participant->get_qos(pqos); pqos.name() = "new_part1"; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2675,20 +2675,20 @@ TEST(ParticipantTests, DeleteEntitiesNegativeClauses) ASSERT_NE(subscriber_1, nullptr); // Try to delete this subscriber using the second partipant. This should return a RETCODE_PRECONDITION_NOT_MET // error code as this subscriber does not belong to the second participant - ASSERT_EQ(participant_2->delete_subscriber(subscriber_1), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant_1->delete_subscriber(subscriber_1), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_2->delete_subscriber(subscriber_1), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant_1->delete_subscriber(subscriber_1), RETCODE_OK); // Create a publisher in the first participant Publisher* publisher_1 = participant_1->create_publisher(PUBLISHER_QOS_DEFAULT); ASSERT_NE(publisher_1, nullptr); // Try to delete this publisher using the second partipant. This should return a RETCODE_PRECONDITION_NOT_MET // error code as this publisher does not belong to the second participant - ASSERT_EQ(participant_2->delete_publisher(publisher_1), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant_1->delete_publisher(publisher_1), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_2->delete_publisher(publisher_1), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant_1->delete_publisher(publisher_1), RETCODE_OK); // Remove both participants - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_1), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_2), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_1), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_2), RETCODE_OK); } /* @@ -2714,7 +2714,7 @@ TEST(ParticipantTests, CreateEntitiesWithProfileNegativeClauses) ASSERT_EQ(topic, nullptr); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2734,10 +2734,10 @@ TEST(ParticipantTests, RegisterTypeNegativeClauses) // Create the TypeSupport with the TopicDataType with an empty name TypeSupport type(data_type); // Register the type shoul return a RETCODE_BAD_PARAMETER return code - EXPECT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_BAD_PARAMETER); + EXPECT_EQ(type.register_type(participant), RETCODE_BAD_PARAMETER); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2752,7 +2752,7 @@ TEST(ParticipantTests, AssertLivelinesNegativeClauses) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(factory->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->set_qos(qos), RETCODE_OK); // Create a disabled participant DomainParticipant* participant = @@ -2762,23 +2762,23 @@ TEST(ParticipantTests, AssertLivelinesNegativeClauses) ASSERT_FALSE(participant->is_enabled()); // Assert liveliness from a disabled participant should return a RETCODE_NOT_ENABLED return code. - ASSERT_EQ(participant->assert_liveliness(), ReturnCode_t::RETCODE_NOT_ENABLED); + ASSERT_EQ(participant->assert_liveliness(), RETCODE_NOT_ENABLED); // Change the participant QoS to disable the Writer Liveliness Protocol DomainParticipantQos pqos; - ASSERT_EQ(participant->get_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->get_qos(pqos), RETCODE_OK); pqos.wire_protocol().builtin.use_WriterLivelinessProtocol = false; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_OK); // Enable the participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); EXPECT_TRUE(participant->is_enabled()); // Check that an error is given at trying to assert the livelines from a participant with a disabled // Writer Liveliness Protocol (WLP writer is not defined). - ASSERT_EQ(participant->assert_liveliness(), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(participant->assert_liveliness(), RETCODE_ERROR); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2791,8 +2791,8 @@ TEST(ParticipantTests, GetCurrentTime) (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); eprosima::fastrtps::Time_t now; - ASSERT_EQ(participant->get_current_time(now), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->get_current_time(now), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2817,8 +2817,8 @@ TEST(ParticipantTests, GetParticipantConst) ASSERT_EQ(participant_pub->guid(), participant->guid()); // Remove the publisher and the participant - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } @@ -2833,7 +2833,7 @@ TEST(ParticipantTests, GetParticipantNames) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(factory->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->set_qos(qos), RETCODE_OK); // Create a disabled participant DomainParticipant* participant = @@ -2847,7 +2847,7 @@ TEST(ParticipantTests, GetParticipantNames) ASSERT_TRUE(participant_names.empty()); // Enable the participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); EXPECT_TRUE(participant->is_enabled()); // Check that the participant name is filled when the participant is enabled @@ -2855,7 +2855,7 @@ TEST(ParticipantTests, GetParticipantNames) ASSERT_FALSE(participant_names.empty()); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2887,7 +2887,7 @@ TEST(ParticipantTests, CreateTopicNegativeClauses) ASSERT_EQ(topic, nullptr); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2945,16 +2945,16 @@ TEST(ParticipantTests, ContainsEntity) ASSERT_TRUE(participant->contains_entity(data_reader_ihandle, true)); // Remove data_writer, data_reader, publisher, subscriber and topic entities. - ASSERT_EQ(publisher->delete_datawriter(data_writer), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(data_writer), RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); // Check that the participant does not contains a removed publisher ASSERT_FALSE(participant->contains_entity(pub_ihandle, false)); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2972,10 +2972,10 @@ TEST(ParticipantTests, UnregisterType) (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); // Check that an error is given at trying to unregister a type with an empty name - ASSERT_EQ(participant->unregister_type(""), ReturnCode_t::RETCODE_BAD_PARAMETER); + ASSERT_EQ(participant->unregister_type(""), RETCODE_BAD_PARAMETER); // Check that no error is given at trying to unregister a non registered type - ASSERT_EQ(participant->unregister_type("missing_type"), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->unregister_type("missing_type"), RETCODE_OK); TypeSupport type(new TopicDataTypeMock()); type.register_type(participant); @@ -2989,10 +2989,10 @@ TEST(ParticipantTests, UnregisterType) DataReader* data_reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(data_reader, nullptr); // Check that an error is given at trying to unregister a type that is been used by a data_reader - ASSERT_EQ(participant->unregister_type(type.get_type_name()), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->unregister_type(type.get_type_name()), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); // Create the publisher and a data_writer that use the above topic Publisher* publisher = participant->create_publisher(PUBLISHER_QOS_DEFAULT); @@ -3000,19 +3000,19 @@ TEST(ParticipantTests, UnregisterType) DataWriter* data_writer = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(data_writer, nullptr); // Check that an error is given at trying to unregister a type that is been used by a data_writer - ASSERT_EQ(participant->unregister_type(type.get_type_name()), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->unregister_type(type.get_type_name()), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(publisher->delete_datawriter(data_writer), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(data_writer), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); // At this point, the type is not been used by any entity. // Check that no errors result when an unused topic is unregistered - ASSERT_EQ(participant->unregister_type(type.get_type_name()), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->unregister_type(type.get_type_name()), RETCODE_OK); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3030,7 +3030,7 @@ TEST(ParticipantTests, NewRemoteEndpointDiscovered) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(factory->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(factory->set_qos(qos) == RETCODE_OK); // Create a disabled participant DomainParticipant* participant = @@ -3047,7 +3047,7 @@ TEST(ParticipantTests, NewRemoteEndpointDiscovered) remote_endpoint_guid, 1, eprosima::fastrtps::rtps::EndpointKind_t::WRITER)); // Enable the participant - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + ASSERT_EQ(RETCODE_OK, participant->enable()); ASSERT_TRUE(participant->is_enabled()); // Check that a WRITER remote endpoint is not registered in an enabled participant @@ -3058,7 +3058,7 @@ TEST(ParticipantTests, NewRemoteEndpointDiscovered) remote_endpoint_guid, 1, eprosima::fastrtps::rtps::EndpointKind_t::READER)); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3073,7 +3073,7 @@ TEST(ParticipantTests, SetDomainParticipantQos) // Change in the DomainParticipantQos object the listening socket buffer size setting of the transport qos pqos.transport().listen_socket_buffer_size = 262144; // Set the modified participant qos as the default qos - ASSERT_EQ(DomainParticipantFactory::get_instance()->set_default_participant_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->set_default_participant_qos(pqos), RETCODE_OK); DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant( @@ -3098,7 +3098,7 @@ TEST(ParticipantTests, SetDomainParticipantQos) ASSERT_EQ(qos.transport().listen_socket_buffer_size, pqos.transport().listen_socket_buffer_size); // Remove the participant - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } /* @@ -3116,35 +3116,35 @@ TEST(ParticipantTests, UpdatableDomainParticipantQos) // Check that the PropertyPolicyQos can not be changed in an enabled participant participant->get_qos(pqos); pqos.properties().properties().emplace_back("dds.persistence.guid", "72.61.75.6c.5f.73.61.6e.63.68.65.7a"); - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); // Check that the TransportConfigQos can not be changed in an enabled participant participant->get_qos(pqos); pqos.transport().listen_socket_buffer_size = 262144; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); // Check that the builtin_controllers_sender_thread can not be changed in an enabled participant participant->get_qos(pqos); pqos.builtin_controllers_sender_thread().affinity = 1; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); // Check that the timed_events_thread can not be changed in an enabled participant participant->get_qos(pqos); pqos.timed_events_thread().affinity = 1; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); // Check that the discovery_server_thread can not be changed in an enabled participant participant->get_qos(pqos); pqos.discovery_server_thread().affinity = 1; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); #if HAVE_SECURITY // Check that the security_log_thread can not be changed in an enabled participant participant->get_qos(pqos); pqos.security_log_thread().affinity = 1; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); #endif // if HAVE_SECURITY } @@ -3178,10 +3178,10 @@ TEST(ParticipantTests, RegisterDynamicTypeToFactories) // add the type dynamic type factories type->auto_fill_type_information(true); type->auto_fill_type_object(true); - ASSERT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(type.register_type(participant), RETCODE_OK); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3214,10 +3214,10 @@ TEST(ParticipantTests, RegisterDynamicTypeToFactoriesNotFillTypeInfo) TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); type->auto_fill_type_information(false); type->auto_fill_type_object(true); - ASSERT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(type.register_type(participant), RETCODE_OK); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Mocked DynamicType for DynamicType creation tests @@ -3282,7 +3282,7 @@ TEST(ParticipantTests, RegisterDynamicTypeToFactoriesNotTypeIdentifier) delete myDescriptor; // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3325,7 +3325,7 @@ TEST(ParticipantTests, GetTypes) ASSERT_EQ(participant->guid().guidPrefix, participant->get_types(types).writer_guid().guidPrefix); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3368,7 +3368,7 @@ TEST(ParticipantTests, GetTypeDependencies) ASSERT_EQ(participant->guid().guidPrefix, participant->get_type_dependencies(types).writer_guid().guidPrefix); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3390,7 +3390,7 @@ TEST(ParticipantTests, RegisterRemoteTypeComplete) // Create the remote participant and enable it DomainParticipant* remote_participant = DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, remote_participant->enable()); + EXPECT_EQ(RETCODE_OK, remote_participant->enable()); EXPECT_TRUE(remote_participant->is_enabled()); // Create the local participant @@ -3433,21 +3433,21 @@ TEST(ParticipantTests, RegisterRemoteTypeComplete) // Register the remote type in the disabled local participant. This should return a RETCODE_NOT_ENABLED return code ASSERT_EQ(participant->register_remote_type(*type_information, type.get_type_name(), callback), - ReturnCode_t::RETCODE_NOT_ENABLED); + RETCODE_NOT_ENABLED); // Enable the local participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); EXPECT_TRUE(participant->is_enabled()); // Register the remote type in the disabled local participant ASSERT_EQ(participant->register_remote_type(*type_information, type_name, callback), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); // Remove the topic and both participants - ASSERT_EQ(remote_participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(remote_participant->delete_topic(topic), RETCODE_OK); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(remote_participant), - ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3469,7 +3469,7 @@ TEST(ParticipantTests, RegisterRemoteTypeMinimal) // Create the remote participant and enable it DomainParticipant* remote_participant = DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, remote_participant->enable()); + EXPECT_EQ(RETCODE_OK, remote_participant->enable()); EXPECT_TRUE(remote_participant->is_enabled()); // Create the local participant @@ -3510,21 +3510,21 @@ TEST(ParticipantTests, RegisterRemoteTypeMinimal) // Register the remote type in the disabled local participant. This should return a RETCODE_NOT_ENABLED return code ASSERT_EQ(participant->register_remote_type(*type_information, type.get_type_name(), callback), - ReturnCode_t::RETCODE_NOT_ENABLED); + RETCODE_NOT_ENABLED); // Enable the local participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); EXPECT_TRUE(participant->is_enabled()); // Register the remote type in the disabled local participant ASSERT_EQ(participant->register_remote_type(*type_information, type_name, callback), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); // Remove the topic and both participants - ASSERT_EQ(remote_participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(remote_participant->delete_topic(topic), RETCODE_OK); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(remote_participant), - ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3571,13 +3571,13 @@ TEST(ParticipantTests, RegisterRemoteTypePreconditionNotMet) fastrtps::types::TypeInformation info = fastrtps::types::TypeInformation(); // Check that register_remote_type() returns RETCODE_PRECONDITION_NOT_MET if the TypeInformation is empty ASSERT_EQ(participant->register_remote_type(info, type.get_type_name(), callback), - ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + RETCODE_PRECONDITION_NOT_MET); // Remove the topic and both participants - ASSERT_EQ(remote_participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(remote_participant->delete_topic(topic), RETCODE_OK); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(remote_participant), - ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Delete contained entities test @@ -3657,7 +3657,7 @@ TEST(ParticipantTests, DeleteContainedEntities) // Setup done, start the actual testing void* loan_data; - ASSERT_EQ(data_writer_foo->loan_sample(loan_data), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_writer_foo->loan_sample(loan_data), RETCODE_OK); // Writer with active loans. Fail and keep everything as is @@ -3668,7 +3668,7 @@ TEST(ParticipantTests, DeleteContainedEntities) EXPECT_EQ(data_writer_list.size(), 2u); subscriber->get_datareaders(data_reader_list); EXPECT_EQ(data_reader_list.size(), 1u); - ASSERT_EQ(retcode, ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(retcode, RETCODE_PRECONDITION_NOT_MET); data_writer_list.clear(); data_reader_list.clear(); @@ -3677,11 +3677,11 @@ TEST(ParticipantTests, DeleteContainedEntities) // Reader with active loans. Fail and keep everything as is - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_bar->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, data_writer_bar->write(&data, HANDLE_NIL)); Duration_t wait_time(1, 0); EXPECT_TRUE(data_reader_bar->wait_for_unread_message(wait_time)); - ASSERT_EQ(data_reader_bar->take(mock_coll, mock_seq), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader_bar->take(mock_coll, mock_seq), RETCODE_OK); retcode = participant->delete_contained_entities(); @@ -3691,12 +3691,12 @@ TEST(ParticipantTests, DeleteContainedEntities) subscriber->get_datareaders(data_reader_list); EXPECT_EQ(data_reader_list.size(), 1u); - ASSERT_EQ(retcode, ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(retcode, RETCODE_PRECONDITION_NOT_MET); data_writer_list.clear(); data_reader_list.clear(); - ASSERT_EQ(data_reader_bar->return_loan(mock_coll, mock_seq), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader_bar->return_loan(mock_coll, mock_seq), RETCODE_OK); QueryCondition* query_condition = data_reader_bar->create_querycondition( mock_sample_state_kind, @@ -3718,7 +3718,7 @@ TEST(ParticipantTests, DeleteContainedEntities) // ContentFilteredTopic is not considered an entity EXPECT_EQ(participant->lookup_topicdescription("contentfilteredtopic"), nullptr); - ASSERT_EQ(retcode, ReturnCode_t::RETCODE_OK); + ASSERT_EQ(retcode, RETCODE_OK); } @@ -3759,11 +3759,11 @@ TEST(ParticipantTests, ContentFilterInterfaces) if (filter_parameters.length() == std::count(s.begin(), s.end(), '%')) { filter_instance = this; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } virtual ReturnCode_t delete_content_filter( @@ -3772,10 +3772,10 @@ TEST(ParticipantTests, ContentFilterInterfaces) { if (this == filter_instance) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } }; @@ -3794,8 +3794,8 @@ TEST(ParticipantTests, ContentFilterInterfaces) // Create a type and a topics TypeSupport type(new TopicDataTypeMock()); - ASSERT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(type.register_type(participant2), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(type.register_type(participant), RETCODE_OK); + ASSERT_EQ(type.register_type(participant2), RETCODE_OK); Topic* topic = participant->create_topic("topic", type.get_type_name(), TOPIC_QOS_DEFAULT); ASSERT_NE(topic, nullptr); @@ -3819,18 +3819,18 @@ TEST(ParticipantTests, ContentFilterInterfaces) EXPECT_EQ(nullptr, participant->create_contentfilteredtopic("contentfilteredtopic", topic, "", {}, nullptr)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, participant->delete_contentfilteredtopic(nullptr)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->delete_contentfilteredtopic(nullptr)); } // Negative tests for register_content_filter_factory { - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->register_content_filter_factory(nullptr, &test_filter)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->register_content_filter_factory(very_long_name.c_str(), &test_filter)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->register_content_filter_factory(TEST_FILTER_CLASS, nullptr)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->register_content_filter_factory(FASTDDS_SQLFILTER_NAME, &test_filter)); } @@ -3843,32 +3843,32 @@ TEST(ParticipantTests, ContentFilterInterfaces) // Negative tests for unregister_content_filter_factory { - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, participant->unregister_content_filter_factory(nullptr)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->unregister_content_filter_factory(nullptr)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(FASTDDS_SQLFILTER_NAME)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); } // Custom filter factory registration { // Register filter factory - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->register_content_filter_factory(TEST_FILTER_CLASS, &test_filter)); // Lookup should return same pointer as the one registered EXPECT_EQ(&test_filter, participant->lookup_content_filter_factory(TEST_FILTER_CLASS)); // But not for other filter class name EXPECT_EQ(nullptr, participant->lookup_content_filter_factory(OTHER_FILTER_CLASS)); // Should not be able to register twice - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->register_content_filter_factory(TEST_FILTER_CLASS, &test_filter)); // Unregister filter factory - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); // Lookup should now return nullptr EXPECT_EQ(nullptr, participant->lookup_content_filter_factory(TEST_FILTER_CLASS)); // Unregister twice should fail - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); } @@ -3878,9 +3878,9 @@ TEST(ParticipantTests, ContentFilterInterfaces) participant->create_contentfilteredtopic("contentfilteredtopic", topic, "", {}, TEST_FILTER_CLASS)); // Register two filter factories to ensure traversal of collections - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->register_content_filter_factory(TEST_FILTER_CLASS, &test_filter)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->register_content_filter_factory(OTHER_FILTER_CLASS, &test_filter)); // Negative tests for custom filtered topic creation @@ -3912,12 +3912,12 @@ TEST(ParticipantTests, ContentFilterInterfaces) EXPECT_EQ(filtered_topic2, participant->lookup_topicdescription("contentfilteredtopic2")); // Should not be able to delete topic, since it is referenced by filtered_topic - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant->delete_topic(topic)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->delete_topic(topic)); // Should not be able to unregister filter factory, since it is referenced by filtered_topic - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(OTHER_FILTER_CLASS)); // Reference filtered_topic by creating a DataReader @@ -3927,31 +3927,31 @@ TEST(ParticipantTests, ContentFilterInterfaces) ASSERT_NE(nullptr, data_reader); // Should not be able to delete filtered_topic, since it is referenced by data_reader - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant->delete_contentfilteredtopic(filtered_topic)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->delete_contentfilteredtopic(filtered_topic)); EXPECT_EQ(filtered_topic, participant->lookup_topicdescription("contentfilteredtopic")); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber->delete_datareader(data_reader)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_subscriber(subscriber)); + EXPECT_EQ(RETCODE_OK, subscriber->delete_datareader(data_reader)); + EXPECT_EQ(RETCODE_OK, participant->delete_subscriber(subscriber)); // Should be able to delete filtered_topic, but only on correct participant - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant2->delete_contentfilteredtopic(filtered_topic)); EXPECT_EQ(filtered_topic, participant->lookup_topicdescription("contentfilteredtopic")); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_contentfilteredtopic(filtered_topic)); + EXPECT_EQ(RETCODE_OK, participant->delete_contentfilteredtopic(filtered_topic)); EXPECT_EQ(nullptr, participant->lookup_topicdescription("contentfilteredtopic")); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_contentfilteredtopic(filtered_topic2)); + EXPECT_EQ(RETCODE_OK, participant->delete_contentfilteredtopic(filtered_topic2)); // Unregister filter factories - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->unregister_content_filter_factory(OTHER_FILTER_CLASS)); } - ASSERT_EQ(participant2->delete_topic(topic2), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant2), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant2->delete_topic(topic2), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant2), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3978,7 +3978,7 @@ TEST(ParticipantTests, UnsupportedMethods) // Create a type and a topic TypeSupport type(new TopicDataTypeMock()); - ASSERT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(type.register_type(participant), RETCODE_OK); Topic* topic = participant->create_topic("topic", type.get_type_name(), TOPIC_QOS_DEFAULT); ASSERT_NE(topic, nullptr); @@ -3992,29 +3992,29 @@ TEST(ParticipantTests, UnsupportedMethods) nullptr); // nullptr use as there are not such a class - ASSERT_EQ(participant->delete_multitopic(nullptr), ReturnCode_t::RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->delete_multitopic(nullptr), RETCODE_UNSUPPORTED); ASSERT_EQ(participant->get_builtin_subscriber(), nullptr); - ASSERT_EQ(participant->ignore_topic(InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); - ASSERT_EQ(participant->ignore_publication(InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); - ASSERT_EQ(participant->ignore_subscription(InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->ignore_topic(InstanceHandle_t()), RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->ignore_publication(InstanceHandle_t()), RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->ignore_subscription(InstanceHandle_t()), RETCODE_UNSUPPORTED); // Discovery methods std::vector handle_vector({InstanceHandle_t()}); builtin::ParticipantBuiltinTopicData pbtd; builtin::TopicBuiltinTopicData tbtd; - ASSERT_EQ(participant->get_discovered_participants(handle_vector), ReturnCode_t::RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->get_discovered_participants(handle_vector), RETCODE_UNSUPPORTED); ASSERT_EQ( - participant->get_discovered_participant_data(pbtd, InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); + participant->get_discovered_participant_data(pbtd, InstanceHandle_t()), RETCODE_UNSUPPORTED); - ASSERT_EQ(participant->get_discovered_topics(handle_vector), ReturnCode_t::RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->get_discovered_topics(handle_vector), RETCODE_UNSUPPORTED); ASSERT_EQ( - participant->get_discovered_topic_data(tbtd, InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); + participant->get_discovered_topic_data(tbtd, InstanceHandle_t()), RETCODE_UNSUPPORTED); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -4040,15 +4040,15 @@ TEST(ParticipantTests, TwoParticipantWithSameFixedId) ASSERT_EQ(participant2, nullptr); // Destroy the first participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant1), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant1), RETCODE_OK); } // Test participants disabled from beginning { DomainParticipantFactoryQos factory_qos; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->get_qos(factory_qos)); + ASSERT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->get_qos(factory_qos)); factory_qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->set_qos(factory_qos)); + ASSERT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->set_qos(factory_qos)); DomainParticipantQos participant_qos; participant_qos.wire_protocol().participant_id = 1; @@ -4063,13 +4063,13 @@ TEST(ParticipantTests, TwoParticipantWithSameFixedId) DomainParticipantFactory::get_instance()->create_participant(0, participant_qos); ASSERT_EQ(participant2, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant1->enable()); + ASSERT_EQ(RETCODE_OK, participant1->enable()); // Destroy the first participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant1), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant1), RETCODE_OK); factory_qos.entity_factory().autoenable_created_entities = true; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->set_qos(factory_qos)); + ASSERT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->set_qos(factory_qos)); } } diff --git a/test/unittest/dds/publisher/DataWriterTests.cpp b/test/unittest/dds/publisher/DataWriterTests.cpp index fe3fac44ce6..4379b067749 100644 --- a/test/unittest/dds/publisher/DataWriterTests.cpp +++ b/test/unittest/dds/publisher/DataWriterTests.cpp @@ -357,10 +357,10 @@ TEST(DataWriterTests, get_type) ASSERT_EQ(type, datawriter->get_type()); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } /*! @@ -437,12 +437,12 @@ TEST(DataWriterTests, get_guid) } ASSERT_EQ(guid, discovery_listener.guid); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( - listener_participant) == ReturnCode_t::RETCODE_OK); + listener_participant) == RETCODE_OK); } TEST(DataWriterTests, ChangeDataWriterQos) @@ -469,17 +469,17 @@ TEST(DataWriterTests, ChangeDataWriterQos) qos.deadline().period = 260; - ASSERT_TRUE(datawriter->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(datawriter->set_qos(qos) == RETCODE_OK); DataWriterQos wqos; datawriter->get_qos(wqos); ASSERT_EQ(qos, wqos); ASSERT_EQ(wqos.deadline().period, 260); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(DataWriterTests, ChangeImmutableDataWriterQos) @@ -510,29 +510,29 @@ TEST(DataWriterTests, ChangeImmutableDataWriterQos) qos.reliable_writer_qos().disable_positive_acks.enabled = true; - ASSERT_TRUE(datawriter->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(datawriter->set_qos(qos) == RETCODE_OK); DataWriterQos wqos; datawriter->get_qos(wqos); ASSERT_EQ(qos, wqos); ASSERT_TRUE(wqos.reliable_writer_qos().disable_positive_acks.enabled); - ASSERT_TRUE(datawriter->enable() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(datawriter->enable() == RETCODE_OK); ASSERT_TRUE(datawriter->is_enabled()); qos.reliable_writer_qos().disable_positive_acks.enabled = false; ASSERT_FALSE(qos == wqos); - ASSERT_TRUE(datawriter->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(datawriter->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); DataWriterQos wqos2; datawriter->get_qos(wqos2); ASSERT_EQ(wqos, wqos2); ASSERT_TRUE(wqos2.reliable_writer_qos().disable_positive_acks.enabled); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(DataWriterTests, ForcedDataSharing) @@ -565,12 +565,12 @@ TEST(DataWriterTests, ForcedDataSharing) qos.endpoint().history_memory_policy = fastrtps::rtps::PREALLOCATED_MEMORY_MODE; datawriter = publisher->create_datawriter(topic, qos); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); // DataSharing automatic, bounded topic data type datawriter = publisher->create_datawriter(bounded_topic, qos); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); // DataSharing enabled, unbounded topic data type qos = DATAWRITER_QOS_DEFAULT; @@ -582,7 +582,7 @@ TEST(DataWriterTests, ForcedDataSharing) // DataSharing enabled, bounded topic data type datawriter = publisher->create_datawriter(bounded_topic, qos); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); // DataSharing enabled, bounded topic data type, Dynamic memory policy qos = DATAWRITER_QOS_DEFAULT; @@ -591,10 +591,10 @@ TEST(DataWriterTests, ForcedDataSharing) datawriter = publisher->create_datawriter(bounded_topic, qos); ASSERT_EQ(datawriter, nullptr); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(bounded_topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(bounded_topic), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); // DataSharing forced, bounded topic data type, security enabled @@ -643,9 +643,9 @@ TEST(DataWriterTests, ForcedDataSharing) datawriter = publisher->create_datawriter(bounded_topic, qos); ASSERT_EQ(datawriter, nullptr); - ASSERT_EQ(participant->delete_topic(bounded_topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(bounded_topic), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); #endif // HAS_SECURITY } @@ -669,7 +669,7 @@ TEST(DataWriterTests, InvalidQos) ASSERT_NE(datawriter, nullptr); /* Unsupported QoS */ - const ReturnCode_t unsupported_code = ReturnCode_t::RETCODE_UNSUPPORTED; + const ReturnCode_t unsupported_code = RETCODE_UNSUPPORTED; DataWriterQos qos; qos = DATAWRITER_QOS_DEFAULT; @@ -685,7 +685,7 @@ TEST(DataWriterTests, InvalidQos) EXPECT_EQ(unsupported_code, datawriter->set_qos(qos)); /* Inconsistent QoS */ - const ReturnCode_t inconsistent_code = ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + const ReturnCode_t inconsistent_code = RETCODE_INCONSISTENT_POLICY; qos = DATAWRITER_QOS_DEFAULT; qos.properties().properties().emplace_back("fastdds.push_mode", "false"); @@ -714,15 +714,15 @@ TEST(DataWriterTests, InvalidQos) EXPECT_EQ(inconsistent_code, datawriter->set_qos(qos)); qos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_MEMORY_MODE; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->set_qos(qos)); + EXPECT_EQ(RETCODE_OK, datawriter->set_qos(qos)); qos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->set_qos(qos)); + EXPECT_EQ(RETCODE_OK, datawriter->set_qos(qos)); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } //TODO: Activate the test once PSM API for DataWriter is in place @@ -765,15 +765,15 @@ TEST(DataWriterTests, Write) FooType data; data.message("HelloWorld"); - ASSERT_FALSE(datawriter->write(nullptr, HANDLE_NIL) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(datawriter->write(&data, HANDLE_NIL) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(datawriter->write(nullptr, HANDLE_NIL) == RETCODE_OK); + ASSERT_TRUE(datawriter->write(&data, HANDLE_NIL) == RETCODE_OK); ASSERT_TRUE(datawriter->write(&data, participant->get_instance_handle()) == - ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + RETCODE_PRECONDITION_NOT_MET); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(DataWriterTests, WriteWithTimestamp) @@ -800,22 +800,22 @@ TEST(DataWriterTests, WriteWithTimestamp) data.message("HelloWorld"); // 1. Calling write with nullptr data returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->write_w_timestamp(nullptr, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_BAD_PARAMETER, datawriter->write_w_timestamp(nullptr, HANDLE_NIL, ts)); // 2. Calling write with an invalid timestamps returns RETCODE_BAD_PARAMETER - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->write_w_timestamp(&data, HANDLE_NIL, fastrtps::c_TimeInfinite)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->write_w_timestamp(&data, HANDLE_NIL, fastrtps::c_TimeInvalid)); // 3. Calling write with a wrong instance handle returns RETCODE_PRECONDITION_NOT_MET - ASSERT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + ASSERT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->write_w_timestamp(&data, participant->get_instance_handle(), ts)); // 4. Correct case - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void set_listener_test ( @@ -823,7 +823,7 @@ void set_listener_test ( DataWriterListener* listener, StatusMask mask) { - ASSERT_EQ(writer->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(writer->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(writer->get_status_mask(), mask); } @@ -876,10 +876,10 @@ TEST(DataWriterTests, SetListener) std::get<2>(testing_case)); } - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(DataWriterTests, TerminateWithoutDestroyingWriter) @@ -967,11 +967,11 @@ TEST(DataWriterTests, RegisterInstance) EXPECT_EQ(HANDLE_NIL, instance_datawriter->register_instance(&data)); // 2. Calling register_instance in a non keyed topic returns HANDLE_NIL - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); EXPECT_EQ(HANDLE_NIL, datawriter->register_instance(&data)); // 3. Calling register_instance with an invalid sample returns HANDLE_NIL - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); EXPECT_EQ(HANDLE_NIL, instance_datawriter->register_instance(nullptr)); // 4. Calling register_instance with a valid key returns a valid handle @@ -999,11 +999,11 @@ TEST(DataWriterTests, RegisterInstanceWithTimestamp) EXPECT_EQ(HANDLE_NIL, instance_datawriter->register_instance_w_timestamp(&data, ts)); // 2. Calling register_instance_w_timestamp in a non keyed topic returns HANDLE_NIL - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); EXPECT_EQ(HANDLE_NIL, datawriter->register_instance_w_timestamp(&data, ts)); // 3. Calling register_instance with an invalid sample returns HANDLE_NIL - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); EXPECT_EQ(HANDLE_NIL, instance_datawriter->register_instance_w_timestamp(nullptr, ts)); // 4. Calling register_instance with an invalid timestamps returns HANDLE_NIL @@ -1031,34 +1031,34 @@ TEST(DataWriterTests, UnregisterInstance) create_writers_for_instance_test(datawriter, instance_datawriter, &instance_type); // 1. Calling unregister_instance in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->unregister_instance(&data, handle)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->unregister_instance(&data, handle)); // 2. Calling unregister_instance in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, datawriter->unregister_instance(&data, handle)); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->unregister_instance(&data, handle)); // 3. Calling unregister_instance with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance(nullptr, handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance(nullptr, handle)); #if !defined(NDEBUG) // 4. Calling unregister_instance with an inconsistent handle returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance(&data, datawriter->get_instance_handle())); #endif // NDEBUG // 5. Calling unregister_instance with a key not yet registered returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance(&data, handle)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance(&data, handle)); // 6. Calling unregister_instance with a valid key returns RETCODE_OK - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance(&data, handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->unregister_instance(&data, handle)); // 7. Calling unregister_instance with a valid InstanceHandle also returns RETCODE_OK data.message("HelloWorld_1"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance(&data, handle)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->unregister_instance(&data, handle)); // TODO(jlbueno) There are other possible errors sending the unregister message: RETCODE_OUT_OF_RESOURCES, // RETCODE_ERROR, and RETCODE_TIMEOUT (only if HAVE_STRICT_REALTIME has been defined). @@ -1083,45 +1083,45 @@ TEST(DataWriterTests, UnregisterInstanceWithTimestamp) eprosima::fastrtps::Time_t ts{ 0, 1 }; // 1. Calling unregister_instance in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->unregister_instance_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 2. Calling unregister_instance in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 3. Calling unregister_instance with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance_w_timestamp(nullptr, handle, ts)); #if !defined(NDEBUG) // 4. Calling unregister_instance with an inconsistent handle returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance_w_timestamp(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance_w_timestamp(&data, datawriter->get_instance_handle(), ts)); #endif // NDEBUG // 5. Calling unregister_instance with a key not yet registered returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 6. Calling unregister_instance with a valid key returns RETCODE_OK - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 7. Calling unregister_instance with a valid InstanceHandle also returns RETCODE_OK data.message("HelloWorld_1"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 8. Check invalid timestamps - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); ts = eprosima::fastrtps::c_TimeInfinite; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); ts = eprosima::fastrtps::c_TimeInvalid; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // TODO(jlbueno) There are other possible errors sending the unregister message: RETCODE_OUT_OF_RESOURCES, @@ -1145,34 +1145,34 @@ TEST(DataWriterTests, Dispose) create_writers_for_instance_test(datawriter, instance_datawriter, &instance_type); // 1. Calling dispose in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->dispose(&data, handle)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->dispose(&data, handle)); // 2. Calling dispose in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, datawriter->dispose(&data, handle)); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->dispose(&data, handle)); // 3. Calling dispose with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->dispose(nullptr, handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->dispose(nullptr, handle)); #if !defined(NDEBUG) // 4. Calling dispose with an inconsistent handle returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose(&data, datawriter->get_instance_handle())); #endif // NDEBUG // 5. Calling dispose with a key not yet registered returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose(&data, handle)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose(&data, handle)); // 6. Calling dispose with a valid key returns RETCODE_OK - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose(&data, handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->dispose(&data, handle)); // 7. Calling dispose with a valid InstanceHandle also returns RETCODE_OK data.message("HelloWorld_1"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose(&data, handle)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->dispose(&data, handle)); // TODO(jlbueno) There are other possible errors sending the dispose message: RETCODE_OUT_OF_RESOURCES, // RETCODE_ERROR, and RETCODE_TIMEOUT (only if HAVE_STRICT_REALTIME has been defined). @@ -1197,41 +1197,41 @@ TEST(DataWriterTests, DisposeWithTimestamp) eprosima::fastrtps::Time_t ts{ 0, 1 }; // 1. Calling dispose in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->dispose_w_timestamp(&data, handle, ts)); // 2. Calling dispose in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, datawriter->dispose_w_timestamp(&data, handle, ts)); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->dispose_w_timestamp(&data, handle, ts)); // 3. Calling dispose with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(nullptr, handle, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(nullptr, handle, ts)); #if !defined(NDEBUG) // 4. Calling dispose with an inconsistent handle returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose_w_timestamp(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose_w_timestamp(&data, datawriter->get_instance_handle(), ts)); #endif // NDEBUG // 5. Calling dispose with a key not yet registered returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); // 6. Calling dispose with a valid key returns RETCODE_OK - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); // 7. Calling dispose with a valid InstanceHandle also returns RETCODE_OK data.message("HelloWorld_1"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); // 8. Check invalid timestamps - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); ts = eprosima::fastrtps::c_TimeInfinite; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); ts = eprosima::fastrtps::c_TimeInvalid; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); // TODO(jlbueno) There are other possible errors sending the dispose message: RETCODE_OUT_OF_RESOURCES, // RETCODE_ERROR, and RETCODE_TIMEOUT (only if HAVE_STRICT_REALTIME has been defined). @@ -1256,39 +1256,39 @@ TEST(DataWriterTests, GetKeyValue) create_writers_for_instance_test(datawriter, instance_datawriter); // 1. Check nullptr on key_holder - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->get_key_value(nullptr, wrong_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(nullptr, wrong_handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->get_key_value(nullptr, wrong_handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(nullptr, wrong_handle)); // 2. Check HANDLE_NIL - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->get_key_value(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->get_key_value(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, HANDLE_NIL)); // 3. Check type should have keys, and writer should be enabled - EXPECT_EQ(ReturnCode_t::RETCODE_ILLEGAL_OPERATION, datawriter->get_key_value(&data, wrong_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, instance_datawriter->get_key_value(&data, wrong_handle)); + EXPECT_EQ(RETCODE_ILLEGAL_OPERATION, datawriter->get_key_value(&data, wrong_handle)); + EXPECT_EQ(RETCODE_NOT_ENABLED, instance_datawriter->get_key_value(&data, wrong_handle)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); // 4. Calling get_key_value with a key not yet registered returns RETCODE_BAD_PARAMETER - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, wrong_handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, wrong_handle)); // 5. Calling get_key_value on a registered instance should work. valid_handle = instance_datawriter->register_instance(&valid_data); EXPECT_NE(HANDLE_NIL, valid_handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); // 6. Calling get_key_value on an unregistered instance should return RETCODE_BAD_PARAMETER. - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance(&valid_data, valid_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, valid_handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->unregister_instance(&valid_data, valid_handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, valid_handle)); // 7. Calling get_key_value with a valid instance should work - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&valid_data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&valid_data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); // 8. Calling get_key_value on a disposed instance should work. - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose(&valid_data, valid_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->dispose(&valid_data, valid_handle)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); } struct LoanableType @@ -1419,61 +1419,61 @@ TEST(DataWriterTests, LoanPositiveTests) void* sample = nullptr; // Loan and discard (check different initialization schemes) - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample, InitKind::NO_LOAN_INITIALIZATION)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample, InitKind::NO_LOAN_INITIALIZATION)); EXPECT_NE(nullptr, sample); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample, InitKind::ZERO_LOAN_INITIALIZATION)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample, InitKind::ZERO_LOAN_INITIALIZATION)); ASSERT_NE(nullptr, sample); EXPECT_EQ(0u, static_cast(sample)->index); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample, InitKind::CONSTRUCTED_LOAN_INITIALIZATION)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample, InitKind::CONSTRUCTED_LOAN_INITIALIZATION)); ASSERT_NE(nullptr, sample); EXPECT_EQ(LoanableType::initialization_value(), static_cast(sample)->index); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); // Resource limits: // Depth has been configured to 1, so pool will allow up to depth + 1 loans. // We will check that the 3rd unreturned loan returns OUT_OF_RESOURCES. void* sample_2 = nullptr; void* sample_3 = nullptr; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample)); EXPECT_NE(nullptr, sample); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample_2)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample_2)); EXPECT_NE(nullptr, sample_2); - EXPECT_EQ(ReturnCode_t::RETCODE_OUT_OF_RESOURCES, datawriter->loan_sample(sample_3)); + EXPECT_EQ(RETCODE_OUT_OF_RESOURCES, datawriter->loan_sample(sample_3)); EXPECT_EQ(nullptr, sample_3); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample_2)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); // Write samples, both loaned and not LoanableType data; fastrtps::rtps::InstanceHandle_t handle; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample)); EXPECT_NE(nullptr, sample); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample_2)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample_2)); EXPECT_NE(nullptr, sample_2); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(sample, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(sample_2, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample_2)); + EXPECT_EQ(RETCODE_OK, datawriter->write(sample, handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->write(sample_2, handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(&data, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->write(&data, handle)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample)); EXPECT_NE(nullptr, sample); - EXPECT_EQ(ReturnCode_t::RETCODE_OUT_OF_RESOURCES, datawriter->write(&data, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(&data, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(&data, handle)); - - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + EXPECT_EQ(RETCODE_OUT_OF_RESOURCES, datawriter->write(&data, handle)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->write(&data, handle)); + EXPECT_EQ(RETCODE_OK, datawriter->write(&data, handle)); + + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } class LoanableTypeSupportTesting : public LoanableTypeSupport @@ -1529,31 +1529,31 @@ TEST(DataWriterTests, LoanNegativeTests) // Check for illegal operation type_support->is_plain_result = false; - EXPECT_EQ(ReturnCode_t::RETCODE_ILLEGAL_OPERATION, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_ILLEGAL_OPERATION, datawriter->loan_sample(sample)); type_support->is_plain_result = true; type_support->m_typeSize = 0; - EXPECT_EQ(ReturnCode_t::RETCODE_ILLEGAL_OPERATION, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_ILLEGAL_OPERATION, datawriter->loan_sample(sample)); type_support->m_typeSize = original_type_size; // Check for not enabled - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->loan_sample(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->enable()); // Check for constructor support type_support->construct_sample_result = false; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, + EXPECT_EQ(RETCODE_UNSUPPORTED, datawriter->loan_sample(sample, InitKind::CONSTRUCTED_LOAN_INITIALIZATION)); type_support->construct_sample_result = true; // Check preconditions on delete_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, publisher->delete_datawriter(datawriter)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, publisher->delete_datawriter(datawriter)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } class DataWriterTest : public DataWriter @@ -1620,21 +1620,21 @@ TEST(DataWriterTests, InstanceWaitForAcknowledgement) ASSERT_NE(nullptr, instance_datawriter); // 1. Calling wait_for_acknowledgments in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->wait_for_acknowledgments(&data, handle, max_wait)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->wait_for_acknowledgments(&data, handle, max_wait)); // 2. Calling wait_for_acknowledgments in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, datawriter->wait_for_acknowledgments(&data, handle, + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->wait_for_acknowledgments(&data, handle, max_wait)); // 3. Calling wait_for_acknowledgments with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->wait_for_acknowledgments(nullptr, handle, + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->wait_for_acknowledgments(nullptr, handle, max_wait)); #if !defined(NDEBUG) // 4. Calling wait_for_acknowledgments with an inconsistent handle returns RETCODE_BAD_PARAMETER - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->wait_for_acknowledgments(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->wait_for_acknowledgments(&data, datawriter->get_instance_handle(), max_wait)); #endif // NDEBUG @@ -1650,8 +1650,8 @@ TEST(DataWriterTests, InstanceWaitForAcknowledgement) // 5. Calling wait_for_acknowledgments in a keyed topic with HANDLE_NIL returns // RETCODE_OK EXPECT_CALL(*history, wait_for_acknowledgement_last_change(_, _, _)).WillOnce(testing::Return(true)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->wait_for_acknowledgments(&data, handle, + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); // 6. Calling wait_for_acknowledgments in a keyed topic with a known handle returns RETCODE_OK (no matched readers) @@ -1659,13 +1659,13 @@ TEST(DataWriterTests, InstanceWaitForAcknowledgement) EXPECT_CALL(*history, wait_for_acknowledgement_last_change(_, _, _)).WillOnce(testing::Return(true)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); // 7. Calling wait_for_acknowledgments in a keyed topic with a known handle timeouts if some reader has not // acknowledged before max_wait time (mock) returns RETCODE_TIMEOUT // Expectations EXPECT_CALL(*history, wait_for_acknowledgement_last_change(_, _, _)).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); + EXPECT_EQ(RETCODE_TIMEOUT, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); } #endif // __QNXNTO__ @@ -1721,7 +1721,7 @@ class DataWriterUnsupportedTests : public ::testing::Test /* * This test checks that the DataWriter methods defined in the standard not yet implemented in FastDDS return - * ReturnCode_t::RETCODE_UNSUPPORTED. The following methods are checked: + * RETCODE_UNSUPPORTED. The following methods are checked: * 1. get_matched_subscription_data * 2. get_matched_subscriptions * 3. lookup_instance @@ -1747,21 +1747,21 @@ TEST_F(DataWriterUnsupportedTests, UnsupportedDataWriterMethods) builtin::SubscriptionBuiltinTopicData subscription_data; fastrtps::rtps::InstanceHandle_t subscription_handle; EXPECT_EQ( - ReturnCode_t::RETCODE_UNSUPPORTED, + RETCODE_UNSUPPORTED, data_writer->get_matched_subscription_data(subscription_data, subscription_handle)); std::vector subscription_handles; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_writer->get_matched_subscriptions(subscription_handles)); + EXPECT_EQ(RETCODE_UNSUPPORTED, data_writer->get_matched_subscriptions(subscription_handles)); EXPECT_EQ(HANDLE_NIL, data_writer->lookup_instance(nullptr /* instance */)); // Expected logWarnings: lookup_instance HELPER_WaitForEntries(1); - ASSERT_EQ(publisher->delete_datawriter(data_writer), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(data_writer), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -1836,47 +1836,47 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyNotKeyed) ASSERT_NE(data_writer5, nullptr); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 DataWriterQos qos2 = DATAWRITER_QOS_DEFAULT; DataWriter* default_data_writer1 = publisher->create_datawriter(topic, qos2); ASSERT_NE(default_data_writer1, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_instances = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 4999; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); } /* @@ -1961,19 +1961,19 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyKeyed) ASSERT_NE(data_writer6, nullptr); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0, as the by default values are already infinite. + // set_qos() should return RETCODE_OK = 0, as the by default values are already infinite. DataWriterQos qos2 = DATAWRITER_QOS_DEFAULT; DataWriter* default_data_writer1 = publisher->create_datawriter(topic, qos2); ASSERT_NE(default_data_writer1, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , // set_qos() should return a value != 0 (not OK) @@ -1981,32 +1981,32 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_NE(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_NE(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples = ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5000; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); } diff --git a/test/unittest/dds/publisher/PublisherTests.cpp b/test/unittest/dds/publisher/PublisherTests.cpp index 5379b87c993..8159a13c6d9 100644 --- a/test/unittest/dds/publisher/PublisherTests.cpp +++ b/test/unittest/dds/publisher/PublisherTests.cpp @@ -205,8 +205,8 @@ TEST(PublisherTests, GetPublisherParticipant) ASSERT_EQ(publisher->get_participant(), participant); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(PublisherTests, GetPSMPublisherParticipant) @@ -316,7 +316,7 @@ TEST(PublisherTests, ChangeDefaultDataWriterQos) // . data_sharing qos.data_sharing().on("/"); - ASSERT_TRUE(publisher->set_default_datawriter_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->set_default_datawriter_qos(qos) == RETCODE_OK); DataWriterQos wqos; publisher->get_default_datawriter_qos(wqos); @@ -437,8 +437,8 @@ TEST(PublisherTests, ChangeDefaultDataWriterQos) EXPECT_TRUE(qos == wqos); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -481,8 +481,8 @@ TEST(PublisherTests, ChangePublisherQos) ASSERT_TRUE(qos == pqos); ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -520,10 +520,10 @@ TEST(PublisherTests, CreateDataWriter) DataWriter* datawriter = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } void check_datawriter_with_profile ( @@ -597,17 +597,17 @@ TEST(PublisherTests, CreateDataWriterWithProfile) DataWriter* default_datawriter = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(default_datawriter, nullptr); check_datawriter_with_profile(default_datawriter, "test_default_publisher_profile"); - ASSERT_TRUE(publisher->delete_datawriter(default_datawriter) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(default_datawriter) == RETCODE_OK); //participant using non-default profile DataWriter* datawriter = publisher->create_datawriter_with_profile(topic, "test_publisher_profile"); ASSERT_NE(datawriter, nullptr); check_datawriter_with_profile(datawriter, "test_publisher_profile"); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(PublisherTests, CreateDataWriterWithProfileFromString) @@ -629,17 +629,17 @@ TEST(PublisherTests, CreateDataWriterWithProfileFromString) DataWriter* default_datawriter = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(default_datawriter, nullptr); check_datawriter_with_profile(default_datawriter, "test_default_publisher_profile_string"); - ASSERT_TRUE(publisher->delete_datawriter(default_datawriter) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(default_datawriter) == RETCODE_OK); //participant using non-default profile DataWriter* datawriter = publisher->create_datawriter_with_profile(topic, "test_publisher_profile_string"); ASSERT_NE(datawriter, nullptr); check_datawriter_with_profile(datawriter, "test_publisher_profile_string"); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(PublisherTests, GetDataWriterProfileQos) @@ -659,7 +659,7 @@ TEST(PublisherTests, GetDataWriterProfileQos) DataWriterQos qos; EXPECT_EQ( publisher->get_datawriter_qos_from_profile("test_publisher_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); //Datawriter using the extracted qos DataWriter* datawriter = publisher->create_datawriter(topic, qos); @@ -670,13 +670,13 @@ TEST(PublisherTests, GetDataWriterProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( publisher->get_datawriter_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(PublisherTests, DeletePublisherWithWriters) @@ -697,13 +697,13 @@ TEST(PublisherTests, DeletePublisherWithWriters) DataWriter* datawriter = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } @@ -712,7 +712,7 @@ void set_listener_test ( PublisherListener* listener, StatusMask mask) { - ASSERT_EQ(publisher->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(publisher->get_status_mask(), mask); } @@ -756,8 +756,8 @@ TEST(PublisherTests, SetListener) std::get<2>(testing_case)); } - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Delete contained entities test @@ -789,23 +789,23 @@ TEST(Publisher, DeleteContainedEntities) data_writer_list.clear(); void* loan_data; - ASSERT_EQ(data_writer_bar->loan_sample(loan_data), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_writer_bar->loan_sample(loan_data), RETCODE_OK); - ASSERT_EQ(publisher->delete_contained_entities(), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(publisher->delete_contained_entities(), RETCODE_PRECONDITION_NOT_MET); publisher->get_datawriters(data_writer_list); ASSERT_EQ(data_writer_list.size(), 2u); data_writer_list.clear(); data_writer_bar->discard_loan(loan_data); - ASSERT_EQ(publisher->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_contained_entities(), RETCODE_OK); publisher->get_datawriters(data_writer_list); ASSERT_FALSE(publisher->has_datawriters()); } /* * This test checks that the Publisher methods defined in the standard not yet implemented in FastDDS return - * ReturnCode_t::RETCODE_UNSUPPORTED. The following methods are checked: + * RETCODE_UNSUPPORTED. The following methods are checked: * 1. copy_from_topic_qos * 2. suspend_publications * 3. resume_publications @@ -822,14 +822,14 @@ TEST(PublisherTests, UnsupportedPublisherMethods) fastdds::dds::DataWriterQos writer_qos; fastdds::dds::TopicQos topic_qos; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->copy_from_topic_qos(writer_qos, topic_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->suspend_publications()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->resume_publications()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->begin_coherent_changes()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->end_coherent_changes()); - - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->copy_from_topic_qos(writer_qos, topic_qos)); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->suspend_publications()); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->resume_publications()); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->begin_coherent_changes()); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->end_coherent_changes()); + + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } } // namespace dds diff --git a/test/unittest/dds/status/ListenerTests.cpp b/test/unittest/dds/status/ListenerTests.cpp index ed4c3e962b1..30b9a1c498f 100644 --- a/test/unittest/dds/status/ListenerTests.cpp +++ b/test/unittest/dds/status/ListenerTests.cpp @@ -584,15 +584,15 @@ class UserListeners : public ::testing::Test void TearDown() override { - ASSERT_EQ(publisher_->delete_datawriter(datawriter_), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant_->delete_publisher(publisher_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(datawriter_), RETCODE_OK); + ASSERT_EQ(participant_->delete_publisher(publisher_), RETCODE_OK); - ASSERT_EQ(subscriber_->delete_datareader(datareader_), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant_->delete_subscriber(subscriber_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber_->delete_datareader(datareader_), RETCODE_OK); + ASSERT_EQ(participant_->delete_subscriber(subscriber_), RETCODE_OK); - ASSERT_EQ(participant_->delete_topic(topic_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->delete_topic(topic_), RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_), RETCODE_OK); } // RTPS entity mocks are nice, we don't want to track all calls diff --git a/test/unittest/dds/subscriber/DataReaderTests.cpp b/test/unittest/dds/subscriber/DataReaderTests.cpp index ea56aa958a3..2da43972762 100644 --- a/test/unittest/dds/subscriber/DataReaderTests.cpp +++ b/test/unittest/dds/subscriber/DataReaderTests.cpp @@ -118,28 +118,28 @@ class DataReaderTests : public ::testing::Test if (data_writer_) { - ASSERT_EQ(publisher_->delete_datawriter(data_writer_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(data_writer_), RETCODE_OK); } if (data_reader_) { - ASSERT_EQ(subscriber_->delete_datareader(data_reader_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber_->delete_datareader(data_reader_), RETCODE_OK); } if (topic_) { - ASSERT_EQ(participant_->delete_topic(topic_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->delete_topic(topic_), RETCODE_OK); } if (publisher_) { - ASSERT_EQ(participant_->delete_publisher(publisher_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->delete_publisher(publisher_), RETCODE_OK); } if (subscriber_) { - ASSERT_EQ(participant_->delete_subscriber(subscriber_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->delete_subscriber(subscriber_), RETCODE_OK); } if (participant_) { auto factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->delete_participant(participant_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->delete_participant(participant_), RETCODE_OK); } } @@ -193,7 +193,7 @@ class DataReaderTests : public ::testing::Test LoanableCollection& data_values, SampleInfoSeq& infos) { - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { data_values.length(0); infos.length(0); @@ -210,7 +210,7 @@ class DataReaderTests : public ::testing::Test { if (infos[i].valid_data) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_->write(buffer[i], HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, data_writer_->write(buffer[i], HANDLE_NIL)); } } } @@ -237,14 +237,14 @@ class DataReaderTests : public ::testing::Test LoanableCollection& data_values, SampleInfoSeq& infos) { - ReturnCode_t expected_return_loan_ret = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; - if (ReturnCode_t::RETCODE_OK == code || ReturnCode_t::RETCODE_NOT_ENABLED == code) + ReturnCode_t expected_return_loan_ret = RETCODE_PRECONDITION_NOT_MET; + if (RETCODE_OK == code || RETCODE_NOT_ENABLED == code) { expected_return_loan_ret = code; } EXPECT_EQ(expected_return_loan_ret, data_reader->return_loan(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == expected_return_loan_ret) + if (RETCODE_OK == expected_return_loan_ret) { EXPECT_TRUE(data_values.has_ownership()); EXPECT_EQ(0, data_values.maximum()); @@ -278,7 +278,7 @@ class DataReaderTests : public ::testing::Test reset_lengths_if_ok(instance_ok_code, data_values, infos); EXPECT_EQ(instance_ok_code, data_reader->take_instance(data_values, infos, max_samples, handle)); - if (ReturnCode_t::RETCODE_OK == instance_ok_code) + if (RETCODE_OK == instance_ok_code) { // Write received data so it can be taken again send_data(data_values, infos); @@ -336,8 +336,8 @@ class DataReaderTests : public ::testing::Test bool two_valid_instances = false) { // Calc expected result of `return_loan` for calls with a wrong instance handle. - ReturnCode_t wrong_loan_code = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; - if (ReturnCode_t::RETCODE_NOT_ENABLED == instance_bad_code) + ReturnCode_t wrong_loan_code = RETCODE_PRECONDITION_NOT_MET; + if (RETCODE_NOT_ENABLED == instance_bad_code) { wrong_loan_code = instance_bad_code; } @@ -395,7 +395,7 @@ class DataReaderTests : public ::testing::Test SampleInfo info; EXPECT_EQ(code, data_reader->take_next_sample(&data, &info)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { // Send taken sample so it can be read again data_writer_->write(&data); @@ -405,15 +405,15 @@ class DataReaderTests : public ::testing::Test } // Return code when requesting a bad instance - ReturnCode_t instance_bad_code = ReturnCode_t::RETCODE_BAD_PARAMETER; - if (ReturnCode_t::RETCODE_NOT_ENABLED == code) + ReturnCode_t instance_bad_code = RETCODE_BAD_PARAMETER; + if (RETCODE_NOT_ENABLED == code) { instance_bad_code = code; } // Return code when requesting a correct instance ReturnCode_t instance_ok_code = instance_bad_code; - if (ReturnCode_t::RETCODE_OK == code && type_->m_isGetKeyDefined) + if (RETCODE_OK == code && type_->m_isGetKeyDefined) { instance_ok_code = code; } @@ -431,7 +431,7 @@ class DataReaderTests : public ::testing::Test reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->take(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { send_data(data_values, infos); data_reader->wait_for_unread_message(time_to_wait); @@ -440,7 +440,7 @@ class DataReaderTests : public ::testing::Test reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->take_next_instance(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { send_data(data_values, infos); data_reader->wait_for_unread_message(time_to_wait); @@ -458,10 +458,10 @@ class DataReaderTests : public ::testing::Test SampleInfoSeq infos(1); ReturnCode_t expected_return_loan_ret = code; - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { // Even when read returns data, no loan will be performed - expected_return_loan_ret = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + expected_return_loan_ret = RETCODE_PRECONDITION_NOT_MET; } EXPECT_EQ(code, data_reader->read(data_values, infos)); @@ -472,7 +472,7 @@ class DataReaderTests : public ::testing::Test reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->take(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { send_data(data_values, infos); data_reader->wait_for_unread_message(time_to_wait); @@ -481,7 +481,7 @@ class DataReaderTests : public ::testing::Test reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->take_next_instance(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { send_data(data_values, infos); data_reader->wait_for_unread_message(time_to_wait); @@ -533,33 +533,33 @@ class DataReaderTests : public ::testing::Test EXPECT_EQ(0ull, data_reader_->get_unread_count()); // Read / take operations should all return NOT_ENABLED - basic_read_apis_check(ReturnCode_t::RETCODE_NOT_ENABLED, data_reader_); + basic_read_apis_check(RETCODE_NOT_ENABLED, data_reader_); // Enable the DataReader and check NO_DATA should be returned - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->enable()); + EXPECT_EQ(RETCODE_OK, data_reader_->enable()); EXPECT_TRUE(data_reader_->is_enabled()); - basic_read_apis_check(ReturnCode_t::RETCODE_NO_DATA, data_reader_); + basic_read_apis_check(RETCODE_NO_DATA, data_reader_); // Send data DataType data; data.index(0); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, data_writer_->write(&data, HANDLE_NIL)); // Wait for data to arrive and check OK should be returned Duration_t wait_time(1, 0); EXPECT_TRUE(data_reader_->wait_for_unread_message(wait_time)); - basic_read_apis_check(ReturnCode_t::RETCODE_OK, data_reader_); + basic_read_apis_check(RETCODE_OK, data_reader_); // Check with data on second instance data.index(2u); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_->write(&data, HANDLE_NIL)); - basic_read_apis_check(ReturnCode_t::RETCODE_OK, data_reader_, true); + EXPECT_EQ(RETCODE_OK, data_writer_->write(&data, HANDLE_NIL)); + basic_read_apis_check(RETCODE_OK, data_reader_, true); // Check with disposed instance if (type_->m_isGetKeyDefined) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_->dispose(&data, handle_wrong_)); - basic_read_apis_check(ReturnCode_t::RETCODE_OK, data_reader_, true); + EXPECT_EQ(RETCODE_OK, data_writer_->dispose(&data, handle_wrong_)); + basic_read_apis_check(RETCODE_OK, data_reader_, true); } } @@ -655,12 +655,12 @@ TEST_F(DataReaderTests, get_guid) } ASSERT_EQ(guid, discovery_listener.guid); - ASSERT_TRUE(subscriber->delete_datareader(datareader) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(subscriber->delete_datareader(datareader) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( - listener_participant) == ReturnCode_t::RETCODE_OK); + listener_participant) == RETCODE_OK); } TEST_F(DataReaderTests, InvalidQos) @@ -670,11 +670,11 @@ TEST_F(DataReaderTests, InvalidQos) create_entities(); ASSERT_TRUE(data_reader_->is_enabled()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_qos(qos)); + ASSERT_EQ(RETCODE_OK, data_reader_->get_qos(qos)); ASSERT_EQ(qos, DATAREADER_QOS_DEFAULT); /* Unsupported QoS */ - const ReturnCode_t unsupported_code = ReturnCode_t::RETCODE_UNSUPPORTED; + const ReturnCode_t unsupported_code = RETCODE_UNSUPPORTED; qos = DATAREADER_QOS_DEFAULT; qos.durability().kind = PERSISTENT_DURABILITY_QOS; @@ -685,7 +685,7 @@ TEST_F(DataReaderTests, InvalidQos) EXPECT_EQ(unsupported_code, data_reader_->set_qos(qos)); /* Inconsistent QoS */ - const ReturnCode_t inconsistent_code = ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + const ReturnCode_t inconsistent_code = RETCODE_INCONSISTENT_POLICY; qos = DATAREADER_QOS_DEFAULT; qos.reader_resource_limits().max_samples_per_read = -1; @@ -708,7 +708,7 @@ TEST_F(DataReaderTests, InvalidQos) EXPECT_EQ(inconsistent_code, data_reader_->set_qos(qos)); /* Inmutable QoS */ - const ReturnCode_t inmutable_code = ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + const ReturnCode_t inmutable_code = RETCODE_IMMUTABLE_POLICY; qos = DATAREADER_QOS_DEFAULT; qos.resource_limits().max_samples = 5000; @@ -813,8 +813,8 @@ TEST_F(DataReaderTests, collection_preconditions) create_entities(); create_instance_handles(); - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_NO_DATA; - const ReturnCode_t& wrong_code = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + const ReturnCode_t& ok_code = RETCODE_NO_DATA; + const ReturnCode_t& wrong_code = RETCODE_PRECONDITION_NOT_MET; // Helper buffers to create loaned sequences FooArray arr; @@ -908,7 +908,7 @@ TEST_F(DataReaderTests, collection_preconditions) { {false_10_1, info_false_10_1}, wrong_code} }; - const ReturnCode_t& instance_bad_code = ReturnCode_t::RETCODE_BAD_PARAMETER; + const ReturnCode_t& instance_bad_code = RETCODE_BAD_PARAMETER; for (const ok_test_case_t& test : ok_cases) { EXPECT_EQ(test.second, data_reader_->read(test.first.first, test.first.second)); @@ -985,11 +985,11 @@ TEST_F(DataReaderTests, return_loan) FooSeq data_values_2; SampleInfoSeq infos_2; - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t& precondition_code = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + const ReturnCode_t& ok_code = RETCODE_OK; + const ReturnCode_t& precondition_code = RETCODE_PRECONDITION_NOT_MET; // Calling return loan on disabled reader should return NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, data_reader_->return_loan(data_values, infos)); + EXPECT_EQ(RETCODE_NOT_ENABLED, data_reader_->return_loan(data_values, infos)); // Enable both readers EXPECT_EQ(ok_code, data_reader_->enable()); @@ -1110,9 +1110,9 @@ TEST_F(DataReaderTests, resource_limits) { static constexpr int32_t num_samples = 100; - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t& resources_code = ReturnCode_t::RETCODE_OUT_OF_RESOURCES; - const ReturnCode_t& no_data_code = ReturnCode_t::RETCODE_NO_DATA; + const ReturnCode_t& ok_code = RETCODE_OK; + const ReturnCode_t& resources_code = RETCODE_OUT_OF_RESOURCES; + const ReturnCode_t& no_data_code = RETCODE_NO_DATA; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; writer_qos.history().kind = KEEP_LAST_HISTORY_QOS; @@ -1325,8 +1325,8 @@ TEST_F(DataReaderTests, read_unread) static constexpr int32_t num_samples = 10; static constexpr uint64_t num_samples_check = static_cast(num_samples); - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t& no_data_code = ReturnCode_t::RETCODE_NO_DATA; + const ReturnCode_t& ok_code = RETCODE_OK; + const ReturnCode_t& no_data_code = RETCODE_NO_DATA; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; writer_qos.history().kind = KEEP_LAST_HISTORY_QOS; @@ -1589,7 +1589,7 @@ TEST_F(DataReaderTests, get_unread_count) static constexpr int32_t num_samples = 10; static constexpr uint64_t num_samples_check = static_cast(num_samples); - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; + const ReturnCode_t& ok_code = RETCODE_OK; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; writer_qos.history().kind = KEEP_LAST_HISTORY_QOS; @@ -1630,7 +1630,7 @@ TEST_F(DataReaderTests, get_unread_count) } SampleInfo sample_info; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); + ASSERT_EQ(RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); ASSERT_EQ(SampleStateKind::NOT_READ_SAMPLE_STATE, sample_info.sample_state); // Calling get_unread_count(false) several times should always return the same value @@ -1639,13 +1639,13 @@ TEST_F(DataReaderTests, get_unread_count) EXPECT_EQ(num_samples_check, data_reader_->get_unread_count(false)); } - ASSERT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); + ASSERT_EQ(RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); ASSERT_EQ(SampleStateKind::NOT_READ_SAMPLE_STATE, sample_info.sample_state); // Calling get_unread_count(true) once will return the correct value EXPECT_EQ(num_samples_check, data_reader_->get_unread_count(true)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); + ASSERT_EQ(RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); ASSERT_EQ(SampleStateKind::READ_SAMPLE_STATE, sample_info.sample_state); // All variants should then return 0 @@ -1817,19 +1817,19 @@ TEST_F(DataReaderTests, sample_info) case TestCmd::DISPOSE: writer = open_writer(cmd.writer_index); ret_code = writer->dispose(&data_[cmd.instance_index], handles_[cmd.instance_index]); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret_code); + EXPECT_EQ(RETCODE_OK, ret_code); break; case TestCmd::UNREGISTER: writer = open_writer(cmd.writer_index); ret_code = writer->unregister_instance(&data_[cmd.instance_index], handles_[cmd.instance_index]); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret_code); + EXPECT_EQ(RETCODE_OK, ret_code); break; case TestCmd::WRITE: writer = open_writer(cmd.writer_index); ret_code = writer->write(&data_[cmd.instance_index], handles_[cmd.instance_index]); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret_code); + EXPECT_EQ(RETCODE_OK, ret_code); break; } } @@ -1845,13 +1845,13 @@ TEST_F(DataReaderTests, sample_info) ret_code = reader->read_instance(values, infos, LENGTH_UNLIMITED, handles_[instance_index]); EXPECT_EQ(ret_code, instance_result.ret_code); - if (ReturnCode_t::RETCODE_OK == ret_code) + if (RETCODE_OK == ret_code) { EXPECT_EQ(instance_result.instance_state, infos[0].instance_state); EXPECT_EQ(instance_result.view_state, infos[0].view_state); EXPECT_EQ(instance_result.disposed_generation_count, infos[0].disposed_generation_count); EXPECT_EQ(instance_result.no_writers_generation_count, infos[0].no_writers_generation_count); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, reader->return_loan(values, infos)); + EXPECT_EQ(RETCODE_OK, reader->return_loan(values, infos)); EXPECT_EQ(handles_[instance_index], reader->lookup_instance(&data_[instance_index])); } @@ -1901,32 +1901,32 @@ TEST_F(DataReaderTests, sample_info) // Instances have never been written {}, { - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // One writer writes on first instance => that instance should be NEW and ALIVE { {0, TestCmd::WRITE, 0} }, { - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // Same writer writes on first instance => instance becomes NOT_NEW { {0, TestCmd::WRITE, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // Same writer disposes first instance => instance becomes NOT_ALIVE_DISPOSED { {0, TestCmd::DISPOSE, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 0}, - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { @@ -1934,48 +1934,48 @@ TEST_F(DataReaderTests, sample_info) // Second writer writes first instance => NEW and ALIVE { {0, TestCmd::WRITE, 1}, {1, TestCmd::WRITE, 0} }, { - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 0}, - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 0}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // Both writers write on second instance => NOT_NEW and ALIVE { {0, TestCmd::WRITE, 1}, {1, TestCmd::WRITE, 1} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 0}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // Second writer closes => first instance becomes NOT_ALIVE_NO_WRITERS { {1, TestCmd::CLOSE, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 0}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // First writer unregisters second instance => NOT_ALIVE_NO_WRITERS { {0, TestCmd::UNREGISTER, 1} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 0}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 0, 0}, } }, { // Both writers write both instances { {0, TestCmd::WRITE, 0}, {1, TestCmd::WRITE, 0}, {0, TestCmd::WRITE, 1}, {1, TestCmd::WRITE, 1} }, { - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 1}, } }, { // Reading twice should return NOT_NEW {}, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 1}, } }, { @@ -1983,8 +1983,8 @@ TEST_F(DataReaderTests, sample_info) // 1 - Disposing while having another alive writer is always done { {0, TestCmd::UNREGISTER, 0}, {1, TestCmd::DISPOSE, 1} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, } }, { @@ -1992,8 +1992,8 @@ TEST_F(DataReaderTests, sample_info) // 1 - Unregister a disposed instance should not change state { {0, TestCmd::WRITE, 0}, {0, TestCmd::UNREGISTER, 1}, {1, TestCmd::UNREGISTER, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, } }, { @@ -2001,8 +2001,8 @@ TEST_F(DataReaderTests, sample_info) // 1 - Closing both writers on a disposed instance should not change state { {0, TestCmd::CLOSE, 0}, {1, TestCmd::CLOSE, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, } }, }; @@ -2014,8 +2014,8 @@ TEST_F(DataReaderTests, sample_info) // Taking all data should remove instance information FooSeq data; SampleInfoSeq infos; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->take(data, infos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->take(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); // Run test again state.run_test(data_reader_, steps); @@ -2086,7 +2086,7 @@ TEST_F(DataReaderTests, check_read_take_iteration) oarraystream out(data.message()); out << i; - EXPECT_EQ(data_writer_->write(&data, handles[i]), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_writer_->write(&data, handles[i]), RETCODE_OK); } } @@ -2105,10 +2105,10 @@ TEST_F(DataReaderTests, check_read_take_iteration) NEW_VIEW_STATE, ALIVE_INSTANCE_STATE); - if ( ret == ReturnCode_t::RETCODE_OK) + if ( ret == RETCODE_OK) { received += data.length(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); } else { @@ -2129,11 +2129,11 @@ TEST_F(DataReaderTests, check_read_take_iteration) SampleInfoSeq infos; EXPECT_EQ(data_reader_->take_instance(data, infos, 1, handles[i]), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); EXPECT_EQ(i, std::atoi(data[0].message().data())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); } // Iterate over available instances with data and check all are retrieved @@ -2152,15 +2152,15 @@ TEST_F(DataReaderTests, check_read_take_iteration) 1, handle); - if (!!ret) + if (RETCODE_OK == ret) { received += data.length(); handle = infos[0].instance_handle; EXPECT_TRUE(std::atoi(data[0].message().data()) % 2 == 1); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); } } - while (ret == ReturnCode_t::RETCODE_OK); + while (ret == RETCODE_OK); EXPECT_EQ(received, max_handles); @@ -2179,15 +2179,15 @@ TEST_F(DataReaderTests, check_read_take_iteration) 1, handle); - if (!!ret) + if (RETCODE_OK == ret) { received += data.length(); handle = infos[0].instance_handle; EXPECT_TRUE(std::atoi(data[0].message().data()) % 2 == 1); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); } } - while (ret == ReturnCode_t::RETCODE_OK); + while (ret == RETCODE_OK); EXPECT_EQ(received, max_handles); } @@ -2232,8 +2232,8 @@ TEST_F(DataReaderTests, Deserialization_errors) static const Duration_t time_to_wait(0, 100 * 1000 * 1000); static constexpr int32_t num_samples = 10; - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t& no_data_code = ReturnCode_t::RETCODE_NO_DATA; + const ReturnCode_t& ok_code = RETCODE_OK; + const ReturnCode_t& no_data_code = RETCODE_NO_DATA; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; writer_qos.history().kind = KEEP_LAST_HISTORY_QOS; @@ -2380,7 +2380,7 @@ void set_listener_test ( DataReaderListener* listener, StatusMask mask) { - ASSERT_EQ(reader->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(reader->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(reader->get_status_mask(), mask); } @@ -2454,11 +2454,11 @@ TEST_F(DataReaderTests, get_listening_locators) // Calling on disabled reader should return NOT_ENABLED LocatorList locator_list; - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, data_reader_->get_listening_locators(locator_list)); + EXPECT_EQ(RETCODE_NOT_ENABLED, data_reader_->get_listening_locators(locator_list)); // Enable and try again - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_listening_locators(locator_list)); + EXPECT_EQ(RETCODE_OK, data_reader_->enable()); + EXPECT_EQ(RETCODE_OK, data_reader_->get_listening_locators(locator_list)); EXPECT_EQ(locator_list.size(), 2u); bool unicast_found = false; @@ -2512,7 +2512,7 @@ TEST_F(DataReaderTests, check_key_history_wholesomeness_on_unmatch) ASSERT_TRUE(data_reader_->wait_for_unread_message(Duration_t(3, 0))); // now the writer is removed - ASSERT_EQ(publisher_->delete_datawriter(data_writer_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(data_writer_), RETCODE_OK); data_writer_ = nullptr; // here the DataReader History state must be coherent and don't loop endlessly @@ -2526,7 +2526,7 @@ TEST_F(DataReaderTests, check_key_history_wholesomeness_on_unmatch) // If the DataWriter is destroyed only the non-notified samples must be removed // this operation MUST succeed - ASSERT_EQ(res, ReturnCode_t::RETCODE_OK); + ASSERT_EQ(res, RETCODE_OK); data_reader_->return_loan(samples, infos); }); @@ -2587,7 +2587,7 @@ class DataReaderUnsupportedTests : public ::testing::Test /* * This test checks that the DataReader methods defined in the standard not yet implemented in FastDDS return - * ReturnCode_t::RETCODE_UNSUPPORTED. The following methods are checked: + * RETCODE_UNSUPPORTED. The following methods are checked: * 1. get_matched_publication_data * 2. create_querycondition * 3. get_matched_publications @@ -2616,7 +2616,7 @@ TEST_F(DataReaderUnsupportedTests, UnsupportedDataReaderMethods) builtin::PublicationBuiltinTopicData publication_data; InstanceHandle_t publication_handle; EXPECT_EQ( - ReturnCode_t::RETCODE_UNSUPPORTED, + RETCODE_UNSUPPORTED, data_reader->get_matched_publication_data(publication_data, publication_handle)); { @@ -2636,20 +2636,20 @@ TEST_F(DataReaderUnsupportedTests, UnsupportedDataReaderMethods) } std::vector publication_handles; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_reader->get_matched_publications(publication_handles)); + EXPECT_EQ(RETCODE_UNSUPPORTED, data_reader->get_matched_publications(publication_handles)); InstanceHandle_t key_handle; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_reader->get_key_value(nullptr, key_handle)); + EXPECT_EQ(RETCODE_UNSUPPORTED, data_reader->get_key_value(nullptr, key_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_reader->wait_for_historical_data({0, 1})); + EXPECT_EQ(RETCODE_UNSUPPORTED, data_reader->wait_for_historical_data({0, 1})); // Expected logWarnings: create_querycondition HELPER_WaitForEntries(1); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Regression test for #12133. @@ -2660,7 +2660,7 @@ TEST_F(DataReaderTests, read_samples_with_future_changes) eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(att); static constexpr int32_t num_samples = 8; static constexpr int32_t expected_samples = 4; - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; + const ReturnCode_t& ok_code = RETCODE_OK; bool start_dropping_acks = false; bool start_dropping_datas = false; static const Duration_t time_to_wait(0, 100 * 1000 * 1000); @@ -2738,7 +2738,7 @@ TEST_F(DataReaderTests, read_samples_with_future_changes) EXPECT_EQ(ok_code, data_reader_->take(data_seq, info_seq, num_samples, NOT_READ_SAMPLE_STATE)); check_collection(data_seq, true, num_samples, expected_samples); - ASSERT_EQ(publisher_->delete_datawriter(data_writer2), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(data_writer2), RETCODE_OK); } // Delete contained entities test @@ -2786,10 +2786,10 @@ TEST_F(DataReaderTests, delete_contained_entities) ASSERT_EQ(query_condition, nullptr); // Should fail with outstanding ReadConditions - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_PRECONDITION_NOT_MET); // Should not fail with outstanding ReadConditions - ASSERT_EQ(data_reader->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader->delete_contained_entities(), RETCODE_OK); } TEST_F(DataReaderTests, read_conditions_management) @@ -2813,7 +2813,7 @@ TEST_F(DataReaderTests, read_conditions_management) cond = reader.create_readcondition( sample_states, view_states, instance_states); EXPECT_NE(cond, nullptr); ReturnCode_t res = reader.delete_readcondition(cond); - EXPECT_EQ(res, ReturnCode_t::RETCODE_OK); + EXPECT_EQ(res, RETCODE_OK); // 3- Create several ReadConditions associated to the same masks (share implementation) std::forward_list conds; @@ -2825,7 +2825,7 @@ TEST_F(DataReaderTests, read_conditions_management) for (ReadCondition* c : conds) { - EXPECT_EQ(reader.delete_readcondition(c), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(reader.delete_readcondition(c), RETCODE_OK); } conds.clear(); @@ -2841,7 +2841,7 @@ TEST_F(DataReaderTests, read_conditions_management) for (ReadCondition* c : conds) { - EXPECT_EQ(reader.delete_readcondition(c), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(reader.delete_readcondition(c), RETCODE_OK); } conds.clear(); @@ -2855,7 +2855,7 @@ TEST_F(DataReaderTests, read_conditions_management) conds.push_front(reader.create_readcondition( ++sample_states, ++view_states, ++instance_states)); } - EXPECT_EQ(reader.delete_contained_entities(), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(reader.delete_contained_entities(), RETCODE_OK); conds.clear(); // 6- Check a DataReader only handles its own ReadConditions @@ -2864,14 +2864,14 @@ TEST_F(DataReaderTests, read_conditions_management) cond = another_reader->create_readcondition(sample_states, view_states, instance_states); EXPECT_NE(cond, nullptr); - EXPECT_EQ(reader.delete_readcondition(cond), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + EXPECT_EQ(reader.delete_readcondition(cond), RETCODE_PRECONDITION_NOT_MET); // 7- Check the DataReader cannot be deleted with outstanding conditions - EXPECT_EQ(subscriber_->delete_datareader(another_reader), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + EXPECT_EQ(subscriber_->delete_datareader(another_reader), RETCODE_PRECONDITION_NOT_MET); // but delete_contained_entities() succeeds with outstanding ReadConditions - EXPECT_EQ(another_reader->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(another_reader->delete_contained_entities(), RETCODE_OK); // no outstanding conditions (killed above) - EXPECT_EQ(subscriber_->delete_datareader(another_reader), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(subscriber_->delete_datareader(another_reader), RETCODE_OK); } TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) @@ -2903,9 +2903,9 @@ TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) // Create the waitset and associate WaitSet ws; - EXPECT_EQ(ws.attach_condition(*read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*not_read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*any_read_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*read_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*not_read_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*any_read_cond), RETCODE_OK); // 1- Check NOT_READ_SAMPLE_STATE // Send sample from a background thread @@ -2922,7 +2922,7 @@ TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) }); ConditionSeq triggered; - EXPECT_EQ(ws.wait(triggered, 2.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 2.0), RETCODE_OK); bw.join(); // Check the data is there @@ -2945,16 +2945,16 @@ TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) datas, infos, 1, - not_read_cond), ReturnCode_t::RETCODE_OK); + not_read_cond), RETCODE_OK); triggered.clear(); - EXPECT_EQ(ws.wait(triggered, 1.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 1.0), RETCODE_OK); // Check data is good ASSERT_TRUE(infos[0].valid_data); EXPECT_EQ(datas[0].index(), 1u); EXPECT_EQ(datas[0].message(), test_message); - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // Check the conditions triggered were the expected ones ASSERT_TRUE(read_cond->get_trigger_value()); @@ -2969,21 +2969,21 @@ TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) datas, infos, 1, - read_cond), ReturnCode_t::RETCODE_OK); + read_cond), RETCODE_OK); // Check data is good ASSERT_TRUE(infos[0].valid_data); EXPECT_EQ(datas[0].index(), 1u); EXPECT_EQ(datas[0].message(), test_message); - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // Detach conditions & destroy - EXPECT_EQ(ws.detach_condition(*read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*not_read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(not_read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*any_read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(any_read_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*read_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(read_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*not_read_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(not_read_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*any_read_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(any_read_cond), RETCODE_OK); } TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) @@ -3015,9 +3015,9 @@ TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) // Create the waitset and associate WaitSet ws; - EXPECT_EQ(ws.attach_condition(*view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*not_view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*any_view_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*view_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*not_view_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*any_view_cond), RETCODE_OK); // 1- Check NEW_VIEW_STATE // Send sample from a background thread @@ -3034,7 +3034,7 @@ TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) }); ConditionSeq triggered; - EXPECT_EQ(ws.wait(triggered, 2.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 2.0), RETCODE_OK); bw.join(); // Check the data is there @@ -3057,16 +3057,16 @@ TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) datas, infos, 1, - view_cond), ReturnCode_t::RETCODE_OK); + view_cond), RETCODE_OK); triggered.clear(); - EXPECT_EQ(ws.wait(triggered, 1.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 1.0), RETCODE_OK); // Check data is good ASSERT_TRUE(infos[0].valid_data); EXPECT_EQ(datas[0].index(), 1u); EXPECT_EQ(datas[0].message(), test_message); - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // Check the conditions triggered were the expected ones ASSERT_FALSE(view_cond->get_trigger_value()); @@ -3077,12 +3077,12 @@ TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) EXPECT_NE(std::find(triggered.begin(), triggered.end(), any_view_cond), triggered.end()); // Detach conditions & destroy - EXPECT_EQ(ws.detach_condition(*view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*not_view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(not_view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*any_view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(any_view_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*view_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(view_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*not_view_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(not_view_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*any_view_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(any_view_cond), RETCODE_OK); } TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) @@ -3118,10 +3118,10 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) // Create the waitset and associate WaitSet ws; - EXPECT_EQ(ws.attach_condition(*alive_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*disposed_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*no_writer_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*any_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*alive_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*disposed_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*no_writer_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*any_cond), RETCODE_OK); // 1- Check ALIVE_INSTANCE_STATE // Send sample from a background thread @@ -3139,7 +3139,7 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) }); ConditionSeq triggered; - EXPECT_EQ(ws.wait(triggered, 2.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 2.0), RETCODE_OK); bw.join(); // Check the data is there @@ -3157,10 +3157,10 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) // 2 - Check NOT_ALIVE_DISPOSED_INSTANCE_STATE // unregister the instance - EXPECT_EQ(data_writer.unregister_instance(&msg, HANDLE_NIL), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_writer.unregister_instance(&msg, HANDLE_NIL), RETCODE_OK); triggered.clear(); - EXPECT_EQ(ws.wait(triggered, 1.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 1.0), RETCODE_OK); // Check the conditions triggered were the expected ones ASSERT_FALSE(alive_cond->get_trigger_value()); @@ -3181,12 +3181,12 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) infos, 1, HANDLE_NIL, - disposed_cond), ReturnCode_t::RETCODE_OK); + disposed_cond), RETCODE_OK); // Check data is bad because the sample for instance 1 was unregistered ASSERT_FALSE(infos[0].valid_data); InstanceHandle_t prev_handle = infos[0].instance_handle; - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // new instance msg.index(2u); @@ -3197,21 +3197,21 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) infos, 1, prev_handle, - alive_cond), ReturnCode_t::RETCODE_OK); + alive_cond), RETCODE_OK); // Check data is good ASSERT_TRUE(infos[0].valid_data); EXPECT_EQ(datas[0].index(), 2u); EXPECT_EQ(datas[0].message(), test_message); - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // 5 - Check NOT_ALIVE_NO_WRITERS_INSTANCE_STATE // delete the writer to remove all writers from a new instance - ASSERT_EQ(publisher_->delete_datawriter(data_writer_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(data_writer_), RETCODE_OK); data_writer_ = nullptr; triggered.clear(); - EXPECT_EQ(ws.wait(triggered, 1.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 1.0), RETCODE_OK); // Check the conditions triggered were the expected ones ASSERT_FALSE(alive_cond->get_trigger_value()); @@ -3224,14 +3224,14 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) EXPECT_NE(std::find(triggered.begin(), triggered.end(), any_cond), triggered.end()); // Detach conditions & destroy - EXPECT_EQ(ws.detach_condition(*alive_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(alive_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*disposed_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(disposed_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*no_writer_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(no_writer_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*any_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(any_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*alive_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(alive_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*disposed_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(disposed_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*no_writer_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(no_writer_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*any_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(any_cond), RETCODE_OK); } /* @@ -3312,50 +3312,50 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyNotKeyed) // This allows to change inmutable policies SubscriberQos subscriber_qos = SUBSCRIBER_QOS_DEFAULT; subscriber_qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, subscriber->set_qos(subscriber_qos)); + ASSERT_EQ(RETCODE_OK, subscriber->set_qos(subscriber_qos)); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 DataReaderQos qos2 = DATAREADER_QOS_DEFAULT; DataReader* default_data_reader2 = subscriber->create_datareader(topic, qos2); ASSERT_NE(default_data_reader2, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_instances = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 4999; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); } /* @@ -3443,22 +3443,22 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyKeyed) // This allows to change inmutable policies SubscriberQos subscriber_qos = SUBSCRIBER_QOS_DEFAULT; subscriber_qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, subscriber->set_qos(subscriber_qos)); + ASSERT_EQ(RETCODE_OK, subscriber->set_qos(subscriber_qos)); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0, as the by default values are already infinite. + // set_qos() should return RETCODE_OK = 0, as the by default values are already infinite. DataReaderQos qos2 = DATAREADER_QOS_DEFAULT; DataReader* default_data_reader2 = subscriber->create_datareader(topic, qos2); ASSERT_NE(default_data_reader2, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , // set_qos() should return a value != 0 (not OK) @@ -3466,32 +3466,32 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_NE(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_NE(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples = ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5000; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); } /* @@ -3569,78 +3569,78 @@ TEST_F(DataReaderTests, UpdateInmutableQos) // Resource limits DataReaderQos reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.resource_limits().max_samples = reader_qos.resource_limits().max_samples - 1; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // History reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.history().kind = KEEP_ALL_HISTORY_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.history().depth = reader_qos.history().depth + 1; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Durability reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Liveliness reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.liveliness().kind = MANUAL_BY_TOPIC_LIVELINESS_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.liveliness().lease_duration = Duration_t{123, 123}; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.liveliness().announcement_period = Duration_t{123, 123}; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Relibility reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Ownsership reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.ownership().kind = EXCLUSIVE_OWNERSHIP_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Destination order (currently reports unsupported) reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.destination_order().kind = BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_UNSUPPORTED, data_reader->set_qos(reader_qos)); // Reader resource limits reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.reader_resource_limits().matched_publisher_allocation.maximum = reader_qos.reader_resource_limits().matched_publisher_allocation.maximum - 1; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Datasharing reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.data_sharing().off(); - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.data_sharing().automatic("."); - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.data_sharing().add_domain_id(static_cast(12)); - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.data_sharing().data_sharing_listener_thread().priority = reader_qos.data_sharing().data_sharing_listener_thread().priority + 1; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Unique network flows reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.properties().properties().push_back({"fastdds.unique_network_flows", "true"}); - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); /* Cleanup */ participant->delete_contained_entities(); diff --git a/test/unittest/dds/subscriber/SubscriberTests.cpp b/test/unittest/dds/subscriber/SubscriberTests.cpp index 57ee694c606..0a6086e6c95 100644 --- a/test/unittest/dds/subscriber/SubscriberTests.cpp +++ b/test/unittest/dds/subscriber/SubscriberTests.cpp @@ -236,21 +236,21 @@ TEST(SubscriberTests, ChangeSubscriberQos) ASSERT_NE(subscriber, nullptr); SubscriberQos qos; - ASSERT_EQ(subscriber->get_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->get_qos(qos), RETCODE_OK); ASSERT_EQ(qos, SUBSCRIBER_QOS_DEFAULT); qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(subscriber->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->set_qos(qos), RETCODE_OK); SubscriberQos pqos; - ASSERT_EQ(subscriber->get_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->get_qos(pqos), RETCODE_OK); ASSERT_TRUE(qos == pqos); ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -380,7 +380,7 @@ TEST(SubscriberTests, ChangeDefaultDataReaderQos) // .data_sharing qos.data_sharing().on("/"); - ASSERT_TRUE(subscriber->set_default_datareader_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(subscriber->set_default_datareader_qos(qos) == RETCODE_OK); DataReaderQos wqos; subscriber->get_default_datareader_qos(wqos); @@ -512,8 +512,8 @@ TEST(SubscriberTests, ChangeDefaultDataReaderQos) EXPECT_EQ(qos, wqos); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(SubscriberTests, ChangePSMDefaultDataReaderQos) @@ -544,8 +544,8 @@ TEST(SubscriberTests, GetSubscriberParticipant) ASSERT_EQ(subscriber->get_participant(), participant); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(SubscriberTests, GetPSMSubscriberParticipant) @@ -574,10 +574,10 @@ TEST(SubscriberTests, CreateDataReader) DataReader* data_reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(data_reader, nullptr); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } void check_datareader_with_profile ( @@ -650,17 +650,17 @@ TEST(SubscriberTests, CreateDataReaderWithProfile) DataReader* default_datareader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(default_datareader, nullptr); check_datareader_with_profile(default_datareader, "test_default_subscriber_profile"); - ASSERT_TRUE(subscriber->delete_datareader(default_datareader) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(subscriber->delete_datareader(default_datareader) == RETCODE_OK); //participant using non-default profile DataReader* datareader = subscriber->create_datareader_with_profile(topic, "test_subscriber_profile"); ASSERT_NE(datareader, nullptr); check_datareader_with_profile(datareader, "test_subscriber_profile"); - ASSERT_TRUE(subscriber->delete_datareader(datareader) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(subscriber->delete_datareader(datareader) == RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(SubscriberTests, GetDataReaderProfileQos) @@ -680,7 +680,7 @@ TEST(SubscriberTests, GetDataReaderProfileQos) DataReaderQos qos; EXPECT_EQ( subscriber->get_datareader_qos_from_profile("test_subscriber_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); //DataReader using the extracted qos DataReader* datareader = subscriber->create_datareader(topic, qos); @@ -691,13 +691,13 @@ TEST(SubscriberTests, GetDataReaderProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( subscriber->get_datareader_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(subscriber->delete_datareader(datareader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(datareader), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(SubscriberTests, DeleteSubscriberWithReaders) @@ -718,13 +718,13 @@ TEST(SubscriberTests, DeleteSubscriberWithReaders) DataReader* data_reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(data_reader, nullptr); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } //TODO: [ILG] Activate the test once PSM API for DataReader is in place @@ -758,7 +758,7 @@ void set_listener_test ( SubscriberListener* listener, StatusMask mask) { - ASSERT_EQ(subscriber->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(subscriber->get_status_mask(), mask); } @@ -810,13 +810,13 @@ TEST(SubscriberTests, SetListener) std::get<2>(testing_case)); } - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* * This test checks that the Subscriber methods defined in the standard not yet implemented in FastDDS return - * ReturnCode_t::RETCODE_UNSUPPORTED. The following methods are checked: + * RETCODE_UNSUPPORTED. The following methods are checked: * 1. copy_from_topic_qos * 2. begin_access * 3. end_access @@ -837,17 +837,17 @@ TEST(SubscriberTests, UnsupportedPublisherMethods) fastdds::dds::DataReaderQos reader_qos; fastdds::dds::TopicQos topic_qos; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, subscriber->copy_from_topic_qos(reader_qos, topic_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, subscriber->begin_access()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, subscriber->end_access()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, subscriber->get_datareaders( + EXPECT_EQ(RETCODE_UNSUPPORTED, subscriber->copy_from_topic_qos(reader_qos, topic_qos)); + EXPECT_EQ(RETCODE_UNSUPPORTED, subscriber->begin_access()); + EXPECT_EQ(RETCODE_UNSUPPORTED, subscriber->end_access()); + EXPECT_EQ(RETCODE_UNSUPPORTED, subscriber->get_datareaders( readers, sample_states, view_states, instance_states)); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /** @@ -955,7 +955,7 @@ TEST(SubscriberTests, DeleteContainedEntities) BarType data; data.index(1); type.get_key(&data, &handle_nil); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_foo->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, data_writer_foo->write(&data, HANDLE_NIL)); // Wait for data to arrive and check OK should be returned Duration_t wait_time(1, 0); @@ -964,11 +964,11 @@ TEST(SubscriberTests, DeleteContainedEntities) LoanableSequence mock_coll; SampleInfoSeq mock_seq; - ASSERT_EQ(data_reader_foo->take(mock_coll, mock_seq), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader_foo->take(mock_coll, mock_seq), RETCODE_OK); - ASSERT_EQ(subscriber->delete_contained_entities(), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(subscriber->delete_contained_entities(), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(data_reader_foo->return_loan(mock_coll, mock_seq), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader_foo->return_loan(mock_coll, mock_seq), RETCODE_OK); SampleStateMask mock_sample_state_kind = ANY_SAMPLE_STATE; ViewStateMask mock_view_state_kind = ANY_VIEW_STATE; @@ -992,7 +992,7 @@ TEST(SubscriberTests, DeleteContainedEntities) ASSERT_TRUE(data_reader_list.size() == 2); data_reader_list.clear(); - ASSERT_EQ(subscriber->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_contained_entities(), RETCODE_OK); subscriber->get_datareaders(data_reader_list); ASSERT_TRUE(data_reader_list.size() == 0); diff --git a/test/unittest/dds/topic/DDSSQLFilter/DDSSQLFilterTests.cpp b/test/unittest/dds/topic/DDSSQLFilter/DDSSQLFilterTests.cpp index 1c26f98b22a..2a75b379143 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/DDSSQLFilterTests.cpp +++ b/test/unittest/dds/topic/DDSSQLFilter/DDSSQLFilterTests.cpp @@ -148,8 +148,8 @@ class DDSSQLFilterTests : public testing::Test protected: - const ReturnCode_t ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t bad_code = ReturnCode_t::RETCODE_BAD_PARAMETER; + const ReturnCode_t ok_code = RETCODE_OK; + const ReturnCode_t bad_code = RETCODE_BAD_PARAMETER; struct TestCase { @@ -185,7 +185,7 @@ class DDSSQLFilterTests : public testing::Test TEST_F(DDSSQLFilterTests, empty_expression) { - TestCase empty{ "", {}, ReturnCode_t::RETCODE_OK }; + TestCase empty{ "", {}, RETCODE_OK }; run(empty); } @@ -1051,13 +1051,13 @@ TEST_P(DDSSQLFilterValueTests, test_filtered_value) IContentFilter* filter_instance = nullptr; auto ret = create_content_filter(uut, input.expression, input.params, &type_support, filter_instance); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); ASSERT_NE(nullptr, filter_instance); perform_basic_check(filter_instance, results, values); ret = uut.delete_content_filter("DDSSQL", filter_instance); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); Log::Flush(); Log::ClearConsumers(); @@ -1084,7 +1084,7 @@ TEST_F(DDSSQLFilterValueTests, test_compound_not) { IContentFilter* filter = nullptr; auto ret = create_content_filter(uut, expression, { param_values.back() }, &type_support, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); ASSERT_NE(nullptr, filter); const auto& values = DDSSQLFilterValueGlobalData::values(); @@ -1099,7 +1099,7 @@ TEST_F(DDSSQLFilterValueTests, test_compound_not) // Update parameter value params[0] = param_values[i].c_str(); ret = uut.create_content_filter("DDSSQL", "ContentFilterTestType", &type_support, nullptr, params, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); ASSERT_NE(nullptr, filter); // Update expected results @@ -1114,7 +1114,7 @@ TEST_F(DDSSQLFilterValueTests, test_compound_not) } ret = uut.delete_content_filter("DDSSQL", filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); } } @@ -1130,7 +1130,7 @@ TEST_F(DDSSQLFilterValueTests, test_compound_and) { IContentFilter* filter = nullptr; auto ret = create_content_filter(uut, expression, { "-3.14159", "3.14159" }, &type_support, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); ASSERT_NE(nullptr, filter); const auto& values = DDSSQLFilterValueGlobalData::values(); @@ -1140,7 +1140,7 @@ TEST_F(DDSSQLFilterValueTests, test_compound_and) perform_basic_check(filter, results, values); ret = uut.delete_content_filter("DDSSQL", filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); } } @@ -1156,7 +1156,7 @@ TEST_F(DDSSQLFilterValueTests, test_compound_or) { IContentFilter* filter = nullptr; auto ret = create_content_filter(uut, expression, { "-3.14159", "3.14159" }, &type_support, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); ASSERT_NE(nullptr, filter); const auto& values = DDSSQLFilterValueGlobalData::values(); @@ -1166,7 +1166,7 @@ TEST_F(DDSSQLFilterValueTests, test_compound_or) perform_basic_check(filter, results, values); ret = uut.delete_content_filter("DDSSQL", filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); } } @@ -1176,7 +1176,7 @@ TEST_F(DDSSQLFilterValueTests, test_update_params) IContentFilter* filter = nullptr; auto ret = create_content_filter(uut, expression, { "'BBB'", "'X'" }, &type_support, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); ASSERT_NE(nullptr, filter); const auto& values = DDSSQLFilterValueGlobalData::values(); @@ -1192,28 +1192,28 @@ TEST_F(DDSSQLFilterValueTests, test_update_params) params[0] = "'Z??"; // Wrong (missing ending quote) params[1] = "'X'"; // Unchanged ret = uut.create_content_filter("DDSSQL", "ContentFilterTestType", &type_support, nullptr, params, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, ret); + EXPECT_EQ(RETCODE_BAD_PARAMETER, ret); perform_basic_check(filter, results, values); // Change %0 to a wrong parameter should preserve filter state and results params[0] = "'Z??"; // Wrong (missing ending quote) params[1] = "'%'"; // Changed ret = uut.create_content_filter("DDSSQL", "ContentFilterTestType", &type_support, nullptr, params, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, ret); + EXPECT_EQ(RETCODE_BAD_PARAMETER, ret); perform_basic_check(filter, results, values); // Change %1 to a wrong parameter should preserve filter state and results params[0] = "'BBB'"; // Unchanged params[1] = "'"; // Wrong (missing ending quote) ret = uut.create_content_filter("DDSSQL", "ContentFilterTestType", &type_support, nullptr, params, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, ret); + EXPECT_EQ(RETCODE_BAD_PARAMETER, ret); perform_basic_check(filter, results, values); // Change %1 to a wrong parameter should preserve filter state and results params[0] = "'.*'"; // Changed params[1] = "'"; // Wrong (missing ending quote) ret = uut.create_content_filter("DDSSQL", "ContentFilterTestType", &type_support, nullptr, params, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, ret); + EXPECT_EQ(RETCODE_BAD_PARAMETER, ret); perform_basic_check(filter, results, values); // Correctly changing both parameters should change results @@ -1221,11 +1221,11 @@ TEST_F(DDSSQLFilterValueTests, test_update_params) params[1] = "''"; // Only first value matches results[0] = results[4] = true; ret = uut.create_content_filter("DDSSQL", "ContentFilterTestType", &type_support, nullptr, params, filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); perform_basic_check(filter, results, values); ret = uut.delete_content_filter("DDSSQL", filter); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); } static void add_test_filtered_value_inputs( diff --git a/test/unittest/dds/topic/TopicTests.cpp b/test/unittest/dds/topic/TopicTests.cpp index a5bb4c4aa9f..403bfb5f3f7 100644 --- a/test/unittest/dds/topic/TopicTests.cpp +++ b/test/unittest/dds/topic/TopicTests.cpp @@ -139,21 +139,21 @@ TEST(TopicTests, ChangeTopicQos) ASSERT_NE(topic, nullptr); TopicQos qos; - ASSERT_EQ(topic->get_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(topic->get_qos(qos), RETCODE_OK); ASSERT_EQ(qos, TOPIC_QOS_DEFAULT); qos.reliability().kind = RELIABLE_RELIABILITY_QOS; - ASSERT_EQ(topic->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(topic->set_qos(qos), RETCODE_OK); TopicQos tqos; - ASSERT_EQ(topic->get_qos(tqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(topic->get_qos(tqos), RETCODE_OK); ASSERT_TRUE(qos == tqos); ASSERT_EQ(tqos.reliability().kind, RELIABLE_RELIABILITY_QOS); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -171,8 +171,8 @@ TEST(TopicTests, GetTopicParticipant) ASSERT_EQ(topic->get_participant(), participant); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void set_listener_test ( @@ -180,7 +180,7 @@ void set_listener_test ( TopicListener* listener, StatusMask mask) { - ASSERT_EQ(topic->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(topic->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(topic->get_status_mask(), mask); } @@ -221,8 +221,8 @@ TEST(TopicTests, SetListener) std::get<2>(testing_case)); } - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } /* @@ -294,47 +294,47 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyNotKeyed) ASSERT_NE(topic5, nullptr); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 TopicQos qos2 = TOPIC_QOS_DEFAULT; Topic* default_topic1 = participant->create_topic("footopic6", type.get_type_name(), qos2); ASSERT_NE(default_topic1, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_instances = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 4999; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); } /* @@ -417,19 +417,19 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyKeyed) ASSERT_NE(topic6, nullptr); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. TopicQos qos2 = TOPIC_QOS_DEFAULT; Topic* default_topic1 = participant->create_topic("footopic7", type.get_type_name(), qos2); ASSERT_NE(default_topic1, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , // set_qos() should return a value != 0 (not OK) @@ -437,32 +437,32 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_NE(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_NE(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples = ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5000; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); } } // namespace dds diff --git a/test/unittest/dynamic_types/DynamicTypesTests.cpp b/test/unittest/dynamic_types/DynamicTypesTests.cpp index 41729254ecd..50c07d039ec 100644 --- a/test/unittest/dynamic_types/DynamicTypesTests.cpp +++ b/test/unittest/dynamic_types/DynamicTypesTests.cpp @@ -74,8 +74,8 @@ TEST_F(DynamicTypesTests, TypeDescriptors_unit_tests) // Then ASSERT_FALSE(pInt32Descriptor.equals(&pInt32Descriptor2)); - ASSERT_FALSE(pInt32Descriptor2.copy_from(nullptr) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(pInt32Descriptor2.copy_from(&pInt32Descriptor) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(pInt32Descriptor2.copy_from(nullptr) == RETCODE_OK); + ASSERT_TRUE(pInt32Descriptor2.copy_from(&pInt32Descriptor) == RETCODE_OK); ASSERT_TRUE(pInt32Descriptor.equals(&pInt32Descriptor2)); pInt32Descriptor2.set_name("TEST_2"); ASSERT_FALSE(pInt32Descriptor.equals(&pInt32Descriptor2)); @@ -102,12 +102,12 @@ TEST_F(DynamicTypesTests, DynamicType_basic_unit_tests) ASSERT_TRUE(struct_type_builder != nullptr); // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", int32_type) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_type_builder->add_member(0, "int32", int32_type) == RETCODE_OK); auto struct_type = struct_type_builder->build(); ASSERT_TRUE(struct_type != nullptr); ASSERT_TRUE(struct_type_builder->add_member(1, "int64", - DynamicTypeBuilderFactory::get_instance()->create_int64_type()) == ReturnCode_t::RETCODE_OK); + DynamicTypeBuilderFactory::get_instance()->create_int64_type()) == RETCODE_OK); auto struct_type2 = struct_type_builder->build(); ASSERT_TRUE(struct_type2 != nullptr); ASSERT_FALSE(struct_type->equals(struct_type2.get())); @@ -130,10 +130,10 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) ASSERT_TRUE(type3 != nullptr); ASSERT_TRUE(type->equals(type3.get())); auto data = DynamicDataFactory::get_instance()->create_data(created_builder.get()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); auto data2 = DynamicDataFactory::get_instance()->create_data(type); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -148,8 +148,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -164,8 +164,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -180,8 +180,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -196,8 +196,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -212,8 +212,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -228,8 +228,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -244,8 +244,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -260,8 +260,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -276,8 +276,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -292,8 +292,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -308,8 +308,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -324,8 +324,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(BOUND_UNLIMITED); @@ -341,8 +341,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); created_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(BOUND_UNLIMITED); ASSERT_TRUE(created_builder != nullptr); @@ -357,8 +357,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); // Create with custom types TypeDescriptor pInt32Descriptor; @@ -374,8 +374,8 @@ TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) data = DynamicDataFactory::get_instance()->create_data(type); data2 = DynamicDataFactory::get_instance()->create_copy(data); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -393,60 +393,60 @@ TEST_F(DynamicTypesTests, DynamicType_int32_unit_tests) int32_t test1 = 123; int32_t test2 = 0; - ASSERT_TRUE(data->set_int32_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_int32_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_int32_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_int32_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - //ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); //int32_t iTest32; - //ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -474,9 +474,9 @@ TEST_F(DynamicTypesTests, DynamicType_int32_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -494,60 +494,60 @@ TEST_F(DynamicTypesTests, DynamicType_uint32_unit_tests) uint32_t test1 = 123; uint32_t test2 = 0; - ASSERT_TRUE(data->set_uint32_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_uint32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_uint32_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_uint32_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_uint32_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); //uint32_t uTest32; - //ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -575,9 +575,9 @@ TEST_F(DynamicTypesTests, DynamicType_uint32_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -595,60 +595,60 @@ TEST_F(DynamicTypesTests, DynamicType_int16_unit_tests) int16_t test1 = 123; int16_t test2 = 0; - ASSERT_TRUE(data->set_int16_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_int16_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_int16_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_int16_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_int16_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); //int16_t iTest16; - //ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -676,9 +676,9 @@ TEST_F(DynamicTypesTests, DynamicType_int16_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -696,60 +696,60 @@ TEST_F(DynamicTypesTests, DynamicType_uint16_unit_tests) uint16_t test1 = 123; uint16_t test2 = 0; - ASSERT_TRUE(data->set_uint16_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_uint16_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_uint16_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_uint16_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_uint16_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); //uint16_t uTest16; - //ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -777,9 +777,9 @@ TEST_F(DynamicTypesTests, DynamicType_uint16_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -797,60 +797,60 @@ TEST_F(DynamicTypesTests, DynamicType_int64_unit_tests) int64_t test1 = 123; int64_t test2 = 0; - ASSERT_TRUE(data->set_int64_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_int64_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_int64_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_int64_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_int64_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); //int64_t iTest64; - //ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -878,9 +878,9 @@ TEST_F(DynamicTypesTests, DynamicType_int64_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -898,60 +898,60 @@ TEST_F(DynamicTypesTests, DynamicType_uint64_unit_tests) uint64_t test1 = 123; uint64_t test2 = 0; - ASSERT_TRUE(data->set_uint64_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_uint64_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_uint64_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_uint64_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_uint64_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); //uint64_t uTest64; - //ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -979,9 +979,9 @@ TEST_F(DynamicTypesTests, DynamicType_uint64_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -999,60 +999,60 @@ TEST_F(DynamicTypesTests, DynamicType_float32_unit_tests) float test1 = 123.0f; float test2 = 0.0f; - ASSERT_TRUE(data->set_float32_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_float32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_float32_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_float32_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_float32_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); //float fTest32; - //ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1080,9 +1080,9 @@ TEST_F(DynamicTypesTests, DynamicType_float32_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); @@ -1101,60 +1101,60 @@ TEST_F(DynamicTypesTests, DynamicType_float64_unit_tests) double test1 = 123.0; double test2 = 0.0; - ASSERT_TRUE(data->set_float64_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_float64_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_float64_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_float64_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_float64_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); //double fTest64; - //ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1182,9 +1182,9 @@ TEST_F(DynamicTypesTests, DynamicType_float64_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); @@ -1203,60 +1203,60 @@ TEST_F(DynamicTypesTests, DynamicType_float128_unit_tests) long double test1 = 123.0; long double test2 = 0.0; - ASSERT_TRUE(data->set_float128_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_float128_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_float128_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_float128_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_float128_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); //long double fTest128; - //ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1284,9 +1284,9 @@ TEST_F(DynamicTypesTests, DynamicType_float128_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -1304,60 +1304,60 @@ TEST_F(DynamicTypesTests, DynamicType_char8_unit_tests) char test1 = 'a'; char test2 = 'b'; - ASSERT_TRUE(data->set_char8_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_char8_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_char8_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_char8_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_char8_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); //char cTest8; - //ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1385,9 +1385,9 @@ TEST_F(DynamicTypesTests, DynamicType_char8_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); @@ -1407,60 +1407,60 @@ TEST_F(DynamicTypesTests, DynamicType_char16_unit_tests) wchar_t test1 = L'a'; wchar_t test2 = L'b'; - ASSERT_TRUE(data->set_char16_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_char16_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_char16_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_char16_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_char16_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); //wchar_t cTest16; - //ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1489,9 +1489,9 @@ TEST_F(DynamicTypesTests, DynamicType_char16_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -1510,60 +1510,60 @@ TEST_F(DynamicTypesTests, DynamicType_byte_unit_tests) octet test1 = 255; octet test2 = 0; - ASSERT_TRUE(data->set_byte_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_byte_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_byte_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_byte_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); //octet oTest; - //ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1591,9 +1591,9 @@ TEST_F(DynamicTypesTests, DynamicType_byte_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -1611,60 +1611,60 @@ TEST_F(DynamicTypesTests, DynamicType_bool_unit_tests) bool test1 = true; bool test2 = false; - ASSERT_TRUE(data->set_bool_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_bool_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_bool_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(test2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_bool_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); //bool bTest; - //ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1692,9 +1692,9 @@ TEST_F(DynamicTypesTests, DynamicType_bool_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -1707,94 +1707,94 @@ TEST_F(DynamicTypesTests, DynamicType_enum_unit_tests) ASSERT_TRUE(created_builder != nullptr); // Add three members to the enum. - ASSERT_TRUE(created_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(created_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(created_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(created_builder->add_empty_member(0, "DEFAULT") == RETCODE_OK); + ASSERT_TRUE(created_builder->add_empty_member(1, "FIRST") == RETCODE_OK); + ASSERT_TRUE(created_builder->add_empty_member(2, "SECOND") == RETCODE_OK); // Try to add a descriptor with the same name. - ASSERT_FALSE(created_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(created_builder->add_empty_member(4, "DEFAULT") == RETCODE_OK); DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); ASSERT_TRUE(created_type != nullptr); DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); ASSERT_TRUE(data != nullptr); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); // Try to set an invalid value. - ASSERT_FALSE(data->set_enum_value("BAD", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("BAD", MEMBER_ID_INVALID) == RETCODE_OK); std::string test1 = "SECOND"; - ASSERT_FALSE(data->set_enum_value(test1, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->set_enum_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_enum_value(test1, 1) == RETCODE_OK); + ASSERT_TRUE(data->set_enum_value(test1, MEMBER_ID_INVALID) == RETCODE_OK); std::string test2; int iTest; - ASSERT_FALSE(data->get_int32_value(iTest, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_enum_value(test2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_enum_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest, 0) == RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(test2, 1) == RETCODE_OK); + ASSERT_TRUE(data->get_enum_value(test2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(test1 == test2); // Work as uint32_t uint32_t uTest1 = 2; - ASSERT_FALSE(data->set_enum_value(uTest1, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->set_enum_value(uTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_enum_value(uTest1, 1) == RETCODE_OK); + ASSERT_TRUE(data->set_enum_value(uTest1, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest2; - ASSERT_FALSE(data->get_int32_value(iTest, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_enum_value(uTest2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_enum_value(uTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest, 0) == RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(uTest2, 1) == RETCODE_OK); + ASSERT_TRUE(data->get_enum_value(uTest2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(uTest1 == uTest2); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); //std::string sEnumTest; - //ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1822,9 +1822,9 @@ TEST_F(DynamicTypesTests, DynamicType_enum_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -1843,69 +1843,69 @@ TEST_F(DynamicTypesTests, DynamicType_string_unit_tests) DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); ASSERT_TRUE(data != nullptr); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", 1) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", 1) == RETCODE_OK); std::string sTest1 = "STRING_TEST"; - ASSERT_TRUE(data->set_string_value(sTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_string_value(sTest1, MEMBER_ID_INVALID) == RETCODE_OK); int test = 0; - ASSERT_FALSE(data->get_int32_value(test, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(test, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest2 = ""; - ASSERT_FALSE(data->get_string_value(sTest2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_string_value(sTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_string_value(sTest2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(sTest1 == sTest2); - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == RETCODE_OK); + + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); //std::string sTest; - //ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -1933,9 +1933,9 @@ TEST_F(DynamicTypesTests, DynamicType_string_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -1954,70 +1954,70 @@ TEST_F(DynamicTypesTests, DynamicType_wstring_unit_tests) DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); ASSERT_TRUE(data != nullptr); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", 1) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", 1) == RETCODE_OK); std::wstring sTest1 = L"STRING_TEST"; - ASSERT_TRUE(data->set_wstring_value(sTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_wstring_value(sTest1, MEMBER_ID_INVALID) == RETCODE_OK); int test = 0; - ASSERT_FALSE(data->get_int32_value(test, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(test, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring sTest2 = L""; - ASSERT_FALSE(data->get_wstring_value(sTest2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_wstring_value(sTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(sTest2, 0) == RETCODE_OK); + ASSERT_TRUE(data->get_wstring_value(sTest2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(sTest1 == sTest2); ASSERT_FALSE(data->set_wstring_value(L"TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + MEMBER_ID_INVALID) == RETCODE_OK); + + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); //std::wstring wsTest; - //ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -2045,9 +2045,9 @@ TEST_F(DynamicTypesTests, DynamicType_wstring_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -2069,14 +2069,14 @@ TEST_F(DynamicTypesTests, DynamicType_alias_unit_tests) DynamicData* aliasData = DynamicDataFactory::get_instance()->create_data(created_type); ASSERT_TRUE(aliasData != nullptr); - ASSERT_FALSE(aliasData->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(aliasData->set_string_value("", 1) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(aliasData->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(aliasData->set_string_value("", 1) == RETCODE_OK); uint32_t uTest1 = 2; - ASSERT_TRUE(aliasData->set_uint32_value(uTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(aliasData->set_uint32_value(uTest1, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest2 = 0; - ASSERT_TRUE(aliasData->get_uint32_value(uTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(aliasData->get_uint32_value(uTest2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(uTest1 == uTest2); // Serialize <-> Deserialize Test @@ -2105,9 +2105,9 @@ TEST_F(DynamicTypesTests, DynamicType_alias_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(aliasData)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(aliasData) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(aliasData) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); @@ -2142,20 +2142,20 @@ TEST_F(DynamicTypesTests, DynamicType_multi_alias_unit_tests) nullptr, "ALIAS2"); ASSERT_FALSE(alias2_type_builder != nullptr); - ASSERT_FALSE(aliasData->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(aliasData->set_string_value("", 1) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(aliasData->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(aliasData->set_string_value("", 1) == RETCODE_OK); std::string sTest1 = "STRING_TEST"; - ASSERT_TRUE(aliasData->set_string_value(sTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(aliasData->set_string_value(sTest1, MEMBER_ID_INVALID) == RETCODE_OK); int test = 0; - ASSERT_FALSE(aliasData->get_int32_value(test, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(aliasData->get_int32_value(test, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest2 = ""; - ASSERT_FALSE(aliasData->get_string_value(sTest2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(aliasData->get_string_value(sTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(aliasData->get_string_value(sTest2, 0) == RETCODE_OK); + ASSERT_TRUE(aliasData->get_string_value(sTest2, MEMBER_ID_INVALID) == RETCODE_OK); ASSERT_TRUE(sTest1 == sTest2); ASSERT_FALSE(aliasData->set_string_value("TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(created_type); @@ -2167,8 +2167,8 @@ TEST_F(DynamicTypesTests, DynamicType_multi_alias_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); ASSERT_TRUE(data2->equals(aliasData)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(aliasData) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(aliasData) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); @@ -2191,8 +2191,8 @@ TEST_F(DynamicTypesTests, DynamicType_bitset_unit_tests) ASSERT_TRUE(bitset_type_builder != nullptr); // Add members to the struct. - ASSERT_TRUE(bitset_type_builder->add_member(0, "int2", base_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(bitset_type_builder->add_member(1, "int20", base_type2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(bitset_type_builder->add_member(0, "int2", base_type) == RETCODE_OK); + ASSERT_TRUE(bitset_type_builder->add_member(1, "int20", base_type2) == RETCODE_OK); bitset_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); bitset_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); bitset_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); @@ -2203,22 +2203,22 @@ TEST_F(DynamicTypesTests, DynamicType_bitset_unit_tests) auto bitset_data = DynamicDataFactory::get_instance()->create_data(bitset_type); ASSERT_TRUE(bitset_data != nullptr); - ASSERT_FALSE(bitset_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(bitset_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(bitset_data->set_int32_value(10, 1) == RETCODE_OK); + ASSERT_FALSE(bitset_data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); // Set and get the child values. octet test1(234); - ASSERT_TRUE(bitset_data->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(bitset_data->set_byte_value(test1, 0) == RETCODE_OK); octet test2(0); - ASSERT_TRUE(bitset_data->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(bitset_data->get_byte_value(test2, 0) == RETCODE_OK); ASSERT_FALSE(test1 == test2); // 11101010 // 00000010 (two bits) ASSERT_TRUE(test2 == 2); uint32_t test3(289582314); - ASSERT_TRUE(bitset_data->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(bitset_data->set_uint32_value(test3, 1) == RETCODE_OK); uint32_t test4(0); - ASSERT_TRUE(bitset_data->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(bitset_data->get_uint32_value(test4, 1) == RETCODE_OK); ASSERT_FALSE(test3 == test4); // 00000001010000101010110011101010 // 00000000000000101010110011101010 (20 bits) @@ -2230,7 +2230,7 @@ TEST_F(DynamicTypesTests, DynamicType_bitset_unit_tests) // Tested in DynamicTypes_4_2_Tests // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(bitset_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(bitset_data) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); @@ -2246,16 +2246,16 @@ TEST_F(DynamicTypesTests, DynamicType_bitmask_unit_tests) ASSERT_TRUE(created_builder != nullptr); // Add two members to the bitmask - ASSERT_TRUE(created_builder->add_empty_member(0, "TEST") == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(created_builder->add_empty_member(0, "TEST") == RETCODE_OK); // Try to add a descriptor with the same name - ASSERT_FALSE(created_builder->add_empty_member(1, "TEST") == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(created_builder->add_empty_member(1, "TEST") == RETCODE_OK); - ASSERT_TRUE(created_builder->add_empty_member(1, "TEST2") == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(created_builder->add_empty_member(1, "TEST2") == RETCODE_OK); - ASSERT_TRUE(created_builder->add_empty_member(4, "TEST4") == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(created_builder->add_empty_member(4, "TEST4") == RETCODE_OK); - ASSERT_FALSE(created_builder->add_empty_member(5, "TEST5") == ReturnCode_t::RETCODE_OK); // Out of bounds + ASSERT_FALSE(created_builder->add_empty_member(5, "TEST5") == RETCODE_OK); // Out of bounds DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); ASSERT_TRUE(created_type != nullptr); @@ -2272,29 +2272,29 @@ TEST_F(DynamicTypesTests, DynamicType_bitmask_unit_tests) ASSERT_TRUE(test5Id == MEMBER_ID_INVALID); bool test1 = true; - ASSERT_FALSE(data->set_int32_value(1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->set_bool_value(test1, testId) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(1, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_TRUE(data->set_bool_value(test1, testId) == RETCODE_OK); // Over the limit - ASSERT_FALSE(data->set_bool_value(test1, limit + 1) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(test1, limit + 1) == RETCODE_OK); bool test2 = false; - ASSERT_TRUE(data->get_bool_value(test2, 2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->get_bool_value(test2, 2) == RETCODE_OK); ASSERT_TRUE(test2 == false); - ASSERT_TRUE(data->get_bool_value(test2, testId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->get_bool_value(test2, testId) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->get_bool_value(test2, testId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->get_bool_value(test2, testId) == RETCODE_OK); ASSERT_TRUE(test1 == test2); bool test3 = data->get_bool_value("TEST"); ASSERT_TRUE(test1 == test3); - ASSERT_TRUE(data->set_bool_value(true, "TEST4") == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_bool_value(true, "TEST4") == RETCODE_OK); bool test4 = data->get_bool_value("TEST4"); ASSERT_TRUE(test4 == true); test1 = false; - ASSERT_TRUE(data->set_bool_value(test1, testId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, test2Id) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, testId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_bool_value(test1, testId) == RETCODE_OK); + ASSERT_TRUE(data->get_bool_value(test2, test2Id) == RETCODE_OK); + ASSERT_TRUE(data->get_bool_value(test2, testId) == RETCODE_OK); ASSERT_TRUE(test1 == test2); data->set_bitmask_value(55); // 00110111 uint64_t value = data->get_bitmask_value(); @@ -2307,58 +2307,58 @@ TEST_F(DynamicTypesTests, DynamicType_bitmask_unit_tests) ASSERT_FALSE(data->get_bool_value("TEST2")); ASSERT_FALSE(data->get_bool_value("TEST4")); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + //ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); //uint64_t uTest64; - //ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + //ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test - ASSERT_TRUE(data->set_bool_value(true, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_bool_value(true, 0) == RETCODE_OK); DynamicPubSubType pubsubType(created_type); uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); SerializedPayload_t payload(payloadSize); @@ -2369,8 +2369,8 @@ TEST_F(DynamicTypesTests, DynamicType_bitmask_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -2390,26 +2390,26 @@ TEST_F(DynamicTypesTests, DynamicType_sequence_unit_tests) ASSERT_TRUE(seq_type != nullptr); auto data = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); // Try to write on an empty position - ASSERT_FALSE(data->set_int32_value(234, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(234, 1) == RETCODE_OK); MemberId newId; - ASSERT_TRUE(data->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_sequence_data(newId) == RETCODE_OK); MemberId newId2; - ASSERT_TRUE(data->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_sequence_data(newId2) == RETCODE_OK); // Try to insert more than the limit. MemberId newId3; - ASSERT_FALSE(data->insert_sequence_data(newId3) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->insert_sequence_data(newId3) == RETCODE_OK); // Set and get a value. int32_t test1(234); - ASSERT_TRUE(data->set_int32_value(test1, newId2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_int32_value(test1, newId2) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, newId2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->get_int32_value(test2, newId2) == RETCODE_OK); ASSERT_TRUE(test1 == test2); // Serialize <-> Deserialize Test @@ -2424,67 +2424,67 @@ TEST_F(DynamicTypesTests, DynamicType_sequence_unit_tests) ASSERT_TRUE(data2->equals(data)); // Remove the elements. - ASSERT_TRUE(data->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->remove_sequence_data(newId) == RETCODE_OK); + ASSERT_TRUE(data->clear_all_values() == RETCODE_OK); // New Insert Methods - ASSERT_TRUE(data->insert_int32_value(test1, newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_int32_value(test2, newId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_int32_value(test1, newId) == RETCODE_OK); + ASSERT_TRUE(data->get_int32_value(test2, newId) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->clear_all_values() == RETCODE_OK); // Check that the sequence is empty. - ASSERT_FALSE(data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(test2, 0) == RETCODE_OK); + + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // SERIALIZATION TEST @@ -2503,9 +2503,9 @@ TEST_F(DynamicTypesTests, DynamicType_sequence_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -2534,31 +2534,31 @@ TEST_F(DynamicTypesTests, DynamicType_sequence_of_sequences_unit_tests) ASSERT_TRUE(seq_seq_type != nullptr); auto data = DynamicDataFactory::get_instance()->create_data(seq_seq_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); MemberId newId; - ASSERT_TRUE(data->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_sequence_data(newId) == RETCODE_OK); MemberId newId2; - ASSERT_TRUE(data->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_sequence_data(newId2) == RETCODE_OK); // Loan Value to modify the first sequence auto seq_data = data->loan_value(newId); ASSERT_TRUE(seq_data != nullptr); MemberId newSeqId; - ASSERT_TRUE(seq_data->insert_sequence_data(newSeqId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(seq_data->insert_sequence_data(newSeqId) == RETCODE_OK); // Set and get a value. int32_t test1(234); - ASSERT_TRUE(seq_data->set_int32_value(test1, newSeqId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(seq_data->set_int32_value(test1, newSeqId) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(seq_data->get_int32_value(test2, newSeqId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(seq_data->get_int32_value(test2, newSeqId) == RETCODE_OK); ASSERT_TRUE(test1 == test2); // Return the pointer of the sequence - ASSERT_TRUE(data->return_loaned_value(seq_data) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(seq_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->return_loaned_value(seq_data) == RETCODE_OK); + ASSERT_FALSE(data->return_loaned_value(seq_data) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(seq_seq_type); @@ -2572,61 +2572,61 @@ TEST_F(DynamicTypesTests, DynamicType_sequence_of_sequences_unit_tests) ASSERT_TRUE(data2->equals(data)); // Remove the elements. - ASSERT_TRUE(data->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->remove_sequence_data(newId) == RETCODE_OK); + ASSERT_TRUE(data->clear_all_values() == RETCODE_OK); // Check that the sequence is empty. - ASSERT_FALSE(data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(test2, 0) == RETCODE_OK); + + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // SERIALIZATION TEST SequenceSequenceStruct seq; @@ -2645,18 +2645,18 @@ TEST_F(DynamicTypesTests, DynamicType_sequence_of_sequences_unit_tests) ASSERT_TRUE(data3->equals(data)); // New Insert Methods - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->clear_all_values() == RETCODE_OK); seq_data = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(seq_data->insert_int32_value(test1, newSeqId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(seq_data->get_int32_value(test2, newSeqId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(seq_data->insert_int32_value(test1, newSeqId) == RETCODE_OK); + ASSERT_TRUE(seq_data->get_int32_value(test2, newSeqId) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->insert_complex_value(seq_data, newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_complex_value(seq_data, newId) == RETCODE_OK); + ASSERT_TRUE(data->clear_all_values() == RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); @@ -2679,11 +2679,11 @@ TEST_F(DynamicTypesTests, DynamicType_array_unit_tests) ASSERT_TRUE(array_type != nullptr); auto data = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); MemberId newId; - ASSERT_FALSE(data->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->insert_sequence_data(newId) == RETCODE_OK); // Get an index in the multidimensional array. std::vector vPosition = { 1, 1, 1 }; @@ -2699,9 +2699,9 @@ TEST_F(DynamicTypesTests, DynamicType_array_unit_tests) // Set and get a value. int32_t test1 = 156; - ASSERT_TRUE(data->set_int32_value(test1, testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_int32_value(test1, testPos) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->get_int32_value(test2, testPos) == RETCODE_OK); ASSERT_TRUE(test1 == test2); // Serialize <-> Deserialize Test @@ -2717,69 +2717,69 @@ TEST_F(DynamicTypesTests, DynamicType_array_unit_tests) // Check items count before and after remove an element. ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_value(testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->clear_value(testPos) == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->clear_array_data(testPos) == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); // Check the clear values method - ASSERT_TRUE(data->set_int32_value(test1, testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_int32_value(test1, testPos) == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->clear_all_values() == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); // Try to set a value out of the array. - ASSERT_FALSE(data->set_int32_value(test1, 100) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(test1, 100) == RETCODE_OK); + + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // SERIALIZATION TEST ArraytStruct seq; @@ -2797,9 +2797,9 @@ TEST_F(DynamicTypesTests, DynamicType_array_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -2827,11 +2827,11 @@ TEST_F(DynamicTypesTests, DynamicType_array_of_arrays_unit_tests) ASSERT_TRUE(parent_array_type != nullptr); auto data = DynamicDataFactory::get_instance()->create_data(parent_array_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); MemberId newId; - ASSERT_FALSE(data->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->insert_sequence_data(newId) == RETCODE_OK); // Get an index in the multidimensional array. std::vector vPosition = { 1, 1 }; @@ -2852,14 +2852,14 @@ TEST_F(DynamicTypesTests, DynamicType_array_of_arrays_unit_tests) ASSERT_FALSE(temp2 != nullptr); int32_t test1 = 156; - ASSERT_TRUE(temp->set_int32_value(test1, testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(temp->set_int32_value(test1, testPos) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(temp->get_int32_value(test2, testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(temp->get_int32_value(test2, testPos) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->return_loaned_value(temp) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(temp) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(temp2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->return_loaned_value(temp) == RETCODE_OK); + ASSERT_FALSE(data->return_loaned_value(temp) == RETCODE_OK); + ASSERT_FALSE(data->return_loaned_value(temp2) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(parent_array_type); @@ -2874,63 +2874,63 @@ TEST_F(DynamicTypesTests, DynamicType_array_of_arrays_unit_tests) // Check items count before and after remove an element. ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_value(testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->clear_value(testPos) == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->clear_array_data(testPos) == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); // Try to set a value out of the array. - ASSERT_FALSE(data->set_int32_value(test1, 100) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(test1, 100) == RETCODE_OK); + + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // SERIALIZATION TEST ArrayArrayStruct seq; @@ -2948,9 +2948,9 @@ TEST_F(DynamicTypesTests, DynamicType_array_of_arrays_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -2973,38 +2973,38 @@ TEST_F(DynamicTypesTests, DynamicType_map_unit_tests) DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); // Try to write on an empty position - ASSERT_FALSE(data->set_int32_value(234, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(234, 0) == RETCODE_OK); MemberId keyId; MemberId valueId; auto key_data = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == RETCODE_OK); // Try to Add the same key twice. - ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == RETCODE_OK); MemberId keyId2; MemberId valueId2; key_data = DynamicDataFactory::get_instance()->create_data(base_type); key_data->set_int32_value(2, MEMBER_ID_INVALID); - ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == RETCODE_OK); // Try to Add one more than the limit auto key_data2 = DynamicDataFactory::get_instance()->create_data(base_type); key_data2->set_int32_value(3, MEMBER_ID_INVALID); - ASSERT_FALSE(data->insert_map_data(key_data2, keyId, valueId) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->insert_map_data(key_data2, keyId, valueId) == RETCODE_OK); // Set and get a value. int32_t test1(234); - ASSERT_TRUE(data->set_int32_value(test1, valueId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->set_int32_value(test1, valueId) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, valueId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->get_int32_value(test2, valueId) == RETCODE_OK); ASSERT_TRUE(test1 == test2); // Serialize <-> Deserialize Test @@ -3018,66 +3018,66 @@ TEST_F(DynamicTypesTests, DynamicType_map_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); // Check items count with removes ASSERT_TRUE(data->get_item_count() == 2); - ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->remove_map_data(valueId) == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == 2); - ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->remove_map_data(keyId) == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == 1); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->clear_all_values() == RETCODE_OK); ASSERT_TRUE(data->get_item_count() == 0); - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); //// SERIALIZATION TEST //MapStruct seq; @@ -3097,13 +3097,13 @@ TEST_F(DynamicTypesTests, DynamicType_map_unit_tests) //ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); //ASSERT_TRUE(data3->equals(data)); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -3132,97 +3132,97 @@ TEST_F(DynamicTypesTests, DynamicType_map_of_maps_unit_tests) DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_map_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); MemberId keyId; MemberId valueId; auto key_data = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == RETCODE_OK); // Try to Add the same key twice. - ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == RETCODE_OK); MemberId keyId2; MemberId valueId2; key_data = DynamicDataFactory::get_instance()->create_data(base_type); key_data->set_int32_value(2, MEMBER_ID_INVALID); - ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == RETCODE_OK); // Try to Add one more than the limit auto key_data2 = DynamicDataFactory::get_instance()->create_data(base_type); key_data2->set_int32_value(3, MEMBER_ID_INVALID); - ASSERT_FALSE(data->insert_map_data(key_data2, keyId, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->insert_map_data(key_data2, keyId, valueId) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == RETCODE_OK); auto seq_data = data->loan_value(valueId); ASSERT_TRUE(seq_data != nullptr); auto key_data3 = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(seq_data->insert_map_data(key_data3, keyId, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(seq_data->insert_map_data(key_data3, keyId, valueId) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data3) == RETCODE_OK); // Set and get a value. int32_t test1(234); - ASSERT_TRUE(seq_data->set_int32_value(test1, valueId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(seq_data->set_int32_value(test1, valueId) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(seq_data->get_int32_value(test2, valueId) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(seq_data->get_int32_value(test2, valueId) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->return_loaned_value(seq_data) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(seq_data) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(data->return_loaned_value(seq_data) == RETCODE_OK); + ASSERT_FALSE(data->return_loaned_value(seq_data) == RETCODE_OK); + + ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == RETCODE_OK); int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == RETCODE_OK); uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == RETCODE_OK); int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == RETCODE_OK); uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == RETCODE_OK); int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == RETCODE_OK); uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == RETCODE_OK); float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == RETCODE_OK); double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == RETCODE_OK); long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == RETCODE_OK); char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == RETCODE_OK); wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == RETCODE_OK); octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == RETCODE_OK); bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == RETCODE_OK); std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == RETCODE_OK); std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(map_map_type); @@ -3253,9 +3253,9 @@ TEST_F(DynamicTypesTests, DynamicType_map_of_maps_unit_tests) //ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); //ASSERT_TRUE(data3->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -3276,27 +3276,27 @@ TEST_F(DynamicTypesTests, DynamicType_structure_unit_tests) ASSERT_TRUE(struct_type_builder != nullptr); // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == RETCODE_OK); + ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == RETCODE_OK); auto struct_type = struct_type_builder->build(); ASSERT_TRUE(struct_type != nullptr); auto struct_data = DynamicDataFactory::get_instance()->create_data(struct_type); ASSERT_TRUE(struct_data != nullptr); - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(struct_data->set_int32_value(10, 1) == RETCODE_OK); + ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); // Set and get the child values. int32_t test1(234); - ASSERT_TRUE(struct_data->set_int32_value(test1, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->set_int32_value(test1, 0) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(struct_data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->get_int32_value(test2, 0) == RETCODE_OK); ASSERT_TRUE(test1 == test2); int64_t test3(234); - ASSERT_TRUE(struct_data->set_int64_value(test3, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->set_int64_value(test3, 1) == RETCODE_OK); int64_t test4(0); - ASSERT_TRUE(struct_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->get_int64_value(test4, 1) == RETCODE_OK); ASSERT_TRUE(test3 == test4); // Serialize <-> Deserialize Test @@ -3328,11 +3328,11 @@ TEST_F(DynamicTypesTests, DynamicType_structure_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(struct_data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); @@ -3354,8 +3354,8 @@ TEST_F(DynamicTypesTests, DynamicType_structure_inheritance_unit_tests) ASSERT_TRUE(struct_type_builder != nullptr); // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == RETCODE_OK); + ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == RETCODE_OK); auto struct_type = struct_type_builder->build(); ASSERT_TRUE(struct_type != nullptr); @@ -3371,35 +3371,35 @@ TEST_F(DynamicTypesTests, DynamicType_structure_inheritance_unit_tests) ASSERT_TRUE(child_struct_type_builder != nullptr); // Add a new member to the child struct. - ASSERT_TRUE(child_struct_type_builder->add_member(2, "child_int32", base_type) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(child_struct_type_builder->add_member(2, "child_int32", base_type) == RETCODE_OK); // try to add a member to override one of the parent struct. - ASSERT_FALSE(child_struct_type_builder->add_member(3, "int32", base_type) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(child_struct_type_builder->add_member(3, "int32", base_type) == RETCODE_OK); auto child_struct_type = child_struct_type_builder->build(); ASSERT_TRUE(child_struct_type != nullptr); auto struct_data = DynamicDataFactory::get_instance()->create_data(child_struct_type); ASSERT_TRUE(struct_data != nullptr); - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(struct_data->set_int32_value(10, 1) == RETCODE_OK); + ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); // Set and get the parent values. int32_t test1(234); - ASSERT_TRUE(struct_data->set_int32_value(test1, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->set_int32_value(test1, 0) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(struct_data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->get_int32_value(test2, 0) == RETCODE_OK); ASSERT_TRUE(test1 == test2); int64_t test3(234); - ASSERT_TRUE(struct_data->set_int64_value(test3, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->set_int64_value(test3, 1) == RETCODE_OK); int64_t test4(0); - ASSERT_TRUE(struct_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->get_int64_value(test4, 1) == RETCODE_OK); ASSERT_TRUE(test3 == test4); // Set and get the child value. int32_t test5(234); - ASSERT_TRUE(struct_data->set_int32_value(test5, 2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->set_int32_value(test5, 2) == RETCODE_OK); int32_t test6(0); - ASSERT_TRUE(struct_data->get_int32_value(test6, 2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->get_int32_value(test6, 2) == RETCODE_OK); ASSERT_TRUE(test5 == test6); // Serialize <-> Deserialize Test @@ -3413,10 +3413,10 @@ TEST_F(DynamicTypesTests, DynamicType_structure_inheritance_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); ASSERT_TRUE(data2->equals(struct_data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -3437,8 +3437,8 @@ TEST_F(DynamicTypesTests, DynamicType_multi_structure_unit_tests) ASSERT_TRUE(struct_type_builder != nullptr); // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == RETCODE_OK); + ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == RETCODE_OK); auto struct_type = struct_type_builder->build(); ASSERT_TRUE(struct_type != nullptr); @@ -3449,8 +3449,8 @@ TEST_F(DynamicTypesTests, DynamicType_multi_structure_unit_tests) ASSERT_TRUE(parent_struct_type_builder != nullptr); // Add members to the parent struct. - ASSERT_TRUE(parent_struct_type_builder->add_member(0, "child_struct", struct_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(parent_struct_type_builder->add_member(1, "child_int64", base_type2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(parent_struct_type_builder->add_member(0, "child_struct", struct_type) == RETCODE_OK); + ASSERT_TRUE(parent_struct_type_builder->add_member(1, "child_int64", base_type2) == RETCODE_OK); auto parent_struct_type = parent_struct_type_builder->build(); ASSERT_TRUE(parent_struct_type != nullptr); @@ -3458,14 +3458,14 @@ TEST_F(DynamicTypesTests, DynamicType_multi_structure_unit_tests) auto struct_data = DynamicDataFactory::get_instance()->create_data(parent_struct_type); ASSERT_TRUE(struct_data != nullptr); - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(struct_data->set_int32_value(10, 1) == RETCODE_OK); + ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); // Set and get the child values. int64_t test1(234); - ASSERT_TRUE(struct_data->set_int64_value(test1, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->set_int64_value(test1, 1) == RETCODE_OK); int64_t test2(0); - ASSERT_TRUE(struct_data->get_int64_value(test2, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->get_int64_value(test2, 1) == RETCODE_OK); ASSERT_TRUE(test1 == test2); auto child_struct_data = struct_data->loan_value(0); @@ -3473,18 +3473,18 @@ TEST_F(DynamicTypesTests, DynamicType_multi_structure_unit_tests) // Set and get the child values. int32_t test3(234); - ASSERT_TRUE(child_struct_data->set_int32_value(test3, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(child_struct_data->set_int32_value(test3, 0) == RETCODE_OK); int32_t test4(0); - ASSERT_TRUE(child_struct_data->get_int32_value(test4, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(child_struct_data->get_int32_value(test4, 0) == RETCODE_OK); ASSERT_TRUE(test3 == test4); int64_t test5(234); - ASSERT_TRUE(child_struct_data->set_int64_value(test5, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(child_struct_data->set_int64_value(test5, 1) == RETCODE_OK); int64_t test6(0); - ASSERT_TRUE(child_struct_data->get_int64_value(test6, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(child_struct_data->get_int64_value(test6, 1) == RETCODE_OK); ASSERT_TRUE(test5 == test6); - ASSERT_TRUE(struct_data->return_loaned_value(child_struct_data) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(struct_data->return_loaned_value(child_struct_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(struct_data->return_loaned_value(child_struct_data) == RETCODE_OK); + ASSERT_FALSE(struct_data->return_loaned_value(child_struct_data) == RETCODE_OK); // Serialize <-> Deserialize Test DynamicPubSubType pubsubType(parent_struct_type); @@ -3515,11 +3515,11 @@ TEST_F(DynamicTypesTests, DynamicType_multi_structure_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(struct_data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -3541,17 +3541,17 @@ TEST_F(DynamicTypesTests, DynamicType_union_unit_tests) ASSERT_TRUE(union_type_builder != nullptr); // Add members to the union. - ASSERT_TRUE(union_type_builder->add_member(0, "first", base_type, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_type_builder->add_member(0, "first", base_type, "", { 0 }, true) == RETCODE_OK); ASSERT_TRUE(union_type_builder->add_member(1, "second", base_type2, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); + false) == RETCODE_OK); // Try to add a second "DEFAULT" value to the union ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 0 }, - true) == ReturnCode_t::RETCODE_OK); + true) == RETCODE_OK); // Try to add a second value to the same case label ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); + false) == RETCODE_OK); // Create a data of this union auto union_type = union_type_builder->build(); @@ -3560,32 +3560,32 @@ TEST_F(DynamicTypesTests, DynamicType_union_unit_tests) ASSERT_TRUE(union_data != nullptr); // Set and get the child values. - ASSERT_FALSE(union_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(union_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(union_data->set_int32_value(10, 1) == RETCODE_OK); + ASSERT_FALSE(union_data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); uint64_t label; - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->get_union_label(label) == RETCODE_OK); ASSERT_TRUE(label == 0); int32_t test1(234); - ASSERT_TRUE(union_data->set_int32_value(test1, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->set_int32_value(test1, 0) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(union_data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->get_int32_value(test2, 0) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->get_union_label(label) == RETCODE_OK); ASSERT_TRUE(label == 0); int64_t test3(234); int64_t test4(0); // Try to get values from invalid indexes and from an invalid element ( not the current one ) - ASSERT_FALSE(union_data->get_int32_value(test2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(union_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(union_data->get_int32_value(test2, 1) == RETCODE_OK); + ASSERT_FALSE(union_data->get_int64_value(test4, 1) == RETCODE_OK); - ASSERT_TRUE(union_data->set_int64_value(test3, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(union_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->set_int64_value(test3, 1) == RETCODE_OK); + ASSERT_TRUE(union_data->get_int64_value(test4, 1) == RETCODE_OK); ASSERT_TRUE(test3 == test4); - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->get_union_label(label) == RETCODE_OK); ASSERT_TRUE(label == 1); // Serialize <-> Deserialize Test @@ -3617,11 +3617,11 @@ TEST_F(DynamicTypesTests, DynamicType_union_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); ASSERT_TRUE(data3->equals(union_data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == RETCODE_OK); // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(union_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(union_data) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -3643,17 +3643,17 @@ TEST_F(DynamicTypesTests, DynamicType_union_with_unions_unit_tests) ASSERT_TRUE(union_type_builder != nullptr); // Add members to the union. - ASSERT_TRUE(union_type_builder->add_member(0, "first", base_type, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_type_builder->add_member(0, "first", base_type, "", { 0 }, true) == RETCODE_OK); ASSERT_TRUE(union_type_builder->add_member(1, "second", base_type2, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); + false) == RETCODE_OK); // Try to add a second "DEFAULT" value to the union ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 0 }, - true) == ReturnCode_t::RETCODE_OK); + true) == RETCODE_OK); // Try to add a second value to the same case label ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); + false) == RETCODE_OK); // Create a data of this union auto union_type = union_type_builder->build(); @@ -3665,9 +3665,9 @@ TEST_F(DynamicTypesTests, DynamicType_union_with_unions_unit_tests) // Add Members to the parent union ASSERT_TRUE(parent_union_type_builder->add_member(0, "first", base_type, "", { 0 }, - true) == ReturnCode_t::RETCODE_OK); + true) == RETCODE_OK); ASSERT_TRUE(parent_union_type_builder->add_member(1, "second", union_type, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); + false) == RETCODE_OK); DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type( parent_union_type_builder.get()); @@ -3676,19 +3676,19 @@ TEST_F(DynamicTypesTests, DynamicType_union_with_unions_unit_tests) ASSERT_TRUE(union_data != nullptr); // Set and get the child values. - ASSERT_FALSE(union_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(union_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(union_data->set_int32_value(10, 1) == RETCODE_OK); + ASSERT_FALSE(union_data->set_string_value("", MEMBER_ID_INVALID) == RETCODE_OK); uint64_t label; - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->get_union_label(label) == RETCODE_OK); ASSERT_TRUE(label == 0); int32_t test1(234); - ASSERT_TRUE(union_data->set_int32_value(test1, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->set_int32_value(test1, 0) == RETCODE_OK); int32_t test2(0); - ASSERT_TRUE(union_data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->get_int32_value(test2, 0) == RETCODE_OK); ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->get_union_label(label) == RETCODE_OK); ASSERT_TRUE(label == 0); // Loan Value ( Activates this union id ) @@ -3699,15 +3699,15 @@ TEST_F(DynamicTypesTests, DynamicType_union_with_unions_unit_tests) int64_t test4(0); // Try to get values from invalid indexes and from an invalid element ( not the current one ) - ASSERT_FALSE(child_data->get_int32_value(test2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(child_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(child_data->get_int32_value(test2, 1) == RETCODE_OK); + ASSERT_FALSE(child_data->get_int64_value(test4, 1) == RETCODE_OK); - ASSERT_TRUE(child_data->set_int64_value(test3, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(child_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(child_data->set_int64_value(test3, 1) == RETCODE_OK); + ASSERT_TRUE(child_data->get_int64_value(test4, 1) == RETCODE_OK); ASSERT_TRUE(test3 == test4); - ASSERT_TRUE(union_data->return_loaned_value(child_data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(union_data->return_loaned_value(child_data) == RETCODE_OK); + ASSERT_TRUE(union_data->get_union_label(label) == RETCODE_OK); ASSERT_TRUE(label == 1); // Serialize <-> Deserialize Test @@ -3721,10 +3721,10 @@ TEST_F(DynamicTypesTests, DynamicType_union_with_unions_unit_tests) ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); ASSERT_TRUE(data2->equals(union_data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == RETCODE_OK); // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(union_data) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(union_data) == RETCODE_OK); } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); @@ -4827,8 +4827,8 @@ TEST_F(DynamicTypesTests, DynamicType_bounded_string_unit_tests) SerializedPayload_t static_payload(static_payloadSize); ASSERT_TRUE(refDatapb.serialize(&refData, &static_payload)); ASSERT_TRUE(static_payload.length == static_payloadSize); - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); delete(pbType); XMLProfileManager::DeleteInstance(); @@ -4860,8 +4860,8 @@ TEST_F(DynamicTypesTests, DynamicType_bounded_wstring_unit_tests) SerializedPayload_t static_payload(static_payloadSize); ASSERT_TRUE(refDatapb.serialize(&refData, &static_payload)); ASSERT_TRUE(static_payload.length == static_payloadSize); - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == RETCODE_OK); + ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == RETCODE_OK); delete(pbType); XMLProfileManager::DeleteInstance(); diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp index 88c0399fa36..56b067c03f8 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp @@ -77,7 +77,7 @@ class DomainParticipantTest : public eprosima::fastdds::dds::DomainParticipant }; /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when create_datawriter fails + * This test checks that enable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when create_datawriter fails * returning a nullptr. * 1. Create participant * 2. Mock create_datawriter so it returns nullptr @@ -116,7 +116,8 @@ TEST_F(StatisticsDomainParticipantMockTests, EnableStatisticsDataWriterFailureCr EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(true)); // 3. enable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ERROR, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); @@ -127,12 +128,12 @@ TEST_F(StatisticsDomainParticipantMockTests, EnableStatisticsDataWriterFailureCr EXPECT_EQ(consumed_entries.size(), 1u); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(participant), ReturnCode_t::RETCODE_OK); + delete_participant(participant), eprosima::fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that disable_statistics_datawriter fails returning RETCODE_ERROR when delete_datawriter fails. + * This test checks that disable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when delete_datawriter fails. * 1. Create a participant * 2. Mock delete_datawriter * 3. Enable a statistics datawriter @@ -168,29 +169,30 @@ TEST_F(StatisticsDomainParticipantMockTests, DisableStatisticsDataWriterFailureD // 3. enable_statistics_datawriter EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); // 4. disable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); EXPECT_CALL(*builtin_pub, delete_datawriter_mock()).WillOnce(testing::Return(false)); EXPECT_CALL(*statistics_participant_impl_test, delete_topic_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), eprosima::fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that disable_statistics_datawriter fails returning RETCODE_ERROR when delete_topic fails. + * This test checks that disable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when delete_topic fails. * 1. Create a participant * 2. Mock delete_topic * 3. Enable a statistics datawriter @@ -223,24 +225,25 @@ TEST_F(StatisticsDomainParticipantMockTests, DisableStatisticsDataWriterFailureD // 3. enable_statistics_datawriter EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // 4. disable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // As the DataWriter has been deleted, the topic has to be removed manually EXPECT_CALL(*statistics_participant_impl_test, delete_topic_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->delete_topic( + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, statistics_participant->delete_topic( dynamic_cast(statistics_participant->lookup_topicdescription( HEARTBEAT_COUNT_TOPIC)))); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), eprosima::fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp index 50fc6ef1239..ea323385edc 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp @@ -41,8 +41,6 @@ namespace fastdds { namespace statistics { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class FooType { public: @@ -187,31 +185,31 @@ TEST_F(StatisticsDomainParticipantTests, NarrowDomainParticipantTest) // 4. Delete DDS entities ASSERT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + fastdds::dds::RETCODE_OK); } /* * This test checks both eprosima::fastdds::statistics::dds::DomainParticipant enable_statistics_datawriter() and * disable_statistics_datawriter() methods. - * 1. If the FASTDDS_STATISTICS compilation flag is not set, check that the methods return RETCODE_UNSUPPORTED. + * 1. If the FASTDDS_STATISTICS compilation flag is not set, check that the methods return fastdds::dds::RETCODE_UNSUPPORTED. * Check that this error takes precedence over other possible errors. * 2. Narrow DomainParticipant to the children class. * 3. Create TypeSupports. * 4. Check that the types are not registered yet. * 5. Check that the topics do not exist yet. * 6. Enable each statistics DataWriter checking that topics are created and types are registered. - * 7. Enable an already enabled statistics DataWriter and check that it returns RETCODE_OK. - * 8. Call enable_statistics_datawriter method with an invalid topic name and check that returns RETCODE_BAD_PARAMETER. + * 7. Enable an already enabled statistics DataWriter and check that it returns fastdds::dds::RETCODE_OK. + * 8. Call enable_statistics_datawriter method with an invalid topic name and check that returns fastdds::dds::RETCODE_BAD_PARAMETER. * 9. Disable one statistics DataWriter and check that it is successful. * 10. Enable the previous statistics DataWriter with an inconsistent QoS and check that it returns - * RETCODE_INCONSISTENT_POLICY. - * 11. Check error code precedence: RETCODE_BAD_PARAMETER takes precedence over RETCODE_INCONSISTENT_POLICY. - * The case where the create_datawriter fails returning RETCODE_ERROR is not checked because it only passes the error + * fastdds::dds::RETCODE_INCONSISTENT_POLICY. + * 11. Check error code precedence: fastdds::dds::RETCODE_BAD_PARAMETER takes precedence over fastdds::dds::RETCODE_INCONSISTENT_POLICY. + * The case where the create_datawriter fails returning fastdds::dds::RETCODE_ERROR is not checked because it only passes the error * upstream. - * 12. Try to disable an already disabled statistics DataWriter and check that returns RETCODE_ERROR. + * 12. Try to disable an already disabled statistics DataWriter and check that returns fastdds::dds::RETCODE_ERROR. * 13. Check that if an invalid topic name is provided to the disable_statistics_datawriter method, it returns - * RETCODE_BAD_PARAMETER. - * The case where the delete_datawriter fails returning RETCODE_ERROR is not checked because it only passes the error + * fastdds::dds::RETCODE_BAD_PARAMETER. + * The case where the delete_datawriter fails returning fastdds::dds::RETCODE_ERROR is not checked because it only passes the error * upstream. * 14. Delete DDS entities. */ @@ -231,13 +229,13 @@ TEST_F(StatisticsDomainParticipantTests, EnableDisableStatisticsDataWriterTest) DomainParticipant* statistics_participant = static_cast(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter( HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", inconsistent_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( HISTORY_LATENCY_TOPIC)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( "INVALID_TOPIC")); #else // 2. Narrow DomainParticipant to eprosima::fastdds::statistics::dds::DomainParticipant @@ -285,202 +283,202 @@ TEST_F(StatisticsDomainParticipantTests, EnableDisableStatisticsDataWriterTest) EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); // 6. Enable each statistics DataWriter checking that topics are created and types are registered. - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_TRUE(history_latency_type == statistics_participant->find_type(history_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NETWORK_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NETWORK_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(NETWORK_LATENCY_TOPIC)); EXPECT_TRUE(network_latency_type == statistics_participant->find_type(network_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter( PUBLICATION_THROUGHPUT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PUBLICATION_THROUGHPUT_TOPIC)); EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter( SUBSCRIPTION_THROUGHPUT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_SENT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_SENT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RTPS_SENT_TOPIC)); EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_LOST_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_LOST_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RTPS_LOST_TOPIC)); EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RESENT_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RESENT_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RESENT_DATAS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(ACKNACK_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(ACKNACK_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(ACKNACK_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NACKFRAG_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NACKFRAG_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(NACKFRAG_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(GAP_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(GAP_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(GAP_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DATA_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DATA_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(DATA_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PDP_PACKETS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PDP_PACKETS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(EDP_PACKETS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(EDP_PACKETS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(EDP_PACKETS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DISCOVERY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DISCOVERY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(DISCOVERY_TOPIC)); EXPECT_TRUE(discovery_type == statistics_participant->find_type(discovery_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(SAMPLE_DATAS_TOPIC)); EXPECT_TRUE(sample_identity_count_type == statistics_participant->find_type( sample_identity_count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); EXPECT_TRUE(physical_data_type == statistics_participant->find_type(physical_data_type.get_type_name())); // 7. Enable an already enabled statistics DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); // 8. Invalid topic name - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", STATISTICS_DATAWRITER_QOS)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription("INVALID_TOPIC")); // 9. Disable statistics DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(history_latency_type.get_type_name())); // 10. Enable previous statistics DataWriter with an inconsistent QoS - EXPECT_EQ(ReturnCode_t::RETCODE_INCONSISTENT_POLICY, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_INCONSISTENT_POLICY, statistics_participant->enable_statistics_datawriter( HISTORY_LATENCY_TOPIC, inconsistent_qos)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(history_latency_type.get_type_name())); - // 11. RETCODE_BAD_PARAMETER error has precedence over RETCODE_INCONSISTENT_POLICY - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + // 11. fastdds::dds::RETCODE_BAD_PARAMETER error has precedence over fastdds::dds::RETCODE_INCONSISTENT_POLICY + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", inconsistent_qos)); // 12. Disable already disabled DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); // 13. Disable invalid topic name - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->disable_statistics_datawriter( "INVALID_TOPIC")); // 14. Remove DDS entities - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NETWORK_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NETWORK_LATENCY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(NETWORK_LATENCY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(network_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( PUBLICATION_THROUGHPUT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PUBLICATION_THROUGHPUT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_SENT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_SENT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RTPS_SENT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_LOST_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_LOST_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RTPS_LOST_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RESENT_DATAS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RESENT_DATAS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RESENT_DATAS_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(ACKNACK_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(ACKNACK_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(ACKNACK_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NACKFRAG_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NACKFRAG_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(NACKFRAG_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(GAP_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(GAP_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(GAP_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DATA_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DATA_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(DATA_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PDP_PACKETS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PDP_PACKETS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(EDP_PACKETS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(EDP_PACKETS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(EDP_PACKETS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DISCOVERY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DISCOVERY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(DISCOVERY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(discovery_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(SAMPLE_DATAS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(SAMPLE_DATAS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(SAMPLE_DATAS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(sample_identity_count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PHYSICAL_DATA_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PHYSICAL_DATA_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(physical_data_type.get_type_name())); #endif // FASTDDS_STATISTICS - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> + EXPECT_EQ(fastdds::dds::RETCODE_OK, eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> delete_participant(statistics_participant)); } @@ -555,12 +553,12 @@ TEST_F(StatisticsDomainParticipantTests, CreateParticipantWithInvalidTopicName) EXPECT_EQ(consumed_entries.size(), 2u); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - ReturnCode_t::RETCODE_OK); + fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when there is already a TypeSupport + * This test checks that enable_statistics_datawriter fails returning fastdds::dds::RETCODE_ERROR when there is already a TypeSupport * using a statistics reserved name registered in the participant. * 1. Create a participant and register a TypeSupport using one of the statistics reserved type names. * 2. Call enable_statistics_datawriter and check that it fails. @@ -599,7 +597,7 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); eprosima::fastdds::dds::TypeSupport type = participant->find_type(count_type.get_type_name()); EXPECT_FALSE(count_type == type); @@ -610,7 +608,7 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp // 4. Call enable_statistics_datawriter with an already correctly registered type. EXPECT_EQ(nullptr, participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_TRUE(physical_data_type == participant->find_type(physical_data_type.get_type_name())); EXPECT_NE(nullptr, participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); @@ -622,12 +620,12 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp // delete_participant removes all builtin statistics entities EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when there is already a statistics + * This test checks that enable_statistics_datawriter fails returning fastdds::dds::RETCODE_ERROR when there is already a statistics * Topic created with another type different from the one expected. * 1. Create a participant and register a Topic using one of the statistics reserved topic names and with another type * different from the one expected. Register another Topic correctly. @@ -674,19 +672,19 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); // 3. Check type registration EXPECT_EQ(null_type, participant->find_type(history_latency_type.get_type_name())); // 4. Call enable_statistics_datawriter with correctly created topic - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_TRUE(count_type == participant->find_type(count_type.get_type_name())); // 5. Call enable_statistics_datawriter and check it is successful - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); // 6. Check log error entry @@ -695,9 +693,9 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp EXPECT_EQ(consumed_entries.size(), 1u); // delete_participant removes all builtin statistics entities but not others - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_topic(invalid_topic)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, participant->delete_topic(invalid_topic)); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } @@ -732,15 +730,15 @@ TEST_F(StatisticsDomainParticipantTests, DeleteParticipantAfterDeleteContainedEn DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); // 3. Perform a delete_contained_entities() in the statistics participant - EXPECT_EQ(participant->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(participant->delete_contained_entities(), fastdds::dds::RETCODE_OK); // 4. Delete the participant EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(participant), ReturnCode_t::RETCODE_OK); + delete_participant(participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } diff --git a/test/unittest/statistics/dds/StatisticsQosTests.cpp b/test/unittest/statistics/dds/StatisticsQosTests.cpp index d5c1f73d1f1..ed61dc1d39a 100644 --- a/test/unittest/statistics/dds/StatisticsQosTests.cpp +++ b/test/unittest/statistics/dds/StatisticsQosTests.cpp @@ -321,7 +321,7 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( "NETWORK_LATENCY_TOPIC", "NETWORK_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); network_latency_writer = statistics_publisher->lookup_datawriter(network_latency_name); ASSERT_NE(network_latency_writer, nullptr); @@ -339,7 +339,7 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ret = statistics_participant->enable_statistics_datawriter_with_profile( "SUBSCRIPTION_THROUGHPUT_TOPIC", "SUBSCRIPTION_THROUGHPUT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); subscription_througput_writer = statistics_publisher->lookup_datawriter(subscription_throughput_name); ASSERT_NE(subscription_througput_writer, nullptr); @@ -359,11 +359,11 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ASSERT_EQ(qos4, subscription_througput_writer->get_qos()); // Calling enable_statistics_datawriter_with_profile with a profile that does not exist, - // RETCODE_ERROR must be returned. + // fastdds::dds::RETCODE_ERROR must be returned. ret = statistics_participant->enable_statistics_datawriter_with_profile( "FAKE_TOPIC", "FAKE_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_ERROR, ret); + ASSERT_EQ(fastdds::dds::RETCODE_ERROR, ret); // DATA_COUNT_TOPIC is defined with inconsistent QoS policies, // and configured to be enabled automatically at initialization @@ -376,17 +376,17 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ASSERT_EQ(data_count_writer, nullptr); // Calling enable_statistics_datawriter_with_profile with a profile defined with inconsistent QoS configuration, - // RETCODE_INCONSISTENT_POLICY must be returned. + // fastdds::dds::RETCODE_INCONSISTENT_POLICY must be returned. ret = statistics_participant->enable_statistics_datawriter_with_profile( "HEARTBEAT_COUNT_TOPIC", "HEARTBEAT_COUNT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_INCONSISTENT_POLICY, ret); + ASSERT_EQ(fastdds::dds::RETCODE_INCONSISTENT_POLICY, ret); // There is the possibility to enable a statistics topic with a profile defined with different name: ret = statistics_participant->enable_statistics_datawriter_with_profile( "OTHER_NAME_FOR_PROFILE", "NACKFRAG_COUNT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); std::string nackfrag_count_name = NACKFRAG_COUNT_TOPIC; eprosima::fastdds::dds::DataWriter* nackfrag_count_writer = statistics_publisher->lookup_datawriter(nackfrag_count_name); @@ -417,17 +417,17 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( "HISTORY_LATENCY_TOPIC", "HISTORY_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); ret = statistics_participant->enable_statistics_datawriter_with_profile( "NETWORK_LATENCY_TOPIC", "NETWORK_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); ret = statistics_participant->enable_statistics_datawriter_with_profile( "SUBSCRIPTION_THROUGHPUT_TOPIC", "SUBSCRIPTION_THROUGHPUT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); #endif // FASTDDS_STATISTICS diff --git a/test/unittest/utils/SystemInfoTests.cpp b/test/unittest/utils/SystemInfoTests.cpp index d94a6e4bb34..61e2bb96723 100644 --- a/test/unittest/utils/SystemInfoTests.cpp +++ b/test/unittest/utils/SystemInfoTests.cpp @@ -37,8 +37,6 @@ #define SIZE 512 -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class SystemInfoTests : public ::testing::Test { public: @@ -96,68 +94,69 @@ TEST_F(SystemInfoTests, GetEnvTest) ASSERT_EQ(0, setenv(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, value.c_str(), 1)); ASSERT_EQ(0, setenv(empty_var_name.c_str(), value.c_str(), 1)); #endif // _WIN32 - ASSERT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); // 2. Read environment variable not contained in the file but set in the environment - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(env_var_name, env_value)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(env_var_name, env_value)); EXPECT_EQ(env_value, value); // 3. Read environment variable contained in the file and in the environment: file has priority - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + eprosima::SystemInfo::get_env(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_EQ("localhost:11811", env_value); // 4. Read variable set empty in the file but with a valid value in the environment: file has priority - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(empty_var_name, env_value)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(empty_var_name, env_value)); EXPECT_TRUE(env_value.empty()); // 5. Invalid environment name: neither in the file nor in the environment - EXPECT_EQ(eprosima::SystemInfo::get_env("INVALID_NAME", env_value), ReturnCode_t::RETCODE_NO_DATA); + EXPECT_EQ(eprosima::SystemInfo::get_env("INVALID_NAME", env_value), eprosima::fastdds::dds::RETCODE_NO_DATA); // 6. Bad parameters: empty environment name std::string non_init_string; - EXPECT_EQ(eprosima::SystemInfo::get_env("", env_value), ReturnCode_t::RETCODE_BAD_PARAMETER); - EXPECT_EQ(eprosima::SystemInfo::get_env(non_init_string, env_value), ReturnCode_t::RETCODE_BAD_PARAMETER); + EXPECT_EQ(eprosima::SystemInfo::get_env("", env_value), eprosima::fastdds::dds::RETCODE_BAD_PARAMETER); + EXPECT_EQ(eprosima::SystemInfo::get_env(non_init_string, env_value), eprosima::fastdds::dds::RETCODE_BAD_PARAMETER); // 7. Check that reading the environment variable directly from file returns correctly - ASSERT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(filename, + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_EQ("localhost:11811", env_value); // 8. Check that an empty environment variable returns correctly std::string empty_environment_variable = "EMPTY_ENV_VAR"; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(filename, empty_environment_variable, env_value)); EXPECT_TRUE(env_value.empty()); - // 9. Check that a non-existent tag returns RETCODE_NO_DATA + // 9. Check that a non-existent tag returns eprosima::fastdds::dds::RETCODE_NO_DATA std::string non_existent_env_variable = "NON_EXISTENT_ENV_VARIBLE"; env_value.clear(); - EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, eprosima::SystemInfo::get_env(filename, non_existent_env_variable, env_value)); EXPECT_TRUE(env_value.empty()); - // 10. Check that a non-existent file returns RETCODE_BAD_PARAMETER + // 10. Check that a non-existent file returns eprosima::fastdds::dds::RETCODE_BAD_PARAMETER filename = "non_existent.json"; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_TRUE(env_value.empty()); - // 11. Check that a wrong formatted file returns RETCODE_ERROR + // 11. Check that a wrong formatted file returns eprosima::fastdds::dds::RETCODE_ERROR filename = "empty_environment_test_file.json"; - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ERROR, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_TRUE(env_value.empty()); } /* * This test checks the get_username static method of the SystemInfo class - * The test only checks that the method returns RETCODE_OK and that the username is not an empty string + * The test only checks that the method returns eprosima::fastdds::dds::RETCODE_OK and that the username is not an empty string */ TEST_F(SystemInfoTests, GetUsernameTest) { std::string username; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_username(username)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_username(username)); EXPECT_FALSE(username.empty()); } @@ -204,9 +203,9 @@ TEST_F(SystemInfoTests, FileExistsTest) */ TEST_F(SystemInfoTests, EnvironmentFileTest) { - // 1. Environment variable not set: call to set_environment_variable returns RETCODE_NO_DATA and + // 1. Environment variable not set: call to set_environment_variable returns eprosima::fastdds::dds::RETCODE_NO_DATA and // get_environment_file returns empty - EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, eprosima::SystemInfo::set_environment_file()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, eprosima::SystemInfo::set_environment_file()); EXPECT_TRUE(eprosima::SystemInfo::get_environment_file().empty()); // 2. Set environment file variable and see that it returns correctly @@ -216,7 +215,7 @@ TEST_F(SystemInfoTests, EnvironmentFileTest) #else ASSERT_EQ(0, setenv(eprosima::FASTDDS_ENVIRONMENT_FILE_ENV_VAR, value.c_str(), 1)); #endif // _WIN32 - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); EXPECT_EQ(0, eprosima::SystemInfo::get_environment_file().compare(value)); } diff --git a/test/unittest/xtypes/XTypesTests.cpp b/test/unittest/xtypes/XTypesTests.cpp index d32886e3322..b539a2af14a 100644 --- a/test/unittest/xtypes/XTypesTests.cpp +++ b/test/unittest/xtypes/XTypesTests.cpp @@ -793,44 +793,58 @@ TEST_F(XTypesTests, MemberDescriptorFullyQualifiedName) my_builder->add_member(member_id, "z", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); my_builder->set_name("Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t1", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t1", my_builder->build())); my_builder->set_name("Position_"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t2", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t2", my_builder->build())); my_builder->set_name("Position123"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t3", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t3", my_builder->build())); my_builder->set_name("position_123"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t4", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t4", my_builder->build())); my_builder->set_name("_Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t5", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "t5", my_builder->build())); my_builder->set_name("123Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t6", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "t6", my_builder->build())); my_builder->set_name("Position&"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t7", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "t7", my_builder->build())); my_builder->set_name("my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t8", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t8", my_builder->build())); my_builder->set_name("my_interface:action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t9", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "t9", my_builder->build())); my_builder->set_name("my_interface:::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tA", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tA", my_builder->build())); my_builder->set_name("_my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tB", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tB", my_builder->build())); my_builder->set_name("1my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tC", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tC", my_builder->build())); my_builder->set_name(":my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tD", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tD", my_builder->build())); my_builder->set_name("::my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tE", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tE", my_builder->build())); my_builder->set_name("$my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tF", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tF", my_builder->build())); my_builder->set_name("my_interface::2action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tG", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tG", my_builder->build())); my_builder->set_name("my_interface::_action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tH", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tH", my_builder->build())); my_builder->set_name("my_interface::*action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tI", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tI", my_builder->build())); my_builder->set_name("my_interface::action*::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tJ", my_builder->build())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + my_builder->add_member(member_id++, "tJ", my_builder->build())); } int main( diff --git a/test/xtypes/TestPublisher.cpp b/test/xtypes/TestPublisher.cpp index 5076ee6eda4..18d55a66da3 100644 --- a/test/xtypes/TestPublisher.cpp +++ b/test/xtypes/TestPublisher.cpp @@ -354,5 +354,5 @@ bool TestPublisher::register_discovered_type() TypeSupport type(disc_type_); type->auto_fill_type_object(true); type->auto_fill_type_information(true); - return type.register_type(mp_participant, disc_type_->get_name()) == ReturnCode_t::RETCODE_OK; + return type.register_type(mp_participant, disc_type_->get_name()) == RETCODE_OK; } diff --git a/test/xtypes/TestSubscriber.cpp b/test/xtypes/TestSubscriber.cpp index b524fba7a7e..8976cff22b2 100644 --- a/test/xtypes/TestSubscriber.cpp +++ b/test/xtypes/TestSubscriber.cpp @@ -274,7 +274,7 @@ void TestSubscriber::SubListener::on_data_available( eprosima::fastdds::dds::DataReader* reader) { SampleInfo info; - if (!!reader->take_next_sample(mParent->m_Data, &info)) + if (RETCODE_OK == reader->take_next_sample(mParent->m_Data, &info)) { if (info.valid_data) { @@ -369,7 +369,7 @@ bool TestSubscriber::register_discovered_type() TypeSupport type(disc_type_); type->auto_fill_type_object(true); type->auto_fill_type_information(true); - return type.register_type(mp_participant, disc_type_->get_name()) == ReturnCode_t::RETCODE_OK; + return type.register_type(mp_participant, disc_type_->get_name()) == RETCODE_OK; } void TestSubscriber::run() diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index 29cc0f5e172..9311daf7129 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -117,7 +117,7 @@ int fastdds_discovery_server( sXMLConfigFile = sXMLConfigFile.substr(delimiter_pos + 1, sXMLConfigFile.length()); } - if (ReturnCode_t::RETCODE_OK != DomainParticipantFactory::get_instance()->load_XML_profiles_file( + if (RETCODE_OK != DomainParticipantFactory::get_instance()->load_XML_profiles_file( sXMLConfigFile)) { std::cout << "Cannot open XML file " << sXMLConfigFile << ". Please, check the path of this " @@ -145,7 +145,7 @@ int fastdds_discovery_server( } #endif // ifdef _WIN32 // Set default participant QoS from XML file - if (ReturnCode_t::RETCODE_OK != DomainParticipantFactory::get_instance()->load_profiles()) + if (RETCODE_OK != DomainParticipantFactory::get_instance()->load_profiles()) { std::cout << "Error setting default DomainParticipantQos from XML default profile." << std::endl; return 1; @@ -154,7 +154,7 @@ int fastdds_discovery_server( } else { - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != DomainParticipantFactory::get_instance()->get_participant_qos_from_profile( profile, participantQos)) {