Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
tests
regress
21.string.stdcxx-466.cpp
Go to the documentation of this file.
1
27
#include <cassert>
28
#include <string>
29
30
int
main
()
31
{
32
std::string
s
(
"efgh"
);
33
34
const
std::string::size_type
len
=
s
.max_size () + 1;
35
36
#define TEST(expr) \
37
try { \
38
assert (expr); \
39
} \
40
catch (...) { \
41
assert (!"Unexpected exception was thrown"); \
42
} (void)0
43
44
const
std::string::size_type npos = std::string::npos;
45
46
TEST
(npos ==
s
.find (
"fg"
, 0,
len
));
47
TEST
(npos ==
s
.rfind (
"fg"
, 0,
len
));
48
TEST
(0 ==
s
.find_first_of (
"eh"
, 0,
len
));
49
TEST
(3 ==
s
.find_last_of (
"eh"
, npos,
len
));
50
TEST
(0 >
s
.compare (0, npos,
"efgh"
,
len
));
51
TEST
(0 >
s
.compare (0, npos,
"ijkl"
,
len
));
52
TEST
(0 <
s
.compare (0, npos,
"abcd"
,
len
));
53
54
s
.clear ();
55
56
TEST
(npos ==
s
.find_first_not_of (
"eh"
, 0,
len
));
57
TEST
(npos ==
s
.find_last_not_of (
"eh"
, npos,
len
));
58
59
return
0;
60
}
s
#define s
Definition
rw_alg_test.h:221
len
#define len
Definition
17.names.cpp:488
TEST
#define TEST(expr)
main
int main()
Definition
21.string.stdcxx-466.cpp:30
Generated by
1.9.8