Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1614 Remove related todos
Browse files Browse the repository at this point in the history
Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
  • Loading branch information
FerdinandSpitzschnueffler committed Nov 1, 2022
1 parent 1de8513 commit bb2d1e1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
11 changes: 4 additions & 7 deletions iceoryx_dust/include/iceoryx_dust/cxx/forward_list.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
// Copyright (c) 2021 - 2022 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@
#ifndef IOX_DUST_CXX_FORWARD_LIST_HPP
#define IOX_DUST_CXX_FORWARD_LIST_HPP

#include "iceoryx_hoofs/containers/uninitialized_array.hpp"
#include "iceoryx_hoofs/cxx/helplets.hpp"

#include <cstdint>
Expand Down Expand Up @@ -355,12 +356,8 @@ class forward_list
// are inserted by the user (starting from BEFORE_BEGIN_INDEX)
size_type m_freeListHeadIdx{0U};

// @todo iox-#1614 will be replaced by uninitialized array
// NOLINTBEGIN(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays)
NodeLink m_links[NODE_LINK_COUNT];
using element_t = uint8_t[sizeof(T)];
alignas(T) element_t m_data[Capacity];
// NOLINTEND(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays)
containers::UninitializedArray<NodeLink, NODE_LINK_COUNT> m_links;
containers::UninitializedArray<T, Capacity> m_data;

size_type m_size{0U};
}; // forward_list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define IOX_DUST_POSIX_WRAPPER_NAMED_PIPE_HPP

#include "iceoryx_hoofs/concurrent/lockfree_queue.hpp"
#include "iceoryx_hoofs/containers/uninitialized_array.hpp"
#include "iceoryx_hoofs/cxx/string.hpp"
#include "iceoryx_hoofs/design_pattern/creation.hpp"
#include "iceoryx_hoofs/internal/posix_wrapper/ipc_channel.hpp"
Expand Down Expand Up @@ -150,9 +151,7 @@ class NamedPipe : public DesignPattern::Creation<NamedPipe, IpcChannelError>
static constexpr units::Duration WAIT_FOR_INIT_SLEEP_TIME = units::Duration::fromMilliseconds(1);

std::atomic<uint64_t> initializationGuard{INVALID_DATA};
/// NOLINTJUSTIFICATION @todo iox-#1614 replace with cxx::array implementation
/// NOLINTNEXTLINE(hicpp-avoid-c-arrays,cppcoreguidelines-avoid-c-arrays)
cxx::optional<UnnamedSemaphore> semaphores[2U];
containers::UninitializedArray<cxx::optional<UnnamedSemaphore>, 2> semaphores;
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class static_storage final
static constexpr uint64_t allocation_size() noexcept;

private:
/// @NOLINTJUSTIFICATION @todo iox-#1614 will be replaced by uninitialized array
/// @NOLINTJUSTIFICATION @todo iox-#1732 will be refactored with BumpAllocator
/// @NOLINTNEXTLINE(hicpp-avoid-c-arrays,cppcoreguidelines-avoid-c-arrays)
alignas(Align) uint8_t m_bytes[Capacity];
void* m_ptr{nullptr};
Expand Down
26 changes: 13 additions & 13 deletions iceoryx_hoofs/test/moduletests/test_cxx_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,37 +1498,37 @@ TEST_F(list_test, IteratorComparisonOfDifferentLists)

auto iterSut1 = sut11.begin();
auto iterSut2 = sut12.begin();
/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(iterSut1 == iterSut2), "");

iterSut1 = sut11.begin();
iterSut2 = sut12.begin();
/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(iterSut1 == iterSut2), "");

iterSut1 = sut11.end();
iterSut2 = sut12.end();
/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(iterSut1 == iterSut2), "");

iterSut1 = sut11.begin();
iterSut2 = sut12.begin();
/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(iterSut1 != iterSut2), "");

iterSut1 = sut11.begin();
iterSut2 = sut12.begin();
/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(iterSut1 != iterSut2), "");

iterSut1 = sut11.end();
iterSut2 = sut12.end();
/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(iterSut1 != iterSut2), "");
}
Expand Down Expand Up @@ -2312,7 +2312,7 @@ TEST_F(list_test, invalidIteratorErase)
++iter;
sut.erase(iter);

/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(sut.erase(iter), "");
}
Expand All @@ -2330,7 +2330,7 @@ TEST_F(list_test, invalidIteratorIncrement)
++iter;
sut.erase(iter);

/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(++iter, "");
}
Expand All @@ -2348,7 +2348,7 @@ TEST_F(list_test, invalidIteratorDecrement)
++iter;
sut.erase(iter);

/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(--iter, "");
}
Expand All @@ -2366,7 +2366,7 @@ TEST_F(list_test, invalidIteratorComparison)
++iter;
auto iter2 IOX_MAYBE_UNUSED = sut.erase(iter);

/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(sut.cbegin() == iter), "");
}
Expand All @@ -2384,7 +2384,7 @@ TEST_F(list_test, invalidIteratorComparisonUnequal)
++iter;
auto iter2 = sut.erase(iter);

/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(iter2 != iter), "");
}
Expand All @@ -2402,7 +2402,7 @@ TEST_F(list_test, invalidIteratorDereferencing)
++iter;
auto iter2 IOX_MAYBE_UNUSED = sut.erase(iter);

/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc((*iter).m_value), "");
}
Expand All @@ -2420,7 +2420,7 @@ TEST_F(list_test, invalidIteratorAddressOfOperator)
++iter;
auto iter2 IOX_MAYBE_UNUSED = sut.erase(iter);

/// @NOLINTJUSTIFICATION @todo iox-#1614 remove EXPECT_DEATH
/// @NOLINTJUSTIFICATION @todo iox-#1613 remove EXPECT_DEATH
/// @NOLINTNEXTLINE (cppcoreguidelines-pro-type-vararg, hicpp-avoid-goto, cert-err33-c)
EXPECT_DEATH(dummyFunc(iter->m_value == 12U), "");
}
Expand Down

0 comments on commit bb2d1e1

Please sign in to comment.