]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/1.cc
f9683b4eb6c736a0686803131e82ff2ae862f6f0
1 // 2006-03-20 Paolo Carlini <pcarlini@suse.de>
3 // Copyright (C) 2006-2019 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
23 #include <testsuite_hooks.h>
25 // In the occasion of libstdc++/25482
30 typedef istreambuf_iterator
<char> in_iterator_type
;
32 const char data1
[] = "Drei Phantasien nach Friedrich Holderlin";
33 const string
str1(data1
);
34 istringstream
iss1(str1
);
35 in_iterator_type
beg1(iss1
);
36 in_iterator_type end1
, it1
;
38 it1
= find(beg1
, beg1
, 'l');
39 VERIFY( it1
== beg1
);
40 VERIFY( *it1
== 'D' );
42 it1
= find(end1
, end1
, 'D');
43 VERIFY( it1
== end1
);
45 it1
= find(end1
, end1
, 'Z');
46 VERIFY( it1
== end1
);
48 it1
= find(beg1
, end1
, 'P');
49 VERIFY( *it1
== 'P' );
50 it1
= find(beg1
, end1
, 't');
51 VERIFY( *it1
== 't' );
53 VERIFY( *it1
== 'a' );
55 it1
= find(beg1
, end1
, 'H');
56 VERIFY( *it1
== 'H' );
57 it1
= find(beg1
, end1
, 'l');
58 VERIFY( *it1
== 'l' );
60 it1
= find(beg1
, end1
, 'l');
61 VERIFY( *it1
== 'l' );
63 VERIFY( *it1
== 'i' );
64 it1
= find(beg1
, end1
, 'Z');
65 VERIFY( it1
== end1
);
67 it1
= find(beg1
, end1
, 'D');
68 VERIFY( it1
== end1
);
71 it1
= find(beg1
, end1
, 'D');
72 VERIFY( it1
!= end1
);
73 VERIFY( *it1
== 'D' );
75 VERIFY( *it1
== 'r' );