Skip to content

Commit

Permalink
iox-#2330 Add platform-specific skips for non-Linux systems
Browse files Browse the repository at this point in the history
  • Loading branch information
khromenokroman committed Sep 1, 2024
1 parent 1ce0015 commit 8d61df2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions iceoryx_posh/test/moduletests/test_roudi_system_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,24 @@ TEST(RoudiSystemD, SetThreadNameHelper)
{
::testing::Test::RecordProperty("TEST_ID", "b9ff9e83-9dde-4221-bd1e-c1016ec2d5ff");
GTEST_SKIP_FOR_WINDOWS();
#if defined(__linux__)
std::unique_ptr<SendMessageServiceManagement> roudiSendMessage;
bool result = true;

ASSERT_NO_THROW(roudiSendMessage = std::make_unique<SendMessageServiceManagement>());
iox::string<SendMessageServiceManagement::SIZE_THREAD_NAME> nameThread = "test";
ASSERT_NO_THROW(result = roudiSendMessage->setThreadNameHelper(nameThread));
ASSERT_EQ(result, true) << "Can not change name thread";
#else
ASSERT_EQ(true, true)
#endif
}

TEST(RoudiSystemD, GetEnvironmentVariableReturnsCorrectValue)
{
::testing::Test::RecordProperty("TEST_ID", "12dfa746-d1f1-4b4e-864d-2cb28ee49f70");
GTEST_SKIP_FOR_WINDOWS();
#if defined(__linux__)
const char* const env_var_name = "TEST_ENV_VAR";
const char* const env_var_value = "test_value";

Expand All @@ -81,12 +86,16 @@ TEST(RoudiSystemD, GetEnvironmentVariableReturnsCorrectValue)
{
EXPECT_EQ(result, "no implement");
}
#else
ASSERT_EQ(true, true)
#endif
}

TEST(RoudiSystemD, GetEnvironmentVariableHandlesNonExistentVar)
{
::testing::Test::RecordProperty("TEST_ID", "9595728f-a504-46e3-8672-b074696326a4");
GTEST_SKIP_FOR_WINDOWS();
#if defined(__linux__)
SendMessageServiceManagement sut;

std::string result = sut.getEnvironmentVariable("NON_EXISTENT_VAR");
Expand All @@ -98,4 +107,7 @@ TEST(RoudiSystemD, GetEnvironmentVariableHandlesNonExistentVar)
{
EXPECT_EQ(result, "no implement");
}
#else
ASSERT_EQ(true, true)
#endif
}

0 comments on commit 8d61df2

Please sign in to comment.