Skip to content
Snippets Groups Projects
Commit c2cbd107 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'testEncoding'


6599eda6 testRobustEncoding: restore format flags for std::cout before exiting

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !53
parents e75d1a31 6599eda6
No related branches found
No related tags found
No related merge requests found
...@@ -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;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment