Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_parser_unittest.cpp File Reference

(0ccf980226462398d5097987466bcffd8236e1e9)

#include "core/fpdfapi/parser/cpdf_parser.h"
#include <array>
#include <limits>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include <vector>
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_linearized_header.h"
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fpdfapi/parser/cpdf_syntax_parser.h"
#include "core/fxcrt/cfx_read_only_span_stream.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_stream.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/stl_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/utils/path_service.h"
Include dependency graph for cpdf_parser_unittest.cpp:

Go to the source code of this file.

Classes

class  CPDF_TestParser
class  ParserXRefTest

Functions

bool operator== (const CPDF_CrossRefTable::ObjectInfo &lhs, const CPDF_CrossRefTable::ObjectInfo &rhs)
std::ostream & operator<< (std::ostream &os, const CPDF_CrossRefTable::ObjectInfo &info)
 TEST (ParserTest, RebuildCrossRefCorrectly)
 TEST (ParserTest, RebuildCrossRefFailed)
 TEST (ParserTest, LoadCrossRefTable)
 TEST (ParserTest, ParseStartXRef)
 TEST (ParserTest, ParseStartXRefWithHeaderOffset)
 TEST (ParserTest, ParseLinearizedWithHeaderOffset)
 TEST (ParserTest, BadStartXrefShouldNotBuildCrossRefTable)
 TEST_F (ParserXRefTest, XrefObjectIndicesTooBig)
 TEST_F (ParserXRefTest, XrefHasInvalidArchiveObjectNumber)
 TEST_F (ParserXRefTest, XrefHasInvalidObjectType)
 TEST_F (ParserXRefTest, XrefHasInvalidPrevValue)
 TEST_F (ParserXRefTest, XrefHasInvalidSizeValue)
 TEST_F (ParserXRefTest, XrefHasInvalidWidth)
 TEST_F (ParserXRefTest, XrefFirstWidthEntryIsZero)
 TEST_F (ParserXRefTest, XrefWithValidIndex)
 TEST_F (ParserXRefTest, XrefIndexWithRepeatedObject)
 TEST_F (ParserXRefTest, XrefIndexWithOutOfOrderObjects)
 TEST_F (ParserXRefTest, XrefWithIndexAndWrongSize)

Function Documentation

◆ operator<<()

◆ operator==()

◆ TEST() [1/7]

TEST ( ParserTest ,
BadStartXrefShouldNotBuildCrossRefTable  )

Definition at line 391 of file cpdf_parser_unittest.cpp.

References CPDF_Parser::FORMAT_ERROR, CPDF_Parser::GetCrossRefTableForTesting(), and CPDF_Parser::StartParseInternal().

Here is the call graph for this function:

◆ TEST() [2/7]

TEST ( ParserTest ,
LoadCrossRefTable  )

Definition at line 180 of file cpdf_parser_unittest.cpp.

References CPDF_CrossRefTable::kFree, CPDF_CrossRefTable::kNormal, and CPDF_Parser::LoadCrossRefTable().

Here is the call graph for this function:

◆ TEST() [3/7]

TEST ( ParserTest ,
ParseLinearizedWithHeaderOffset  )

Definition at line 369 of file cpdf_parser_unittest.cpp.

References CPDF_Parser::GetCrossRefTableForTesting(), PathService::GetTestFilePath(), and CPDF_CrossRefTable::trailer_object_number().

Here is the call graph for this function:

◆ TEST() [4/7]

TEST ( ParserTest ,
ParseStartXRef  )

Definition at line 333 of file cpdf_parser_unittest.cpp.

References PathService::GetTestFilePath(), CPDF_TestParser::InitTestFromFile(), and CPDF_Parser::ParseStartXRef().

Here is the call graph for this function:

◆ TEST() [5/7]

TEST ( ParserTest ,
ParseStartXRefWithHeaderOffset  )

Definition at line 347 of file cpdf_parser_unittest.cpp.

References PathService::GetTestFilePath(), and CPDF_Parser::ParseStartXRef().

Here is the call graph for this function:

◆ TEST() [6/7]

TEST ( ParserTest ,
RebuildCrossRefCorrectly  )

Definition at line 146 of file cpdf_parser_unittest.cpp.

References CPDF_Parser::GetCrossRefTableForTesting(), PathService::GetTestFilePath(), CPDF_TestParser::InitTestFromFile(), CPDF_Parser::RebuildCrossRef(), and CPDF_CrossRefTable::trailer_object_number().

Here is the call graph for this function:

◆ TEST() [7/7]

TEST ( ParserTest ,
RebuildCrossRefFailed  )

Definition at line 170 of file cpdf_parser_unittest.cpp.

References PathService::GetTestFilePath(), CPDF_TestParser::InitTestFromFile(), and CPDF_Parser::RebuildCrossRef().

Here is the call graph for this function:

◆ TEST_F() [1/11]

◆ TEST_F() [2/11]

TEST_F ( ParserXRefTest ,
XrefHasInvalidArchiveObjectNumber  )

Definition at line 474 of file cpdf_parser_unittest.cpp.

References CPDF_CrossRefTable::kNormal, CPDF_CrossRefTable::ObjectInfo::pos, CPDF_Parser::SUCCESS, CPDF_CrossRefTable::trailer_object_number(), and CPDF_CrossRefTable::ObjectInfo::type.

Here is the call graph for this function:

◆ TEST_F() [3/11]

TEST_F ( ParserXRefTest ,
XrefHasInvalidObjectType  )

Definition at line 514 of file cpdf_parser_unittest.cpp.

References CPDF_Parser::FORMAT_ERROR.

◆ TEST_F() [4/11]

TEST_F ( ParserXRefTest ,
XrefHasInvalidPrevValue  )

Definition at line 533 of file cpdf_parser_unittest.cpp.

References CPDF_Parser::FORMAT_ERROR.

◆ TEST_F() [5/11]

TEST_F ( ParserXRefTest ,
XrefHasInvalidSizeValue  )

Definition at line 558 of file cpdf_parser_unittest.cpp.

References CPDF_Parser::FORMAT_ERROR.

◆ TEST_F() [6/11]

TEST_F ( ParserXRefTest ,
XrefHasInvalidWidth  )

Definition at line 583 of file cpdf_parser_unittest.cpp.

References CPDF_Parser::SUCCESS.

◆ TEST_F() [7/11]

◆ TEST_F() [8/11]

◆ TEST_F() [9/11]

◆ TEST_F() [10/11]

◆ TEST_F() [11/11]