Small cleanup of self tests

This commit is contained in:
Martin Hořeňovský
2019-08-04 13:50:25 +02:00
parent 7dc7d77af2
commit 3701c2e2e6
8 changed files with 82 additions and 73 deletions

View File

@@ -194,6 +194,31 @@ namespace { namespace CompilationTests {
REQUIRE(std::is_same<TypeList<int>, TypeList<int>>::value);
}
// #925
using signal_t = void (*) (void*);
struct TestClass {
signal_t testMethod_uponComplete_arg = nullptr;
};
namespace utility {
inline static void synchronizing_callback( void * ) { }
}
TEST_CASE("#925: comparing function pointer to function address failed to compile", "[!nonportable]" ) {
TestClass test;
REQUIRE(utility::synchronizing_callback != test.testMethod_uponComplete_arg);
}
TEST_CASE( "#1027: Bitfields can be captured" ) {
struct Y {
uint32_t v : 1;
};
Y y{ 0 };
REQUIRE( y.v == 0 );
REQUIRE( 0 == y.v );
}
}} // namespace CompilationTests

View File

@@ -440,12 +440,6 @@ TEST_CASE( "long long" ) {
REQUIRE( l == std::numeric_limits<long long>::max() );
}
//TEST_CASE( "Divide by Zero signal handler", "[.][sig]" ) {
// int i = 0;
// int x = 10/i; // This should cause the signal to fire
// CHECK( x == 0 );
//}
TEST_CASE( "This test 'should' fail but doesn't", "[.][failing][!shouldfail]" ) {
SUCCEED( "oops!" );
}

View File

@@ -402,32 +402,6 @@ TEST_CASE( "non-copyable objects", "[.][failing]" ) {
CHECK( ti == typeid(int) );
}
// #925
using signal_t = void (*) (void*);
struct TestClass {
signal_t testMethod_uponComplete_arg = nullptr;
};
namespace utility {
inline static void synchronizing_callback( void * ) { }
}
TEST_CASE("#925: comparing function pointer to function address failed to compile", "[!nonportable]" ) {
TestClass test;
REQUIRE(utility::synchronizing_callback != test.testMethod_uponComplete_arg);
}
TEST_CASE( "Bitfields can be captured (#1027)" ) {
struct Y {
uint32_t v : 1;
};
Y y{ 0 };
REQUIRE( y.v == 0 );
REQUIRE( 0 == y.v );
}
TEST_CASE("#1514: stderr/stdout is not captured in tests aborted by an exception", "[output-capture][regression][.]") {
std::cout << "This would not be caught previously\n" << std::flush;
std::clog << "Nor would this\n" << std::flush;