Skip to content

Commit

Permalink
iox-eclipse-iceoryx#2055 Solve the conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Liu <[email protected]>
  • Loading branch information
Dennis40816 committed Jan 14, 2024
1 parent 82ab07f commit 8d2a811
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions iceoryx_hoofs/test/moduletests/test_utility_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ TEST_F(convert_test, fromString_LongDouble_Success)

auto result = iox::convert::from_string<long double>(source.c_str());
ASSERT_THAT(result.has_value(), Eq(true));
EXPECT_THAT(LongDouble::Eq(VERIFY, result.value()), Eq(true)); // NOLINT(clang-analyzer-core.CallAndMessage)
// NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage)
EXPECT_THAT(LongDouble::Eq(VERIFY, result.value()), Eq(true));
}

TEST_F(convert_test, fromString_LongDouble_Fail)
Expand Down Expand Up @@ -765,26 +766,26 @@ TEST_F(convert_test, fromString_LongDouble_EdgeCase_InRange_Success)
::testing::Test::RecordProperty("TEST_ID", "cab1c90b-1de0-4654-bbea-4bb4e55e4fc3");

// the number larger than numeric_limits<long double>::digits10 that will pass all tests for all platforms
constexpr uint16_t PLATFORM_DIGIT_WORKAROUND_MIN{34};
constexpr uint16_t PLATFORM_DIGIT_WORKAROUND_MIN{36};
constexpr uint16_t PLATFORM_DIGIT_WORKAROUND_MAX{34};

std::string source = fp_to_string(std::numeric_limits<long double>::min(), PLATFORM_DIGIT_WORKAROUND_MIN);
auto long_double_min = iox::convert::from_string<long double>(source.c_str());
ASSERT_THAT(long_double_min.has_value(), Eq(true));
EXPECT_THAT(LongDouble::Eq(long_double_min.value(), std::numeric_limits<long double>::min()),
Eq(true)); // NOLINT(clang-analyzer-core.CallAndMessage)
// NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage)
EXPECT_THAT(LongDouble::Eq(long_double_min.value(), std::numeric_limits<long double>::min()), Eq(true));

source = fp_to_string(std::numeric_limits<long double>::lowest(), PLATFORM_DIGIT_WORKAROUND_MAX);
auto long_double_lowest = iox::convert::from_string<long double>(source.c_str());
ASSERT_THAT(long_double_lowest.has_value(), Eq(true));
EXPECT_THAT(LongDouble::Eq(long_double_lowest.value(), std::numeric_limits<long double>::lowest()),
Eq(true)); // NOLINT(clang-analyzer-core.CallAndMessage)
// NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage)
EXPECT_THAT(LongDouble::Eq(long_double_lowest.value(), std::numeric_limits<long double>::lowest()), Eq(true));

source = fp_to_string(std::numeric_limits<long double>::max(), PLATFORM_DIGIT_WORKAROUND_MAX);
auto long_double_max = iox::convert::from_string<long double>(source.c_str());
ASSERT_THAT(long_double_max.has_value(), Eq(true));
EXPECT_THAT(LongDouble::Eq(long_double_max.value(), std::numeric_limits<long double>::max()),
Eq(true)); // NOLINT(clang-analyzer-core.CallAndMessage)
// NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage)
EXPECT_THAT(LongDouble::Eq(long_double_max.value(), std::numeric_limits<long double>::max()), Eq(true));
}

TEST_F(convert_test, fromString_LongDouble_EdgeCase_SubNormalLongDouble_ShouldFailExceptMsvc)
Expand Down Expand Up @@ -933,7 +934,8 @@ TEST_F(convert_test, fromString_LongDouble_EdgeCase_ZeroDecimalNotation_Success)
{
auto decimal_ret = iox::convert::from_string<long double>(v.c_str());
ASSERT_THAT(decimal_ret.has_value(), Eq(true));
ASSERT_THAT(LongDouble::Eq(decimal_ret.value(), 0.0L), Eq(true)); // NOLINT(clang-analyzer-core.CallAndMessage)
// NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage)
ASSERT_THAT(LongDouble::Eq(decimal_ret.value(), 0.0L), Eq(true));
}
}

Expand Down

0 comments on commit 8d2a811

Please sign in to comment.