| Index: core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp
|
| diff --git a/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp b/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp
|
| index beeb8f30c9577d9117e956f3c0be0a51441db3aa..b79eae515a8e9c83a1b71d256cc657fb6eda1285 100644
|
| --- a/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp
|
| +++ b/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp
|
| @@ -95,8 +95,10 @@ class PDFObjectsTest : public testing::Test {
|
|
|
| // Indirect references to indirect objects.
|
| m_ObjHolder.reset(new CPDF_IndirectObjectHolder());
|
| - m_IndirectObjs = {boolean_true_obj, number_int_obj, str_spec_obj, name_obj,
|
| - m_ArrayObj, m_DictObj, stream_obj};
|
| + m_IndirectObjs = {boolean_true_obj->Clone(), number_int_obj->Clone(),
|
| + str_spec_obj->Clone(), name_obj->Clone(),
|
| + m_ArrayObj->Clone(), m_DictObj->Clone(),
|
| + stream_obj->Clone()};
|
| for (size_t i = 0; i < m_IndirectObjs.size(); ++i) {
|
| m_ObjHolder->AddIndirectObject(m_IndirectObjs[i]);
|
| m_RefObjs.emplace_back(new CPDF_Reference(
|
| @@ -104,7 +106,7 @@ class PDFObjectsTest : public testing::Test {
|
| }
|
| }
|
|
|
| - bool Equal(CPDF_Object* obj1, CPDF_Object* obj2) {
|
| + bool Equal(const CPDF_Object* obj1, const CPDF_Object* obj2) {
|
| if (obj1 == obj2)
|
| return true;
|
| if (!obj1 || !obj2 || obj1->GetType() != obj2->GetType())
|
| @@ -253,7 +255,7 @@ TEST_F(PDFObjectsTest, GetDict) {
|
| const CPDF_Dictionary* const indirect_obj_results[] = {
|
| nullptr, nullptr, nullptr, nullptr, nullptr, m_DictObj, m_StreamDictObj};
|
| for (size_t i = 0; i < m_RefObjs.size(); ++i)
|
| - EXPECT_EQ(indirect_obj_results[i], m_RefObjs[i]->GetDict());
|
| + EXPECT_TRUE(Equal(indirect_obj_results[i], m_RefObjs[i]->GetDict()));
|
| }
|
|
|
| TEST_F(PDFObjectsTest, GetArray) {
|
|
|