1
0
mirror of https://github.com/ceph/ceph synced 2025-04-01 23:02:17 +00:00

Merge pull request from Rethan/fix_formatter_pointer

test: free Formatter pointers

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-11-21 19:01:33 +08:00 committed by GitHub
commit 8f26ecb35d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions
src/test

View File

@ -327,7 +327,7 @@ TEST(chunk_refs_t, size)
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);

View File

@ -7893,7 +7893,7 @@ TEST_P(StoreTest, KVDBHistogramTest) {
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;
@ -7937,7 +7937,7 @@ TEST_P(StoreTest, KVDBStatsTest) {
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;
@ -8482,7 +8482,7 @@ TEST_P(StoreTest, BluestoreStatistics) {
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;