diff options
Diffstat (limited to 'core/fpdfdoc/cpdf_filespec_unittest.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_filespec_unittest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_filespec_unittest.cpp b/core/fpdfdoc/cpdf_filespec_unittest.cpp index 4da5019314..d164165f00 100644 --- a/core/fpdfdoc/cpdf_filespec_unittest.cpp +++ b/core/fpdfdoc/cpdf_filespec_unittest.cpp @@ -67,7 +67,8 @@ TEST(cpdf_filespec, GetFileName) { L"/docs/test.pdf" #endif }; - std::unique_ptr<CPDF_Object> str_obj(new CPDF_String(test_data.input)); + std::unique_ptr<CPDF_Object> str_obj( + new CPDF_String(nullptr, test_data.input)); CPDF_FileSpec file_spec(str_obj.get()); CFX_WideString file_name; EXPECT_TRUE(file_spec.GetFileName(&file_name)); @@ -102,13 +103,13 @@ TEST(cpdf_filespec, GetFileName) { CPDF_FileSpec file_spec(dict_obj.get()); CFX_WideString file_name; for (int i = 0; i < 5; ++i) { - dict_obj->SetFor(keywords[i], new CPDF_String(test_data[i].input)); + dict_obj->SetNewFor<CPDF_String>(keywords[i], test_data[i].input); EXPECT_TRUE(file_spec.GetFileName(&file_name)); EXPECT_TRUE(file_name == test_data[i].expected); } // With all the former fields and 'FS' field suggests 'URL' type. - dict_obj->SetStringFor("FS", "URL"); + dict_obj->SetNewFor<CPDF_String>("FS", "URL", false); EXPECT_TRUE(file_spec.GetFileName(&file_name)); // Url string is not decoded. EXPECT_TRUE(file_name == test_data[4].input); @@ -136,7 +137,7 @@ TEST(cpdf_filespec, SetFileName) { #endif }; // String object. - std::unique_ptr<CPDF_Object> str_obj(new CPDF_String(L"babababa")); + std::unique_ptr<CPDF_Object> str_obj(new CPDF_String(nullptr, L"babababa")); CPDF_FileSpec file_spec1(str_obj.get()); file_spec1.SetFileName(test_data.input); // Check internal object value. |