Browse Source

tslist: add asserts for tests

pull/114/head
nillerusr 2 years ago
parent
commit
0a66367243
  1. 8
      tier0/tslist.cpp

8
tier0/tslist.cpp

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

Loading…
Cancel
Save