summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfannot_embeddertest.cpp28
-rw-r--r--fpdfsdk/fpdfedit_embeddertest.cpp14
-rw-r--r--fpdfsdk/fpdfeditpath_embeddertest.cpp4
3 files changed, 23 insertions, 23 deletions
diff --git a/fpdfsdk/fpdfannot_embeddertest.cpp b/fpdfsdk/fpdfannot_embeddertest.cpp
index c49e77bc2b..dce658201c 100644
--- a/fpdfsdk/fpdfannot_embeddertest.cpp
+++ b/fpdfsdk/fpdfannot_embeddertest.cpp
@@ -286,15 +286,15 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndSaveUnderlineAnnotation) {
const char md5[] = "dba153419f67b7c0c0e3d22d3e8910d5";
OpenSavedDocument();
- LoadSavedPage();
- VerifySavedRendering(612, 792, md5);
+ page = LoadSavedPage(0);
+ VerifySavedRendering(page, 612, 792, md5);
// Check that the saved document has 2 annotations on the first page
- EXPECT_EQ(2, FPDFPage_GetAnnotCount(m_SavedPage));
+ EXPECT_EQ(2, FPDFPage_GetAnnotCount(page));
// Check that the second annotation is an underline annotation and verify
// its quadpoints.
- FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(m_SavedPage, 1);
+ FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(page, 1);
ASSERT_TRUE(new_annot);
EXPECT_EQ(FPDF_ANNOT_UNDERLINE, FPDFAnnot_GetSubtype(new_annot));
FS_QUADPOINTSF new_quadpoints;
@@ -306,7 +306,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndSaveUnderlineAnnotation) {
FPDFPage_CloseAnnot(new_annot);
- CloseSavedPage();
+ CloseSavedPage(page);
CloseSavedDocument();
}
@@ -591,12 +591,12 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) {
// Open the saved document.
OpenSavedDocument();
- LoadSavedPage();
- VerifySavedRendering(595, 842, md5_new_annot);
+ page = LoadSavedPage(0);
+ VerifySavedRendering(page, 595, 842, md5_new_annot);
// Check that the document has a correct count of annotations and objects.
- EXPECT_EQ(3, FPDFPage_GetAnnotCount(m_SavedPage));
- annot = FPDFPage_GetAnnot(m_SavedPage, 2);
+ EXPECT_EQ(3, FPDFPage_GetAnnotCount(page));
+ annot = FPDFPage_GetAnnot(page, 2);
ASSERT_TRUE(annot);
EXPECT_EQ(1, FPDFAnnot_GetObjectCount(annot));
@@ -608,7 +608,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) {
EXPECT_EQ(rect.top, new_rect.top);
FPDFPage_CloseAnnot(annot);
- CloseSavedPage();
+ CloseSavedPage(page);
CloseSavedDocument();
}
@@ -870,9 +870,9 @@ TEST_F(FPDFAnnotEmbeddertest, GetSetStringValue) {
const char md5[] = "c96ee1f316d7f5a1b154de9f9d467f01";
#endif
OpenSavedDocument();
- LoadSavedPage();
- VerifySavedRendering(595, 842, md5);
- FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(m_SavedPage, 0);
+ page = LoadSavedPage(0);
+ VerifySavedRendering(page, 595, 842, md5);
+ FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(page, 0);
// Check that the string value of the modified date is the newly-set value.
EXPECT_EQ(FPDF_OBJECT_STRING, FPDFAnnot_GetValueType(new_annot, kDateKey));
@@ -886,7 +886,7 @@ TEST_F(FPDFAnnotEmbeddertest, GetSetStringValue) {
.c_str());
FPDFPage_CloseAnnot(new_annot);
- CloseSavedPage();
+ CloseSavedPage(page);
CloseSavedDocument();
}
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index f1f02ffa6d..6cb2771154 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -457,31 +457,31 @@ TEST_F(FPDFEditEmbeddertest, EditOverExistingContent) {
UnloadPage(page);
OpenSavedDocument();
- LoadSavedPage();
- VerifySavedRendering(612, 792, "ad04e5bd0f471a9a564fb034bd0fb073");
+ page = LoadSavedPage(0);
+ VerifySavedRendering(page, 612, 792, "ad04e5bd0f471a9a564fb034bd0fb073");
ClearString();
// Add another opaque rectangle on top of the existing content
FPDF_PAGEOBJECT green_rect = FPDFPageObj_CreateNewRect(150, 700, 25, 50);
EXPECT_TRUE(FPDFPath_SetFillColor(green_rect, 0, 255, 0, 255));
EXPECT_TRUE(FPDFPath_SetDrawMode(green_rect, FPDF_FILLMODE_ALTERNATE, 0));
- FPDFPage_InsertObject(m_SavedPage, green_rect);
+ FPDFPage_InsertObject(page, green_rect);
// Add another transparent rectangle on top of existing content
FPDF_PAGEOBJECT green_rect2 = FPDFPageObj_CreateNewRect(175, 700, 25, 50);
EXPECT_TRUE(FPDFPath_SetFillColor(green_rect2, 0, 255, 0, 100));
EXPECT_TRUE(FPDFPath_SetDrawMode(green_rect2, FPDF_FILLMODE_ALTERNATE, 0));
- FPDFPage_InsertObject(m_SavedPage, green_rect2);
- FPDF_BITMAP new_bitmap = RenderPageWithFlags(m_SavedPage, m_SavedForm, 0);
+ FPDFPage_InsertObject(page, green_rect2);
+ FPDF_BITMAP new_bitmap = RenderPageWithFlags(page, m_SavedForm, 0);
const char last_md5[] = "4b5b00f824620f8c9b8801ebb98e1cdd";
CompareBitmap(new_bitmap, 612, 792, last_md5);
FPDFBitmap_Destroy(new_bitmap);
- EXPECT_TRUE(FPDFPage_GenerateContent(m_SavedPage));
+ EXPECT_TRUE(FPDFPage_GenerateContent(page));
// Now save the result, closing the page and document
EXPECT_TRUE(FPDF_SaveAsCopy(m_SavedDocument, this, 0));
- CloseSavedPage();
+ CloseSavedPage(page);
CloseSavedDocument();
// Render the saved result
diff --git a/fpdfsdk/fpdfeditpath_embeddertest.cpp b/fpdfsdk/fpdfeditpath_embeddertest.cpp
index 71af2fad55..59e5dbbabf 100644
--- a/fpdfsdk/fpdfeditpath_embeddertest.cpp
+++ b/fpdfsdk/fpdfeditpath_embeddertest.cpp
@@ -32,7 +32,7 @@ TEST_F(FPDFEditPathEmbedderTest, VerifyCorrectColoursReturned) {
page = nullptr;
OpenSavedDocument();
- page = LoadSavedPage();
+ page = LoadSavedPage(0);
ASSERT(page);
for (size_t i = 0; i < 256; ++i) {
@@ -58,6 +58,6 @@ TEST_F(FPDFEditPathEmbedderTest, VerifyCorrectColoursReturned) {
EXPECT_EQ(i, a);
}
- CloseSavedPage();
+ CloseSavedPage(page);
CloseSavedDocument();
}