From e44b7e3e10c3b5afb73ecdcc77e60d4046c27a71 Mon Sep 17 00:00:00 2001 From: npm Date: Mon, 28 Nov 2016 09:49:00 -0800 Subject: Fix leak in cpdf_document_unittest Make GetPagesInDisorder be TEST_F instead of TEST for consistency... Call CPDF_ModuleMgr::Destroy() on TearDown to avoid leaks. Review-Url: https://codereview.chromium.org/2528093002 --- core/fpdfapi/parser/cpdf_document_unittest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/fpdfapi/parser/cpdf_document_unittest.cpp b/core/fpdfapi/parser/cpdf_document_unittest.cpp index 94cef559f0..e4fe033c8a 100644 --- a/core/fpdfapi/parser/cpdf_document_unittest.cpp +++ b/core/fpdfapi/parser/cpdf_document_unittest.cpp @@ -132,7 +132,7 @@ class cpdf_document_test : public testing::Test { CPDF_ModuleMgr* module_mgr = CPDF_ModuleMgr::Get(); module_mgr->InitPageModule(); } - void TearDown() override {} + void TearDown() override { CPDF_ModuleMgr::Destroy(); } }; TEST_F(cpdf_document_test, GetPages) { @@ -173,7 +173,7 @@ TEST_F(cpdf_document_test, GetPagesReverseOrder) { EXPECT_FALSE(page); } -TEST(cpdf_document, GetPagesInDisorder) { +TEST_F(cpdf_document_test, GetPagesInDisorder) { std::unique_ptr document = pdfium::MakeUnique(); -- cgit v1.2.3