summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-06-27 15:32:50 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-27 20:19:47 +0000
commitb109ac4f09528f2e3a4ef96a163625846039198f (patch)
treef8e5d7422d260f6ab9097bed8cf8b2eaf8c2eac8 /core
parent2e2da135d4b38cad719cd1a410ea2356e5ae1a8a (diff)
downloadpdfium-b109ac4f09528f2e3a4ef96a163625846039198f.tar.xz
Add empty string test case for ostream << CFX_ByteString.
Change-Id: I1f3933709ad4a4f251a634dbe6d87a541994f02e Reviewed-on: https://pdfium-review.googlesource.com/7037 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fxcrt/cfx_bytestring_unittest.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/fxcrt/cfx_bytestring_unittest.cpp b/core/fxcrt/cfx_bytestring_unittest.cpp
index 86fa3830c2..b0265038d5 100644
--- a/core/fxcrt/cfx_bytestring_unittest.cpp
+++ b/core/fxcrt/cfx_bytestring_unittest.cpp
@@ -1261,9 +1261,16 @@ TEST(fxcrt, EqualNoCase) {
}
TEST(fxcrt, OStreamByteStringOverload) {
- // Basic case
std::ostringstream stream;
- CFX_ByteString str("def");
+
+ // Basic case, empty string
+ CFX_ByteString str;
+ stream << str;
+ EXPECT_EQ("", stream.str());
+
+ // Basic case, non-empty string
+ str = "def";
+ stream.str("");
stream << "abc" << str << "ghi";
EXPECT_EQ("abcdefghi", stream.str());