From 4620bcf8062545306adfba8f564c4c9a172ac2b8 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 14 Jul 2017 15:43:52 +0200 Subject: [PATCH] winhttp/tests: Make sure that all notifications were called before the end of a test. Signed-off-by: Jacek Caban Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/winhttp/tests/notification.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index dc36b880814..e9de1520070 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -163,6 +163,12 @@ static void setup_test( struct info *info, enum api function, unsigned int line info->test[info->index].function, function); } +static void end_test( struct info *info, unsigned int line ) +{ + ok_(__FILE__,line)(info->index == info->count, "some notifications were missing: %x\n", + info->test[info->index].status); +} + static void test_connection_cache( void ) { HANDLE ses, con, req, event; @@ -364,6 +370,7 @@ done: WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); CloseHandle( info.wait ); + end_test( &info, __LINE__ ); if (unload) { @@ -456,6 +463,7 @@ done: WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); CloseHandle( info.wait ); + end_test( &info, __LINE__ ); } static const struct notification async_test[] = @@ -593,6 +601,7 @@ static void test_async( void ) } WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); + end_test( &info, __LINE__ ); if (unload) {