Skip to content

Commit

Permalink
Got rid of a few as_unsigned in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OleErikPeistorpet committed Jun 2, 2024
1 parent fc05f9e commit d7d2aab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion unit_test/dynarray_construct_assignop_swap_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ void testAssignMoveElements()

EXPECT_EQ(capBefore, a.capacity());
ASSERT_EQ(na, ssize(b));
for (unsigned i{}; i < as_unsigned(na); ++i)
for (int i = 0; i < na; ++i)
EXPECT_TRUE(b[i].hasValue() and *b[i] == i + 0.5);
}
EXPECT_EQ(T::nConstructions, T::nDestruct);
Expand Down
8 changes: 4 additions & 4 deletions unit_test/dynarray_mutate_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ TEST_F(dynarrayTest, appendNonForwardRange)
EXPECT_EQ(it, end);
EXPECT_EQ(3u, dest.size());
for (int i = 0; i < 3; ++i)
EXPECT_EQ( i + 1, dest[oel::as_unsigned(i)] );
EXPECT_EQ(i + 1, dest[i]);
}
#endif

Expand Down Expand Up @@ -466,8 +466,8 @@ TEST_F(dynarrayTest, insertR)
}
if (dest.size() > initSize)
{
for (size_t i{}; i < oel::as_unsigned(countThrow); ++i)
EXPECT_TRUE( *toInsert[i] == *dest[i + oel::as_unsigned(insertOffset)] );
for (ptrdiff_t i{}; i < countThrow; ++i)
EXPECT_TRUE( *toInsert[oel::as_unsigned(i)] == *dest[i + insertOffset] );
}
if (insertOffset == 0)
{
Expand Down Expand Up @@ -520,7 +520,7 @@ TEST_F(dynarrayTest, emplace)
{ dest.emplace(dest.begin() + insertOffset);

EXPECT_EQ(initSize + 1, ssize(dest));
EXPECT_FALSE( dest.at(oel::as_unsigned(insertOffset)).hasValue() );
EXPECT_FALSE( dest.at(insertOffset).hasValue() );
}
if (insertOffset == 0)
{
Expand Down

0 comments on commit d7d2aab

Please sign in to comment.