#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"
ElementsAre;
Pair;
Return;
namespace {
struct OffsetAndType { … };
CPDF_CrossRefTable::ObjectInfo GetObjInfo(const CPDF_Parser& parser,
uint32_t obj_num) { … }
class TestObjectsHolder final : public CPDF_Parser::ParsedObjectsHolder { … };
}
bool operator==(const CPDF_CrossRefTable::ObjectInfo& lhs,
const CPDF_CrossRefTable::ObjectInfo& rhs) { … }
std::ostream& operator<<(std::ostream& os,
const CPDF_CrossRefTable::ObjectInfo& info) { … }
class CPDF_TestParser final : public CPDF_Parser { … };
TEST(ParserTest, RebuildCrossRefCorrectly) { … }
TEST(ParserTest, RebuildCrossRefFailed) { … }
TEST(ParserTest, LoadCrossRefTable) { … }
TEST(ParserTest, ParseStartXRef) { … }
TEST(ParserTest, ParseStartXRefWithHeaderOffset) { … }
TEST(ParserTest, ParseLinearizedWithHeaderOffset) { … }
TEST(ParserTest, BadStartXrefShouldNotBuildCrossRefTable) { … }
class ParserXRefTest : public testing::Test { … };
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) { … }