Work around Catch multi-thread unsafety
Don't use Catch asserts in threads other than main, this doesn't work reliably. Switch to using simple wxASSERT() which doesn't give as much information as Catch asserts when the test fails, but at least allows the tests to pass when the asserts don't fail.
This commit is contained in:
@@ -195,20 +195,22 @@ void *QueueTestCase::MyThread::Entry()
|
||||
if ( res == wxMSGQUEUE_MISC_ERROR )
|
||||
return (wxThread::ExitCode)wxMSGQUEUE_MISC_ERROR;
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( wxMSGQUEUE_NO_ERROR, res );
|
||||
// We can't use Catch asserts outside of the main thread
|
||||
// currently, unfortunately.
|
||||
wxASSERT( res == wxMSGQUEUE_NO_ERROR );
|
||||
}
|
||||
++messagesReceived;
|
||||
continue;
|
||||
}
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL ( result, wxMSGQUEUE_TIMEOUT );
|
||||
wxASSERT( result == wxMSGQUEUE_TIMEOUT );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if ( messagesReceived != m_maxMsgCount )
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL( m_type, WaitWithTimeout );
|
||||
wxASSERT( m_type == WaitWithTimeout );
|
||||
|
||||
return (wxThread::ExitCode)wxMSGQUEUE_TIMEOUT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user