doctest
doctest copied to clipboard
No reset to std::dec for printing the test summary table
I'm using v2.3.0 .
If I set std::hex on cout somewhere in the testcode, doctest does not reset this to std::dec for printing its test summary. I think that it should.
Are you sure that std::dec is enough? I mean, are there no other ios flags you need to make sure and set?
From what I saw I couldn't figure out how to fully reset the ios flags of a stream (maybe I glossed over it). It did feel sloppy... Any idea how? I'd reopen this and properly fix it for the next version.
It's also advisable for people who change these flags to use RAII so that they reset them when the RAII guard goes out of scope...
EDIT: forget about that - I should look into std::resetiosflags(). I could also save the flags of std::cout at the beginning of the test run and later use that
Huh, well this says exactly the opposite from the comment on #229! So still only std::dec is being set, I think we should either reset all or none. Thoughts?
Adapting my comment from #229
- doctest should isolate its ios flags from those of the test code, i.e. if the code I'm testing sets
std::hex, doctest should not produce hexadecimal numbers for its own output (test indicates, number of passing jobs etc) - doctest should allow setting some/all ios flags for its own output - using some separate, dedicated mechanism (either exposing a stream or via getters/setters which work with
ios_base::fmtflagsvalues).