chromium/third_party/pdfium/core/fpdfapi/parser/cpdf_parser_unittest.cpp

// Copyright 2015 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {};

}  // namespace

// Test-only helper to support Gmock. Cannot be in an anonymous namespace.
bool operator==(const CPDF_CrossRefTable::ObjectInfo& lhs,
                const CPDF_CrossRefTable::ObjectInfo& rhs) {}

// Test-only helper to let Gmock pretty-print `info`. Cannot be in an anonymous
// namespace.
std::ostream& operator<<(std::ostream& os,
                         const CPDF_CrossRefTable::ObjectInfo& info) {}

// A wrapper class to help test member functions of CPDF_Parser.
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) {}