You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
547 B
36 lines
547 B
13 years ago
|
#include <cxxtest/TestSuite.h>
|
||
|
|
||
|
#define private public // need to reach Singleton's private m_instance
|
||
|
|
||
|
#include "Common.hpp"
|
||
|
#include "Fixture.hpp"
|
||
|
#include "Singleton_meyers.hpp"
|
||
|
|
||
|
|
||
|
class TestSingletonMeyersSuite : public CxxTest::TestSuite
|
||
|
{
|
||
|
|
||
|
private:
|
||
|
|
||
|
class BasicSingleton : public Singleton_meyers<BasicSingleton>
|
||
|
{
|
||
|
public:
|
||
|
int getSeven()
|
||
|
{
|
||
|
TRACE;
|
||
|
return 7;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
public:
|
||
|
|
||
|
void testBasic( void )
|
||
|
{
|
||
|
TEST_HEADER;
|
||
|
|
||
|
TS_ASSERT_EQUALS( BasicSingleton::getInstance()->getSeven(), 7 );
|
||
|
}
|
||
|
|
||
|
|
||
|
};
|