~ubuntu-branches/ubuntu/trusty/libc++/trusty

« back to all changes in this revision

Viewing changes to libcxx/test/input.output/string.streams/stringstream.cons/default.pass.cpp

  • Committer: Package Import Robot
  • Author(s): Andrej Belym
  • Date: 2012-06-02 19:25:47 UTC
  • Revision ID: package-import@ubuntu.com-20120602192547-b6ta950a8ckc9um2
Tags: upstream-1.0~svn160132
ImportĀ upstreamĀ versionĀ 1.0~svn160132

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===----------------------------------------------------------------------===//
 
2
//
 
3
//                     The LLVM Compiler Infrastructure
 
4
//
 
5
// This file is dual licensed under the MIT and the University of Illinois Open
 
6
// Source Licenses. See LICENSE.TXT for details.
 
7
//
 
8
//===----------------------------------------------------------------------===//
 
9
 
 
10
// <sstream>
 
11
 
 
12
// template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
 
13
// class basic_stringstream
 
14
 
 
15
// explicit basic_stringstream(ios_base::openmode which = ios_base::out|ios_base::in);
 
16
 
 
17
#include <sstream>
 
18
#include <cassert>
 
19
 
 
20
int main()
 
21
{
 
22
    {
 
23
        std::stringstream ss;
 
24
        assert(ss.rdbuf() != 0);
 
25
        assert(ss.good());
 
26
        assert(ss.str() == "");
 
27
    }
 
28
    {
 
29
        std::stringstream ss(std::ios_base::in);
 
30
        assert(ss.rdbuf() != 0);
 
31
        assert(ss.good());
 
32
        assert(ss.str() == "");
 
33
    }
 
34
    {
 
35
        std::wstringstream ss;
 
36
        assert(ss.rdbuf() != 0);
 
37
        assert(ss.good());
 
38
        assert(ss.str() == L"");
 
39
    }
 
40
    {
 
41
        std::wstringstream ss(std::ios_base::in);
 
42
        assert(ss.rdbuf() != 0);
 
43
        assert(ss.good());
 
44
        assert(ss.str() == L"");
 
45
    }
 
46
}