Co5385Ctor_uint.runTest C# (CSharp) Method

runTest() public method

public runTest ( ) : bool
return bool
 public bool runTest()
   {
   Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
   int iCountErrors = 0;
   int iCountTestcases = 0;
   String strLoc = "Loc_000oo";
   String strValue = String.Empty;
   try
     {
     Decimal dec1, dec2;
     UInt32 ui32;
     iCountTestcases++;
     if(Convert.ToInt64(UInt32.MaxValue) != 0xffffffffL)
       {
       iCountErrors++;
       printerr("Error_98fud! UInt32.MaxValue is incorrect");
       }
     for(long l = 0 ; l < Convert.ToInt64(UInt32.MaxValue) ; l+=1000000)
       {
       ui32 = Convert.ToUInt32(l);
       dec1 = new Decimal(ui32);
       iCountTestcases++;
       if(dec1 != (Decimal)l)
	 {
	 iCountErrors++;
	 printerr("Error_938fh! Expected=="+l.ToString()+" , got value=="+dec1.ToString());
	 }
       }
     Console.WriteLine(UInt32.MaxValue);
     } catch (Exception exc_general ) {
     ++iCountErrors;
     Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general=="+exc_general.ToString());
     }
   if ( iCountErrors == 0 )
     {
     Console.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
     return true;
     }
   else
     {
     Console.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors.ToString()+" , BugNums?: "+s_strActiveBugNums );
     return false;
     }
   }
 public void printerr ( String err )

Usage Example

コード例 #1
0
    public static void Main(String[] args)
    {
        bool            bResult = false;
        Co5385Ctor_uint cbA     = new Co5385Ctor_uint();

        try {
            bResult = cbA.runTest();
        } catch (Exception exc_main) {
            bResult = false;
            Console.WriteLine(s_strTFAbbrev + " : FAiL! Error Err_9999zzz! Uncaught Exception in main(), exc_main==" + exc_main.ToString());
        }
        if (!bResult)
        {
            Console.WriteLine("Path: " + s_strTFName + s_strTFPath);
            Console.WriteLine(" ");
            Console.WriteLine("FAiL!  " + s_strTFAbbrev);
            Console.WriteLine(" ");
        }
        if (bResult)
        {
            Environment.ExitCode = 0;
        }
        else
        {
            Environment.ExitCode = 1;
        }
    }
All Usage Examples Of Co5385Ctor_uint::runTest