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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp

Issue 1654303002: Remove the m_ObjVersion member variable from CPDF_Parser. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 11 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/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp
index b39eb967851d0be4d3c33f6c8087d7f45941ea3b..77780b9dcf9ee385e06459317927702050a86d53 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp
@@ -7,20 +7,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/utils/path_service.h"
-// Functions to help test an array's content against expected results.
-template <class TYPE>
-bool CompareArray(const CFX_ArrayTemplate<TYPE>& array1,
- const TYPE* array2,
- size_t size) {
- if (array1.GetSize() != size)
- return false;
-
- for (int i = 0; i < size; ++i)
- if (array1.GetAt(i) != array2[i])
- return false;
- return true;
-}
-
// Provide a way to read test data from a buffer instead of a file.
class CFX_TestBufferRead : public IFX_FileRead {
public:
@@ -257,8 +243,8 @@ TEST(fpdf_parser_parser, RebuildCrossRefCorrectly) {
const FX_WORD versions[] = {0, 0, 2, 4, 6, 8, 0};
for (size_t i = 0; i < FX_ArraySize(offsets); ++i)
EXPECT_EQ(offsets[i], parser.m_ObjectInfo[i].pos);
- ASSERT_TRUE(
- CompareArray(parser.m_ObjVersion, versions, FX_ArraySize(versions)));
+ for (size_t i = 0; i < FX_ArraySize(versions); ++i)
+ EXPECT_EQ(versions[i], parser.m_ObjectInfo[i].gennum);
}
TEST(fpdf_parser_parser, RebuildCrossRefFailed) {
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698