Co5396Max_long.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
     {
     Int64 i64a, i64b, i64ret;
     strLoc = "Loc_09utg";
     i64a = 0;
     i64b = 0;
     i64ret = Math.Max(i64a, i64b);
     iCountTestcases++;
     if(i64ret != 0)
       {
       iCountErrors++;
       printerr("Error_20xxu");
       }
     strLoc = "Loc_209uc";
     i64a = -1;
     i64b = 0;
     i64ret = Math.Max(i64a,i64b);
     iCountTestcases++;
     if(i64ret != 0)
       {
       iCountErrors++;
       printerr("Error_230uc! Expected==0 , value=="+i64ret.ToString());
       }
     strLoc = "Loc_209cc";
     i64a  = 0;
     i64b = -1;
     i64ret = Math.Max(i64a, i64b);
     iCountTestcases++;
     if(i64ret != 0)
       {
       iCountErrors++;
       printerr("Error_948nc! Expected==1 , value=="+i64ret.ToString());
       }
     strLoc = "Loc_20uxw";
     i64a = Int64.MaxValue;
     i64b = Int64.MinValue;
     i64ret = Math.Max(i64a, i64b);
     iCountTestcases++;
     if(i64ret != Int64.MaxValue)
       {
       iCountErrors++;
       printerr("Error_2908x! expected=="+Int64.MaxValue.ToString()+" , value=="+i64ret.ToString());
       }
     strLoc = "Loc_6745x";
     i64a = 10;
     i64b = 9;
     i64ret = Math.Max(i64a, i64b);
     iCountTestcases++;
     if(i64ret != 10)
       {
       iCountErrors++;
       printerr("Error_298xz! Expected==10 , value=="+i64ret.ToString());
       }
     strLoc = "Loc_298yx";
     i64a = 9;
     i64b = 10;
     i64ret = Math.Max(i64a, i64b);
     iCountTestcases++;
     if(i64ret != 10)
       {
       iCountErrors++;
       printerr("Error_298di! Expeceted==10 , value=="+i64ret.ToString());
       }
     strLoc = "Loc_12309";
     i64a = -10;
     i64b = -9;
     i64ret = Math.Max(i64a, i64b);
     iCountTestcases++;
     if(i64ret != -9)
       {
       iCountErrors++;
       printerr("Error_29xhs! Expected==-9 , value=="+i64ret.ToString());
       }
     strLoc = "Loc_9gr43";
     i64a = -9;
     i64b = -10;
     i64ret = Math.Max(i64a, i64b);
     iCountTestcases++;
     if(i64ret != -9)
       {
       iCountErrors++;
       printerr("Error_28eou! Expected==-9 , value=="+i64ret.ToString());
       }
     } 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_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
     return true;
     }
   else
     {
     Console.WriteLine("FAiL! "+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;
        Co5396Max_long cbA     = new Co5396Max_long();

        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 Co5396Max_long::runTest