|
|
|
@ -67,19 +67,19 @@ TEST(InlinedVectorTest, EmplaceBack) { |
|
|
|
|
TEST(InlinedVectorTest, ClearAndRepopulate) { |
|
|
|
|
const int kNumElements = 10; |
|
|
|
|
InlinedVector<int, 5> v; |
|
|
|
|
EXPECT_EQ(0, v.size()); |
|
|
|
|
EXPECT_EQ(0UL, v.size()); |
|
|
|
|
for (int i = 0; i < kNumElements; ++i) { |
|
|
|
|
v.push_back(i); |
|
|
|
|
EXPECT_EQ(i + 1, v.size()); |
|
|
|
|
EXPECT_EQ(i + 1UL, v.size()); |
|
|
|
|
} |
|
|
|
|
for (int i = 0; i < kNumElements; ++i) { |
|
|
|
|
EXPECT_EQ(i, v[i]); |
|
|
|
|
} |
|
|
|
|
v.clear(); |
|
|
|
|
EXPECT_EQ(0, v.size()); |
|
|
|
|
EXPECT_EQ(0UL, v.size()); |
|
|
|
|
for (int i = 0; i < kNumElements; ++i) { |
|
|
|
|
v.push_back(kNumElements + i); |
|
|
|
|
EXPECT_EQ(i + 1, v.size()); |
|
|
|
|
EXPECT_EQ(i + 1UL, v.size()); |
|
|
|
|
} |
|
|
|
|
for (int i = 0; i < kNumElements; ++i) { |
|
|
|
|
EXPECT_EQ(kNumElements + i, v[i]); |
|
|
|
@ -89,10 +89,10 @@ TEST(InlinedVectorTest, ClearAndRepopulate) { |
|
|
|
|
TEST(InlinedVectorTest, ConstIndexOperator) { |
|
|
|
|
const int kNumElements = 10; |
|
|
|
|
InlinedVector<int, 5> v; |
|
|
|
|
EXPECT_EQ(0, v.size()); |
|
|
|
|
EXPECT_EQ(0UL, v.size()); |
|
|
|
|
for (int i = 0; i < kNumElements; ++i) { |
|
|
|
|
v.push_back(i); |
|
|
|
|
EXPECT_EQ(i + 1, v.size()); |
|
|
|
|
EXPECT_EQ(i + 1UL, v.size()); |
|
|
|
|
} |
|
|
|
|
auto const_func = [kNumElements](const InlinedVector<int, 5>& v) { |
|
|
|
|
for (int i = 0; i < kNumElements; ++i) { |
|
|
|
|