summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-06-01 19:44:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-01 19:44:53 +0000
commitee0fffe57e04041ba092a860418e5d4cfcbfd999 (patch)
tree531e9301a5f948eede645d9acac9d742b92156d0
parent075e0395b4864e54d4eaaddb789a6b210b433293 (diff)
downloadpdfium-ee0fffe57e04041ba092a860418e5d4cfcbfd999.tar.xz
Remove unused assignments in test code
prev_offset is written multiple times through out CPDF_CrossRefAvailTest, but not read until it is written again. Removing this unused intermediate writes. Issues found with Clang Static Analyzer. Change-Id: I980263b8be7f691c030e937a05f248fd9b133fb4 Reviewed-on: https://pdfium-review.googlesource.com/33592 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
-rw-r--r--core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp b/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
index b798e17377..12b94ffb2d 100644
--- a/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_cross_ref_avail_unittest.cpp
@@ -136,10 +136,8 @@ TEST(CPDF_CrossRefAvailTest, IncorrectData) {
TEST(CPDF_CrossRefAvailTest, ThreeCrossRefV4) {
char int_buffer[100];
- int prev_offset = 0;
int cur_offset = 0;
std::string table = "pdf blah blah blah\n";
- prev_offset = cur_offset;
cur_offset = static_cast<int>(table.size());
table +=
"xref \n"
@@ -150,7 +148,7 @@ TEST(CPDF_CrossRefAvailTest, ThreeCrossRefV4) {
"[<afbb0f593c2d2aea5b519cb61da1c17b><4f9bb2e7978401808f8f1f2a75c322c8>]"
"/Info 15 0 R/Size 16>>\n";
table += "Dummy Data jgwhughouiwbahng";
- prev_offset = cur_offset;
+ int prev_offset = cur_offset;
cur_offset = static_cast<int>(table.size());
table += std::string(
"xref \n"
@@ -188,10 +186,8 @@ TEST(CPDF_CrossRefAvailTest, ThreeCrossRefV4) {
TEST(CPDF_CrossRefAvailTest, ThreeCrossRefV5) {
char int_buffer[100];
- int prev_offset = 0;
int cur_offset = 0;
std::string table = "pdf blah blah blah\n";
- prev_offset = cur_offset;
cur_offset = static_cast<int>(table.size());
table +=
"16 0 obj\n"
@@ -202,7 +198,7 @@ TEST(CPDF_CrossRefAvailTest, ThreeCrossRefV5) {
"endobj\n";
table += "Dummy Data jgwhughouiwbahng";
- prev_offset = cur_offset;
+ int prev_offset = cur_offset;
cur_offset = static_cast<int>(table.size());
table += std::string(
"55 0 obj\n"