diff --git a/iceoryx_dust/test/moduletests/test_container_fixed_position_container.cpp b/iceoryx_dust/test/moduletests/test_container_fixed_position_container.cpp index e66ddfd934a..42670ea32ce 100644 --- a/iceoryx_dust/test/moduletests/test_container_fixed_position_container.cpp +++ b/iceoryx_dust/test/moduletests/test_container_fixed_position_container.cpp @@ -17,8 +17,8 @@ #include "iox/fixed_position_container.hpp" #include "iceoryx_hoofs/error_handling/error_handling.hpp" -#include "iceoryx_hoofs/testing/ctor_and_assignment_operator_test_class.hpp" #include "iceoryx_hoofs/testing/fatal_failure.hpp" +#include "iceoryx_hoofs/testing/lifetime_and_assignment_tracker.hpp" #include "test.hpp" @@ -35,7 +35,7 @@ struct FixedPositionContainer_test : public Test using Sut = FixedPositionContainer; - using ComplexType = CTorAndAssignmentOperatorTestClass; + using ComplexType = LifetimeAndAssignmentTracker; using SutComplex = FixedPositionContainer; void SetUp() override diff --git a/iceoryx_dust/test/moduletests/test_cxx_forward_list.cpp b/iceoryx_dust/test/moduletests/test_cxx_forward_list.cpp index ea86c47204b..3cf8c89bc74 100644 --- a/iceoryx_dust/test/moduletests/test_cxx_forward_list.cpp +++ b/iceoryx_dust/test/moduletests/test_cxx_forward_list.cpp @@ -16,8 +16,8 @@ #include "iceoryx_dust/cxx/forward_list.hpp" #include "iceoryx_hoofs/error_handling/error_handling.hpp" -#include "iceoryx_hoofs/testing/ctor_and_assignment_operator_test_class.hpp" #include "iceoryx_hoofs/testing/fatal_failure.hpp" +#include "iceoryx_hoofs/testing/lifetime_and_assignment_tracker.hpp" #include "iox/attributes.hpp" #include "test.hpp" @@ -33,7 +33,7 @@ constexpr int64_t TEST_LIST_ELEMENT_DEFAULT_VALUE{-99L}; class forward_list_test : public Test { public: - using TestListElement = CTorAndAssignmentOperatorTestClass; + using TestListElement = LifetimeAndAssignmentTracker; void SetUp() override { diff --git a/iceoryx_hoofs/test/moduletests/test_container_vector.cpp b/iceoryx_hoofs/test/moduletests/test_container_vector.cpp index 1981c60c900..21db232f58a 100644 --- a/iceoryx_hoofs/test/moduletests/test_container_vector.cpp +++ b/iceoryx_hoofs/test/moduletests/test_container_vector.cpp @@ -16,8 +16,8 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_hoofs/error_handling/error_handling.hpp" -#include "iceoryx_hoofs/testing/ctor_and_assignment_operator_test_class.hpp" #include "iceoryx_hoofs/testing/fatal_failure.hpp" +#include "iceoryx_hoofs/testing/lifetime_and_assignment_tracker.hpp" #include "iox/vector.hpp" #include "test.hpp" @@ -32,7 +32,7 @@ using namespace iox::testing; class vector_test : public Test { public: - using CTorTest = CTorAndAssignmentOperatorTestClass<>; + using CTorTest = LifetimeAndAssignmentTracker<>; void SetUp() override { diff --git a/iceoryx_hoofs/test/moduletests/test_cxx_list.cpp b/iceoryx_hoofs/test/moduletests/test_cxx_list.cpp index d6614a0aa72..f87322451dc 100644 --- a/iceoryx_hoofs/test/moduletests/test_cxx_list.cpp +++ b/iceoryx_hoofs/test/moduletests/test_cxx_list.cpp @@ -16,8 +16,8 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_hoofs/error_handling/error_handling.hpp" -#include "iceoryx_hoofs/testing/ctor_and_assignment_operator_test_class.hpp" #include "iceoryx_hoofs/testing/fatal_failure.hpp" +#include "iceoryx_hoofs/testing/lifetime_and_assignment_tracker.hpp" #include "iox/attributes.hpp" #include "iox/list.hpp" #include "iox/logging.hpp" @@ -36,7 +36,7 @@ constexpr int64_t TEST_LIST_ELEMENT_DEFAULT_VALUE{-99L}; class list_test : public Test { public: - using TestListElement = CTorAndAssignmentOperatorTestClass; + using TestListElement = LifetimeAndAssignmentTracker; void SetUp() override { diff --git a/iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/ctor_and_assignment_operator_test_class.hpp b/iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/lifetime_and_assignment_tracker.hpp similarity index 74% rename from iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/ctor_and_assignment_operator_test_class.hpp rename to iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/lifetime_and_assignment_tracker.hpp index d1388fcbed2..61e2c77333f 100644 --- a/iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/ctor_and_assignment_operator_test_class.hpp +++ b/iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/lifetime_and_assignment_tracker.hpp @@ -16,8 +16,8 @@ // // SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_TESTING_CTOR_AND_ASSIGNMENT_OPERATOR_TEST_CLASS_HPP -#define IOX_HOOFS_TESTING_CTOR_AND_ASSIGNMENT_OPERATOR_TEST_CLASS_HPP +#ifndef IOX_HOOFS_TESTING_LIFETIME_AND_ASSIGNMENT_TRACKER_HPP +#define IOX_HOOFS_TESTING_LIFETIME_AND_ASSIGNMENT_TRACKER_HPP #include #include @@ -27,38 +27,38 @@ namespace iox namespace testing { template -class CTorAndAssignmentOperatorTestClass +class LifetimeAndAssignmentTracker { public: - CTorAndAssignmentOperatorTestClass() + LifetimeAndAssignmentTracker() { stats.cTor++; stats.classValue = value; } // NOLINTNEXTLINE(hicpp-explicit-conversions) we want to use this class in tests transparently to a 'T' - CTorAndAssignmentOperatorTestClass(const T value) + LifetimeAndAssignmentTracker(const T value) : value(value) { stats.customCTor++; stats.classValue = value; } - CTorAndAssignmentOperatorTestClass(const CTorAndAssignmentOperatorTestClass& rhs) + LifetimeAndAssignmentTracker(const LifetimeAndAssignmentTracker& rhs) : value(rhs.value) { stats.copyCTor++; stats.classValue = value; } - CTorAndAssignmentOperatorTestClass(CTorAndAssignmentOperatorTestClass&& rhs) noexcept + LifetimeAndAssignmentTracker(LifetimeAndAssignmentTracker&& rhs) noexcept : value(rhs.value) { stats.moveCTor++; stats.classValue = value; } - CTorAndAssignmentOperatorTestClass& operator=(const CTorAndAssignmentOperatorTestClass& rhs) + LifetimeAndAssignmentTracker& operator=(const LifetimeAndAssignmentTracker& rhs) { if (this != &rhs) { @@ -69,7 +69,7 @@ class CTorAndAssignmentOperatorTestClass return *this; } - CTorAndAssignmentOperatorTestClass& operator=(CTorAndAssignmentOperatorTestClass&& rhs) noexcept + LifetimeAndAssignmentTracker& operator=(LifetimeAndAssignmentTracker&& rhs) noexcept { if (this != &rhs) { @@ -80,12 +80,12 @@ class CTorAndAssignmentOperatorTestClass return *this; } - bool operator==(const CTorAndAssignmentOperatorTestClass& rhs) const + bool operator==(const LifetimeAndAssignmentTracker& rhs) const { return value == rhs.value; } - ~CTorAndAssignmentOperatorTestClass() + ~LifetimeAndAssignmentTracker() { stats.dTor++; stats.classValue = value; @@ -136,9 +136,9 @@ class CTorAndAssignmentOperatorTestClass }; template -typename CTorAndAssignmentOperatorTestClass::Statistics - CTorAndAssignmentOperatorTestClass::stats{}; +typename LifetimeAndAssignmentTracker::Statistics + LifetimeAndAssignmentTracker::stats{}; } // namespace testing } // namespace iox -#endif // IOX_HOOFS_TESTING_CTOR_AND_ASSIGNMENT_OPERATOR_TEST_CLASS_HPP +#endif // IOX_HOOFS_TESTING_LIFETIME_AND_ASSIGNMENT_TRACKER_HPP