Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(928)

Unified Diff: fpdfsdk/src/fpdftext_embeddertest.cpp

Issue 1138973004: Merge to XFA: Fix leaks in the embedder tests themselves. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@xfa
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfformfill_embeddertest.cpp ('k') | fpdfsdk/src/fpdfview_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdftext_embeddertest.cpp
diff --git a/fpdfsdk/src/fpdftext_embeddertest.cpp b/fpdfsdk/src/fpdftext_embeddertest.cpp
index 394e1a96b30aab73609e8a8a3fd01b4374c0d1c9..8384a41944c1500004e78f4413d17ee2588f0ca9 100644
--- a/fpdfsdk/src/fpdftext_embeddertest.cpp
+++ b/fpdfsdk/src/fpdftext_embeddertest.cpp
@@ -36,7 +36,7 @@ TEST_F(FPDFTextEmbeddertest, Text) {
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
EXPECT_NE(nullptr, textpage);
- const char expected[] = "Hello, world!\r\nGoodbye, world!";
+ static const char expected[] = "Hello, world!\r\nGoodbye, world!";
unsigned short fixed_buffer[128];
memset(fixed_buffer, 0xbd, sizeof(fixed_buffer));
@@ -134,6 +134,7 @@ TEST_F(FPDFTextEmbeddertest, Text) {
EXPECT_EQ(0xbdbd, fixed_buffer[10]);
FPDFText_ClosePage(textpage);
+ UnloadPage(page);
}
TEST_F(FPDFTextEmbeddertest, TextSearch) {
@@ -239,6 +240,7 @@ TEST_F(FPDFTextEmbeddertest, TextSearch) {
FPDFText_FindClose(search);
FPDFText_ClosePage(textpage);
+ UnloadPage(page);
}
// Test that the page has characters despite a bad stream length.
@@ -252,6 +254,7 @@ TEST_F(FPDFTextEmbeddertest, StreamLengthPastEndOfFile) {
EXPECT_EQ(13, FPDFText_CountChars(textpage));
FPDFText_ClosePage(textpage);
+ UnloadPage(page);
}
TEST_F(FPDFTextEmbeddertest, WebLinks) {
@@ -277,7 +280,7 @@ TEST_F(FPDFTextEmbeddertest, WebLinks) {
EXPECT_EQ(25, FPDFLink_GetURL(pagelink, 0, nullptr, 0));
EXPECT_EQ(26, FPDFLink_GetURL(pagelink, 1, nullptr, 0));
- const char expected_url[] = "http://example.com?q=foo";
+ static const char expected_url[] = "http://example.com?q=foo";
unsigned short fixed_buffer[128];
// Retrieve a link with too small a buffer. Buffer will not be
@@ -358,4 +361,5 @@ TEST_F(FPDFTextEmbeddertest, WebLinks) {
FPDFLink_CloseWebLinks(pagelink);
FPDFText_ClosePage(textpage);
+ UnloadPage(page);
}
« no previous file with comments | « fpdfsdk/src/fpdfformfill_embeddertest.cpp ('k') | fpdfsdk/src/fpdfview_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698