setfill.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
1//===----------------------------------------------------------------------===//
2//
3// ��������������������The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <iomanip>
11
12// template<charT> T4 setfill(charT c);
13
14#include <iomanip>
15#include <cassert>
16
17template <class CharT>
18struct testbuf
19    : public std::basic_streambuf<CharT>
20{
21    testbuf() {}
22};
23
24int main()
25{
26    {
27        testbuf<char> sb;
28        std::ostream os(&sb);
29        os << std::setfill('*');
30        assert(os.fill() == '*');
31    }
32    {
33        testbuf<wchar_t> sb;
34        std::wostream os(&sb);
35        os << std::setfill(L'*');
36        assert(os.fill() == L'*');
37    }
38}
39