• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <sstream>
10 
11 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
12 // class basic_ostringstream
13 
14 // explicit basic_ostringstream(ios_base::openmode which = ios_base::in);
15 
16 #include <sstream>
17 #include <cassert>
18 
19 #include "test_macros.h"
20 
main(int,char **)21 int main(int, char**)
22 {
23     {
24         std::ostringstream ss;
25         assert(ss.rdbuf() != 0);
26         assert(ss.good());
27         assert(ss.str() == "");
28     }
29     {
30         std::ostringstream ss(std::ios_base::out);
31         assert(ss.rdbuf() != 0);
32         assert(ss.good());
33         assert(ss.str() == "");
34     }
35     {
36         std::wostringstream ss;
37         assert(ss.rdbuf() != 0);
38         assert(ss.good());
39         assert(ss.str() == L"");
40     }
41     {
42         std::wostringstream ss(std::ios_base::out);
43         assert(ss.rdbuf() != 0);
44         assert(ss.good());
45         assert(ss.str() == L"");
46     }
47 
48   return 0;
49 }
50