Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sylvain Joubert
KWSys
Commits
6599eda6
Commit
6599eda6
authored
7 years ago
by
Matthias Männich
Browse files
Options
Downloads
Patches
Plain Diff
testRobustEncoding: restore format flags for std::cout before exiting
parent
f108739d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testEncoding.cxx
+5
-0
5 additions, 0 deletions
testEncoding.cxx
with
5 additions
and
0 deletions
testEncoding.cxx
+
5
−
0
View file @
6599eda6
...
...
@@ -75,6 +75,10 @@ static int testRobustEncoding()
// test that the conversion functions handle invalid
// unicode correctly/gracefully
// we manipulate the format flags of stdout, remember
// the original state here to restore before return
std
::
ios
::
fmtflags
const
&
flags
=
std
::
cout
.
flags
();
int
ret
=
0
;
char
cstr
[]
=
{
(
char
)
-
1
,
0
};
// this conversion could fail
...
...
@@ -120,6 +124,7 @@ static int testRobustEncoding()
ret
++
;
}
std
::
cout
.
flags
(
flags
);
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment