Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1336)

Unified Diff: fpdfsdk/src/fpdftext_embeddertest.cpp

Issue 1288603006: Merge to XFA: Fix more sign comparison errors. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfdoc/doc_ap.cpp ('k') | fpdfsdk/src/javascript/PublicMethods.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdftext_embeddertest.cpp
diff --git a/fpdfsdk/src/fpdftext_embeddertest.cpp b/fpdfsdk/src/fpdftext_embeddertest.cpp
index dd3737a40ef1044efc7d0ce73e0af41b562d403a..b3fe9e4c1e19bc3694ec239859af991bee1b72e3 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));
« no previous file with comments | « core/src/fpdfdoc/doc_ap.cpp ('k') | fpdfsdk/src/javascript/PublicMethods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698