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

Unified Diff: fpdfsdk/fpdfdoc_unittest.cpp

Issue 2498223005: Make CPDF_Array take unique_ptrs (Closed)
Patch Set: nits Created 4 years, 1 month 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/fpdf_transformpage.cpp ('k') | fpdfsdk/fpdfeditpage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfdoc_unittest.cpp
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index 7d1d6b4ba875d0c8b4e989698085134be46a88a1..50837d52e3b03fad389a53f0e9901edb458720c1 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -236,11 +236,11 @@ TEST_F(PDFDocTest, FindBookmark) {
TEST_F(PDFDocTest, GetLocationInPage) {
auto array = pdfium::MakeUnique<CPDF_Array>();
- array->AddInteger(0); // Page Index.
- array->AddName("XYZ");
- array->AddNumber(4); // X
- array->AddNumber(5); // Y
- array->AddNumber(6); // Zoom.
+ array->AddNew<CPDF_Number>(0); // Page Index.
+ array->AddNew<CPDF_Name>("XYZ");
+ array->AddNew<CPDF_Number>(4); // X
+ array->AddNew<CPDF_Number>(5); // Y
+ array->AddNew<CPDF_Number>(6); // Zoom.
FPDF_BOOL hasX;
FPDF_BOOL hasY;
@@ -258,9 +258,9 @@ TEST_F(PDFDocTest, GetLocationInPage) {
EXPECT_EQ(5, y);
EXPECT_EQ(6, zoom);
- array->SetAt(2, new CPDF_Null);
- array->SetAt(3, new CPDF_Null);
- array->SetAt(4, new CPDF_Null);
+ array->SetNewAt<CPDF_Null>(2);
+ array->SetNewAt<CPDF_Null>(3);
+ array->SetNewAt<CPDF_Null>(4);
EXPECT_TRUE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom,
&x, &y, &zoom));
EXPECT_FALSE(hasX);
« no previous file with comments | « fpdfsdk/fpdf_transformpage.cpp ('k') | fpdfsdk/fpdfeditpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698