diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp index 7afa5e536a..adac8250f6 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp @@ -39,7 +39,10 @@ #include #include -#ifdef USE_SYSTEMD +#elif defined(__MINGW32__) || defined(__MINGW64__) +#elif USE_SYSTEMD +#include +#else #include #endif diff --git a/iceoryx_posh/test/moduletests/test_roudi_system_manager.cpp b/iceoryx_posh/test/moduletests/test_roudi_system_manager.cpp index 1487e60ea3..0b2bd268c0 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_system_manager.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_system_manager.cpp @@ -18,6 +18,12 @@ #include "iceoryx_posh/internal/roudi/roudi.hpp" #include +#if defined(_WIN32) || defined(_WIN64) +#define GTEST_SKIP_FOR_WINDOWS() GTEST_SKIP() << "Skipping this test on Windows." +#else +#define GTEST_SKIP_FOR_WINDOWS() (void)0 +#endif + TEST(RoudiSystemD, CreateObject) { ::testing::Test::RecordProperty("TEST_ID", "aa77b5f6-ffb3-4267-982d-dfe85da384ca"); @@ -40,11 +46,11 @@ TEST(RoudiSystemD, CheckConstantsSizeString) ASSERT_NO_THROW(roudiSendMessage = std::make_unique()); ASSERT_EQ(roudiSendMessage->SIZE_STRING, 4096) << "Size string must equal 4096 simbols"; } -#ifndef _WIN32 + TEST(RoudiSystemD, SetThreadNameHelper) { ::testing::Test::RecordProperty("TEST_ID", "b9ff9e83-9dde-4221-bd1e-c1016ec2d5ff"); - + GTEST_SKIP_FOR_WINDOWS(); std::unique_ptr roudiSendMessage; bool result = true; @@ -57,6 +63,7 @@ TEST(RoudiSystemD, SetThreadNameHelper) TEST(RoudiSystemD, GetEnvironmentVariableReturnsCorrectValue) { ::testing::Test::RecordProperty("TEST_ID", "12dfa746-d1f1-4b4e-864d-2cb28ee49f70"); + GTEST_SKIP_FOR_WINDOWS(); const char* const env_var_name = "TEST_ENV_VAR"; const char* const env_var_value = "test_value"; @@ -79,6 +86,7 @@ TEST(RoudiSystemD, GetEnvironmentVariableReturnsCorrectValue) TEST(RoudiSystemD, GetEnvironmentVariableHandlesNonExistentVar) { ::testing::Test::RecordProperty("TEST_ID", "9595728f-a504-46e3-8672-b074696326a4"); + GTEST_SKIP_FOR_WINDOWS(); SendMessageServiceManagement sut; std::string result = sut.getEnvironmentVariable("NON_EXISTENT_VAR"); @@ -90,5 +98,4 @@ TEST(RoudiSystemD, GetEnvironmentVariableHandlesNonExistentVar) { EXPECT_EQ(result, "no implement"); } -} -#endif \ No newline at end of file +} \ No newline at end of file