diff --git a/test/ChunkContainer_test.cpp b/test/ChunkContainer_test.cpp index 77b13c27..aa1feebb 100644 --- a/test/ChunkContainer_test.cpp +++ b/test/ChunkContainer_test.cpp @@ -230,3 +230,16 @@ TEST(ChunkContainer, push_back_no_check) for (int i = 0; i < 17; ++i) EXPECT_THAT(chk[size_t(i)], Eq(i)) << "at " << i; } + +TEST(ChunkContainer, emplace_back) +{ + ChunkContainer, 8> chk; + for (int i = 0; i < 17; ++i) chk.emplace_back(i, i); + + EXPECT_THAT(chk.size(), Eq(17u)); + + for (int i = 0; i < 17; ++i) + { + EXPECT_THAT(chk[size_t(i)], Pair(i, i)) << "at " << i; + } +} \ No newline at end of file diff --git a/test/OperationsContainer_test.cpp b/test/OperationsContainer_test.cpp index 24f5892b..db6b6dae 100644 --- a/test/OperationsContainer_test.cpp +++ b/test/OperationsContainer_test.cpp @@ -120,11 +120,11 @@ TYPED_TEST(OperationsContainerTest, canResizeExtendingSize) { auto c = TypeParam(); c.push_back(42.0, 123); - c.resize(8); + c.resize(9); EXPECT_THAT(c.size(), Eq(8)); EXPECT_THAT(c[0], Pair(42.0, 123)); - for (unsigned i = 1; i < 8; ++i) + for (unsigned i = 1; i < 9; ++i) { EXPECT_THAT(c[i], Pair(0.0, 0)) << "for i=" << i; } @@ -198,10 +198,12 @@ TYPED_TEST(OperationsContainerTest2, callsDestructOnDisposal) TestStruct::items = 0; { auto c = TypeParam(); - c.push_back(TestStruct(), 1); - c.push_back(TestStruct(), 2); - EXPECT_THAT(c[1], Pair(_, 2)); - EXPECT_THAT(TestStruct::items, Eq(2)); + for (int i = 0; i < 13; ++i) + { + c.push_back(TestStruct(), i); + } + EXPECT_THAT(c[1], Pair(_, 1)); + EXPECT_THAT(TestStruct::items, Eq(13)); } EXPECT_THAT(TestStruct::items, Eq(0)); }