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

Unified Diff: fpdfsdk/fpdfview_embeddertest.cpp

Issue 1841643002: Code change to avoid signed/unsigned mismatch warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 9 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 | « fpdfsdk/fpdfview.cpp ('k') | fpdfsdk/javascript/Field.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfview_embeddertest.cpp
diff --git a/fpdfsdk/fpdfview_embeddertest.cpp b/fpdfsdk/fpdfview_embeddertest.cpp
index 29eb91ab4df7ca87b23ed959c0a0004b1d0e8275..10fe3aa8222d8356dbe2b2a26da0ef645936ee0e 100644
--- a/fpdfsdk/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/fpdfview_embeddertest.cpp
@@ -88,14 +88,16 @@ TEST_F(FPDFViewEmbeddertest, NamedDests) {
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), 2, fixed_buffer, &buffer_size);
EXPECT_EQ(nullptr, dest);
- EXPECT_EQ(sizeof(fixed_buffer), buffer_size); // unmodified.
+ EXPECT_EQ(sizeof(fixed_buffer),
+ static_cast<size_t>(buffer_size)); // unmodified.
// Try to retrieve the forth item with ample buffer. Item is taken
// from Dests NameTree but has a vale of the wrong type in named_dests.pdf.
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), 3, fixed_buffer, &buffer_size);
EXPECT_EQ(nullptr, dest);
- EXPECT_EQ(sizeof(fixed_buffer), buffer_size); // unmodified.
+ EXPECT_EQ(sizeof(fixed_buffer),
+ static_cast<size_t>(buffer_size)); // unmodified.
// Try to retrieve fifth item with ample buffer. Item taken from the
// old-style Dests dictionary object in named_dests.pdf.
@@ -120,25 +122,29 @@ TEST_F(FPDFViewEmbeddertest, NamedDests) {
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), 6, fixed_buffer, &buffer_size);
EXPECT_EQ(nullptr, dest);
- EXPECT_EQ(sizeof(fixed_buffer), buffer_size); // unmodified.
+ EXPECT_EQ(sizeof(fixed_buffer),
+ static_cast<size_t>(buffer_size)); // unmodified.
// Try to underflow/overflow the integer index.
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), std::numeric_limits<int>::max(),
fixed_buffer, &buffer_size);
EXPECT_EQ(nullptr, dest);
- EXPECT_EQ(sizeof(fixed_buffer), buffer_size); // unmodified.
+ EXPECT_EQ(sizeof(fixed_buffer),
+ static_cast<size_t>(buffer_size)); // unmodified.
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), std::numeric_limits<int>::min(),
fixed_buffer, &buffer_size);
EXPECT_EQ(nullptr, dest);
- EXPECT_EQ(sizeof(fixed_buffer), buffer_size); // unmodified.
+ EXPECT_EQ(sizeof(fixed_buffer),
+ static_cast<size_t>(buffer_size)); // unmodified.
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), -1, fixed_buffer, &buffer_size);
EXPECT_EQ(nullptr, dest);
- EXPECT_EQ(sizeof(fixed_buffer), buffer_size); // unmodified.
+ EXPECT_EQ(sizeof(fixed_buffer),
+ static_cast<size_t>(buffer_size)); // unmodified.
}
TEST_F(FPDFViewEmbeddertest, NamedDestsByName) {
« no previous file with comments | « fpdfsdk/fpdfview.cpp ('k') | fpdfsdk/javascript/Field.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698