From a021def0a4a500ee8373d37f7122097927387873 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Oct 2018 21:19:17 +0000 Subject: Add more FPDFLink_* public API coverage Change-Id: Ica4c9859b1b4b7f1b4d44a75497becdd956f2600 Reviewed-on: https://pdfium-review.googlesource.com/c/43752 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fpdfsdk/fpdf_doc_embeddertest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdf_doc_embeddertest.cpp b/fpdfsdk/fpdf_doc_embeddertest.cpp index dc367d8e26..d90cc370e3 100644 --- a/fpdfsdk/fpdf_doc_embeddertest.cpp +++ b/fpdfsdk/fpdf_doc_embeddertest.cpp @@ -165,11 +165,18 @@ TEST_F(FPDFDocEmbeddertest, BUG_821454) { FPDF_PAGE page = LoadPage(0); ASSERT_TRUE(page); + // Cover some NULL arg cases while we're at it. + EXPECT_FALSE(FPDFLink_GetLinkAtPoint(nullptr, 150, 360)); + EXPECT_EQ(-1, FPDFLink_GetLinkZOrderAtPoint(nullptr, 150, 360)); + FPDF_LINK link1 = FPDFLink_GetLinkAtPoint(page, 150, 360); ASSERT_TRUE(link1); FPDF_LINK link2 = FPDFLink_GetLinkAtPoint(page, 150, 420); ASSERT_TRUE(link2); + EXPECT_EQ(0, FPDFLink_GetLinkZOrderAtPoint(page, 150, 360)); + EXPECT_EQ(1, FPDFLink_GetLinkZOrderAtPoint(page, 150, 420)); + FPDF_DEST dest1 = FPDFLink_GetDest(document(), link1); ASSERT_TRUE(dest1); FPDF_DEST dest2 = FPDFLink_GetDest(document(), link2); -- cgit v1.2.3