Boost logo

Boost :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2008-07-18 10:02:30


Robert Caldecott <robert.caldecott <at> gmail.com> writes:

> I need to make a call to AfxWinInit, but the only way
> I can see to do this is to define my own
> init_unit_test_suite function and add tests 'by hand',
> rather than using BOOST_AUTO_TEST_CASE.
>
> Does anyone know of a way I can avoid adding tests by hand?
> Does the Boost auto main stuff make a call to any init
> function I can override, so I can squeeze in an MFC init call?

There are number of possibilities, from implementing your
own main function with either static and shared library
to something as trivial as defining global fixture.

Try later first:

struct WinInitSetup {
   WinInitSetup()
   {
      AfxWinInit();
   }
};

BOOST_TEST_GLOBAL_FIXTURE( WinInitSetup );

Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk