summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview_embeddertest.cpp
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-29 16:42:53 -0700
committerWei Li <weili@chromium.org>2016-03-29 16:42:53 -0700
commit05d53f0355e9889c43bfa436e985d5643f249d99 (patch)
treeeca037b407114efe357e8280a96e44eee182cdfc /fpdfsdk/fpdfview_embeddertest.cpp
parent602aebc11a615971800d38f8d427a4e4f95c1134 (diff)
downloadpdfium-05d53f0355e9889c43bfa436e985d5643f249d99.tar.xz
Code change to avoid signed/unsigned mismatch warnings.
This makes pdfium code on Linux and Mac sign-compare warning free. The warning flag will be re-enabled after checking on windows clang build. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1841643002 .
Diffstat (limited to 'fpdfsdk/fpdfview_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfview_embeddertest.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/fpdfsdk/fpdfview_embeddertest.cpp b/fpdfsdk/fpdfview_embeddertest.cpp
index 29eb91ab4d..10fe3aa822 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) {