From b109ac4f09528f2e3a4ef96a163625846039198f Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Tue, 27 Jun 2017 15:32:50 -0400 Subject: Add empty string test case for ostream << CFX_ByteString. Change-Id: I1f3933709ad4a4f251a634dbe6d87a541994f02e Reviewed-on: https://pdfium-review.googlesource.com/7037 Reviewed-by: Tom Sepez Commit-Queue: Henrique Nakashima --- core/fxcrt/cfx_bytestring_unittest.cpp | 11 +++++++++-- 1 file 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()); -- cgit v1.2.3