Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Utils
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
No related tags found
1 merge request
!53
testRobustEncoding: restore format flags for std::cout before exiting
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()
...
@@ -75,6 +75,10 @@ static int testRobustEncoding()
// test that the conversion functions handle invalid
// test that the conversion functions handle invalid
// unicode correctly/gracefully
// 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
;
int
ret
=
0
;
char
cstr
[]
=
{
(
char
)
-
1
,
0
};
char
cstr
[]
=
{
(
char
)
-
1
,
0
};
// this conversion could fail
// this conversion could fail
...
@@ -120,6 +124,7 @@ static int testRobustEncoding()
...
@@ -120,6 +124,7 @@ static int testRobustEncoding()
ret
++
;
ret
++
;
}
}
std
::
cout
.
flags
(
flags
);
return
ret
;
return
ret
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Brad King
@brad.king
mentioned in commit
c2cbd107
·
7 years ago
mentioned in commit
c2cbd107
mentioned in commit c2cbd1079f482445a18c84eef98264e5c283a9b7
Toggle commit list
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