Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp

Issue 1853233002: Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix CPDF_Name::GetConstString() Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_number.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_boolean.h" 5 #include "core/fpdfapi/fpdf_parser/cpdf_boolean.h"
6 #include "core/fpdfapi/fpdf_parser/cpdf_null.h" 6 #include "core/fpdfapi/fpdf_parser/cpdf_null.h"
7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
8 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 return true; 129 return true;
130 } 130 }
131 case CPDF_Object::DICTIONARY: { 131 case CPDF_Object::DICTIONARY: {
132 const CPDF_Dictionary* dict1 = obj1->AsDictionary(); 132 const CPDF_Dictionary* dict1 = obj1->AsDictionary();
133 const CPDF_Dictionary* dict2 = obj2->AsDictionary(); 133 const CPDF_Dictionary* dict2 = obj2->AsDictionary();
134 if (dict1->GetCount() != dict2->GetCount()) 134 if (dict1->GetCount() != dict2->GetCount())
135 return false; 135 return false;
136 for (CPDF_Dictionary::const_iterator it = dict1->begin(); 136 for (CPDF_Dictionary::const_iterator it = dict1->begin();
137 it != dict1->end(); ++it) { 137 it != dict1->end(); ++it) {
138 if (!Equal(it->second, dict2->GetObjectBy(it->first))) 138 if (!Equal(it->second, dict2->GetObjectBy(it->first.AsByteStringC())))
139 return false; 139 return false;
140 } 140 }
141 return true; 141 return true;
142 } 142 }
143 case CPDF_Object::NULLOBJ: 143 case CPDF_Object::NULLOBJ:
144 return true; 144 return true;
145 case CPDF_Object::STREAM: { 145 case CPDF_Object::STREAM: {
146 const CPDF_Stream* stream1 = obj1->AsStream(); 146 const CPDF_Stream* stream1 = obj1->AsStream();
147 const CPDF_Stream* stream2 = obj2->AsStream(); 147 const CPDF_Stream* stream2 = obj2->AsStream();
148 if (!stream1->GetDict() && !stream2->GetDict()) 148 if (!stream1->GetDict() && !stream2->GetDict())
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 EXPECT_EQ(arr->GetCount(), arr1->GetCount()); 767 EXPECT_EQ(arr->GetCount(), arr1->GetCount());
768 for (size_t i = 0; i < arr->GetCount(); ++i) { 768 for (size_t i = 0; i < arr->GetCount(); ++i) {
769 EXPECT_EQ(CPDF_Object::REFERENCE, arr->GetObjectAt(i)->GetType()); 769 EXPECT_EQ(CPDF_Object::REFERENCE, arr->GetObjectAt(i)->GetType());
770 EXPECT_EQ(indirect_objs[i], arr->GetObjectAt(i)->GetDirect()); 770 EXPECT_EQ(indirect_objs[i], arr->GetObjectAt(i)->GetDirect());
771 EXPECT_EQ(indirect_objs[i], arr->GetDirectObjectAt(i)); 771 EXPECT_EQ(indirect_objs[i], arr->GetDirectObjectAt(i));
772 EXPECT_EQ(CPDF_Object::REFERENCE, arr1->GetObjectAt(i)->GetType()); 772 EXPECT_EQ(CPDF_Object::REFERENCE, arr1->GetObjectAt(i)->GetType());
773 EXPECT_EQ(indirect_objs[i], arr1->GetObjectAt(i)->GetDirect()); 773 EXPECT_EQ(indirect_objs[i], arr1->GetObjectAt(i)->GetDirect());
774 EXPECT_EQ(indirect_objs[i], arr1->GetDirectObjectAt(i)); 774 EXPECT_EQ(indirect_objs[i], arr1->GetDirectObjectAt(i));
775 } 775 }
776 } 776 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_number.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698