bufferlist bl2;
encode(a, bl2);
if (!bl.contents_equal(bl2)) {
- Formatter *f = Formatter::create("json-pretty");
+ std::unique_ptr<Formatter> f(Formatter::create("json-pretty"));
cout << "original:\n";
f->dump_object("refs", r);
f->flush(cout);
ASSERT_EQ(r, 0);
}
- Formatter *f = Formatter::create("store_test", "json-pretty", "json-pretty");
+ std::unique_ptr<Formatter> f(Formatter::create("store_test", "json-pretty", "json-pretty"));
store->generate_db_histogram(f);
f->flush(cout);
cout << std::endl;
ASSERT_EQ(r, 0);
}
- Formatter *f = Formatter::create("store_test", "json-pretty", "json-pretty");
+ std::unique_ptr<Formatter> f(Formatter::create("store_test", "json-pretty", "json-pretty"));
store->get_db_statistics(f);
f->flush(cout);
cout << std::endl;
ASSERT_EQ(static_cast<int>(bl.length()), r);
ASSERT_TRUE(bl_eq(bl, readback));
}
- Formatter *f = Formatter::create("store_test", "json-pretty", "json-pretty");
+ std::unique_ptr<Formatter> f(Formatter::create("store_test", "json-pretty", "json-pretty"));
EXPECT_NO_THROW(store->get_db_statistics(f));
f->flush(cout);
cout << std::endl;