From c8213b782735c7916cbc996c8dcdf89f9593d354 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 15 Sep 2009 20:31:46 +0000 Subject: Drop the raw_ostream required buffer size to 1. - As best I can tell, we have eliminated all the code which used to require a larger buffer size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81912 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/raw_ostream_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'unittests/Support/raw_ostream_test.cpp') diff --git a/unittests/Support/raw_ostream_test.cpp b/unittests/Support/raw_ostream_test.cpp index 52639ba7a2..bd2e95cbb5 100644 --- a/unittests/Support/raw_ostream_test.cpp +++ b/unittests/Support/raw_ostream_test.cpp @@ -117,4 +117,14 @@ TEST(raw_ostreamTest, BufferEdge) { EXPECT_EQ("1.20", printToString(format("%.2f", 1.2), 10)); } +TEST(raw_ostreamTest, TinyBuffer) { + std::string Str; + raw_string_ostream OS(Str); + OS.SetBufferSize(1); + OS << "hello"; + OS << 1; + OS << 'w' << 'o' << 'r' << 'l' << 'd'; + EXPECT_EQ("hello1world", OS.str()); +} + } -- cgit v1.2.3