Re: [1/2] dpnet: Add IDirectPlay8Client tests (try 2)
Am 2014-05-07 03:39, schrieb Alistair Leslie-Hughes:
Hi, Changed test_init_dp to return a boolean. Sorry, I was a bit slow with replying to your previous mail.
Is there anything that prevents you from having a helper function that creates a new client object for each test? If you share one client object and the tests modify the state, then the tests end up depending on each other. We had a similar situation in the d3d8/9 visual tests (and still have in ddraw:visual), and it leads to hard to debug test failures. If the client object takes too long to create (I'd say > 0.25 seconds) then that's a reason to keep the client around. Otherwise creating a fresh one for each test and destroying it afterwards will really help you in the long run. Somewhat related:
+static BOOL test_init_dp(void) ... + hr = CoInitialize(0); ... +static void test_cleanup_dp(void) ... + CoUninitialize(); +} I'd move that to the test's main function. (And no, I don't think there's a need to call CoInitialize / CoUninitialize more than once.)
Cheers, Stefan
participants (1)
-
Stefan Dösinger