summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdftext_embeddertest.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-01-11 14:34:06 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-11 14:34:06 +0000
commit241752f3c188ed992a26618361e55b1d7f2be7cc (patch)
tree68cc3709bb5e5f83a8f357b64385c07a90c2f076 /fpdfsdk/fpdftext_embeddertest.cpp
parent96d6b4df3a96976bb3d9ba068a88bf655f3da856 (diff)
downloadpdfium-241752f3c188ed992a26618361e55b1d7f2be7cc.tar.xz
Change FPDFText_GetCharBox() to return a boolean.
BUG=pdfium:858 Change-Id: Id8b6c032d60894eaf14ae0ba52098a60b2485fca Reviewed-on: https://pdfium-review.googlesource.com/22731 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdftext_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdftext_embeddertest.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/fpdfsdk/fpdftext_embeddertest.cpp b/fpdfsdk/fpdftext_embeddertest.cpp
index a9637be5df..86d32a711a 100644
--- a/fpdfsdk/fpdftext_embeddertest.cpp
+++ b/fpdfsdk/fpdftext_embeddertest.cpp
@@ -87,7 +87,23 @@ TEST_F(FPDFTextEmbeddertest, Text) {
double right = 0.0;
double bottom = 0.0;
double top = 0.0;
- FPDFText_GetCharBox(textpage, 4, &left, &right, &bottom, &top);
+ EXPECT_FALSE(FPDFText_GetCharBox(nullptr, 4, &left, &right, &bottom, &top));
+ EXPECT_DOUBLE_EQ(0.0, left);
+ EXPECT_DOUBLE_EQ(0.0, right);
+ EXPECT_DOUBLE_EQ(0.0, bottom);
+ EXPECT_DOUBLE_EQ(0.0, top);
+ EXPECT_FALSE(FPDFText_GetCharBox(textpage, -1, &left, &right, &bottom, &top));
+ EXPECT_DOUBLE_EQ(0.0, left);
+ EXPECT_DOUBLE_EQ(0.0, right);
+ EXPECT_DOUBLE_EQ(0.0, bottom);
+ EXPECT_DOUBLE_EQ(0.0, top);
+ EXPECT_FALSE(FPDFText_GetCharBox(textpage, 55, &left, &right, &bottom, &top));
+ EXPECT_DOUBLE_EQ(0.0, left);
+ EXPECT_DOUBLE_EQ(0.0, right);
+ EXPECT_DOUBLE_EQ(0.0, bottom);
+ EXPECT_DOUBLE_EQ(0.0, top);
+
+ EXPECT_TRUE(FPDFText_GetCharBox(textpage, 4, &left, &right, &bottom, &top));
EXPECT_NEAR(41.071, left, 0.001);
EXPECT_NEAR(46.243, right, 0.001);
EXPECT_NEAR(49.844, bottom, 0.001);