mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-31 17:07:52 +00: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:
parent
440a47011f
commit
e091018514
7 changed files with 82 additions and 12 deletions
|
@ -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]" )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue