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

Side by Side Diff: fpdfsdk/fpdfdoc_embeddertest.cpp

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: Fix bad search/replace Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "core/fxcrt/include/fx_string.h" 7 #include "core/fxcrt/include/fx_string.h"
8 #include "public/fpdf_doc.h" 8 #include "public/fpdf_doc.h"
9 #include "public/fpdf_edit.h" 9 #include "public/fpdf_edit.h"
10 #include "public/fpdfview.h" 10 #include "public/fpdfview.h"
11 #include "testing/embedder_test.h" 11 #include "testing/embedder_test.h"
12 #include "testing/fx_string_testhelpers.h" 12 #include "testing/fx_string_testhelpers.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 #include "testing/test_support.h" 14 #include "testing/test_support.h"
15 15
16 class FPDFDocEmbeddertest : public EmbedderTest {}; 16 class FPDFDocEmbeddertest : public EmbedderTest {};
17 17
18 TEST_F(FPDFDocEmbeddertest, DestGetPageIndex) { 18 TEST_F(FPDFDocEmbeddertest, DestGetPageIndex) {
19 EXPECT_TRUE(OpenDocument("named_dests.pdf")); 19 EXPECT_TRUE(OpenDocument("named_dests.pdf"));
20 20
21 // NULL FPDF_DEST case. 21 // nullptr FPDF_DEST case.
Tom Sepez 2016/06/02 20:26:26 NULL preferred in comment, I think.
Lei Zhang 2016/06/07 08:03:13 Done.
22 EXPECT_EQ(0U, FPDFDest_GetPageIndex(document(), nullptr)); 22 EXPECT_EQ(0U, FPDFDest_GetPageIndex(document(), nullptr));
23 23
24 // Page number directly in item from Dests NameTree. 24 // Page number directly in item from Dests NameTree.
25 FPDF_DEST dest = FPDF_GetNamedDestByName(document(), "First"); 25 FPDF_DEST dest = FPDF_GetNamedDestByName(document(), "First");
26 EXPECT_TRUE(dest); 26 EXPECT_TRUE(dest);
27 EXPECT_EQ(1U, FPDFDest_GetPageIndex(document(), dest)); 27 EXPECT_EQ(1U, FPDFDest_GetPageIndex(document(), dest));
28 28
29 // Page number via object reference in item from Dests NameTree. 29 // Page number via object reference in item from Dests NameTree.
30 dest = FPDF_GetNamedDestByName(document(), "Next"); 30 dest = FPDF_GetNamedDestByName(document(), "Next");
31 EXPECT_TRUE(dest); 31 EXPECT_TRUE(dest);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 GetFPDFWideString(L"anything"); 139 GetFPDFWideString(L"anything");
140 EXPECT_EQ(nullptr, FPDFBookmark_Find(document(), title.get())); 140 EXPECT_EQ(nullptr, FPDFBookmark_Find(document(), title.get()));
141 } 141 }
142 142
143 TEST_F(FPDFDocEmbeddertest, DeletePage) { 143 TEST_F(FPDFDocEmbeddertest, DeletePage) {
144 EXPECT_TRUE(OpenDocument("hello_world.pdf")); 144 EXPECT_TRUE(OpenDocument("hello_world.pdf"));
145 EXPECT_EQ(1, FPDF_GetPageCount(document())); 145 EXPECT_EQ(1, FPDF_GetPageCount(document()));
146 FPDFPage_Delete(document(), 0); 146 FPDFPage_Delete(document(), 0);
147 EXPECT_EQ(0, FPDF_GetPageCount(document())); 147 EXPECT_EQ(0, FPDF_GetPageCount(document()));
148 } 148 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfdoc.cpp ('k') | fpdfsdk/fpdfeditimg.cpp » ('j') | fpdfsdk/fpdfeditpage.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698