Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1196 Fix leftovers with missing U, capital F and …
Browse files Browse the repository at this point in the history
…make STACK_SIZE in test uint64_t again

Signed-off-by: Christian Eltzschig <[email protected]>
  • Loading branch information
elfenpiff committed Jul 6, 2022
1 parent 6d4f09b commit 6bc6ec7
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions iceoryx_hoofs/test/moduletests/test_cxx_forward_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ TEST_F(forward_list_test, CustomCTorWithOneElements)
::testing::Test::RecordProperty("TEST_ID", "56251d67-94f6-406d-9448-3224a58df4bb");
constexpr uint64_t CAPACITY{42U};
constexpr uint64_t ELEMENT_COUNT{1U};
constexpr int64_t DEFAULT_VALUE{3U};
constexpr int64_t DEFAULT_VALUE{3};
forward_list<TestListElement, CAPACITY> sut1;

for (uint64_t i = 0U; i < ELEMENT_COUNT; ++i)
Expand Down Expand Up @@ -464,7 +464,7 @@ TEST_F(forward_list_test, EmplaceAfterWithSomeElements)
constexpr uint64_t ELEMENT_COUNT{37U};
forward_list<TestListElement, CAPACITY> sut1;
auto iter = sut1.cbefore_begin();
int64_t cnt = 0U;
int64_t cnt = 0;

EXPECT_THAT(cTor, Eq(0U));
EXPECT_THAT(customCTor, Eq(0U));
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_cxx_function_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ TEST_F(function_refTest, CreationWithFunctionPointerWithComplexTypeArgWorks)
constexpr auto fp = &returnComplexType;
function_ref<ComplexType(ComplexType)> sut(fp);

ComplexType arg{1, 2, 3.3f};
ComplexType arg{1, 2, 3.3F};
auto result = sut(arg);
EXPECT_EQ(result, arg);
}
Expand Down
6 changes: 3 additions & 3 deletions iceoryx_hoofs/test/moduletests/test_cxx_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ TEST_F(list_test, NotFullWhenFilledWithCapacityAndEraseOneElements)
TEST_F(list_test, NotFullWhenFilledWithCapacityAndEraseOneAndReinsertElements)
{
::testing::Test::RecordProperty("TEST_ID", "c7e70ac7-e476-43aa-976c-1ac78513c869");
int64_t counter = 0U;
int64_t counter = 0;
for (; static_cast<uint64_t>(counter) < sut.capacity(); ++counter)
{
sut.emplace_back(counter);
Expand Down Expand Up @@ -909,14 +909,14 @@ TEST_F(list_test, PushBackFailsWhenSpaceNotAvailableRValue)
TEST_F(list_test, PushBackCheckInsertPosition)
{
::testing::Test::RecordProperty("TEST_ID", "5d07986f-87ba-4dde-bfb9-7da56eb4bb54");
int64_t counter = 0U;
int64_t counter = 0;

for (; static_cast<uint64_t>(counter) < TESTLISTCAPACITY; ++counter)
{
EXPECT_TRUE(sut.push_back(counter));
}

counter = 0U;
counter = 0;
for (auto& listElement : sut)
{
EXPECT_THAT(listElement.m_value, Eq(counter));
Expand Down
14 changes: 7 additions & 7 deletions iceoryx_hoofs/test/moduletests/test_cxx_stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TestClass
{
public:
TestClass() noexcept = default;
TestClass(const int32_t a, const int32_t b, const int32_t c) noexcept
TestClass(const uint32_t a, const uint32_t b, const uint32_t c) noexcept
: m_a(a)
, m_b(b)
, m_c(c)
Expand All @@ -37,18 +37,18 @@ class TestClass
{
return m_a == rhs.m_a && m_b == rhs.m_b && m_c == rhs.m_c;
}
int32_t m_a = 0, m_b = 0, m_c = 0;
uint32_t m_a = 0, m_b = 0, m_c = 0;
};

class stack_test : public Test
{
public:
static constexpr int32_t STACK_SIZE = 10U;
cxx::stack<TestClass, static_cast<uint64_t>(STACK_SIZE)> m_sut;
static constexpr uint32_t STACK_SIZE = 10U;
cxx::stack<TestClass, STACK_SIZE> m_sut;

void pushElements(const int32_t numberOfElements)
void pushElements(const uint32_t numberOfElements)
{
for (int32_t i = 0U; i < numberOfElements; ++i)
for (uint32_t i = 0U; i < numberOfElements; ++i)
{
ASSERT_TRUE(m_sut.push(i + 1, i + 2, i + 3));
EXPECT_THAT(m_sut.size(), Eq(static_cast<uint64_t>(i) + 1U));
Expand Down Expand Up @@ -92,7 +92,7 @@ TEST_F(stack_test, pushingElementsTillStackIsFullAndPoppingInLIFOOrderSucceeds)
::testing::Test::RecordProperty("TEST_ID", "2d12fd5d-ded8-482d-86dd-094660c65f9c");
pushElements(STACK_SIZE);

for (int32_t i = 0U; i < STACK_SIZE; ++i)
for (uint32_t i = 0U; i < STACK_SIZE; ++i)
{
auto element = m_sut.pop();
EXPECT_THAT(m_sut.size(), Eq(static_cast<uint64_t>(STACK_SIZE - i) - 1U));
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_objectpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ TEST_F(ObjectPool_test, iterator)
}

EXPECT_THAT(numElements, Eq(3));
for (uint64_t i = 1; i <= 3; ++i)
for (uint64_t i = 1U; i <= 3U; ++i)
{
EXPECT_THAT(count[i], Eq(1)); // expect each value exactly once
}
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_relative_pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ TYPED_TEST(RelativePointer_test, getPtr)
EXPECT_EQ(rp1.registerPtr(1, typedPtr), true);
EXPECT_EQ(BaseRelativePointer::getPtr(1, 0), ptr);

uint64_t offset = SHARED_MEMORY_SIZE / 2;
uint64_t offset = SHARED_MEMORY_SIZE / 2U;
auto addressAtOffset = reinterpret_cast<TypeParam*>(ptr + offset);
RelativePointer<TypeParam> rp2(addressAtOffset, 1);
EXPECT_EQ(BaseRelativePointer::getPtr(1, offset), addressAtOffset);
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_hoofs/test/moduletests/test_unit_duration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,7 @@ TEST(Duration_test, MultiplyMaxDurationWithDoubleOneResultsInMaxDuration)
TEST(Duration_test, MultiplyDurationWithFloatResultsInSaturationDueToSeconds)
{
::testing::Test::RecordProperty("TEST_ID", "085de609-5f38-4a63-8719-f15263ca448b");
constexpr float MULTIPLICATOR{1343535617188545797.0f};
constexpr float MULTIPLICATOR{1343535617188545797.0F};
constexpr Duration DURATION = 14_s;

EXPECT_THAT(MULTIPLICATOR * DURATION, Eq(DurationAccessor::max()));
Expand All @@ -2096,7 +2096,7 @@ TEST(Duration_test, MultiplyDurationWithDoubleResultsInSaturationDueToSeconds)
TEST(Duration_test, MultiplyDurationWithFloatResultsInSaturationDueToNanoseconds)
{
::testing::Test::RecordProperty("TEST_ID", "38ad7f5d-480a-4c4b-8ff0-8a24f3d6f2a6");
constexpr float MULTIPLICATOR{1343535617188545797.0f};
constexpr float MULTIPLICATOR{1343535617188545797.0F};
constexpr Duration DURATION = 13_s + 930_ms + 37_ns;

EXPECT_THAT(MULTIPLICATOR * DURATION, Eq(DurationAccessor::max()));
Expand Down

0 comments on commit 6bc6ec7

Please sign in to comment.