aboutsummaryrefslogtreecommitdiff
path: root/src/common/memory_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/memory_unittest.cc')
-rw-r--r--src/common/memory_unittest.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/memory_unittest.cc b/src/common/memory_unittest.cc
index 8b2ec410..d580c1fe 100644
--- a/src/common/memory_unittest.cc
+++ b/src/common/memory_unittest.cc
@@ -69,6 +69,7 @@ typedef testing::Test WastefulVectorTest;
TEST(WastefulVectorTest, Setup) {
PageAllocator allocator_;
wasteful_vector<int> v(&allocator_);
+ ASSERT_TRUE(v.empty());
ASSERT_EQ(v.size(), 0u);
}
@@ -76,8 +77,12 @@ TEST(WastefulVectorTest, Simple) {
PageAllocator allocator_;
wasteful_vector<unsigned> v(&allocator_);
- for (unsigned i = 0; i < 256; ++i)
+ for (unsigned i = 0; i < 256; ++i) {
v.push_back(i);
+ ASSERT_EQ(i, v.back());
+ ASSERT_EQ(&v.back(), &v[i]);
+ }
+ ASSERT_FALSE(v.empty());
ASSERT_EQ(v.size(), 256u);
for (unsigned i = 0; i < 256; ++i)
ASSERT_EQ(v[i], i);