Add tests for #835

Also add ErrnoGuard before `isatty` call, because apparently it can set
errno to 25 (ENOTTY).
This commit is contained in:
Martin Hořeňovský
2017-03-06 22:07:33 +01:00
parent 613e1466f9
commit ace70407a2
7 changed files with 92 additions and 12 deletions

View File

@@ -48,6 +48,23 @@ PASSED:
with expansion:
42 == {?}
-------------------------------------------------------------------------------
#835 -- errno should not be touched by Catch
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>: FAILED:
CHECK( f() == 0 )
with expansion:
1 == 0
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( (*__errno_location ()) == 1 )
with expansion:
1 == 1
-------------------------------------------------------------------------------
'Not' checks that should fail
-------------------------------------------------------------------------------
@@ -65,10 +82,7 @@ ConditionTests.cpp:<line number>: FAILED:
with expansion:
false
ConditionTests.cpp:<line number>: FAILED:
CHECK_FALSE( true )
===============================================================================
test cases: 4 | 3 passed | 1 failed
assertions: 10 | 6 passed | 4 failed
test cases: 5 | 3 passed | 2 failed
assertions: 11 | 7 passed | 4 failed