summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-11-28 09:49:00 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-28 09:49:00 -0800
commite44b7e3e10c3b5afb73ecdcc77e60d4046c27a71 (patch)
tree62bc65e9540b77e7b627d9629ddffc1ddf9023cc
parente421327725da2fbc713b52ea0e623f67d7bcbcaa (diff)
downloadpdfium-e44b7e3e10c3b5afb73ecdcc77e60d4046c27a71.tar.xz
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
-rw-r--r--core/fpdfapi/parser/cpdf_document_unittest.cpp4
1 files 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<CPDF_TestDocumentForPages> document =
pdfium::MakeUnique<CPDF_TestDocumentForPages>();