Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
b0e7d996
Commit
b0e7d996
authored
Jul 12, 1998
by
Bob Sidebotham
Committed by
Jason Merrill
Jul 11, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tstring.cc (findtest): New fn.
From-SVN: r21071
parent
e70b4d8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
libstdc++/tests/ChangeLog
+4
-0
libstdc++/tests/tstring.cc
+48
-0
No files found.
libstdc++/tests/ChangeLog
View file @
b0e7d996
1998-07-12 Bob Sidebotham <rns@fore.com>
* tstring.cc (findtest): New fn.
1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
* tlist.cc, tvector.cc, tmap.cc: Remove explicit instantiations.
* tlist.cc, tvector.cc, tmap.cc: Remove explicit instantiations.
...
...
libstdc++/tests/tstring.cc
View file @
b0e7d996
...
@@ -109,6 +109,53 @@ void cattest()
...
@@ -109,6 +109,53 @@ void cattest()
assert
(
z
==
"Hello, world."
);
assert
(
z
==
"Hello, world."
);
}
}
void
findtest
()
{
string
x
;
string
::
size_type
pos
;
pos
=
x
.
find_last_not_of
(
'X'
);
assert
(
pos
==
string
::
npos
);
pos
=
x
.
find_last_not_of
(
"XYZ"
);
assert
(
pos
==
string
::
npos
);
string
y
(
"a"
);
pos
=
y
.
find_last_not_of
(
'X'
);
assert
(
pos
==
0
);
pos
=
y
.
find_last_not_of
(
'a'
);
assert
(
pos
==
string
::
npos
);
pos
=
y
.
find_last_not_of
(
"XYZ"
);
assert
(
pos
==
0
);
pos
=
y
.
find_last_not_of
(
"a"
);
assert
(
pos
==
string
::
npos
);
string
z
(
"ab"
);
pos
=
z
.
find_last_not_of
(
'X'
);
assert
(
pos
==
1
);
pos
=
z
.
find_last_not_of
(
"XYZ"
);
assert
(
pos
==
1
);
pos
=
z
.
find_last_not_of
(
'b'
);
assert
(
pos
==
0
);
pos
=
z
.
find_last_not_of
(
"Xb"
);
assert
(
pos
==
0
);
pos
=
z
.
find_last_not_of
(
"Xa"
);
assert
(
pos
==
1
);
pos
=
z
.
find_last_of
(
"ab"
);
assert
(
pos
==
1
);
pos
=
z
.
find_last_of
(
"Xa"
);
assert
(
pos
==
0
);
pos
=
z
.
find_last_of
(
"Xb"
);
assert
(
pos
==
1
);
pos
=
z
.
find_last_of
(
"XYZ"
);
assert
(
pos
==
string
::
npos
);
pos
=
z
.
find_last_of
(
'a'
);
assert
(
pos
==
0
);
pos
=
z
.
find_last_of
(
'b'
);
assert
(
pos
==
1
);
pos
=
z
.
find_last_of
(
'X'
);
assert
(
pos
==
string
::
npos
);
}
void
comparetest
()
void
comparetest
()
{
{
string
x
=
X
;
string
x
=
X
;
...
@@ -191,6 +238,7 @@ int main()
...
@@ -191,6 +238,7 @@ int main()
decltest
();
decltest
();
cattest
();
cattest
();
comparetest
();
comparetest
();
findtest
();
substrtest
();
substrtest
();
identitytest
(
X
,
X
);
identitytest
(
X
,
X
);
identitytest
(
X
,
Y
);
identitytest
(
X
,
Y
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment