diff options
author | tsepez <tsepez@chromium.org> | 2016-03-30 15:14:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-30 15:14:09 -0700 |
commit | ac88953dfa7c1a68c69989d61d7bc03c0595064b (patch) | |
tree | f31a1f26a04618d666b4dcae40950843f934a585 /core/fxcrt/fx_basic_bstring_unittest.cpp | |
parent | a123f0184894073a8495bc0cf49b5c890781b289 (diff) | |
download | pdfium-ac88953dfa7c1a68c69989d61d7bc03c0595064b.tar.xz |
Use CFX_RetainPtr to ref count CFX_ByteStringchromium/2696
This moves the reference counts from an ad-hoc mechanism
to being automatically tracked.
Also:
Make StringData::Create() always return non-null.
Add better ctors for StringData itself.
Consolidate copies into StringData methods.
Simplify the concat() code.
Rename/reorder some parameter names to be simpler.
Review URL: https://codereview.chromium.org/1810823002
Diffstat (limited to 'core/fxcrt/fx_basic_bstring_unittest.cpp')
-rw-r--r-- | core/fxcrt/fx_basic_bstring_unittest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/fxcrt/fx_basic_bstring_unittest.cpp b/core/fxcrt/fx_basic_bstring_unittest.cpp index 834a6e444d..6e360448c7 100644 --- a/core/fxcrt/fx_basic_bstring_unittest.cpp +++ b/core/fxcrt/fx_basic_bstring_unittest.cpp @@ -288,28 +288,28 @@ TEST(fxcrt, ByteStringCNull) { EXPECT_NE(null_string, non_null_string); } -TEST(fxcrt, ByteStringConcatInPlace) { +TEST(fxcrt, ByteStringConcat) { CFX_ByteString fred; - fred.ConcatInPlace(4, "FRED"); + fred.Concat("FRED", 4); EXPECT_EQ("FRED", fred); - fred.ConcatInPlace(2, "DY"); + fred.Concat("DY", 2); EXPECT_EQ("FREDDY", fred); fred.Delete(3, 3); EXPECT_EQ("FRE", fred); - fred.ConcatInPlace(1, "D"); + fred.Concat("D", 1); EXPECT_EQ("FRED", fred); CFX_ByteString copy = fred; - fred.ConcatInPlace(2, "DY"); + fred.Concat("DY", 2); EXPECT_EQ("FREDDY", fred); EXPECT_EQ("FRED", copy); // Test invalid arguments. copy = fred; - fred.ConcatInPlace(-6, "freddy"); + fred.Concat("freddy", -6); CFX_ByteString not_aliased("xxxxxx"); EXPECT_EQ("FREDDY", fred); EXPECT_EQ("xxxxxx", not_aliased); |