OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" | 5 #include "core/fpdfapi/parser/cpdf_array.h" |
6 #include "core/fpdfapi/fpdf_parser/cpdf_boolean.h" | 6 #include "core/fpdfapi/parser/cpdf_boolean.h" |
7 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" | 7 #include "core/fpdfapi/parser/cpdf_dictionary.h" |
8 #include "core/fpdfapi/fpdf_parser/cpdf_name.h" | 8 #include "core/fpdfapi/parser/cpdf_name.h" |
9 #include "core/fpdfapi/fpdf_parser/cpdf_null.h" | 9 #include "core/fpdfapi/parser/cpdf_null.h" |
10 #include "core/fpdfapi/fpdf_parser/cpdf_number.h" | 10 #include "core/fpdfapi/parser/cpdf_number.h" |
11 #include "core/fpdfapi/fpdf_parser/cpdf_reference.h" | 11 #include "core/fpdfapi/parser/cpdf_reference.h" |
12 #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" | 12 #include "core/fpdfapi/parser/cpdf_stream.h" |
13 #include "core/fpdfapi/fpdf_parser/cpdf_string.h" | 13 #include "core/fpdfapi/parser/cpdf_string.h" |
14 | 14 |
15 #include <memory> | 15 #include <memory> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.h" | 19 #include "core/fpdfapi/parser/cpdf_indirect_object_holder.h" |
20 #include "core/fxcrt/fx_basic.h" | 20 #include "core/fxcrt/fx_basic.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 using ScopedArray = std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Array>>; | 25 using ScopedArray = std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Array>>; |
26 using ScopedDict = | 26 using ScopedDict = |
27 std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>>; | 27 std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>>; |
28 | 28 |
29 void TestArrayAccessors(const CPDF_Array* arr, | 29 void TestArrayAccessors(const CPDF_Array* arr, |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 // Cloned object should be the same as the original. | 826 // Cloned object should be the same as the original. |
827 ASSERT_TRUE(cloned_dict); | 827 ASSERT_TRUE(cloned_dict); |
828 CPDF_Object* cloned_arr = cloned_dict->GetObjectFor("arr"); | 828 CPDF_Object* cloned_arr = cloned_dict->GetObjectFor("arr"); |
829 ASSERT_TRUE(cloned_arr); | 829 ASSERT_TRUE(cloned_arr); |
830 ASSERT_TRUE(cloned_arr->IsArray()); | 830 ASSERT_TRUE(cloned_arr->IsArray()); |
831 EXPECT_EQ(1u, cloned_arr->AsArray()->GetCount()); | 831 EXPECT_EQ(1u, cloned_arr->AsArray()->GetCount()); |
832 // Recursively referenced object is not cloned. | 832 // Recursively referenced object is not cloned. |
833 EXPECT_EQ(nullptr, cloned_arr->AsArray()->GetObjectAt(0)); | 833 EXPECT_EQ(nullptr, cloned_arr->AsArray()->GetObjectAt(0)); |
834 } | 834 } |
835 } | 835 } |
OLD | NEW |