summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdftext_embeddertest.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-17 15:39:30 -0700
committerLei Zhang <thestig@chromium.org>2015-08-17 15:39:30 -0700
commita0f67247277f666d80899985eda3c19f3641b9bf (patch)
treefd235c13988e638a44181b9e5a1d1d3c5fd5ad05 /fpdfsdk/src/fpdftext_embeddertest.cpp
parent7dc5cc1c18e04375c19b9793c9da5864660a22f9 (diff)
downloadpdfium-a0f67247277f666d80899985eda3c19f3641b9bf.tar.xz
Merge to XFA: Fix more sign comparison errors.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1290383003 . (cherry picked from commit 9494421208674d2c57a9f864d342f017c0b20902) Review URL: https://codereview.chromium.org/1288603006 .
Diffstat (limited to 'fpdfsdk/src/fpdftext_embeddertest.cpp')
-rw-r--r--fpdfsdk/src/fpdftext_embeddertest.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/fpdfsdk/src/fpdftext_embeddertest.cpp b/fpdfsdk/src/fpdftext_embeddertest.cpp
index dd3737a40e..b3fe9e4c1e 100644
--- a/fpdfsdk/src/fpdftext_embeddertest.cpp
+++ b/fpdfsdk/src/fpdftext_embeddertest.cpp
@@ -40,13 +40,17 @@ TEST_F(FPDFTextEmbeddertest, Text) {
memset(fixed_buffer, 0xbd, sizeof(fixed_buffer));
// Check includes the terminating NUL that is provided.
- EXPECT_EQ(sizeof(expected), FPDFText_GetText(textpage, 0, 128, fixed_buffer));
+ int num_chars = FPDFText_GetText(textpage, 0, 128, fixed_buffer);
+ ASSERT_GE(num_chars, 0);
+ EXPECT_EQ(sizeof(expected), static_cast<size_t>(num_chars));
EXPECT_TRUE(check_unsigned_shorts(expected, fixed_buffer, sizeof(expected)));
// Count does not include the terminating NUL in the string literal.
EXPECT_EQ(sizeof(expected) - 1, FPDFText_CountChars(textpage));
for (size_t i = 0; i < sizeof(expected) - 1; ++i) {
- EXPECT_EQ(expected[i], FPDFText_GetUnicode(textpage, i)) << " at " << i;
+ EXPECT_EQ(static_cast<unsigned int>(expected[i]),
+ FPDFText_GetUnicode(textpage, i))
+ << " at " << i;
}
EXPECT_EQ(12.0, FPDFText_GetFontSize(textpage, 0));