]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/1.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / basic_ostream / inserters_character / wchar_t / 1.cc
CommitLineData
a945c346 1// Copyright (C) 2005-2024 Free Software Foundation, Inc.
ba4b172f
PC
2//
3// This file is part of the GNU ISO C++ Library. This library is free
4// software; you can redistribute it and/or modify it under the
5// terms of the GNU General Public License as published by the
748086b7 6// Free Software Foundation; either version 3, or (at your option)
ba4b172f
PC
7// any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License along
748086b7
JJ
15// with this library; see the file COPYING3. If not see
16// <http://www.gnu.org/licenses/>.
ba4b172f
PC
17
18// 27.6.2.5.4 basic_ostream character inserters
19
20#include <string>
21#include <ostream>
22#include <fstream>
23#include <testsuite_hooks.h>
24
25// ofstream
26void test01()
27{
28 std::wstring str01;
29 const int size = 1000;
30 const char name_02[] = "wostream_inserter_char-1.txt";
31
32 // initialize string
33 for(int i=0 ; i < size; i++) {
34 str01 += L'1';
35 str01 += L'2';
36 str01 += L'3';
37 str01 += L'4';
38 str01 += L'5';
39 str01 += L'6';
40 str01 += L'7';
41 str01 += L'8';
42 str01 += L'9';
43 str01 += L'\n';
44 }
45 std::wofstream f(name_02);
46
47 f << str01;
48 f.close();
49}
50
51int main()
52{
53 test01();
54 return 0;
55}