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

Unified Diff: core/fpdfapi/parser/cpdf_object_unittest.cpp

Issue 2509123002: Make CPDF_Object subclass constructors intern strings (Closed)
Patch Set: Nits Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_object.h ('k') | core/fpdfapi/parser/cpdf_string.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_object_unittest.cpp
diff --git a/core/fpdfapi/parser/cpdf_object_unittest.cpp b/core/fpdfapi/parser/cpdf_object_unittest.cpp
index c34128460288ea3ab203c6238eb55abc528f7ee8..2de6256912f8932f077732765e90b045cb27a0de 100644
--- a/core/fpdfapi/parser/cpdf_object_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_object_unittest.cpp
@@ -56,7 +56,7 @@ class PDFObjectsTest : public testing::Test {
CPDF_String* str_reg_obj = new CPDF_String(L"A simple test");
CPDF_String* str_spec_obj = new CPDF_String(L"\t\n");
// Name object.
- CPDF_Name* name_obj = new CPDF_Name("space");
+ CPDF_Name* name_obj = new CPDF_Name(nullptr, "space");
// Array object.
m_ArrayObj = new CPDF_Array;
m_ArrayObj->InsertNewAt<CPDF_Number>(0, 8902);
@@ -620,12 +620,12 @@ TEST(PDFArrayTest, GetTypeAt) {
arr_val->AddNew<CPDF_Number>(2);
CPDF_Dictionary* dict_val = arr->InsertNewAt<CPDF_Dictionary>(12);
- dict_val->SetFor("key1", new CPDF_String("Linda", false));
- dict_val->SetFor("key2", new CPDF_String("Zoe", false));
+ dict_val->SetFor("key1", new CPDF_String(nullptr, "Linda", false));
+ dict_val->SetFor("key2", new CPDF_String(nullptr, "Zoe", false));
CPDF_Dictionary* stream_dict = new CPDF_Dictionary();
- stream_dict->SetFor("key1", new CPDF_String("John", false));
- stream_dict->SetFor("key2", new CPDF_String("King", false));
+ stream_dict->SetFor("key1", new CPDF_String(nullptr, "John", false));
+ stream_dict->SetFor("key2", new CPDF_String(nullptr, "King", false));
uint8_t data[] = "A stream for test";
// The data buffer will be owned by stream object, so it needs to be
// dynamically allocated.
@@ -710,8 +710,9 @@ TEST(PDFArrayTest, AddReferenceAndGetObjectAt) {
CPDF_Boolean* boolean_obj = new CPDF_Boolean(true);
CPDF_Number* int_obj = new CPDF_Number(-1234);
CPDF_Number* float_obj = new CPDF_Number(2345.089f);
- CPDF_String* str_obj = new CPDF_String("Adsfdsf 343434 %&&*\n", false);
- CPDF_Name* name_obj = new CPDF_Name("Title:");
+ CPDF_String* str_obj =
+ new CPDF_String(nullptr, "Adsfdsf 343434 %&&*\n", false);
+ CPDF_Name* name_obj = new CPDF_Name(nullptr, "Title:");
CPDF_Null* null_obj = new CPDF_Null();
CPDF_Object* indirect_objs[] = {boolean_obj, int_obj, float_obj,
str_obj, name_obj, null_obj};
« no previous file with comments | « core/fpdfapi/parser/cpdf_object.h ('k') | core/fpdfapi/parser/cpdf_string.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698