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

Unified Diff: core/fpdfdoc/cpdf_filespec_unittest.cpp

Issue 2510223002: Make CPDF_Dictionary use unique pointers. (Closed)
Patch Set: rebase 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/fpdfdoc/cpdf_filespec.cpp ('k') | core/fpdfdoc/cpdf_formcontrol.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_filespec_unittest.cpp
diff --git a/core/fpdfdoc/cpdf_filespec_unittest.cpp b/core/fpdfdoc/cpdf_filespec_unittest.cpp
index 4da50193143d6d7e65c22fbb9011f9fe66efca78..d164165f00da932242b4d0111cff2ecac28b3df7 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.
« no previous file with comments | « core/fpdfdoc/cpdf_filespec.cpp ('k') | core/fpdfdoc/cpdf_formcontrol.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698