Skip to content
Snippets Groups Projects
Commit 6599eda6 authored by Matthias Männich's avatar Matthias Männich
Browse files

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

parent f108739d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
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