diff --git a/iceoryx_posh/test/CMakeLists.txt b/iceoryx_posh/test/CMakeLists.txt index 965949ea82..44f51b8126 100644 --- a/iceoryx_posh/test/CMakeLists.txt +++ b/iceoryx_posh/test/CMakeLists.txt @@ -81,13 +81,5 @@ iox_add_executable( TARGET ${PROJECT_PREFIX}_integrationtests ${TESTUTILS_SRC} ) -# TODO: iox-#1287 fix conversion warnings -if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - set(TEST_CXX_FLAGS ${ICEORYX_WARNINGS} /bigobj) -else() - set(TEST_CXX_FLAGS PRIVATE ${ICEORYX_WARNINGS} ${ICEORYX_SANITIZER_FLAGS} -Wno-pedantic -Wno-conversion) -endif() - target_compile_options(${PROJECT_PREFIX}_moduletests PRIVATE ${TEST_CXX_FLAGS}) target_compile_options(${PROJECT_PREFIX}_integrationtests PRIVATE ${TEST_CXX_FLAGS}) -# TODO: END iox-#1287 fix conversion warnings diff --git a/iceoryx_posh/test/integrationtests/test_client_server.cpp b/iceoryx_posh/test/integrationtests/test_client_server.cpp index 5e9e3a3d27..dd46b583e4 100644 --- a/iceoryx_posh/test/integrationtests/test_client_server.cpp +++ b/iceoryx_posh/test/integrationtests/test_client_server.cpp @@ -271,7 +271,8 @@ TEST_F(ClientServer_test, SlowServerDoesNotBlockClient) Server server{sd, serverOptions}; // send request till queue overflows - for (uint64_t i = 0; i < serverOptions.requestQueueCapacity + NUMBER_OF_OVERFLOWS; ++i) + const int64_t iMax = static_cast(serverOptions.requestQueueCapacity) + NUMBER_OF_OVERFLOWS; + for (int64_t i = 0; i < iMax; ++i) { auto loanResult = client.loan(); ASSERT_FALSE(loanResult.has_error()); 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 875d290659..5f3924051f 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 @@ -345,7 +345,7 @@ TIMING_TEST_F(PortUser_IntegrationTest, SingleProducer, Repeat(5), [&] { TIMING_TEST_EXPECT_TRUE(m_sendCounter.load(std::memory_order_relaxed) == m_receiveCounter); TIMING_TEST_EXPECT_FALSE(PortUser_IntegrationTest::m_subscriberPortUserMultiProducer.hasLostChunksSinceLastCall()); -}); +}) TIMING_TEST_F(PortUser_IntegrationTest, MultiProducer, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "d27279d3-26c0-4489-9208-bd361120525a"); @@ -381,6 +381,6 @@ 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_posh_mepoo.cpp b/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp index 642682e36b..a63a2e5125 100644 --- a/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp +++ b/iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp @@ -461,6 +461,6 @@ TIMING_TEST_F(Mepoo_IntegrationTest, MempoolCreationTimeDefaultConfig, Repeat(5) // Currently we expect that the RouDi is ready at least after 2 seconds 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 9bd90f0f57..1f96babdde 100644 --- a/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp +++ b/iceoryx_posh/test/integrationtests/test_publisher_subscriber_communication.cpp @@ -416,7 +416,7 @@ TEST_F(PublisherSubscriberCommunication_test, SendingComplexDataType_optional) TEST_F(PublisherSubscriberCommunication_test, SendingComplexDataType_stack) { ::testing::Test::RecordProperty("TEST_ID", "c378e0db-d863-4cad-9efa-4daec364b266"); - using Type_t = ComplexDataType>; + using Type_t = ComplexDataType>; auto publisher = createPublisher(); this->InterOpWait(); auto subscriber = createSubscriber(); @@ -427,7 +427,7 @@ TEST_F(PublisherSubscriberCommunication_test, SendingComplexDataType_stack) sample->someNumber = 41231; for (uint64_t i = 0U; i < 10U; ++i) { - sample->complexType.push(i + 123); + sample->complexType.push(i + 123U); } sample.publish(); }) diff --git a/iceoryx_posh/test/integrationtests/test_service_discovery.cpp b/iceoryx_posh/test/integrationtests/test_service_discovery.cpp index 4f24470f4e..aa9131bcd4 100644 --- a/iceoryx_posh/test/integrationtests/test_service_discovery.cpp +++ b/iceoryx_posh/test/integrationtests/test_service_discovery.cpp @@ -178,7 +178,14 @@ struct ReqRes }; using CommunicationKind = Types; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(ServiceDiscovery_test, CommunicationKind); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif // // Built-in topics can be found @@ -783,7 +790,14 @@ using TestVariations = TypestestFindService(s1); this->testFindService(s2); this->testFindService(s3); -}; +} // // test mixed operation of PUB/SUB and REQ/RES @@ -1054,6 +1068,6 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices) this->testFindService(s1); this->testFindService(s2); this->testFindService(s3); -}; +} } // namespace diff --git a/iceoryx_posh/test/mocks/base_port_mock.hpp b/iceoryx_posh/test/mocks/base_port_mock.hpp index 5541569f1d..cc98076a34 100644 --- a/iceoryx_posh/test/mocks/base_port_mock.hpp +++ b/iceoryx_posh/test/mocks/base_port_mock.hpp @@ -44,12 +44,19 @@ class MockBasePort return *this; } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(const iox::capro::ServiceDescription&, getCaProServiceDescription, (), (const, noexcept)); MOCK_METHOD(const iox::RuntimeName_t&, getRuntimeName, (), (const, noexcept)); MOCK_METHOD(iox::popo::UniquePortId, getUniqueID, (), (const, noexcept)); MOCK_METHOD(const iox::NodeName_t&, getNodeName, (), (const, noexcept)); MOCK_METHOD(void, destroy, (), (noexcept)); MOCK_METHOD(bool, toBeDestroyed, (), (const, noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif explicit operator bool() const { diff --git a/iceoryx_posh/test/mocks/client_mock.hpp b/iceoryx_posh/test/mocks/client_mock.hpp index db3e75d0f6..c6cf933d00 100644 --- a/iceoryx_posh/test/mocks/client_mock.hpp +++ b/iceoryx_posh/test/mocks/client_mock.hpp @@ -46,6 +46,10 @@ class MockClientPortUser : public MockBasePort return *this; } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD((iox::cxx::expected), allocateRequest, (const uint32_t, const uint32_t), @@ -69,6 +73,9 @@ class MockClientPortUser : public MockBasePort MOCK_METHOD(void, setConditionVariable, (iox::popo::ConditionVariableData&, const uint64_t), (noexcept)); MOCK_METHOD(void, unsetConditionVariable, (), (noexcept)); MOCK_METHOD(bool, isConditionVariableSet, (), (const, noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif }; class MockBaseClient @@ -82,6 +89,10 @@ class MockBaseClient { } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(iox::popo::uid_t, getUid, (), (const, noexcept)); MOCK_METHOD(const iox::capro::ServiceDescription&, getServiceDescription, (), (const, noexcept)); MOCK_METHOD(void, connect, (), (noexcept)); @@ -100,6 +111,9 @@ class MockBaseClient MOCK_METHOD(void, disableState, (const iox::popo::ClientState), (noexcept)); MOCK_METHOD(void, enableEvent, (iox::popo::TriggerHandle&&, const iox::popo::ClientEvent), (noexcept)); MOCK_METHOD(void, disableEvent, (const iox::popo::ClientEvent), (noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif const PortType& port() const noexcept diff --git a/iceoryx_posh/test/mocks/roudi_memory_block_mock.hpp b/iceoryx_posh/test/mocks/roudi_memory_block_mock.hpp index ab471f8cfa..b7524f499d 100644 --- a/iceoryx_posh/test/mocks/roudi_memory_block_mock.hpp +++ b/iceoryx_posh/test/mocks/roudi_memory_block_mock.hpp @@ -24,10 +24,17 @@ class MemoryBlockMock final : public iox::roudi::MemoryBlock { public: +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(uint64_t, size, (), (const, noexcept, override)); MOCK_METHOD(uint64_t, alignment, (), (const, noexcept, override)); MOCK_METHOD(void, onMemoryAvailable, (iox::cxx::not_null), (noexcept, override)); MOCK_METHOD(void, destroy, (), (noexcept, override)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif }; #endif // IOX_POSH_MOCKS_ROUDI_MEMORY_BLOCK_MOCK_HPP diff --git a/iceoryx_posh/test/mocks/roudi_memory_provider_mock.hpp b/iceoryx_posh/test/mocks/roudi_memory_provider_mock.hpp index 4626807680..bdfe853f37 100644 --- a/iceoryx_posh/test/mocks/roudi_memory_provider_mock.hpp +++ b/iceoryx_posh/test/mocks/roudi_memory_provider_mock.hpp @@ -49,7 +49,14 @@ class MemoryProviderTestImpl : public iox::roudi::MemoryProvider dummyMemory = static_cast(iox::cxx::alignedAlloc(alignment, size)); return iox::cxx::success(dummyMemory); } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(void, createMemoryMock, (uint64_t, uint64_t), (noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif iox::cxx::expected destroyMemory() noexcept override { @@ -63,7 +70,14 @@ class MemoryProviderTestImpl : public iox::roudi::MemoryProvider return iox::cxx::success(); } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(void, destroyMemoryMock, (), (noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif uint8_t* dummyMemory{nullptr}; diff --git a/iceoryx_posh/test/mocks/server_mock.hpp b/iceoryx_posh/test/mocks/server_mock.hpp index 43ff970bf6..51cf4e7f5e 100644 --- a/iceoryx_posh/test/mocks/server_mock.hpp +++ b/iceoryx_posh/test/mocks/server_mock.hpp @@ -46,6 +46,10 @@ class MockServerPortUser : public MockBasePort return *this; } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD((iox::cxx::expected), getRequest, (), @@ -70,6 +74,9 @@ class MockServerPortUser : public MockBasePort MOCK_METHOD(void, setConditionVariable, (iox::popo::ConditionVariableData&, const uint64_t), (noexcept)); MOCK_METHOD(void, unsetConditionVariable, (), (noexcept)); MOCK_METHOD(bool, isConditionVariableSet, (), (const, noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif }; class MockBaseServer @@ -83,6 +90,10 @@ class MockBaseServer { } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(iox::popo::uid_t, getUid, (), (const, noexcept)); MOCK_METHOD(const iox::capro::ServiceDescription&, getServiceDescription, (), (const, noexcept)); MOCK_METHOD(void, offer, (), (noexcept)); @@ -102,6 +113,9 @@ class MockBaseServer MOCK_METHOD(void, disableState, (const iox::popo::ServerState), (noexcept)); MOCK_METHOD(void, enableEvent, (iox::popo::TriggerHandle&&, const iox::popo::ServerEvent), (noexcept)); MOCK_METHOD(void, disableEvent, (const iox::popo::ServerEvent), (noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif const PortType& port() const noexcept diff --git a/iceoryx_posh/test/mocks/trigger_handle_mock.hpp b/iceoryx_posh/test/mocks/trigger_handle_mock.hpp index 9ac88d1c3a..fe7dcb6343 100644 --- a/iceoryx_posh/test/mocks/trigger_handle_mock.hpp +++ b/iceoryx_posh/test/mocks/trigger_handle_mock.hpp @@ -47,6 +47,10 @@ class MockTriggeHandle return *this; } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(bool, isValid, (), (const, noexcept)); MOCK_METHOD(bool, wasTriggered, (), (const, noexcept)); MOCK_METHOD(void, trigger, (), (noexcept)); @@ -54,13 +58,23 @@ class MockTriggeHandle MOCK_METHOD(void, invalidate, (), (noexcept)); MOCK_METHOD(uint64_t, getUniqueId, (), (const, noexcept)); MOCK_METHOD(iox::popo::ConditionVariableData*, getConditionVariableData, (), (noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif explicit operator bool() const { return operatorBoolMock(); } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(bool, operatorBoolMock, (), (const)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif uint64_t triggerId{0}; }; diff --git a/iceoryx_posh/test/moduletests/test_base_port.cpp b/iceoryx_posh/test/moduletests/test_base_port.cpp index 6dda18e33e..26e2df399d 100644 --- a/iceoryx_posh/test/moduletests/test_base_port.cpp +++ b/iceoryx_posh/test/moduletests/test_base_port.cpp @@ -53,7 +53,14 @@ std::vector uniquePortIds; using PortDataTypes = Types; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(BasePort_test, PortDataTypes); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif // port data factories diff --git a/iceoryx_posh/test/moduletests/test_fixed_size_container.cpp b/iceoryx_posh/test/moduletests/test_fixed_size_container.cpp index 464924a7a6..85466d07e9 100644 --- a/iceoryx_posh/test/moduletests/test_fixed_size_container.cpp +++ b/iceoryx_posh/test/moduletests/test_fixed_size_container.cpp @@ -115,7 +115,7 @@ TEST_F(FixedSizeContainer_test, removeAndSizeMultiElementContainer) for (uint32_t k = 0; k < capacity; ++k) { - container.remove(k); + container.remove(static_cast(k)); EXPECT_THAT(container.size(), Eq(capacity - k - 1)); } @@ -123,19 +123,21 @@ TEST_F(FixedSizeContainer_test, removeAndSizeMultiElementContainer) { container.add(12); container.add(12); - container.remove(k); + container.remove(static_cast(k)); container.add(12); size_t newSize = 2 * (k + 1); if (newSize > 100) + { newSize = 100; + } EXPECT_THAT(container.size(), Eq(newSize)); } for (uint32_t k = 0; k < capacity; ++k) { - container.remove(k); + container.remove(static_cast(k)); EXPECT_THAT(container.size(), Eq(capacity - k - 1)); } } @@ -156,22 +158,22 @@ TEST_F(FixedSizeContainer_test, addAndVerifySingleElementContainer) TEST_F(FixedSizeContainer_test, addAndVerifyMultiElementContainer) { ::testing::Test::RecordProperty("TEST_ID", "de654427-1873-4583-b6a6-117869ca86f0"); - constexpr size_t capacity = 25; + constexpr uint32_t capacity = 25; FixedSizeContainer container; - for (size_t i = 0; i < capacity; ++i) + for (uint32_t i = 0; i < capacity; ++i) { - for (size_t k = i; k < capacity; ++k) + for (uint32_t k = i; k < capacity; ++k) { - EXPECT_THAT(container.get(k), Eq(nullptr)); + EXPECT_THAT(container.get(static_cast(k)), Eq(nullptr)); } container.add(2 * i + 1); - for (size_t k = 0; k < i; ++k) + for (uint32_t k = 0; k < i; ++k) { - EXPECT_THAT(*container.get(k), Eq(2 * k + 1)); - EXPECT_THAT(container[k], Eq(2 * k + 1)); + EXPECT_THAT(*container.get(static_cast(k)), Eq(2 * k + 1)); + EXPECT_THAT(container[static_cast(k)], Eq(2 * k + 1)); } } } @@ -191,23 +193,23 @@ TEST_F(FixedSizeContainer_test, removeAndVerifySingleElementContainer) TEST_F(FixedSizeContainer_test, removeAndVerifyMultiElementContainer) { ::testing::Test::RecordProperty("TEST_ID", "ad112c45-1166-41f9-8cd0-af604677957f"); - constexpr size_t capacity = 25; + constexpr uint32_t capacity = 25; FixedSizeContainer container; - for (size_t i = 0; i < capacity; ++i) + for (uint32_t i = 0; i < capacity; ++i) { container.add(5 * i + 12); } - for (size_t i = 0; i < capacity; ++i) + for (uint32_t i = 0; i < capacity; ++i) { - for (size_t k = 0; k < i; ++k) + for (uint32_t k = 0; k < i; ++k) { - EXPECT_THAT(container.get(k), Eq(nullptr)); + EXPECT_THAT(container.get(static_cast(k)), Eq(nullptr)); } - container.remove(i); - for (size_t k = i + 1; k < capacity; ++k) + container.remove(static_cast(i)); + for (uint32_t k = i + 1; k < capacity; ++k) { - EXPECT_THAT(*container.get(k), Eq(5 * k + 12)); + EXPECT_THAT(*container.get(static_cast(k)), Eq(5 * k + 12)); } } } diff --git a/iceoryx_posh/test/moduletests/test_mq_message.cpp b/iceoryx_posh/test/moduletests/test_mq_message.cpp index 57e6a002d9..7468a7e8c0 100644 --- a/iceoryx_posh/test/moduletests/test_mq_message.cpp +++ b/iceoryx_posh/test/moduletests/test_mq_message.cpp @@ -78,7 +78,7 @@ TEST_F(IpcMessage_test, CTorWithInitializerList_validEntries) IpcMessage message3({"", "", ""}); EXPECT_THAT(message3.isValid(), Eq(true)); EXPECT_THAT(message3.getNumberOfElements(), Eq(3u)); - for (int i = 0; i < 3; ++i) + for (uint16_t i = 0; i < 3; ++i) { EXPECT_THAT(message3.getElementAtIndex(i), Eq("")); } diff --git a/iceoryx_posh/test/moduletests/test_popo_base_client.cpp b/iceoryx_posh/test/moduletests/test_popo_base_client.cpp index e0ab2fedbe..f13cc144e2 100644 --- a/iceoryx_posh/test/moduletests/test_popo_base_client.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_base_client.cpp @@ -40,18 +40,18 @@ using UntypedClientWithMocks = iox::popo::UntypedClientImpl using TypedClientWithMocks = iox::popo::ClientImpl; template -uint64_t resetCallsFromDtors() +int resetCallsFromDtors() { // from derived and base class - return 2U; + return 2; } template <> -uint64_t resetCallsFromDtors() +int resetCallsFromDtors() { // from base only - return 1U; -}; + return 1; +} template class TestBaseClient : public Base @@ -75,7 +75,14 @@ class TestBaseClient : public Base using BaseClientTypes = Types; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(BaseClient_test, BaseClientTypes); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif template class BaseClient_test : public Test diff --git a/iceoryx_posh/test/moduletests/test_popo_base_server.cpp b/iceoryx_posh/test/moduletests/test_popo_base_server.cpp index cd5ab28d75..2b3c8e42e5 100644 --- a/iceoryx_posh/test/moduletests/test_popo_base_server.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_base_server.cpp @@ -40,18 +40,18 @@ using UntypedServerWithMocks = iox::popo::UntypedServerImpl using TypedServerWithMocks = iox::popo::ServerImpl; template -uint64_t resetCallsFromDtors() +int resetCallsFromDtors() { // from derived and base class - return 2U; + return 2; } template <> -uint64_t resetCallsFromDtors() +int resetCallsFromDtors() { // from base only - return 1U; -}; + return 1; +} template class TestBaseServer : public Base @@ -75,7 +75,14 @@ class TestBaseServer : public Base using BaseServerTypes = Types; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(BaseServer_test, BaseServerTypes); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif template class BaseServer_test : public Test diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp index 5652d47a91..ba9ea35214 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp @@ -39,14 +39,21 @@ using namespace iox::mepoo; using ChunkDistributorTestSubjects = Types; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(ChunkDistributor_test, ChunkDistributorTestSubjects); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif template class ChunkDistributor_test : public Test { public: - SharedChunk allocateChunk(uint32_t value) + SharedChunk allocateChunk(uint64_t value) { ChunkManagement* chunkMgmt = static_cast(chunkMgmtPool.getChunk()); auto chunk = mempool.getChunk(); @@ -61,7 +68,7 @@ class ChunkDistributor_test : public Test ChunkHeader* chunkHeader = new (chunk) ChunkHeader(mempool.getChunkSize(), chunkSettings); new (chunkMgmt) ChunkManagement{chunkHeader, &mempool, &chunkMgmtPool}; - *static_cast(chunkHeader->userPayload()) = value; + *static_cast(chunkHeader->userPayload()) = value; return SharedChunk(chunkMgmt); } uint32_t getSharedChunkValue(const SharedChunk& chunk) diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp index 4149a30353..bab3ba3ccf 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp @@ -84,7 +84,14 @@ using ChunkQueueSubjects = TypeDefinitions, TypeDefinitions>; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(ChunkQueue_test, ChunkQueueSubjects); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif template @@ -268,7 +275,14 @@ TYPED_TEST(ChunkQueue_test, AttachSecondConditionVariable) /// @note this could be changed to a parameterized ChunkQueueSaturatingFIFO_test when there are more FIFOs available using ChunkQueueFiFoTestSubjects = Types; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(ChunkQueueFiFo_test, ChunkQueueFiFoTestSubjects); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif template @@ -332,7 +346,14 @@ TYPED_TEST(ChunkQueueFiFo_test, PushFull) /// @note this could be changed to a parameterized ChunkQueueOverflowingFIFO_test when there are more FIFOs available using ChunkQueueSoFiSubjects = Types; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(ChunkQueueSoFi_test, ChunkQueueSoFiSubjects); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif template diff --git a/iceoryx_posh/test/moduletests/test_popo_listener.cpp b/iceoryx_posh/test/moduletests/test_popo_listener.cpp index 855c38b1bb..dcbd7e6fdd 100644 --- a/iceoryx_posh/test/moduletests/test_popo_listener.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_listener.cpp @@ -667,7 +667,7 @@ TIMING_TEST_F(Listener_test, CallbackIsCalledAfterNotify, Repeat(5), [&] { TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_source == &fuu); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 1U); -}); +}) TIMING_TEST_F(Listener_test, CallbackWithEventAndUserTypeIsCalledAfterNotify, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "6df97139-8c2e-42b1-bd9a-8770c295bf2e"); @@ -685,7 +685,7 @@ TIMING_TEST_F(Listener_test, CallbackWithEventAndUserTypeIsCalledAfterNotify, Re TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_source == &fuu); TIMING_TEST_EXPECT_TRUE(userType == 1U); -}); +}) TIMING_TEST_F(Listener_test, CallbackWithUserTypeIsCalledAfterNotify, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "98ffc91c-cf17-4331-8b20-a84121090119"); @@ -701,7 +701,7 @@ TIMING_TEST_F(Listener_test, CallbackWithUserTypeIsCalledAfterNotify, Repeat(5), TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_source == &fuu); TIMING_TEST_EXPECT_TRUE(userType == 1U); -}); +}) TIMING_TEST_F(Listener_test, CallbackIsCalledOnlyOnceWhenTriggered, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "ad1470d7-a683-4089-a548-93616278c772"); @@ -728,7 +728,7 @@ TIMING_TEST_F(Listener_test, CallbackIsCalledOnlyOnceWhenTriggered, Repeat(5), [ TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 1U); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_source == &fuu2); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_count == 1U); -}); +}) TIMING_TEST_F(Listener_test, TriggerWhileInCallbackLeadsToAnotherCallback, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "b29c6689-35cf-4d2f-b719-5c928bf5e870"); @@ -753,7 +753,7 @@ TIMING_TEST_F(Listener_test, TriggerWhileInCallbackLeadsToAnotherCallback, Repea TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_source == &fuu); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 2U); -}); +}) TIMING_TEST_F(Listener_test, TriggerWhileInCallbackLeadsToAnotherCallbackOnce, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "1dea4bbc-6f11-434c-845d-d2ae1104707e"); @@ -787,7 +787,7 @@ TIMING_TEST_F(Listener_test, TriggerWhileInCallbackLeadsToAnotherCallbackOnce, R TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 2U); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_source == &bar); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_count == 1U); -}); +}) TIMING_TEST_F(Listener_test, TriggerMultipleTimesWhileInCallbackLeadsToAnotherCallback, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "9e1e5a70-e2e9-4ee9-85f9-f52cf475cb61"); @@ -815,7 +815,7 @@ TIMING_TEST_F(Listener_test, TriggerMultipleTimesWhileInCallbackLeadsToAnotherCa TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_source == &fuu); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 2U); -}); +}) TIMING_TEST_F(Listener_test, TriggerMultipleTimesWhileInCallbackLeadsToAnotherCallbackOnce, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "51163b5c-01c9-426b-9f59-3fac62a2f10c"); @@ -852,7 +852,7 @@ TIMING_TEST_F(Listener_test, TriggerMultipleTimesWhileInCallbackLeadsToAnotherCa TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 2U); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_source == &bar); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_count == 1U); -}); +}) TIMING_TEST_F(Listener_test, NoTriggerLeadsToNoCallback, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "6c11cc3f-d251-4e10-9c8e-cdc18c257227"); @@ -868,7 +868,7 @@ TIMING_TEST_F(Listener_test, NoTriggerLeadsToNoCallback, Repeat(5), [&] { TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_source == nullptr); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 0U); -}); +}) TIMING_TEST_F(Listener_test, TriggeringAllEventsCallsAllCallbacks, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "9c0d0be4-7fdf-4b2d-8e40-992a975aa6cc"); @@ -898,7 +898,7 @@ TIMING_TEST_F(Listener_test, TriggeringAllEventsCallsAllCallbacks, Repeat(5), [& TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[i].m_source == &events[i]); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[i].m_count == 1U); } -}); +}) TIMING_TEST_F(Listener_test, TriggeringAllEventsCallsAllCallbacksOnce, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "6840b748-adcc-40c3-ac39-24870540a58f"); @@ -931,7 +931,7 @@ TIMING_TEST_F(Listener_test, TriggeringAllEventsCallsAllCallbacksOnce, Repeat(5) TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[i].m_source == &events[i]); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[i].m_count == 1U); } -}); +}) ////////////////////////////////// // END ////////////////////////////////// @@ -964,7 +964,7 @@ TIMING_TEST_F(Listener_test, AttachingWhileCallbackIsRunningWorks, Repeat(5), [& TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_source == &events[1U]); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_count == 1U); -}); +}) TIMING_TEST_F(Listener_test, AttachingMultipleWhileCallbackIsRunningWorks, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "9ff36b35-0396-4f57-831a-dfc9dd0fdd46"); @@ -996,7 +996,7 @@ TIMING_TEST_F(Listener_test, AttachingMultipleWhileCallbackIsRunningWorks, Repea TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[i].m_source == &events[i]); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[i].m_count == 1U); } -}); +}) TIMING_TEST_F(Listener_test, DetachingWhileCallbackIsRunningWorks, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "f93b89e9-4bc9-432c-9808-cdb6f46ebff2"); @@ -1020,7 +1020,7 @@ TIMING_TEST_F(Listener_test, DetachingWhileCallbackIsRunningWorks, Repeat(5), [& TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 1U); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_source == nullptr); -}); +}) TIMING_TEST_F(Listener_test, DetachingWhileCallbackIsRunningBlocksDetach, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "0a2b5a79-1ff6-4171-9318-52c593828cfb"); @@ -1041,7 +1041,7 @@ TIMING_TEST_F(Listener_test, DetachingWhileCallbackIsRunningBlocksDetach, Repeat auto elapsed = std::chrono::duration_cast(end - begin); TIMING_TEST_EXPECT_TRUE(static_cast(elapsed.count()) > CALLBACK_WAIT_IN_MS / 2U); -}); +}) TIMING_TEST_F(Listener_test, EventDestructorBlocksWhenCallbackIsRunning, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "0a7fc0d7-aa69-4812-837a-f1497401d3b6"); @@ -1060,7 +1060,7 @@ TIMING_TEST_F(Listener_test, EventDestructorBlocksWhenCallbackIsRunning, Repeat( auto elapsed = std::chrono::duration_cast(end - begin); TIMING_TEST_EXPECT_TRUE(static_cast(elapsed.count()) > CALLBACK_WAIT_IN_MS / 2U); -}); +}) TIMING_TEST_F(Listener_test, DetachingMultipleWhileCallbackIsRunningWorks, Repeat(5), [&] { @@ -1094,7 +1094,7 @@ TIMING_TEST_F(Listener_test, DetachingMultipleWhileCallbackIsRunningWorks, Repea { TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[i].m_source == nullptr); } -}); +}) TIMING_TEST_F(Listener_test, AttachingDetachingRunsIndependentOfCallback, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "f5a15344-a2d7-44dd-9a12-a65b70976f46"); @@ -1120,7 +1120,7 @@ TIMING_TEST_F(Listener_test, AttachingDetachingRunsIndependentOfCallback, Repeat // EXPECT_* (assert step) is inside of doIt call. We expect that every event can // be attached AttachEvent::doIt(*m_sut, events, SimpleEvent::StoepselBachelorParty); -}); +}) ////////////////////////////////// // END ////////////////////////////////// @@ -1144,7 +1144,7 @@ TIMING_TEST_F(Listener_test, DetachingSelfInCallbackWorks, Repeat(5), [&] { std::this_thread::sleep_for(std::chrono::milliseconds(CALLBACK_WAIT_IN_MS)); TIMING_TEST_EXPECT_TRUE(m_sut->size() == 0U); -}); +}) TIMING_TEST_F(Listener_test, DetachingNonSelfEventInCallbackWorks, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "78d646d0-9899-4563-91cf-3740221fbca1"); @@ -1167,7 +1167,7 @@ TIMING_TEST_F(Listener_test, DetachingNonSelfEventInCallbackWorks, Repeat(5), [& std::this_thread::sleep_for(std::chrono::milliseconds(CALLBACK_WAIT_IN_MS)); TIMING_TEST_EXPECT_TRUE(m_sut->size() == 1U); -}); +}) TIMING_TEST_F(Listener_test, DetachedCallbacksAreNotBeingCalledWhenTriggeredBefore, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "7581bb34-802e-4241-a42e-e72c990936ab"); @@ -1212,7 +1212,7 @@ TIMING_TEST_F(Listener_test, DetachedCallbacksAreNotBeingCalledWhenTriggeredBefo TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_source == nullptr); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 0U); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[1U].m_count == 1U); -}); +}) TIMING_TEST_F(Listener_test, AttachingInCallbackWorks, Repeat(5), [&] { ::testing::Test::RecordProperty("TEST_ID", "58734e7f-2d3f-49ac-9f37-8052016def8c"); @@ -1233,7 +1233,7 @@ TIMING_TEST_F(Listener_test, AttachingInCallbackWorks, Repeat(5), [&] { TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_source == &events[1U]); TIMING_TEST_EXPECT_TRUE(g_triggerCallbackArg[0U].m_count == 1U); -}); +}) ////////////////////////////////// // END ////////////////////////////////// diff --git a/iceoryx_posh/test/moduletests/test_popo_publisher.cpp b/iceoryx_posh/test/moduletests/test_popo_publisher.cpp index 88a56ed346..e4d7c1a2bf 100644 --- a/iceoryx_posh/test/moduletests/test_popo_publisher.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_publisher.cpp @@ -115,11 +115,11 @@ TEST_F(PublisherTest, CanLoanSamplesAndPublishTheResultOfALambdaWithAdditionalAr EXPECT_CALL(portMock, sendChunk(chunkMock.chunkHeader())); // ===== Test ===== // auto result = sut.publishResultOf( - [](DummyData* allocation, int intVal) { + [](DummyData* allocation, uint64_t intVal) { auto data = new (allocation) DummyData(); data->val = intVal; }, - 42); + 42U); // ===== Verify ===== // EXPECT_FALSE(result.has_error()); // ===== Cleanup ===== // @@ -167,7 +167,7 @@ TEST_F(PublisherTest, CanLoanSamplesAndPublishTheResultOfACallableStructWithAddi ::testing::Test::RecordProperty("TEST_ID", "6a14a270-118d-4067-9906-3a608fe046cd"); struct CallableStruct { - void operator()(DummyData* allocation, int, float) + void operator()(DummyData* allocation, uint64_t, float) { auto data = new (allocation) DummyData(); data->val = 777; @@ -177,7 +177,7 @@ TEST_F(PublisherTest, CanLoanSamplesAndPublishTheResultOfACallableStructWithAddi .WillOnce(Return(ByMove(iox::cxx::success(chunkMock.chunkHeader())))); EXPECT_CALL(portMock, sendChunk(chunkMock.chunkHeader())); // ===== Test ===== // - auto result = sut.publishResultOf(CallableStruct{}, 42, 77.77); + auto result = sut.publishResultOf(CallableStruct{}, 42U, 77.77F); // ===== Verify ===== // EXPECT_FALSE(result.has_error()); // ===== Cleanup ===== // @@ -188,7 +188,7 @@ void freeFunctionNoAdditionalArgs(DummyData* allocation) auto data = new (allocation) DummyData(); data->val = 777; } -void freeFunctionWithAdditionalArgs(DummyData* allocation, int, float) +void freeFunctionWithAdditionalArgs(DummyData* allocation, uint64_t, float) { auto data = new (allocation) DummyData(); data->val = 777; @@ -214,7 +214,7 @@ TEST_F(PublisherTest, CanLoanSamplesAndPublishTheResultOfFunctionPointerWithAddi .WillOnce(Return(ByMove(iox::cxx::success(chunkMock.chunkHeader())))); EXPECT_CALL(portMock, sendChunk(chunkMock.chunkHeader())); // ===== Test ===== // - auto result = sut.publishResultOf(freeFunctionWithAdditionalArgs, 42, 77.77); + auto result = sut.publishResultOf(freeFunctionWithAdditionalArgs, 42U, 77.77F); // ===== Verify ===== // EXPECT_FALSE(result.has_error()); // ===== Cleanup ===== // diff --git a/iceoryx_posh/test/moduletests/test_popo_smart_chunk.cpp b/iceoryx_posh/test/moduletests/test_popo_smart_chunk.cpp index 86027277e7..3f453510e6 100644 --- a/iceoryx_posh/test/moduletests/test_popo_smart_chunk.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_smart_chunk.cpp @@ -35,7 +35,14 @@ class SmartChunkTest : public Test using Implementations = Types; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(SmartChunkTest, Implementations); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif TYPED_TEST(SmartChunkTest, ConstructedSmartChunkIsValid) { diff --git a/iceoryx_posh/test/moduletests/test_popo_smart_chunk_common.hpp b/iceoryx_posh/test/moduletests/test_popo_smart_chunk_common.hpp index 019d09db33..1899e7e5b7 100644 --- a/iceoryx_posh/test/moduletests/test_popo_smart_chunk_common.hpp +++ b/iceoryx_posh/test/moduletests/test_popo_smart_chunk_common.hpp @@ -55,7 +55,14 @@ class MockPublisherInterface : public PublisherInterface return mockSend(std::move(s)); } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(void, mockSend, (SampleProducerType &&), (noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif }; struct SampleTestCase @@ -92,7 +99,14 @@ class MockRequestInterface : public RpcInterface, mockSend, (RequestProducerType &&), (noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif }; class RequestTestCase @@ -130,7 +144,14 @@ class MockResponseInterface : public RpcInterface, mockSend, (ResponseProducerType &&), (noexcept)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif }; class ResponseTestCase 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 787a8e7d11..75300c4de4 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 @@ -36,7 +36,7 @@ namespace { using ParseErrorInputFile_t = std::pair; using CheckCharactersValidity_t = std::pair; -}; // namespace +} // namespace // ======================================== Fixture ======================================== // class TomlGatewayConfigParserTest : public TestWithParam diff --git a/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp b/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp index 4141669491..081b8714d7 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_memory_manager.cpp @@ -150,7 +150,7 @@ TEST_F(RouDiMemoryManager_Test, AddMemoryProviderExceedsCapacity) TEST_F(RouDiMemoryManager_Test, OperatorTest) { ::testing::Test::RecordProperty("TEST_ID", "67167a98-5ac2-498d-8062-47a61102a130"); - for (int16_t i = 0; i < nbTestCase; i++) + for (uint16_t i = 0; i < nbTestCase; i++) { iox::log::LogStream logStream(loggerMock); logStream << m_testCombinationRoudiMemoryManagerError[i]; diff --git a/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp b/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp index 79834433b0..2ec2ddac4a 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_mempool_introspection.cpp @@ -135,7 +135,7 @@ class MemPoolIntrospection_test : public Test } template - void initMemPoolInfo(int index, MemPoolInfoStruct& info) + void initMemPoolInfo(uint32_t index, MemPoolInfoStruct& info) { info.m_chunkSize = index * 100 + 10; info.m_minFreeChunks = index * 100 + 45; @@ -146,7 +146,7 @@ class MemPoolIntrospection_test : public Test // initializes the mempool info with a defined pattern void initMemPoolInfoContainer(MemPoolInfoContainer& memPoolInfoContainer) { - int index = 0; + uint32_t index = 0; for (auto& info : memPoolInfoContainer) { initMemPoolInfo(index, info); @@ -158,7 +158,7 @@ class MemPoolIntrospection_test : public Test template bool compareMemPoolInfo(MemPoolInfoType1& first, MemPoolInfoType2& second) { - int index = 0; + uint32_t index = 0; for (auto& info : first) { if (info.m_chunkSize != second[index].m_chunkSize) @@ -277,6 +277,6 @@ TIMING_TEST_F(MemPoolIntrospection_test, thread, Repeat(5), [&] { std::this_thread::sleep_for(std::chrono::milliseconds( 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_process.cpp b/iceoryx_posh/test/moduletests/test_roudi_process.cpp index 589f9420ca..2f6c3a7826 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_process.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_process.cpp @@ -47,7 +47,7 @@ class Process_test : public Test { public: const iox::RuntimeName_t processname = {"TestProcess"}; - pid_t pid{200U}; + uint32_t pid{200U}; PosixUser user{"foo"}; bool isMonitored = true; const uint64_t dataSegmentId{0x654321U}; diff --git a/iceoryx_posh/test/moduletests/test_roudi_process_manager.cpp b/iceoryx_posh/test/moduletests/test_roudi_process_manager.cpp index e2e9b5d8fa..888e390931 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_process_manager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_process_manager.cpp @@ -55,7 +55,7 @@ class ProcessManager_test : public Test } const iox::RuntimeName_t m_processname{"TestProcess"}; - const pid_t m_pid{42U}; + const uint32_t m_pid{42U}; PosixUser m_user{iox::posix::PosixUser::getUserOfCurrentProcess().getName()}; const bool m_isMonitored{true}; VersionInfo m_versionInfo{42U, 42U, 42U, 42U, "Foo", "Bar"}; diff --git a/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp b/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp index 012868671f..e3116f92c9 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp @@ -165,7 +165,14 @@ class ServiceRegistry_test : public Test constexpr auto CAPACITY = ServiceRegistry::CAPACITY; typedef ::testing::Types TestTypes; +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif TYPED_TEST_SUITE(ServiceRegistry_test, TestTypes); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif TYPED_TEST(ServiceRegistry_test, AddNoServiceDescriptionsAndWildcardSearchReturnsNothing) { diff --git a/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/posh_runtime_mock.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/posh_runtime_mock.hpp index 2a9a2d586e..6353d1f933 100644 --- a/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/posh_runtime_mock.hpp +++ b/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/posh_runtime_mock.hpp @@ -45,6 +45,10 @@ class PoshRuntimeMock : public iox::runtime::PoshRuntime mockRuntime().reset(); } +#ifdef __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif MOCK_METHOD(iox::PublisherPortUserType::MemberType_t*, getMiddlewarePublisher, (const iox::capro::ServiceDescription&, @@ -79,6 +83,9 @@ class PoshRuntimeMock : public iox::runtime::PoshRuntime sendRequestToRouDi, (const iox::runtime::IpcMessage&, iox::runtime::IpcMessage&), (noexcept, override)); +#ifdef __clang__ +#pragma GCC diagnostic pop +#endif private: PoshRuntimeMock(const iox::RuntimeName_t& name)