public Boolean runTest()
{
Console.Out.WriteLine( "Co4045Abs_SByte .cs runTest() started." );
StringBuilder sblMsg = new StringBuilder( 99 );
int iCountErrors = 0;
int iCountTestcases = 0;
SByte SByteVal;
SByte SByteKnown;
do
{
try
{
++iCountTestcases;
SByteVal = -( (SByte)0x79 );
SByteKnown = (SByte)0x79;
if ( Math.Abs( SByteVal ) != SByteKnown )
{
++iCountErrors;
sblMsg.Length = 99 ;
sblMsg.Append( "POINTTOBREAK: find E_3nk4, ABS wrong! " );
sblMsg.Append( "EXTENDEDINFO: Expected SByteKnown == " + SByteKnown );
sblMsg.Append( " intead got Math.Abs( SByteVal ) == " + Math.Abs( SByteVal ) );
break;
}
++iCountTestcases;
SByteVal = -( (SByte)0x00 );
SByteKnown = 0;
if ( Math.Abs( SByteVal ) != SByteKnown )
{
++iCountErrors;
sblMsg.Length = 99 ;
sblMsg.Append( "POINTTOBREAK: find E_pf71, ABS wrong! " );
sblMsg.Append( "EXTENDEDINFO: Expected SByteKnown == " + SByteKnown );
sblMsg.Append( " intead got Math.Abs( SByteVal ) == " + Math.Abs( SByteVal ) );
break;
}
++iCountTestcases;
SByteVal = -( (SByte)0x01 );
SByteKnown = 1;
if ( Math.Abs( SByteVal ) != SByteKnown )
{
++iCountErrors;
sblMsg.Length = 99 ;
sblMsg.Append( "POINTTOBREAK: find E_6mz2, ABS wrong! " );
sblMsg.Append( "EXTENDEDINFO: Expected SByteKnown == " + SByteKnown );
sblMsg.Append( " intead got Math.Abs( SByteVal ) == " + Math.Abs( SByteVal ) );
break;
}
++iCountTestcases;
SByteVal = ( (SByte)0x7F );
SByteKnown = 127;
if ( Math.Abs( SByteVal ) != SByteKnown )
{
++iCountErrors;
sblMsg.Length = 99 ;
sblMsg.Append( "POINTTOBREAK: find E_ss81, ABS wrong! " );
sblMsg.Append( "EXTENDEDINFO: Expected SByteKnown == " + SByteKnown );
sblMsg.Append( " intead got Math.Abs( SByteVal ) == " + Math.Abs( SByteVal ) );
break;
}
++iCountTestcases;
SByteVal = ( (SByte)0x00 );
SByteKnown = 0;
if ( Math.Abs( SByteVal ) != SByteKnown )
{
++iCountErrors;
sblMsg.Length = 99 ;
sblMsg.Append( "POINTTOBREAK: find E_4f9v, ABS wrong! " );
sblMsg.Append( "EXTENDEDINFO: Expected SByteKnown == " + SByteKnown );
sblMsg.Append( " intead got Math.Abs( SByteVal ) == " + Math.Abs( SByteVal ) );
break;
}
++iCountTestcases;
SByteVal = ( (SByte)0x01 );
SByteKnown = 1;
if ( Math.Abs( SByteVal ) != SByteKnown )
{
++iCountErrors;
sblMsg.Length = 99 ;
sblMsg.Append( "POINTTOBREAK: find E_bbq11, ABS wrong! " );
sblMsg.Append( "EXTENDEDINFO: Expected SByteKnown == " + SByteKnown );
sblMsg.Append( " intead got Math.Abs( SByteVal ) == " + Math.Abs( SByteVal ) );
break;
}
}
catch ( Exception Exc )
{
++iCountErrors;
sblMsg.Length = 99 ;
sblMsg.Append( "POINTTOBREAK: find E_f3h5, Generic Exception Caught, Exc.ToString() == " );
sblMsg.Append( Exc.ToString() );
Console.Error.WriteLine( sblMsg.ToString() );
break;
}
}
while ( false );
if ( iCountErrors == 0 )
{
Console.Error.Write( "Math\\Co4045Abs_SByte .cs: paSs. iCountTestcases==" );
Console.Error.WriteLine( iCountTestcases );
return true;
}
else
{
Console.Error.Write( "Co4045Abs_SByte .cs iCountErrors==" );
Console.Error.WriteLine( iCountErrors );
Console.Error.WriteLine( "Co4045Abs_SByte .cs FAiL !" );
return false;
}
}
public static void Main( String[] args )