summaryrefslogtreecommitdiff
path: root/db/write_batch_test.cc
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-05-21 02:17:43 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-05-21 02:17:43 +0000
commitda7990950787257cb312ca562ce5977749afc3e9 (patch)
tree91fe98f6e14e74c794392b22105a47a58499edff /db/write_batch_test.cc
parent3c111335a760d8d82414b91a54f740df09dd4f8f (diff)
downloadleveldb-da7990950787257cb312ca562ce5977749afc3e9.tar.gz
sync with upstream @ 21409451
Check the NEWS file for details of what changed. git-svn-id: https://leveldb.googlecode.com/svn/trunk@28 62dab493-f737-651d-591e-8d6aee1b9529
Diffstat (limited to 'db/write_batch_test.cc')
-rw-r--r--db/write_batch_test.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/db/write_batch_test.cc b/db/write_batch_test.cc
index 2bf1134..73d68fd 100644
--- a/db/write_batch_test.cc
+++ b/db/write_batch_test.cc
@@ -14,10 +14,11 @@ namespace leveldb {
static std::string PrintContents(WriteBatch* b) {
InternalKeyComparator cmp(BytewiseComparator());
- MemTable mem(cmp);
+ MemTable* mem = new MemTable(cmp);
+ mem->Ref();
std::string state;
- Status s = WriteBatchInternal::InsertInto(b, &mem);
- Iterator* iter = mem.NewIterator();
+ Status s = WriteBatchInternal::InsertInto(b, mem);
+ Iterator* iter = mem->NewIterator();
for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
ParsedInternalKey ikey;
ASSERT_TRUE(ParseInternalKey(iter->key(), &ikey));
@@ -42,6 +43,7 @@ static std::string PrintContents(WriteBatch* b) {
if (!s.ok()) {
state.append("ParseError()");
}
+ mem->Unref();
return state;
}