summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdftext_embeddertest.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-07 10:46:22 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 10:46:23 -0700
commit4997b22f84307521a62838f874928bf56cd3423c (patch)
treead11d99ac0a491ee222e9d0a42ec3b6ad3354e2a /fpdfsdk/fpdftext_embeddertest.cpp
parent0687e76dc259c678b3f29a6608331f07ffd8f1e2 (diff)
downloadpdfium-4997b22f84307521a62838f874928bf56cd3423c.tar.xz
Get rid of NULLs in core/
Review-Url: https://codereview.chromium.org/2032613003
Diffstat (limited to 'fpdfsdk/fpdftext_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdftext_embeddertest.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/fpdfsdk/fpdftext_embeddertest.cpp b/fpdfsdk/fpdftext_embeddertest.cpp
index a5215c20cc..3070c30771 100644
--- a/fpdfsdk/fpdftext_embeddertest.cpp
+++ b/fpdfsdk/fpdftext_embeddertest.cpp
@@ -32,10 +32,10 @@ class FPDFTextEmbeddertest : public EmbedderTest {};
TEST_F(FPDFTextEmbeddertest, Text) {
EXPECT_TRUE(OpenDocument("hello_world.pdf"));
FPDF_PAGE page = LoadPage(0);
- EXPECT_NE(nullptr, page);
+ EXPECT_TRUE(page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
- EXPECT_NE(nullptr, textpage);
+ EXPECT_TRUE(textpage);
static const char expected[] = "Hello, world!\r\nGoodbye, world!";
unsigned short fixed_buffer[128];
@@ -141,10 +141,10 @@ TEST_F(FPDFTextEmbeddertest, Text) {
TEST_F(FPDFTextEmbeddertest, TextSearch) {
EXPECT_TRUE(OpenDocument("hello_world.pdf"));
FPDF_PAGE page = LoadPage(0);
- EXPECT_NE(nullptr, page);
+ EXPECT_TRUE(page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
- EXPECT_NE(nullptr, textpage);
+ EXPECT_TRUE(textpage);
std::unique_ptr<unsigned short, pdfium::FreeDeleter> nope =
GetFPDFWideString(L"nope");
@@ -157,7 +157,7 @@ TEST_F(FPDFTextEmbeddertest, TextSearch) {
// No occurences of "nope" in test page.
FPDF_SCHHANDLE search = FPDFText_FindStart(textpage, nope.get(), 0, 0);
- EXPECT_NE(nullptr, search);
+ EXPECT_TRUE(search);
EXPECT_EQ(0, FPDFText_GetSchResultIndex(search));
EXPECT_EQ(0, FPDFText_GetSchCount(search));
@@ -174,7 +174,7 @@ TEST_F(FPDFTextEmbeddertest, TextSearch) {
// Two occurences of "world" in test page.
search = FPDFText_FindStart(textpage, world.get(), 0, 2);
- EXPECT_NE(nullptr, search);
+ EXPECT_TRUE(search);
// Remains not found until advanced.
EXPECT_EQ(0, FPDFText_GetSchResultIndex(search));
@@ -209,7 +209,7 @@ TEST_F(FPDFTextEmbeddertest, TextSearch) {
// Exact search unaffected by case sensitiity and whole word flags.
search = FPDFText_FindStart(textpage, world.get(),
FPDF_MATCHCASE | FPDF_MATCHWHOLEWORD, 0);
- EXPECT_NE(nullptr, search);
+ EXPECT_TRUE(search);
EXPECT_TRUE(FPDFText_FindNext(search));
EXPECT_EQ(7, FPDFText_GetSchResultIndex(search));
EXPECT_EQ(5, FPDFText_GetSchCount(search));
@@ -217,7 +217,7 @@ TEST_F(FPDFTextEmbeddertest, TextSearch) {
// Default is case-insensitive, so matching agaist caps works.
search = FPDFText_FindStart(textpage, world_caps.get(), 0, 0);
- EXPECT_NE(nullptr, search);
+ EXPECT_TRUE(search);
EXPECT_TRUE(FPDFText_FindNext(search));
EXPECT_EQ(7, FPDFText_GetSchResultIndex(search));
EXPECT_EQ(5, FPDFText_GetSchCount(search));
@@ -252,10 +252,10 @@ TEST_F(FPDFTextEmbeddertest, TextSearch) {
TEST_F(FPDFTextEmbeddertest, StreamLengthPastEndOfFile) {
EXPECT_TRUE(OpenDocument("bug_57.pdf"));
FPDF_PAGE page = LoadPage(0);
- EXPECT_NE(nullptr, page);
+ EXPECT_TRUE(page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
- EXPECT_NE(nullptr, textpage);
+ EXPECT_TRUE(textpage);
EXPECT_EQ(13, FPDFText_CountChars(textpage));
FPDFText_ClosePage(textpage);
@@ -265,13 +265,13 @@ TEST_F(FPDFTextEmbeddertest, StreamLengthPastEndOfFile) {
TEST_F(FPDFTextEmbeddertest, WebLinks) {
EXPECT_TRUE(OpenDocument("weblinks.pdf"));
FPDF_PAGE page = LoadPage(0);
- EXPECT_NE(nullptr, page);
+ EXPECT_TRUE(page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
- EXPECT_NE(nullptr, textpage);
+ EXPECT_TRUE(textpage);
FPDF_PAGELINK pagelink = FPDFLink_LoadWebLinks(textpage);
- EXPECT_NE(nullptr, pagelink);
+ EXPECT_TRUE(pagelink);
// Page contains two HTTP-style URLs.
EXPECT_EQ(2, FPDFLink_CountWebLinks(pagelink));
@@ -371,10 +371,10 @@ TEST_F(FPDFTextEmbeddertest, WebLinks) {
TEST_F(FPDFTextEmbeddertest, GetFontSize) {
EXPECT_TRUE(OpenDocument("hello_world.pdf"));
FPDF_PAGE page = LoadPage(0);
- EXPECT_NE(nullptr, page);
+ EXPECT_TRUE(page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
- EXPECT_NE(nullptr, textpage);
+ EXPECT_TRUE(textpage);
const double kExpectedFontsSizes[] = {12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 1, 1, 16, 16, 16, 16, 16,