mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-23 13:05:39 +02:00
Fixes toString() for function pointers and added support for member function pointers.
- thanks to Malcolm Noyes for supplying sample code on which the solution here was based
This commit is contained in:
@@ -356,6 +356,20 @@ TEST_CASE( "Comparing function pointers", "[Tricky][function pointer]" )
|
||||
REQUIRE( a == &foo );
|
||||
}
|
||||
|
||||
struct S
|
||||
{
|
||||
void f() {}
|
||||
};
|
||||
|
||||
|
||||
TEST_CASE( "Comparing member function pointers", "[Tricky][member function pointer]" )
|
||||
{
|
||||
typedef void (S::*MF)();
|
||||
MF m = &S::f;
|
||||
|
||||
CHECK( m == &S::f );
|
||||
}
|
||||
|
||||
class ClassName {};
|
||||
|
||||
TEST_CASE( "pointer to class", "[Tricky]" )
|
||||
|
Reference in New Issue
Block a user