Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1949)

Unified Diff: base/pickle_unittest.cc

Issue 46056: Change Pickle to double its capacity by default, rather than increasing... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/pickle.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pickle_unittest.cc
===================================================================
--- base/pickle_unittest.cc (revision 11625)
+++ base/pickle_unittest.cc (working copy)
@@ -167,7 +167,8 @@
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 @@
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());
}
« no previous file with comments | « base/pickle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698