Skip to content

Commit

Permalink
Merge pull request #157 from rghouzra/patch-3
Browse files Browse the repository at this point in the history
add test for clear() method
  • Loading branch information
auto-differentiation-dev authored Dec 5, 2024
2 parents 5fedca2 + e20d156 commit af3a989
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/ChunkContainer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,23 @@ TEST(ChunkContainer, resize)
}
}

TEST(ChunkContainer, clear_method)
{
ChunkContainer<int, 8> chk;
chk.resize(20, 42);

EXPECT_THAT(chk.size(), Eq(20u));
auto cp = chk.capacity();

chk.clear();
EXPECT_THAT(chk.size(), Eq(0u));
EXPECT_THAT(chk.capacity(), Eq(cp));

chk.resize(10, -42);
EXPECT_THAT(chk.size(), Eq(10u));
}


TEST(ChunkContainer, resize_fills_with_values)
{
ChunkContainer<int, 8> chk;
Expand Down

0 comments on commit af3a989

Please sign in to comment.