I came across an example of a global fixture macro in the docs,
'BOOST_GLOBAL_FIXTURE( fixture )'
The example that is provided with Boost demonstrates setup and teardown
utilizing the constructor and destructor of the fixture passed through the macro.
It does not show members in this global fixture.
I added a member to the fixture and tried to access it within a test case
and I received a compiler error stating that the variable had not been
declared in this scope.
Is it possible to access a global fixture member? If yes, then how?
struct Fixture
{
const char* str;
}
BOOST_GLOBAL_FIXTURE( Fixture )
BOOST_TEST_CASE( testGlobalFixture )
{
BOOST_CHECK( str != 0 );
}
// The above code fails to compile stating: 'str' undeclared (first use this function)
Steve Watjen