corelib/tests/ptr-common.hh

28 lines
425 B
C++

// Common code for pointer tests
namespace {
struct T_Test
{
static int dCalled;
int field;
T_Test( ) : T_Test( -1 ) { }
T_Test( int f ) : field( f ) { }
virtual ~T_Test( ) { dCalled ++; }
};
int T_Test::dCalled = 0;
struct T_TestChild : public T_Test
{
T_TestChild( ) : T_Test( 256 ) { }
};
struct T_OtherChild : T_Test
{
int otherField;
T_OtherChild( int x , int y ) : T_Test( x ) , otherField( y ) { }
};
}