{
// Stop any potential failures that might occur during verification.gTestController.CancelFailureCountdown();
// Prepare an array of counts of the occurrence of each value in// the legal range.unsigned counts[SortClass::kRange];
EH_STD::fill_n( counts, (int)SortClass::kRange, 0 );
for ( constSortClass *q = orig.begin(); q != orig.end(); q++ )
counts[ q->value() ]++;
// Check that each element is greater than the previous one, or if they are// equal, that their order has been preserved.for ( constSortClass* p = buf.begin(); p != buf.end(); p++ )
{
if ( p != buf.begin() ) {
EH_ASSERT( p->value() > p[-1].value()
|| p->value() == p[-1].value() && p->GetAddress() > p[-1].GetAddress() );
}
// Decrement the appropriate count for each value.
counts[ p->value() ]--;
}
// Check that the values were only rearranged, and none were lost.for ( unsigned j = 0; j < SortClass::kRange; j++ ) {
EH_ASSERT( counts[j] == 0 );
}
}
Generated on Sun May 27 2012 06:02:59 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.