// Custom includes
#include <iostream>
#include "singleton.hh"
+#include "IgnoreValue.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
#define prefix_
-///////////////////////////////cc.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
namespace {
~AliveTest2();
};
- AliveTest1::AliveTest1()
+ AliveTest1::AliveTest1()
{
test2Alive = AliveTest2::alive();
}
AliveTest1::~AliveTest1()
{
if (test2Dead) {
- assert( ! AliveTest2::alive() );
- std::cerr << "singleton alive test ok\n";
+ if (! AliveTest2::alive() )
+ std::cerr << "singleton alive test ok\n";
+ else {
+ std::cerr << "singleton alive test 2 NOT ok!\n";
+ throw 1;
+ }
}
test1Dead = true;
}
AliveTest2::~AliveTest2()
{
if (test1Dead) {
- assert( ! AliveTest1::alive() );
- std::cerr << "singleton alive test ok\n";
+ if (! AliveTest1::alive() )
+ std::cerr << "singleton alive test ok\n";
+ else {
+ std::cerr << "singleton alive test 1 NOT ok!\n";
+ throw 1;
+ }
}
test2Dead = true;
}
SENF_AUTO_UNIT_TEST(singletonAlive)
{
- (void) AliveTest1::instance();
- (void) AliveTest2::instance();
+ senf::IGNORE( AliveTest1::instance() );
+ senf::IGNORE( AliveTest2::instance() );
BOOST_CHECK( (test1Alive && !test2Alive) || (!test1Alive && test2Alive) );
BOOST_CHECK( AliveTest1::alive() );
BOOST_CHECK( AliveTest2::alive() );
}
-///////////////////////////////cc.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
#undef prefix_
\f