summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfedit_embeddertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfedit_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfedit_embeddertest.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index 070c51e3b6..c0ddd77cda 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -928,15 +928,16 @@ TEST_F(FPDFEditEmbeddertest, TransformAnnot) {
FPDF_PAGE page = FPDF_LoadPage(document(), 0);
ASSERT_TRUE(page);
- // Add an underline annotation to the page without specifying its rectangle.
- FPDF_ANNOTATION annot = FPDFPage_CreateAnnot(page, FPDF_ANNOT_UNDERLINE);
- ASSERT_TRUE(annot);
-
- // FPDFPage_TransformAnnots() should run without errors when modifying
- // annotation rectangles.
- FPDFPage_TransformAnnots(page, 1, 2, 3, 4, 5, 6);
-
- FPDFPage_CloseAnnot(annot);
+ {
+ // Add an underline annotation to the page without specifying its rectangle.
+ std::unique_ptr<void, FPDFAnnotationDeleter> annot(
+ FPDFPage_CreateAnnot(page, FPDF_ANNOT_UNDERLINE));
+ ASSERT_TRUE(annot);
+
+ // FPDFPage_TransformAnnots() should run without errors when modifying
+ // annotation rectangles.
+ FPDFPage_TransformAnnots(page, 1, 2, 3, 4, 5, 6);
+ }
UnloadPage(page);
}