mirror of
https://github.com/ceph/ceph
synced 2025-04-07 10:03:50 +00:00
Merge pull request #38223 from Rethan/fix_formatter_pointer
test: free Formatter pointers Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
8f26ecb35d
@ -327,7 +327,7 @@ TEST(chunk_refs_t, size)
|
|||||||
bufferlist bl2;
|
bufferlist bl2;
|
||||||
encode(a, bl2);
|
encode(a, bl2);
|
||||||
if (!bl.contents_equal(bl2)) {
|
if (!bl.contents_equal(bl2)) {
|
||||||
Formatter *f = Formatter::create("json-pretty");
|
std::unique_ptr<Formatter> f(Formatter::create("json-pretty"));
|
||||||
cout << "original:\n";
|
cout << "original:\n";
|
||||||
f->dump_object("refs", r);
|
f->dump_object("refs", r);
|
||||||
f->flush(cout);
|
f->flush(cout);
|
||||||
|
@ -7893,7 +7893,7 @@ TEST_P(StoreTest, KVDBHistogramTest) {
|
|||||||
ASSERT_EQ(r, 0);
|
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);
|
store->generate_db_histogram(f);
|
||||||
f->flush(cout);
|
f->flush(cout);
|
||||||
cout << std::endl;
|
cout << std::endl;
|
||||||
@ -7937,7 +7937,7 @@ TEST_P(StoreTest, KVDBStatsTest) {
|
|||||||
ASSERT_EQ(r, 0);
|
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);
|
store->get_db_statistics(f);
|
||||||
f->flush(cout);
|
f->flush(cout);
|
||||||
cout << std::endl;
|
cout << std::endl;
|
||||||
@ -8482,7 +8482,7 @@ TEST_P(StoreTest, BluestoreStatistics) {
|
|||||||
ASSERT_EQ(static_cast<int>(bl.length()), r);
|
ASSERT_EQ(static_cast<int>(bl.length()), r);
|
||||||
ASSERT_TRUE(bl_eq(bl, readback));
|
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));
|
EXPECT_NO_THROW(store->get_db_statistics(f));
|
||||||
f->flush(cout);
|
f->flush(cout);
|
||||||
cout << std::endl;
|
cout << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user