diff --git a/iceoryx2-ffi/cxx/tests/src/slice_tests.cpp b/iceoryx2-ffi/cxx/tests/src/slice_tests.cpp index 07de4373b..9c0cbf95d 100644 --- a/iceoryx2-ffi/cxx/tests/src/slice_tests.cpp +++ b/iceoryx2-ffi/cxx/tests/src/slice_tests.cpp @@ -13,6 +13,8 @@ #include "iox/slice.hpp" #include "test.hpp" +#include + namespace { struct DummyData { @@ -27,25 +29,25 @@ TEST(SliceTest, const_correctness_is_maintained) { auto elements = std::array {}; - auto mutable_slice = iox::MutableSlice(elements.begin(), SLICE_MAX_LENGTH); + auto mutable_slice = iox::MutableSlice(elements.data(), SLICE_MAX_LENGTH); ASSERT_FALSE(std::is_const_v>); ASSERT_FALSE(std::is_const_v>); ASSERT_FALSE(std::is_const_v>); ASSERT_FALSE(std::is_const_v>); - const auto const_mutable_slice = iox::MutableSlice(elements.begin(), SLICE_MAX_LENGTH); + const auto const_mutable_slice = iox::MutableSlice(elements.data(), SLICE_MAX_LENGTH); ASSERT_FALSE(std::is_const_v>); ASSERT_FALSE(std::is_const_v>); ASSERT_FALSE(std::is_const_v>); ASSERT_FALSE(std::is_const_v>); - auto immutable_slice = iox::ImmutableSlice(elements.begin(), SLICE_MAX_LENGTH); + auto immutable_slice = iox::ImmutableSlice(elements.data(), SLICE_MAX_LENGTH); ASSERT_TRUE(std::is_const_v>); ASSERT_TRUE(std::is_const_v>); ASSERT_TRUE(std::is_const_v>); ASSERT_TRUE(std::is_const_v>); - const auto const_immutable_slice = iox::ImmutableSlice(elements.begin(), SLICE_MAX_LENGTH); + const auto const_immutable_slice = iox::ImmutableSlice(elements.data(), SLICE_MAX_LENGTH); ASSERT_TRUE(std::is_const_v>); ASSERT_TRUE(std::is_const_v>); ASSERT_TRUE(std::is_const_v>); @@ -57,7 +59,7 @@ TEST(SliceTest, can_iterate_mutable_slice) { auto elements = std::array {}; - auto mutable_slice = iox::MutableSlice(elements.begin(), SLICE_MAX_LENGTH); + auto mutable_slice = iox::MutableSlice(elements.data(), SLICE_MAX_LENGTH); auto iterations = 0; for (auto element : mutable_slice) { ASSERT_THAT(element.a, Eq(DummyData::DEFAULT_VALUE_A)); @@ -72,7 +74,7 @@ TEST(SliceTest, can_iterate_const_mutable_slice) { auto elements = std::array {}; - const auto slice = iox::MutableSlice(elements.begin(), SLICE_MAX_LENGTH); + const auto slice = iox::MutableSlice(elements.data(), SLICE_MAX_LENGTH); auto iterations = 0; for (auto element : slice) { ASSERT_THAT(element.a, Eq(DummyData::DEFAULT_VALUE_A)); @@ -87,7 +89,7 @@ TEST(SliceTest, can_iterate_immutable_slice) { auto elements = std::array {}; - auto slice = iox::ImmutableSlice(elements.begin(), SLICE_MAX_LENGTH); + auto slice = iox::ImmutableSlice(elements.data(), SLICE_MAX_LENGTH); auto iterations = 0; for (auto element : slice) { ASSERT_THAT(element.a, Eq(DummyData::DEFAULT_VALUE_A)); @@ -102,7 +104,7 @@ TEST(SliceTest, can_iterate_const_immutable_slice) { auto elements = std::array {}; - const auto slice = iox::ImmutableSlice(elements.begin(), SLICE_MAX_LENGTH); + const auto slice = iox::ImmutableSlice(elements.data(), SLICE_MAX_LENGTH); auto iterations = 0; for (auto element : slice) { ASSERT_THAT(element.a, Eq(DummyData::DEFAULT_VALUE_A));