mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-03 10:27:57 +00:00
Add tests for #835
Also add ErrnoGuard before `isatty` call, because apparently it can set errno to 25 (ENOTTY).
This commit is contained in:
parent
613e1466f9
commit
ace70407a2
7 changed files with 92 additions and 12 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "../include/internal/catch_xmlwriter.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <cerrno>
|
||||
|
||||
TEST_CASE( "random SECTION tests", "[.][sections][failing]" )
|
||||
{
|
||||
|
@ -393,3 +394,14 @@ TEST_CASE( "This test 'should' fail but doesn't", "[.][failing][!shouldfail]" )
|
|||
TEST_CASE( "# A test name that starts with a #" ) {
|
||||
SUCCEED( "yay" );
|
||||
}
|
||||
|
||||
|
||||
static int f() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
TEST_CASE( "#835 -- errno should not be touched by Catch" ) {
|
||||
errno = 1;
|
||||
CHECK(f() == 0);
|
||||
REQUIRE(errno == 1); // Check that f() doesn't touch errno.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue