add asserts

This commit is contained in:
Chris Danford
2005-03-05 08:33:59 +00:00
parent 3eca1410f0
commit 527534cdaa
+9 -3
View File
@@ -33,11 +33,17 @@ static void SelectExactlyOne( int iSelection, vector<bool> &vbSelectedOut )
static int GetOneSelection( const vector<bool> &vbSelected )
{
int iRet = -1;
for( unsigned i=0; i<vbSelected.size(); i++ )
{
if( vbSelected[i] )
return i;
ASSERT(0); // shouldn't call this if not expecting one to be selected
return -1;
{
ASSERT( iRet == -1 ); // only one should be selected
iRet = i;
}
}
ASSERT( iRet != -1 ); // shouldn't call this if not expecting one to be selected
return iRet;
}