diff options
Diffstat (limited to 'base/pickle_unittest.cc')
-rw-r--r-- | base/pickle_unittest.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/base/pickle_unittest.cc b/base/pickle_unittest.cc index a3fa1eb..48ab1cd 100644 --- a/base/pickle_unittest.cc +++ b/base/pickle_unittest.cc @@ -167,7 +167,8 @@ TEST(PickleTest, Resize) { static_cast<int>(payload_size_after_header - sizeof(uint32))); size_t cur_payload = payload_size_after_header; - EXPECT_EQ(pickle.capacity(), unit); + // note: we assume 'unit' is a power of 2 + EXPECT_EQ(unit, pickle.capacity()); EXPECT_EQ(pickle.payload_size(), payload_size_after_header); // fill out a full page (noting data header) @@ -176,10 +177,10 @@ TEST(PickleTest, Resize) { EXPECT_EQ(unit * 2, pickle.capacity()); EXPECT_EQ(cur_payload, pickle.payload_size()); - // one more byte should expand the capacity by one unit + // one more byte should double the capacity pickle.WriteData(data_ptr, 1); cur_payload += 5; - EXPECT_EQ(unit * 3, pickle.capacity()); + EXPECT_EQ(unit * 4, pickle.capacity()); EXPECT_EQ(cur_payload, pickle.payload_size()); } |