diff --git a/doc/aspice_swe3_4/example/iceoryx_component/test/moduletests/test_component_modules.cpp b/doc/aspice_swe3_4/example/iceoryx_component/test/moduletests/test_component_modules.cpp index d0b54e48d4..00cd62489e 100644 --- a/doc/aspice_swe3_4/example/iceoryx_component/test/moduletests/test_component_modules.cpp +++ b/doc/aspice_swe3_4/example/iceoryx_component/test/moduletests/test_component_modules.cpp @@ -19,7 +19,6 @@ using namespace ::testing; using ::testing::_; -using ::testing::Return; int main(int argc, char* argv[]) diff --git a/doc/aspice_swe3_4/example/iceoryx_component/test/moduletests/test_example_base_class.cpp b/doc/aspice_swe3_4/example/iceoryx_component/test/moduletests/test_example_base_class.cpp index 5f6b23f17c..3f9f827a3c 100644 --- a/doc/aspice_swe3_4/example/iceoryx_component/test/moduletests/test_example_base_class.cpp +++ b/doc/aspice_swe3_4/example/iceoryx_component/test/moduletests/test_example_base_class.cpp @@ -20,13 +20,10 @@ #include #include +namespace +{ using namespace ::testing; -using ::testing::Return; -namespace example -{ -namespace test -{ /// @req IOX_SWRS_112, IOX_SWRS_200 /// @brief Test goal: "This test suite verifies that the BaseClass function is verified" /// @pre describe what needs to be done in setup() @@ -51,5 +48,4 @@ TEST_F(ExampleBaseClass_test, GetMemberVariableFromCtor) EXPECT_THAT(sut2.getMemberVariable(), Eq(99U)); } -} // namespace test -} // namespace example \ No newline at end of file +} // namespace diff --git a/iceoryx_binding_c/test/moduletests/main.cpp b/iceoryx_binding_c/test/moduletests/main.cpp index d6a24275a2..77fe11c888 100644 --- a/iceoryx_binding_c/test/moduletests/main.cpp +++ b/iceoryx_binding_c/test/moduletests/main.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +19,6 @@ using namespace ::testing; using ::testing::_; -using ::testing::Return; int main(int argc, char* argv[]) { diff --git a/iceoryx_dds/test/moduletests/main.cpp b/iceoryx_dds/test/moduletests/main.cpp index d6a24275a2..77fe11c888 100644 --- a/iceoryx_dds/test/moduletests/main.cpp +++ b/iceoryx_dds/test/moduletests/main.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +19,6 @@ using namespace ::testing; using ::testing::_; -using ::testing::Return; int main(int argc, char* argv[]) { diff --git a/iceoryx_dds/test/moduletests/test_iox_to_dds.cpp b/iceoryx_dds/test/moduletests/test_iox_to_dds.cpp index b10b9b20e6..83ff178854 100644 --- a/iceoryx_dds/test/moduletests/test_iox_to_dds.cpp +++ b/iceoryx_dds/test/moduletests/test_iox_to_dds.cpp @@ -35,7 +35,6 @@ using namespace ::testing; using ::testing::_; using ::testing::InSequence; -using ::testing::Return; using ::testing::SetArgPointee; // ======================================== Helpers ======================================== // diff --git a/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_service_discovery.hpp b/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_service_discovery.hpp deleted file mode 100644 index 742be9f7d4..0000000000 --- a/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_service_discovery.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. -// -// 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. -// -// SPDX-License-Identifier: Apache-2.0 - -#ifndef IOX_POSH_SERVICE_DISCOVERY_TEST_ROUDI_SERVICE_DISCOVERY_HPP -#define IOX_POSH_SERVICE_DISCOVERY_TEST_ROUDI_SERVICE_DISCOVERY_HPP - -#include "iceoryx_posh/testing/roudi_gtest.hpp" - -using iox::capro::IdString_t; -using iox::runtime::InstanceContainer; - -template -class vector_init_list : public iox::cxx::vector -{ - public: - vector_init_list(std::initializer_list l) - { - for (auto& i : l) - { - iox::cxx::vector::push_back(i); - } - } -}; - -class RouDiServiceDiscoveryTest : public RouDi_GTest -{ - protected: - void InitContainer(InstanceContainer& dest, std::vector src) - { - dest.clear(); - for (size_t i = 0; i < src.size(); i++) - { - dest.push_back(IdString_t(iox::cxx::TruncateToCapacity, src[i])); - } - } -}; - -#endif // IOX_POSH_SERVICE_DISCOVERY_TEST_ROUDI_SERVICE_DISCOVERY_HPP diff --git a/iceoryx_posh/test/integrationtests/test_interface_port_stack_blowup.cpp b/iceoryx_posh/test/integrationtests/test_interface_port_stack_blowup.cpp index ff7970dc55..f4298b138d 100644 --- a/iceoryx_posh/test/integrationtests/test_interface_port_stack_blowup.cpp +++ b/iceoryx_posh/test/integrationtests/test_interface_port_stack_blowup.cpp @@ -22,8 +22,9 @@ #include "test.hpp" +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::gw; @@ -42,3 +43,5 @@ TEST_F(InterfacePortRequestStackBlowup_test, RouDiMustContinue) // we don't care if there are capro messages or not, we just want to have a check that there was no segfault EXPECT_THAT(sut.getCaProMessage(caproMessage), AnyOf(true, false)); } + +} // namespace diff --git a/iceoryx_posh/test/integrationtests/test_mq_interface_startup_race.cpp b/iceoryx_posh/test/integrationtests/test_mq_interface_startup_race.cpp index e69d4cce27..167e9f5d38 100644 --- a/iceoryx_posh/test/integrationtests/test_mq_interface_startup_race.cpp +++ b/iceoryx_posh/test/integrationtests/test_mq_interface_startup_race.cpp @@ -29,6 +29,8 @@ #include #include +namespace +{ using namespace ::testing; using namespace iox; using namespace iox::units; @@ -266,3 +268,5 @@ TEST_F(CMqInterfaceStartupRace_test, ObsoleteRegAck) auto response = m_appQueue->timedReceive(10_ms); EXPECT_THAT(response.has_error(), Eq(true)); } + +} // namespace diff --git a/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp b/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp index efb132e272..cd44be8433 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp @@ -29,12 +29,13 @@ #include #include +namespace +{ using namespace ::testing; using namespace iox::popo; using namespace iox::cxx; using namespace iox::mepoo; using namespace iox::posix; -using ::testing::Return; struct DummySample { @@ -252,3 +253,5 @@ TEST_F(ChunkBuildingBlocks_IntegrationTest, TwoHopsThreeThreadsNoSoFi) ASSERT_FALSE(m_chunkReceiver.hasLostChunks()); EXPECT_EQ(m_sendCounter, m_receiveCounter); } + +} // namespace diff --git a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp index 816b1cd6fd..0ae07a82c7 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp @@ -32,13 +32,14 @@ #include #include +namespace +{ using namespace ::testing; using namespace iox::popo; using namespace iox::capro; using namespace iox::cxx; using namespace iox::mepoo; using namespace iox::posix; -using ::testing::Return; struct DummySample { @@ -383,3 +384,5 @@ TIMING_TEST_F(PortUser_IntegrationTest, MultiProducer, Repeat(5), [&] { TIMING_TEST_EXPECT_TRUE(m_sendCounter.load(std::memory_order_relaxed) == m_receiveCounter); TIMING_TEST_EXPECT_FALSE(PortUser_IntegrationTest::m_subscriberPortUserMultiProducer.hasLostChunksSinceLastCall()); }); + +} // namespace diff --git a/iceoryx_posh/test/integrationtests/test_popo_pub_sub_listener.cpp b/iceoryx_posh/test/integrationtests/test_popo_pub_sub_listener.cpp index d8900284cf..8f1391bcff 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_pub_sub_listener.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_pub_sub_listener.cpp @@ -22,15 +22,14 @@ #include "test.hpp" +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::popo; using namespace iox::capro; using namespace iox::runtime; -namespace -{ void onSampleReceivedCallback(Subscriber* subscriber IOX_MAYBE_UNUSED) { } @@ -58,7 +57,6 @@ class PubSubListener_IntegrationTest : public RouDi_GTest std::unique_ptr> m_subscriber; std::unique_ptr m_untypedSubscriber; }; -} // namespace /// @note Here we test that the trigger reset methods are called correctly in the d'tor of SubscriberImpl. They must not /// be called in the BaseSubscriber d'tor since the SubscriberImpl was attached to the Listener. When it goes out of @@ -90,3 +88,4 @@ TEST_F(PubSubListener_IntegrationTest, UntypedSubscriberGoesOutOfScopeAndDetachi m_untypedSubscriber.reset(); } +} // namespace diff --git a/iceoryx_posh/test/integrationtests/test_posh_integration.cpp b/iceoryx_posh/test/integrationtests/test_posh_integration.cpp index 6f0bd76b17..232714c6a7 100644 --- a/iceoryx_posh/test/integrationtests/test_posh_integration.cpp +++ b/iceoryx_posh/test/integrationtests/test_posh_integration.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +21,6 @@ using namespace ::testing; using ::testing::_; -using ::testing::Return; int main(int argc, char* argv[]) { diff --git a/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp b/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp index c8ca007828..026b2284ac 100644 --- a/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp +++ b/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp @@ -40,11 +40,12 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::units::duration_literals; using iox::mepoo::MePooConfig; using iox::roudi::RouDiEnvironment; -using ::testing::Return; using iox::posix::Timer; @@ -445,3 +446,5 @@ TIMING_TEST_F(Mepoo_IntegrationTest, MempoolCreationTimeDefaultConfig, Repeat(5) auto maxtime = 2000_ms; EXPECT_THAT(timediff, Le(maxtime)); }); + +} // namespace diff --git a/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp b/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp index 45c727a9bb..4f1f425843 100644 --- a/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp +++ b/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp @@ -30,15 +30,14 @@ #include "test.hpp" +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox; using namespace iox::popo; using namespace iox::cxx; -namespace -{ template struct ComplexDataType { @@ -81,7 +80,6 @@ class PublisherSubscriberCommunication_test : public RouDi_GTest capro::ServiceDescription m_serviceDescription{ "PublisherSubscriberCommunication", "IntegrationTest", "AllHailHypnotoad"}; }; -} // namespace TEST_F(PublisherSubscriberCommunication_test, SendingComplexDataType_forward_list) { @@ -464,3 +462,5 @@ TEST_F(PublisherSubscriberCommunication_test, MixedOptionsSetupWorksWithBlocking EXPECT_THAT(subscriberNonBlocking->take().has_error(), Eq(true)); } + +} // namespace diff --git a/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_findservice.cpp b/iceoryx_posh/test/integrationtests/test_roudi_findservice.cpp similarity index 97% rename from iceoryx_posh/test/integrationtests/service_discovery/test_roudi_findservice.cpp rename to iceoryx_posh/test/integrationtests/test_roudi_findservice.cpp index 0eb1ad379a..9ae5c67043 100644 --- a/iceoryx_posh/test/integrationtests/service_discovery/test_roudi_findservice.cpp +++ b/iceoryx_posh/test/integrationtests/test_roudi_findservice.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019, 2021 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,10 +16,15 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iceoryx_posh/testing/roudi_gtest.hpp" #include "iceoryx_utils/cxx/convert.hpp" -#include "test_roudi_service_discovery.hpp" -class RoudiFindService_test : public RouDiServiceDiscoveryTest +namespace +{ +using iox::capro::IdString_t; +using iox::runtime::InstanceContainer; + +class RoudiFindService_test : public RouDi_GTest { public: void SetUp() @@ -195,7 +201,9 @@ TEST_F(RoudiFindService_test, SubscribeAnyInstance) senderRuntime->offerService({"service1", "instance3"}); this->InterOpWait(); InstanceContainer instanceContainerExp; - InitContainer(instanceContainerExp, {"instance1", "instance2", "instance3"}); + instanceContainerExp.push_back("instance1"); + instanceContainerExp.push_back("instance2"); + instanceContainerExp.push_back("instance3"); auto instanceContainer = receiverRuntime->findService({"service1", iox::capro::AnyServiceString}); @@ -397,3 +405,5 @@ TEST_F(RoudiFindService_test, findServiceInstanceContainerOverflowError) ASSERT_THAT(instanceContainer.has_error(), Eq(true)); } + +} // namespace diff --git a/iceoryx_posh/test/integrationtests/test_roudi_roudi_environment.cpp b/iceoryx_posh/test/integrationtests/test_roudi_roudi_environment.cpp index dbcf1dddda..59a335ac5c 100644 --- a/iceoryx_posh/test/integrationtests/test_roudi_roudi_environment.cpp +++ b/iceoryx_posh/test/integrationtests/test_roudi_roudi_environment.cpp @@ -19,9 +19,10 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; -using ::testing::Return; class RouDiEnvironment_test : public Test { @@ -35,3 +36,5 @@ TEST_F(RouDiEnvironment_test, StartingRouDiTwiceLeadsToError) RouDiEnvironment m_sut{iox::RouDiConfig_t().setDefaults()}; EXPECT_DEATH({ RouDiEnvironment m_sut2{iox::RouDiConfig_t().setDefaults()}; }, ".*"); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_base_port.cpp b/iceoryx_posh/test/moduletests/test_base_port.cpp index f7c5331477..ec0890701a 100644 --- a/iceoryx_posh/test/moduletests/test_base_port.cpp +++ b/iceoryx_posh/test/moduletests/test_base_port.cpp @@ -28,6 +28,8 @@ #include "iceoryx_utils/cxx/helplets.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::capro; using namespace iox::popo; @@ -175,3 +177,5 @@ TYPED_TEST(BasePort_test, CallingGetRuntimeNameWorks) using PortData_t = typename TestFixture::PortData_t; EXPECT_THAT(this->sut.getRuntimeName(), Eq(expectedProcessName())); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_capro_message.cpp b/iceoryx_posh/test/moduletests/test_capro_message.cpp index 2a748a4112..f068b6c1e6 100644 --- a/iceoryx_posh/test/moduletests/test_capro_message.cpp +++ b/iceoryx_posh/test/moduletests/test_capro_message.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +22,8 @@ #include "iceoryx_utils/cxx/generic_raii.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::capro; @@ -58,3 +61,5 @@ TEST_F(CaproMessage_test, DefaultArgsOfCtor) EXPECT_EQ(CaproMessageSubType::NOSUBTYPE, testObj.m_subType); EXPECT_EQ(nullptr, testObj.m_chunkQueueData); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_capro_service.cpp b/iceoryx_posh/test/moduletests/test_capro_service.cpp index 64271e6bc4..17d25ea4ef 100644 --- a/iceoryx_posh/test/moduletests/test_capro_service.cpp +++ b/iceoryx_posh/test/moduletests/test_capro_service.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019, 2021 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,8 +24,9 @@ #include +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::capro; @@ -675,3 +677,5 @@ TEST_F(ServiceDescription_test, LessThanOperatorReturnsFalseIfEventStringOfFirst } /// END SERVICEDESCRIPTION TESTS + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_compatibility_check_level.cpp b/iceoryx_posh/test/moduletests/test_compatibility_check_level.cpp index 6724173a23..1515c37329 100644 --- a/iceoryx_posh/test/moduletests/test_compatibility_check_level.cpp +++ b/iceoryx_posh/test/moduletests/test_compatibility_check_level.cpp @@ -25,6 +25,8 @@ #include #include +namespace +{ using namespace ::testing; using namespace iox::version; @@ -122,3 +124,5 @@ TEST_F(CompatibilityCheckLevel_test, BuildDateLeadsToCorrectString) EXPECT_THAT(m_loggerMock.m_logs[0].message, Eq("CompatibilityCheckLevel::BUILD_DATE")); EXPECT_THAT(m_loggerMock.m_logs[0].level, Eq(iox::log::LogLevel::kWarn)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_fixed_size_container.cpp b/iceoryx_posh/test/moduletests/test_fixed_size_container.cpp index 2c9812c58a..089c05ea94 100644 --- a/iceoryx_posh/test/moduletests/test_fixed_size_container.cpp +++ b/iceoryx_posh/test/moduletests/test_fixed_size_container.cpp @@ -1,4 +1,5 @@ -// Copyright (c) 2019, 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. +// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,8 +20,9 @@ #include +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::roudi; @@ -201,3 +203,5 @@ TEST_F(FixedSizeContainer_test, removeAndVerifyMultiElementContainer) } } } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_gw_channel.cpp b/iceoryx_posh/test/moduletests/test_gw_channel.cpp index 4a83c22775..34f2eee778 100644 --- a/iceoryx_posh/test/moduletests/test_gw_channel.cpp +++ b/iceoryx_posh/test/moduletests/test_gw_channel.cpp @@ -20,6 +20,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using ::testing::_; @@ -58,3 +60,5 @@ TEST_F(ChannelTest, ReturnsEmptyOptionalIfObjectPoolExhausted) {"", "", ""}, StubbedIceoryxTerminal::Options()); EXPECT_FALSE(channel.has_error()); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp b/iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp index f9cf5fba6d..99d5e77006 100644 --- a/iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp +++ b/iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp @@ -1,4 +1,5 @@ -// Copyright (c) 2019, 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. +// Copyright (c) 2019 - 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,8 +20,9 @@ #include "iceoryx_posh/gateway/gateway_discovery.hpp" #include "iceoryx_posh/internal/popo/ports/base_port.hpp" +namespace +{ using namespace ::testing; -using ::testing::Return; using CaproMessage = iox::capro::CaproMessage; using BasePort = iox::popo::BasePort; @@ -65,3 +67,5 @@ TEST_F(GatewayDiscovery_test, GetCaproMessage) EXPECT_EQ(iox::capro::CaproMessageType::ACK, msg.m_type); EXPECT_EQ(iox::capro::ServiceDescription(), msg.m_serviceDescription); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_gw_gateway_generic.cpp b/iceoryx_posh/test/moduletests/test_gw_gateway_generic.cpp index 7e59b15bd0..7048a4797f 100644 --- a/iceoryx_posh/test/moduletests/test_gw_gateway_generic.cpp +++ b/iceoryx_posh/test/moduletests/test_gw_gateway_generic.cpp @@ -25,6 +25,8 @@ #include "stubs/stub_gateway_generic.hpp" +namespace +{ using namespace ::testing; using namespace iox::units::duration_literals; using ::testing::_; @@ -262,3 +264,5 @@ TEST_F(GatewayGenericTest, ForEachChannelExecutesGivenFunctionForAllStoredChanne EXPECT_EQ(3U, count); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_mepoo_mempool.cpp b/iceoryx_posh/test/moduletests/test_mepoo_mempool.cpp index c81b9a426a..40e2281b4e 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_mempool.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_mempool.cpp @@ -19,6 +19,8 @@ #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::mepoo; @@ -217,3 +219,5 @@ TEST_F(MemPool_test, dieWhenMempoolChunkSizeIsNotPowerOf32) { EXPECT_DEATH({ iox::mepoo::MemPool sut(333, 10, allocator, allocator); }, ".*"); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp index eea9ed9f77..de530a3cf0 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp @@ -30,10 +30,6 @@ #include #include -using namespace ::testing; -using namespace iox::mepoo; -using namespace iox::posix; - namespace iox { namespace cxx @@ -48,6 +44,13 @@ struct ErrorTypeAdapter }; } // namespace cxx } // namespace iox + +namespace +{ +using namespace ::testing; +using namespace iox::mepoo; +using namespace iox::posix; + class MePooSegment_test : public Test { public: @@ -205,3 +208,5 @@ TEST_F(MePooSegment_test, ADD_TEST_WITH_ADDITIONAL_USER(GetMemoryManager)) auto chunk = sut.getMemoryManager().getChunk(chunkSettings); EXPECT_THAT(chunk.getChunkHeader()->userPayloadSize(), Eq(USER_PAYLOAD_SIZE)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp b/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp index 9beb7462a2..cb587e9f80 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp @@ -27,6 +27,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::mepoo; using namespace iox::posix; @@ -196,3 +198,5 @@ TEST_F(SegmentManager_test, ADD_TEST_WITH_ADDITIONAL_USER(addingMaximumNumberOfS SegmentConfig segmentConfig = getSegmentConfigWithMaximumNumberOfSegements(); SegmentManager sut{segmentConfig, &allocator}; } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_mepoo_shared_chunk.cpp b/iceoryx_posh/test/moduletests/test_mepoo_shared_chunk.cpp index eaac91791d..459d15ad21 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_shared_chunk.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_shared_chunk.cpp @@ -21,6 +21,8 @@ #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::mepoo; @@ -270,3 +272,5 @@ TEST_F(SharedChunk_Test, MultipleChunksCleanup) EXPECT_THAT(mempool.getUsedChunks(), Eq(1)); EXPECT_THAT(chunkMgmtPool.getUsedChunks(), Eq(1)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_mepoo_shared_pointer.cpp b/iceoryx_posh/test/moduletests/test_mepoo_shared_pointer.cpp index b8008f0ae3..ba10f64bca 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_shared_pointer.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_shared_pointer.cpp @@ -22,6 +22,8 @@ #include "iceoryx_utils/internal/relocatable_pointer/base_relative_pointer.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::mepoo; @@ -361,3 +363,5 @@ TEST_F(SharedPointer_Test, SharedPointerWithContentIsValid) auto sut3 = SharedPointer::create(chunk3, 1, 2).value(); EXPECT_THAT(static_cast(sut3), Eq(true)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp b/iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp index 4d15ed2093..e91e40108b 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp @@ -22,6 +22,24 @@ #include "test.hpp" +namespace iox +{ +namespace cxx +{ +template <> +struct ErrorTypeAdapter> +{ + static variant getInvalidState() + { + return variant(iox::cxx::in_place_index<0>(), + mepoo::TypedMemPoolError::INVALID_STATE); + }; +}; +} // namespace cxx +} // namespace iox + +namespace +{ using namespace ::testing; using namespace iox::mepoo; class TypedMemPool_test : public Test @@ -61,22 +79,6 @@ class TypedMemPool_test : public Test TypedMemPool sut; }; -namespace iox -{ -namespace cxx -{ -template <> -struct ErrorTypeAdapter> -{ - static variant getInvalidState() - { - return variant(iox::cxx::in_place_index<0>(), - mepoo::TypedMemPoolError::INVALID_STATE); - }; -}; -} // namespace cxx -} // namespace iox - TEST_F(TypedMemPool_test, GetOneObject) { auto object = sut.createObject(1, 223); @@ -148,3 +150,5 @@ TEST_F(TypedMemPool_Semaphore_test, CreateInvalidSemaphore) iox::posix::CreateNamedSemaphore, "", S_IRUSR | S_IWUSR, 10); EXPECT_THAT(semaphorePtr.has_error(), Eq(true)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_monitoringmode_logstream.cpp b/iceoryx_posh/test/moduletests/test_monitoringmode_logstream.cpp index d666ca3d95..7c6d48e8f9 100644 --- a/iceoryx_posh/test/moduletests/test_monitoringmode_logstream.cpp +++ b/iceoryx_posh/test/moduletests/test_monitoringmode_logstream.cpp @@ -21,6 +21,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; @@ -62,3 +64,5 @@ TEST_F(MonitoringModeLogStreamTest, MonitoringModeOnLeadsToCorrectString) EXPECT_THAT(m_loggerMock.m_logs[0].message, Eq("MonitoringMode::ON")); EXPECT_THAT(m_loggerMock.m_logs[0].level, Eq(iox::log::LogLevel::kWarn)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_mq_message.cpp b/iceoryx_posh/test/moduletests/test_mq_message.cpp index e9bbbc4e26..5d2e832ff0 100644 --- a/iceoryx_posh/test/moduletests/test_mq_message.cpp +++ b/iceoryx_posh/test/moduletests/test_mq_message.cpp @@ -20,6 +20,8 @@ #include "iceoryx_utils/testing/mocks/time_mock.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using iox::runtime::IpcMessage; @@ -433,4 +435,6 @@ TEST_F(IpcMessage_test, setMessage) message1.setMessage("1,2,3,4"); EXPECT_THAT(message1.isValid(), Eq(false)); } + +} // namespace #endif diff --git a/iceoryx_posh/test/moduletests/test_popo_base_publisher.cpp b/iceoryx_posh/test/moduletests/test_popo_base_publisher.cpp index d993670b8d..aa8f2a2bcf 100644 --- a/iceoryx_posh/test/moduletests/test_popo_base_publisher.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_base_publisher.cpp @@ -20,6 +20,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using ::testing::_; @@ -109,3 +111,5 @@ TEST_F(BasePublisherTest, DestroysUnderlyingPortOnDestruction) { EXPECT_CALL(sut.port(), destroy).Times(1); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp index ea0e07dc93..a37920acbf 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp @@ -28,8 +28,9 @@ #include +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::popo; using namespace iox::cxx; using namespace iox::mepoo; @@ -645,3 +646,5 @@ TYPED_TEST(ChunkDistributor_test, MultipleBlockingQueuesWillBeFilledWhenThereBec EXPECT_THAT(this->getSharedChunkValue(*maybeSharedChunk), Eq(1152U)); } } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp index 7e65bbcf84..aabe44255b 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp @@ -28,8 +28,9 @@ #include "test.hpp" +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::popo; using namespace iox::mepoo; @@ -381,3 +382,5 @@ TYPED_TEST(ChunkQueueSoFi_test, LostChunkInfoIsResetAfterRead) EXPECT_FALSE(this->m_popper.hasLostChunks()); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp index be7268efad..ac81b29787 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp @@ -29,6 +29,8 @@ #include +namespace +{ using namespace ::testing; struct DummySample @@ -229,3 +231,5 @@ TEST_F(ChunkReceiver_test, Cleanup) EXPECT_THAT(m_memoryManager.getMemPoolInfo(0).m_usedChunks, Eq(0U)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp index fecfd0e14d..00a5c8e902 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp @@ -35,6 +35,8 @@ #include +namespace +{ using namespace ::testing; struct DummySample @@ -628,3 +630,5 @@ TEST_F(ChunkSender_test, Cleanup) EXPECT_THAT(m_memoryManager.getMemPoolInfo(0).m_usedChunks, Eq(0U)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_condition_variable.cpp b/iceoryx_posh/test/moduletests/test_popo_condition_variable.cpp index ff6f1dc0ee..5dce6e7eaa 100644 --- a/iceoryx_posh/test/moduletests/test_popo_condition_variable.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_condition_variable.cpp @@ -27,8 +27,9 @@ #include #include +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::popo; using namespace iox::cxx; using namespace iox::units::duration_literals; @@ -466,3 +467,5 @@ TEST_F(ConditionVariable_test, TimedWaitReturnsSortedListWhenTriggeredInReverseO waitReturnsSortedListWhenTriggeredInReverseOrder( *this, [this] { return m_waiter.timedWait(iox::units::Duration::fromSeconds(1)); }); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_listener.cpp b/iceoryx_posh/test/moduletests/test_popo_listener.cpp index bea8c78165..03e1d55ab5 100644 --- a/iceoryx_posh/test/moduletests/test_popo_listener.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_listener.cpp @@ -32,8 +32,9 @@ #include #include +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::popo; using namespace iox::cxx; using namespace iox::units::duration_literals; @@ -1160,3 +1161,4 @@ TIMING_TEST_F(Listener_test, AttachingInCallbackWorks, Repeat(5), [&] { // END ////////////////////////////////// +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_notification_info.cpp b/iceoryx_posh/test/moduletests/test_popo_notification_info.cpp index 6447e7df88..9f70c56a1d 100644 --- a/iceoryx_posh/test/moduletests/test_popo_notification_info.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_notification_info.cpp @@ -20,6 +20,8 @@ #include "test.hpp" #include +namespace +{ using namespace iox; using namespace iox::popo; using namespace ::testing; @@ -125,3 +127,5 @@ TEST_F(NotificationInfo_test, triggerCallbackReturnsFalseWithUnsetCallback) m_sut = NotificationInfo{&m_origin, 9U, NotificationCallback{}}; EXPECT_FALSE(m_sut()); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_publisher.cpp b/iceoryx_posh/test/moduletests/test_popo_publisher.cpp index 06a8935bb8..c87b7b88eb 100644 --- a/iceoryx_posh/test/moduletests/test_popo_publisher.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_publisher.cpp @@ -21,13 +21,11 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using ::testing::_; -// anonymous namespace to prevent linker issues or sanitizer false positives -// if a struct with the same name is used in other tests -namespace -{ struct DummyData { DummyData() = default; @@ -42,7 +40,6 @@ struct DummyData }; uint64_t val{defaultVal()}; }; -} // namespace using TestPublisher = iox::popo::PublisherImpl>; @@ -299,3 +296,5 @@ TEST_F(PublisherTest, GetServiceDescriptionCallForwardedToUnderlyingPublisherPor // ===== Test ===== // sut.getServiceDescription(); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_publisher_port.cpp b/iceoryx_posh/test/moduletests/test_popo_publisher_port.cpp index 5a52094dc5..b6d1ae1829 100644 --- a/iceoryx_posh/test/moduletests/test_popo_publisher_port.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_publisher_port.cpp @@ -31,6 +31,8 @@ #include +namespace +{ using namespace ::testing; struct DummySample @@ -550,3 +552,5 @@ TEST_F(PublisherPort_test, cleanupReleasesAllChunks) EXPECT_THAT(m_memoryManager.getMemPoolInfo(0).m_usedChunks, Eq(0U)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_sample.cpp b/iceoryx_posh/test/moduletests/test_popo_sample.cpp index 4d44ac4476..69395b2614 100644 --- a/iceoryx_posh/test/moduletests/test_popo_sample.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_sample.cpp @@ -23,13 +23,11 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using ::testing::_; -// anonymous namespace to prevent linker issues or sanitizer false positives -// if a struct with the same name is used in other tests -namespace -{ struct DummyData { DummyData() = default; @@ -40,7 +38,6 @@ struct DummyHeader DummyHeader() = default; uint64_t counter = 0; }; -} // namespace template class MockPublisherInterface : public iox::popo::PublisherInterface @@ -157,3 +154,5 @@ TEST_F(SampleTest, CallingGetUserHeaderFromConstTypeReturnsCorrectAddress) // ===== Cleanup ===== // } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_subscriber.cpp b/iceoryx_posh/test/moduletests/test_popo_subscriber.cpp index a9354551ab..6a995be896 100644 --- a/iceoryx_posh/test/moduletests/test_popo_subscriber.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_subscriber.cpp @@ -21,18 +21,15 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using ::testing::_; -// anonymous namespace to prevent linker issues or sanitizer false positives -// if a struct with the same name is used in other tests -namespace -{ struct DummyData { uint64_t val = 42; }; -} // namespace template class StubbedSubscriber : public iox::popo::SubscriberImpl @@ -181,3 +178,5 @@ TEST_F(SubscriberTest, ReleasesQueuedDataViaBaseSubscriber) // ===== Verify ===== // // ===== Cleanup ===== // } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_subscriber_port.cpp b/iceoryx_posh/test/moduletests/test_popo_subscriber_port.cpp index 163a72c4f2..ed8ef9645b 100644 --- a/iceoryx_posh/test/moduletests/test_popo_subscriber_port.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_subscriber_port.cpp @@ -32,6 +32,8 @@ #include +namespace +{ using namespace ::testing; class SubscriberPortSingleProducer_test : public Test @@ -521,3 +523,5 @@ TEST_F(SubscriberPortMultiProducer_test, InvalidMessageResultsInError) EXPECT_TRUE(errorHandlerCalled); ASSERT_THAT(receivedError, Eq(iox::Error::kPOPO__CAPRO_PROTOCOL_ERROR)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_toml_gateway_config_parser.cpp b/iceoryx_posh/test/moduletests/test_popo_toml_gateway_config_parser.cpp index 78ae65563d..02215f075d 100644 --- a/iceoryx_posh/test/moduletests/test_popo_toml_gateway_config_parser.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_toml_gateway_config_parser.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,12 +15,14 @@ // // SPDX-License-Identifier: Apache-2.0 +#include "iceoryx/tests/posh/moduletests/test_input_path.hpp" #include "iceoryx_posh/gateway/toml_gateway_config_parser.hpp" #include "stubs/stub_toml_gateway_config_parser.hpp" #include "test.hpp" -#include "iceoryx/tests/posh/moduletests/test_input_path.hpp" +namespace +{ using namespace ::testing; using ::testing::_; @@ -255,3 +258,5 @@ TEST_P(TomlGatewayConfigParserTest, ParseMalformedInputFileCausesError) ASSERT_TRUE(result.has_error()); EXPECT_EQ(parseErrorInputFile.first, result.get_error()); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_trigger.cpp b/iceoryx_posh/test/moduletests/test_popo_trigger.cpp index 81e837d4fe..c8ecb3153f 100644 --- a/iceoryx_posh/test/moduletests/test_popo_trigger.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_trigger.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020, 2021 by Apex.AI Inc. All rights reserved. +// Copyright (c) 2020 - 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ #include "test.hpp" #include +namespace +{ using namespace iox; using namespace iox::popo; using namespace ::testing; @@ -767,3 +769,5 @@ TEST_F(Trigger_test, EventBasedMovedAssignedWithInvalidTrigger) EXPECT_THAT(trigger.getTriggerType(), Eq(TriggerType::INVALID)); EXPECT_FALSE(trigger.isLogicalEqualTo(&m_triggerClass, anotherOriginType, anotherOriginTypeHash)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_trigger_handle.cpp b/iceoryx_posh/test/moduletests/test_popo_trigger_handle.cpp index 4dc9889536..9cdbad3423 100644 --- a/iceoryx_posh/test/moduletests/test_popo_trigger_handle.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_trigger_handle.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020, 2021 by Apex.AI Inc. All rights reserved. +// Copyright (c) 2020 - 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,8 @@ #include "test.hpp" #include +namespace +{ using namespace iox; using namespace iox::popo; using namespace ::testing; @@ -149,3 +151,4 @@ TEST_F(TriggerHandle_test, wasTriggeredReturnsFalseAfterItWasTriggeredAndTheList EXPECT_FALSE(m_sut.wasTriggered()); } +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_typed_unique_id.cpp b/iceoryx_posh/test/moduletests/test_popo_typed_unique_id.cpp index 05eed0bdfe..0471ccaf63 100644 --- a/iceoryx_posh/test/moduletests/test_popo_typed_unique_id.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_typed_unique_id.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +20,8 @@ #include "iceoryx_utils/cxx/generic_raii.hpp" #include "test.hpp" - +namespace +{ using namespace ::testing; using namespace iox::popo; using namespace iox::cxx; @@ -167,3 +169,5 @@ TYPED_TEST(TypedUniqueId_test, InvalidIdIsInvalid) typename TestFixture::UniqueIDType a(InvalidId); EXPECT_FALSE(a.isValid()); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_untyped_subscriber.cpp b/iceoryx_posh/test/moduletests/test_popo_untyped_subscriber.cpp index 68eea5444f..044cddff65 100644 --- a/iceoryx_posh/test/moduletests/test_popo_untyped_subscriber.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_untyped_subscriber.cpp @@ -21,18 +21,15 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using ::testing::_; -// anonymous namespace to prevent linker issues or sanitizer false positives -// if a struct with the same name is used in other tests -namespace -{ struct DummyData { uint64_t val = 42; }; -} // namespace using TestUntypedSubscriber = iox::popo::UntypedSubscriberImpl>; @@ -151,3 +148,5 @@ TEST_F(UntypedSubscriberTest, ReleasesQueuedDataViaBaseSubscriber) // ===== Verify ===== // // ===== Cleanup ===== // } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_user_trigger.cpp b/iceoryx_posh/test/moduletests/test_popo_user_trigger.cpp index d78918fcdc..d233352adb 100644 --- a/iceoryx_posh/test/moduletests/test_popo_user_trigger.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_user_trigger.cpp @@ -21,12 +21,12 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox; using namespace iox::popo; -namespace -{ class WaitSetTest : public iox::popo::WaitSet<> { public: @@ -56,7 +56,6 @@ class UserTrigger_test : public Test m_callbackOrigin = origin; } }; -} // namespace UserTrigger* UserTrigger_test::m_callbackOrigin = nullptr; @@ -189,3 +188,5 @@ TEST_F(UserTrigger_test, UserTriggerCallbackCanBeCalledOverloadWithoutId) (*triggerInfoVector[0U])(); EXPECT_THAT(m_callbackOrigin, &sut); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_popo_waitset.cpp b/iceoryx_posh/test/moduletests/test_popo_waitset.cpp index 89f1f34183..8975900fd7 100644 --- a/iceoryx_posh/test/moduletests/test_popo_waitset.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_waitset.cpp @@ -29,14 +29,13 @@ #include #include +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::popo; using namespace iox::cxx; using namespace iox::units::duration_literals; -namespace -{ class WaitSetTest : public iox::popo::WaitSet<> { public: @@ -396,7 +395,6 @@ SimpleState1 WaitSet_test::SimpleEventClass::m_simpleState1 = SimpleState1::INVA SimpleState2 WaitSet_test::SimpleEventClass::m_simpleState2 = SimpleState2::INVALID; SimpleState1 WaitSet_test::SimpleEventClass::m_simpleState1TriggerCallback = SimpleState1::INVALID; SimpleState2 WaitSet_test::SimpleEventClass::m_simpleState2TriggerCallback = SimpleState2::INVALID; -} // namespace //////////////////////// // BEGIN attach / detach @@ -1460,3 +1458,4 @@ TEST_F(WaitSet_test, TimedWaitUnblocksAfterMarkForDestructionCall) t.join(); } +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_posh_modules.cpp b/iceoryx_posh/test/moduletests/test_posh_modules.cpp index 2581448004..5393ec26ad 100644 --- a/iceoryx_posh/test/moduletests/test_posh_modules.cpp +++ b/iceoryx_posh/test/moduletests/test_posh_modules.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +19,6 @@ using namespace ::testing; using ::testing::_; -using ::testing::Return; int main(int argc, char* argv[]) diff --git a/iceoryx_posh/test/moduletests/test_posh_runtime.cpp b/iceoryx_posh/test/moduletests/test_posh_runtime.cpp index c706e94d49..08fbb0655d 100644 --- a/iceoryx_posh/test/moduletests/test_posh_runtime.cpp +++ b/iceoryx_posh/test/moduletests/test_posh_runtime.cpp @@ -26,6 +26,8 @@ #include +namespace +{ using namespace ::testing; using namespace iox::runtime; using iox::roudi::RouDiEnvironment; @@ -53,15 +55,12 @@ class PoshRuntimeTestAccess : public PoshRuntime } }; -namespace -{ bool callbackWasCalled = false; PoshRuntime& testFactory(iox::cxx::optional name) { callbackWasCalled = true; return PoshRuntimeTestAccess::getDefaultRuntime(name); } -} // namespace class PoshRuntime_test : public Test { @@ -101,12 +100,8 @@ class PoshRuntime_test : public Test IpcMessage m_receiveBuffer; const iox::NodeName_t m_nodeName{"testNode"}; const iox::NodeName_t m_invalidNodeName{"invalidNode,"}; - static bool m_errorHandlerCalled; }; -bool PoshRuntime_test::m_errorHandlerCalled{false}; - - TEST_F(PoshRuntime_test, ValidAppName) { iox::RuntimeName_t appName("valid_name"); @@ -740,3 +735,5 @@ TEST(PoshRuntimeFactory_test, DISABLED_SetEmptyRuntimeFactoryFails) // just in case the previous test doesn't die and breaks the following tests PoshRuntimeTestAccess::resetRuntimeFactory(); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_posh_runtime_node.cpp b/iceoryx_posh/test/moduletests/test_posh_runtime_node.cpp index 47a28ec186..ff57600969 100644 --- a/iceoryx_posh/test/moduletests/test_posh_runtime_node.cpp +++ b/iceoryx_posh/test/moduletests/test_posh_runtime_node.cpp @@ -21,15 +21,13 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::runtime; using namespace iox::roudi; +using namespace iox; - -namespace iox -{ -namespace test -{ /// @brief Test goal: This test suit verifies class node class PoshRuntimeNode_test : public Test @@ -112,5 +110,4 @@ TEST_F(PoshRuntimeNode_test, VerifyMoveConstructorAssignsCorrectNodeName) EXPECT_THAT(nodeTest.getNodeName(), Eq(nodeNewName)); } -} // namespace test -} // namespace iox +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_posh_runtime_node_property.cpp b/iceoryx_posh/test/moduletests/test_posh_runtime_node_property.cpp index 1366461e18..38361b36a5 100644 --- a/iceoryx_posh/test/moduletests/test_posh_runtime_node_property.cpp +++ b/iceoryx_posh/test/moduletests/test_posh_runtime_node_property.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2021 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,15 +20,13 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::runtime; using namespace iox::roudi; +using namespace iox; - -namespace iox -{ -namespace test -{ /// @brief Test goal: This test suit verifies class node class PoshRuntimeNodeProperty_test : public Test @@ -77,5 +76,4 @@ TEST_F(PoshRuntimeNodeProperty_test, ConstructorNodePropertyWithWrongSerializati EXPECT_EQ(sut.m_name, nodeName); } -} // namespace test -} // namespace iox +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_posh_runtime_single_process.cpp b/iceoryx_posh/test/moduletests/test_posh_runtime_single_process.cpp index 519a7f206f..2f66fd9afe 100644 --- a/iceoryx_posh/test/moduletests/test_posh_runtime_single_process.cpp +++ b/iceoryx_posh/test/moduletests/test_posh_runtime_single_process.cpp @@ -20,14 +20,13 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::runtime; using namespace iox::roudi; +using namespace iox; -namespace iox -{ -namespace test -{ /// @brief Test goal: This test suit verifies class posh_runtime_single_process class PoshRuntimeSingleProcess_test : public Test @@ -79,5 +78,4 @@ TEST_F(PoshRuntimeSingleProcess_test, ConstructorPoshRuntimeSingleProcessMultipl EXPECT_THAT(detectedError.value(), Eq(iox::Error::kPOSH__RUNTIME_IS_CREATED_MULTIPLE_TIMES)); } -} // namespace test -} // namespace iox +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_cmd_line_parser.cpp b/iceoryx_posh/test/moduletests/test_roudi_cmd_line_parser.cpp index 8fafa10fd2..9ee9b05888 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_cmd_line_parser.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_cmd_line_parser.cpp @@ -21,7 +21,6 @@ #include "iceoryx_posh/roudi/roudi_cmd_line_parser.hpp" using namespace ::testing; -using ::testing::Return; using namespace iox::roudi; using namespace iox::config; @@ -43,9 +42,7 @@ bool operator==(const CmdLineArgs_t& lhs, const CmdLineArgs_t& rhs) } // namespace config } // namespace iox -namespace iox -{ -namespace test +namespace { class CmdLineParser_test : public Test { @@ -475,6 +472,5 @@ TEST_F(CmdLineParser_test, CmdLineParsingModeEqualToOneHandlesOnlyTheFirstOption EXPECT_TRUE(result.value().run); } -} // namespace test -} // namespace iox +} // namespace #endif diff --git a/iceoryx_posh/test/moduletests/test_roudi_cmd_line_parser_config_file_option.cpp b/iceoryx_posh/test/moduletests/test_roudi_cmd_line_parser_config_file_option.cpp index 9abac58e31..85d39cca49 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_cmd_line_parser_config_file_option.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_cmd_line_parser_config_file_option.cpp @@ -23,16 +23,13 @@ #include +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::cxx; using namespace iox::config; -namespace iox -{ -namespace test -{ class CmdLineParserConfigFileOption_test : public Test { public: @@ -178,7 +175,6 @@ TEST_F(CmdLineParserConfigFileOption_test, CmdLineParsingModeEqualToOneHandleOnl EXPECT_THAT(res.value().configFilePath.c_str(), StrEq(path)); } -} // namespace test -} // namespace iox +} // namespace #endif diff --git a/iceoryx_posh/test/moduletests/test_roudi_config_toml_file_provider.cpp b/iceoryx_posh/test/moduletests/test_roudi_config_toml_file_provider.cpp index 313d08c7fe..abbfe536a2 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_config_toml_file_provider.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_config_toml_file_provider.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2021 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,12 +20,11 @@ #include "iceoryx/tests/posh/moduletests/test_input_path.hpp" #include "test.hpp" -using namespace ::testing; - namespace { +using namespace ::testing; + using ParseErrorInputFile_t = std::pair; -}; class RoudiConfigTomlFileProvider_test : public TestWithParam { @@ -93,3 +93,5 @@ TEST_P(RoudiConfigTomlFileProvider_test, ParseMalformedInputFileCausesError) ASSERT_TRUE(result.has_error()); EXPECT_EQ(parseErrorInputFile.first, result.get_error()); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_generic_memory_block.cpp b/iceoryx_posh/test/moduletests/test_roudi_generic_memory_block.cpp index 017406e246..c882a130aa 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_generic_memory_block.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_generic_memory_block.cpp @@ -21,6 +21,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; @@ -219,3 +221,5 @@ TEST_F(GenericMemoryBlock_NonTrivial_Test, RepetitiveDestroyWithEmplace) EXPECT_THAT(NonTrivialClass::s_destructorCounter, Eq(1u)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_iceoryx_roudi_app.cpp b/iceoryx_posh/test/moduletests/test_roudi_iceoryx_roudi_app.cpp index 79bf53864f..93f1421dfb 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_iceoryx_roudi_app.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_iceoryx_roudi_app.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2021 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,16 +25,14 @@ #include +namespace +{ using namespace ::testing; -using ::testing::Return; using iox::roudi::IceOryxRouDiApp; using namespace iox::config; +using namespace iox; -namespace iox -{ -namespace test -{ class OutputBuffer { public: @@ -271,5 +270,4 @@ TEST_F(IceoryxRoudiApp_test, VerifyConstructorUsingConfigWithSegmentWithoutMemPo EXPECT_NE(output.find(expected), std::string::npos); } -} // namespace test -} // namespace iox +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_iceoyx_roudi_memory_manager.cpp b/iceoryx_posh/test/moduletests/test_roudi_iceoyx_roudi_memory_manager.cpp index d0859de60b..770d1ccf84 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_iceoyx_roudi_memory_manager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_iceoyx_roudi_memory_manager.cpp @@ -19,14 +19,12 @@ #include "iceoryx_posh/roudi/memory/iceoryx_roudi_memory_manager.hpp" +namespace +{ using namespace ::testing; using iox::roudi::IceOryxRouDiMemoryManager; -namespace iox -{ -namespace test -{ /// @brief This test file verifies that the BaseClass IceoryxRouDiMemoryManager is tested class IceoryxRoudiMemoryManager_test : public Test { @@ -167,5 +165,4 @@ TEST_F(IceoryxRoudiMemoryManager_test, DestroyMemoryNotFailingAfterCalledTwoTime EXPECT_THAT(res.has_error(), Eq(false)); } -} // namespace test -} // namespace iox +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_memory_block.cpp b/iceoryx_posh/test/moduletests/test_roudi_memory_block.cpp index 35dfc5805e..2fd0adda9e 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_memory_block.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_memory_block.cpp @@ -22,6 +22,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; @@ -59,3 +61,5 @@ TEST_F(MemoryBlock_Test, MemoryAvailableAfterCreation) ASSERT_THAT(sut.memory().has_value(), Eq(true)); EXPECT_THAT(sut.memory().value(), Eq(memoryProvider.dummyMemory)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp b/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp index b9ed3f2f8e..68663780ef 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp @@ -23,6 +23,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; @@ -151,3 +153,5 @@ TEST_F(RouDiMemoryManager_Test, OperatorTest) EXPECT_THAT(loggerMock.m_logs[i].message, Eq(m_testResultOperatorMethod[i])); } } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_memory_provider.cpp b/iceoryx_posh/test/moduletests/test_roudi_memory_provider.cpp index 02c28acd76..de7e597ae9 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_memory_provider.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_memory_provider.cpp @@ -24,6 +24,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; @@ -347,3 +349,5 @@ TEST_F(MemoryProvider_Test, GetErrorString) EXPECT_THAT(*result, Eq(*m_testResultGetErrorString[i])); } } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp b/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp index 1c4bb7ea08..21ceb02146 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp @@ -15,21 +15,19 @@ // // SPDX-License-Identifier: Apache-2.0 +#include "iceoryx_posh/internal/mepoo/segment_manager.hpp" +#include "iceoryx_posh/internal/roudi/introspection/mempool_introspection.hpp" +#include "iceoryx_posh/roudi/introspection_types.hpp" #include "iceoryx_posh/testing/mocks/chunk_mock.hpp" +#include "iceoryx_utils/cxx/vector.hpp" +#include "iceoryx_utils/testing/timing_test.hpp" #include "mocks/mepoo_memory_manager_mock.hpp" #include "mocks/publisher_mock.hpp" -#include "iceoryx_utils/testing/timing_test.hpp" -#include "test.hpp" - -using namespace ::testing; -using ::testing::Return; -#include "iceoryx_posh/internal/roudi/introspection/mempool_introspection.hpp" - -#include "iceoryx_posh/internal/mepoo/segment_manager.hpp" -#include "iceoryx_posh/roudi/introspection_types.hpp" -#include "iceoryx_utils/cxx/vector.hpp" +#include "test.hpp" +namespace +{ class CallChecker { public: @@ -274,3 +272,5 @@ TIMING_TEST_F(MemPoolIntrospection_test, thread, Repeat(5), [&] { 6 * snapshotInterval.toMilliseconds())); // the thread should sleep, if not, we have 12 runs introspectionAccess.stop(); }); + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_port_introspection.cpp b/iceoryx_posh/test/moduletests/test_roudi_port_introspection.cpp index ec0917c19e..8d7f1410c8 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_port_introspection.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_port_introspection.cpp @@ -15,20 +15,21 @@ // // SPDX-License-Identifier: Apache-2.0 +#include "iceoryx_posh/internal/roudi/introspection/port_introspection.hpp" +#include "iceoryx_posh/mepoo/chunk_header.hpp" #include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "iceoryx_utils/cxx/generic_raii.hpp" #include "mocks/publisher_mock.hpp" #include "mocks/subscriber_mock.hpp" -#include "test.hpp" -using namespace ::testing; -using ::testing::Return; - -#include "iceoryx_posh/internal/roudi/introspection/port_introspection.hpp" -#include "iceoryx_posh/mepoo/chunk_header.hpp" +#include "test.hpp" #include +namespace +{ +using namespace ::testing; + template class PortIntrospectionAccess : public iox::roudi::PortIntrospection { @@ -471,3 +472,5 @@ TEST_F(PortIntrospection_test, DISABLED_thread) std::this_thread::sleep_for( std::chrono::milliseconds(555)); // if the thread doesn't stop, we have 12 runs after the sleep period } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp b/iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp index 843b07bae7..173d694548 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp @@ -15,12 +15,9 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "test.hpp" - -#include "iceoryx_posh/internal/capro/capro_message.hpp" -#include "iceoryx_posh/internal/popo/ports/publisher_port_user.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" +#include "iceoryx_posh/internal/capro/capro_message.hpp" #include "iceoryx_posh/internal/popo/ports/publisher_port_user.hpp" #include "iceoryx_posh/internal/roudi/port_manager.hpp" #include "iceoryx_posh/roudi/memory/iceoryx_roudi_memory_manager.hpp" @@ -28,14 +25,16 @@ #include "iceoryx_utils/cxx/generic_raii.hpp" #include "iceoryx_utils/internal/relocatable_pointer/base_relative_pointer.hpp" #include "iceoryx_utils/posix_wrapper/posix_access_rights.hpp" - #include "iceoryx_utils/testing/watch_dog.hpp" +#include "test.hpp" + #include #include // std::numeric_limits +namespace +{ using namespace ::testing; -using ::testing::Return; using iox::popo::PublisherOptions; using iox::popo::PublisherPortUser; @@ -84,7 +83,8 @@ class PortManager_test : public Test m_portManager = new PortManagerTester(m_roudiMemoryManager); auto user = iox::posix::PosixUser::getUserOfCurrentProcess().getName(); - auto segmentInfo = m_roudiMemoryManager->segmentManager().value()->getSegmentInformationWithWriteAccessForUser(user); + auto segmentInfo = + m_roudiMemoryManager->segmentManager().value()->getSegmentInformationWithWriteAccessForUser(user); ASSERT_TRUE(segmentInfo.m_memoryManager.has_value()); m_payloadDataSegmentMemoryManager = &segmentInfo.m_memoryManager.value().get(); @@ -1034,3 +1034,5 @@ TEST_F(PortManager_test, OfferPublisherServiceUpdatesServiceRegistryChangeCounte EXPECT_EQ(serviceCounter->load(), initialCount + 1); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_portpool.cpp b/iceoryx_posh/test/moduletests/test_roudi_portpool.cpp index 0de1f5f25b..2c1122809a 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_portpool.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_portpool.cpp @@ -22,14 +22,12 @@ #include "iceoryx_utils/cxx/convert.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; -using ::testing::Return; using namespace iox::capro; +using namespace iox; -namespace iox -{ -namespace test -{ static constexpr uint32_t DEFAULT_DEVICE_ID{20U}; static constexpr uint32_t DEFAULT_MEMORY_TYPE{100U}; class PortPool_test : public Test @@ -615,5 +613,5 @@ TEST_F(PortPool_test, GetServiceRegistryChangeCounterIsSuccessful) ASSERT_EQ(serviceCounter->load(), 1U); } -} // namespace test -} // namespace iox + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_posix_shm_memory_provider.cpp b/iceoryx_posh/test/moduletests/test_roudi_posix_shm_memory_provider.cpp index a3f39e09b0..84fb23cb42 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_posix_shm_memory_provider.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_posix_shm_memory_provider.cpp @@ -23,6 +23,8 @@ #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; @@ -110,3 +112,5 @@ TEST_F(PosixShmMemoryProvider_Test, CreationFailedWithAlignmentExceedingPageSize EXPECT_THAT(shmExists(), Eq(false)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_process.cpp b/iceoryx_posh/test/moduletests/test_roudi_process.cpp index fea14f679a..bc96b1e8ee 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_process.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_process.cpp @@ -24,12 +24,13 @@ #include "iceoryx_utils/platform/types.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; using namespace iox::popo; using namespace iox::runtime; using namespace iox::posix; -using ::testing::Return; class IpcInterfaceUser_Mock : public iox::roudi::Process { @@ -110,3 +111,5 @@ TEST_F(Process_test, TimeStamp) roudiproc.setTimestamp(timestmp); EXPECT_THAT(roudiproc.getTimestamp(), Eq(timestmp)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_process_introspection.cpp b/iceoryx_posh/test/moduletests/test_roudi_process_introspection.cpp index acc37d2b03..f23240542f 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_process_introspection.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_process_introspection.cpp @@ -15,17 +15,17 @@ // // SPDX-License-Identifier: Apache-2.0 +#include "iceoryx_posh/internal/popo/ports/publisher_port_data.hpp" +#include "iceoryx_posh/internal/roudi/introspection/process_introspection.hpp" +#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" #include "iceoryx_utils/testing/timing_test.hpp" +#include "mocks/publisher_mock.hpp" + #include "test.hpp" +namespace +{ using namespace ::testing; -using ::testing::Return; - -#include "iceoryx_posh/internal/roudi/introspection/process_introspection.hpp" - -#include "iceoryx_posh/internal/popo/ports/publisher_port_data.hpp" -#include "iceoryx_posh/testing/mocks/chunk_mock.hpp" -#include "mocks/publisher_mock.hpp" class ProcessIntrospectionAccess : public iox::roudi::ProcessIntrospection { @@ -264,3 +264,5 @@ TEST_F(ProcessIntrospection_test, addRemoveNode) EXPECT_CALL(introspectionAccess.getPublisherPort().value(), stopOffer()).Times(1); } } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_process_manager.cpp b/iceoryx_posh/test/moduletests/test_roudi_process_manager.cpp index 7940eddbcd..da571741b1 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_process_manager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_process_manager.cpp @@ -26,13 +26,14 @@ #include "iceoryx_utils/testing/watch_dog.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::roudi; using namespace iox::popo; using namespace iox::runtime; using namespace iox::posix; using namespace iox::version; -using ::testing::Return; class ProcessManager_test : public Test { @@ -147,3 +148,5 @@ TEST_F(ProcessManager_test, HandleProcessShutdownPreparationRequestWorks) // ideally this should be checked by a mock, but since there isn't on for PortManager we just check the side effect ASSERT_FALSE(publisher.isOffered()); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp b/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp index f8c885cb95..e3c9ea053f 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,13 +15,14 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "test.hpp" - #include "iceoryx_posh/internal/roudi/service_registry.hpp" #include "iceoryx_utils/cxx/string.hpp" +#include "test.hpp" + +namespace +{ using namespace ::testing; -using ::testing::Return; class ServiceRegistry_test : public Test { @@ -187,3 +189,5 @@ TEST_F(ServiceRegistry_test, GetServiceMap) EXPECT_THAT(mapA && mapE, Eq(true)); } + +} // namespace diff --git a/iceoryx_posh/test/moduletests/test_runtime_ipc_interface_creator.cpp b/iceoryx_posh/test/moduletests/test_runtime_ipc_interface_creator.cpp index 3f8439b62d..6ee1df08ec 100644 --- a/iceoryx_posh/test/moduletests/test_runtime_ipc_interface_creator.cpp +++ b/iceoryx_posh/test/moduletests/test_runtime_ipc_interface_creator.cpp @@ -21,6 +21,8 @@ #include +namespace +{ using namespace ::testing; using namespace iox; using namespace iox::posix; @@ -66,4 +68,6 @@ TEST_F(IpcInterfaceCreator_test, CreateWithSameNameLeadsToError) EXPECT_DEATH({ IpcInterfaceCreator m_sut2{goodName}; }, ".*"); } +} // namespace + #endif diff --git a/iceoryx_posh/test/moduletests/test_version_info.cpp b/iceoryx_posh/test/moduletests/test_version_info.cpp index 0616b4f3b3..a8c99fc739 100644 --- a/iceoryx_posh/test/moduletests/test_version_info.cpp +++ b/iceoryx_posh/test/moduletests/test_version_info.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +19,8 @@ #include "iceoryx_versions.hpp" #include "test.hpp" +namespace +{ using namespace ::testing; using namespace iox::version; using namespace iox::cxx; @@ -177,3 +180,5 @@ TEST_F(VersionInfo_test, ComparesVersionsDifferInBuildDate) EXPECT_TRUE(versionInfo.checkCompatibility(versionInfoWithUnequalBuildDate, CompatibilityCheckLevel::COMMIT_ID)); EXPECT_FALSE(versionInfo.checkCompatibility(versionInfoWithUnequalBuildDate, CompatibilityCheckLevel::BUILD_DATE)); } + +} // namespace diff --git a/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp index 87562a2297..bcd812fc19 100644 --- a/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp +++ b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp @@ -23,7 +23,6 @@ #include using namespace ::testing; -using ::testing::Return; class RouDi_GTest : public iox::roudi::RouDiEnvironment, public Test { diff --git a/iceoryx_utils/test/integrationtests/test_utils_integration.cpp b/iceoryx_utils/test/integrationtests/test_utils_integration.cpp index d6a24275a2..77fe11c888 100644 --- a/iceoryx_utils/test/integrationtests/test_utils_integration.cpp +++ b/iceoryx_utils/test/integrationtests/test_utils_integration.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +19,6 @@ using namespace ::testing; using ::testing::_; -using ::testing::Return; int main(int argc, char* argv[]) { diff --git a/iceoryx_utils/test/moduletests/test_utils_modules.cpp b/iceoryx_utils/test/moduletests/test_utils_modules.cpp index 5674cae918..839a773770 100644 --- a/iceoryx_utils/test/moduletests/test_utils_modules.cpp +++ b/iceoryx_utils/test/moduletests/test_utils_modules.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +19,6 @@ using namespace ::testing; using ::testing::_; -using ::testing::Return; // global argc and argv needed by the argv_inspection test int g_argc; diff --git a/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/time_mock.hpp b/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/time_mock.hpp index 45639ce51a..00293fbaa8 100644 --- a/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/time_mock.hpp +++ b/iceoryx_utils/testing/include/iceoryx_utils/testing/mocks/time_mock.hpp @@ -23,7 +23,6 @@ #include using namespace ::testing; -using ::testing::Return; class time_MOCK {