tslist: add asserts for tests

This commit is contained in:
nillerusr 2022-08-19 23:21:37 +03:00
parent c909de8faf
commit 0a66367243

View File

@ -11,6 +11,7 @@
#if defined( _X360 )
#include "xbox/xbox_win32stubs.h"
#endif
#include "unitlib/unitlib.h"
namespace TSListTests
{
@ -129,7 +130,7 @@ void ValidateBuckets()
if ( g_pTestBuckets[i] != 0 )
{
Msg( "Test bucket %d has an invalid value %d\n", i, g_pTestBuckets[i] );
DebuggerBreakIfDebugging();
Shipping_Assert( 0 );
return;
}
}
@ -151,7 +152,7 @@ uintp PopThreadFunc( void *)
{
if ( g_nPushThreads == 0 )
{
// Pop the rest
// Pop the rest
while ( g_pTestOps->Pop( &ignored ) )
{
ThreadSleep( 0 );
@ -216,6 +217,7 @@ void TestEnd( bool bExpectEmpty = true )
if ( g_nPops != g_nPushes )
{
Msg( "FAIL: Not all items popped\n" );
Shipping_Assert( 0 );
return;
}
@ -228,11 +230,13 @@ void TestEnd( bool bExpectEmpty = true )
else
{
Msg("FAIL: !IsEmpty()\n");
Shipping_Assert( 0 );
}
}
else
{
Msg("FAIL: !Validate()\n");
Shipping_Assert( 0 );
}
while ( g_ThreadHandles.size() )
{