Improve checking of connection lost test

This commit is contained in:
Ian Craggs 2014-07-22 11:25:04 +01:00
parent dfe2e6d7b2
commit 404909dd4f
1 changed files with 5 additions and 1 deletions

View File

@ -1095,12 +1095,16 @@ int test6(struct Options options)
MyLog(LOGA_INFO, "Waiting to receive the will message");
count = 0;
while (test6_will_message_arrived != 1 && test6_connection_lost_called != 1 && ++count < 40)
while (++count < 40)
{
#if defined(WIN32)
Sleep(1000L);
#else
sleep(1);
#endif
if (test6_will_message_arrived == 1 && test6_connection_lost_called == 1)
break;
}
assert("will message arrived", test6_will_message_arrived == 1,
"will_message_arrived was %d\n", test6_will_message_arrived);
assert("connection lost called", test6_connection_lost_called == 1,