1 // Copyright (C) 2004, 2005 Free Software Foundation, Inc.
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
6 // Free Software Foundation; either version 2, or (at your option)
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.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING. If not, write to the Free
16 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 // rope (SGI extension)
22 #include <testsuite_hooks.h>
25 "Happy families are all alike; every unhappy family is unhappy in \
28 Everything was in confusion in the Oblonskys' house. The wife \
29 had discovered that the husband was carrying on an intrigue with \
30 a French girl, who had been a governess in their family, and she \
31 had announced to her husband that she could not go on living in \
32 the same house with him. This position of affairs had now lasted \
33 three days, and not only the husband and wife themselves, but all \
34 the members of their family and household, were painfully \
35 conscious of it. Every person in the house felt that there was \
36 so sense in their living together, and that the stray people \
37 brought together by chance in any inn had more in common with one \
38 another than they, the members of the family and household of the \
39 Oblonskys. The wife did not leave her own room, the husband had \
40 not been at home for three days. The children ran wild all over \
41 the house; the English governess quarreled with the housekeeper, \
42 and wrote to a friend asking her to look out for a new situation \
43 for her; the man-cook had walked off the day before just at \
44 dinner time; the kitchen-maid, and the coachman had given \
48 int baselen
= sizeof(base
) - 1;
50 template<class StringType
>
52 multiply(const StringType
& s
, int n
)
63 template <class StringType
>
65 mung_substrings(const StringType
& s
, int len
, int n
, int skip
)
71 StringType tmp
= s
.substr (start
, len
);
82 using namespace __gnu_cxx
;
83 bool test
__attribute__((unused
)) = true;
86 r
= multiply(crope(base
), 100000);
89 r1
= mung_substrings(r
, 100000, 500, 73);
91 VERIFY( r1
.size() == 50000000 );
92 VERIFY( r1
.substr(88888, 6)[0] == 's' );
93 VERIFY( r1
.substr(88888, 6)[2] == 'h' );