summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdftext_embeddertest.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-17 12:20:05 -0700
committerLei Zhang <thestig@chromium.org>2015-08-17 12:20:05 -0700
commit9494421208674d2c57a9f864d342f017c0b20902 (patch)
tree7441d485f36011a697aa31fb78d706fb8ca211cd /fpdfsdk/src/fpdftext_embeddertest.cpp
parented7599b9042169f11b00f1126bfd3aff0f56b35f (diff)
downloadpdfium-9494421208674d2c57a9f864d342f017c0b20902.tar.xz
Fix more sign comparison errors.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1290383003 .
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));