diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-04-25 18:49:32 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-25 18:49:32 +0000 |
commit | e08d2b1fee0db40bac9538ca8b7be0a951675bd6 (patch) | |
tree | 81ded468a54adb247f46d7824632f6c4a537619c /fpdfsdk/fpdf_save_embeddertest.cpp | |
parent | eb3ec8f29846a5df67269a53ca94d1d740c84513 (diff) | |
download | pdfium-e08d2b1fee0db40bac9538ca8b7be0a951675bd6.tar.xz |
Introduce ScopedFPDF types in public/cpp/fpdf_scopers.h
Applies std::remove_ptr to the public API types so that we can
deduce a correct unique ptr type no matter how that API might
change away from void* usage.
Creates shorter names for std::unique_ptr<std::remove_pointer<>, ...>
Change-Id: I04a0ff43cb7d5a4d3867939a53a54c9cef00db86
Reviewed-on: https://pdfium-review.googlesource.com/31292
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_save_embeddertest.cpp')
-rw-r--r-- | fpdfsdk/fpdf_save_embeddertest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fpdfsdk/fpdf_save_embeddertest.cpp b/fpdfsdk/fpdf_save_embeddertest.cpp index e753ba0356..64a305fa86 100644 --- a/fpdfsdk/fpdf_save_embeddertest.cpp +++ b/fpdfsdk/fpdf_save_embeddertest.cpp @@ -6,6 +6,7 @@ #include <string> #include "core/fxcrt/fx_string.h" +#include "public/cpp/fpdf_scopers.h" #include "public/fpdf_edit.h" #include "public/fpdf_ppo.h" #include "public/fpdf_save.h" @@ -67,7 +68,7 @@ TEST_F(FPDFSaveEmbedderTest, SaveLinearizedDoc) { for (int i = 0; i < kPageCount; ++i) { FPDF_PAGE page = LoadPage(i); ASSERT_TRUE(page); - std::unique_ptr<void, FPDFBitmapDeleter> bitmap = RenderLoadedPage(page); + ScopedFPDFBitmap bitmap = RenderLoadedPage(page); EXPECT_EQ(612, FPDFBitmap_GetWidth(bitmap.get())); EXPECT_EQ(792, FPDFBitmap_GetHeight(bitmap.get())); original_md5[i] = HashBitmap(bitmap.get()); @@ -85,7 +86,7 @@ TEST_F(FPDFSaveEmbedderTest, SaveLinearizedDoc) { for (int i = 0; i < kPageCount; ++i) { FPDF_PAGE page = LoadSavedPage(i); ASSERT_TRUE(page); - std::unique_ptr<void, FPDFBitmapDeleter> bitmap = RenderSavedPage(page); + ScopedFPDFBitmap bitmap = RenderSavedPage(page); EXPECT_EQ(original_md5[i], HashBitmap(bitmap.get())); CloseSavedPage(page); } |