コード例 #1
0
    public static void Main(String[] args)
    {
        Console.WriteLine(" Starting " + strName + " ...");
        Console.WriteLine("USAGE:  Co2346Replace_ss.exe  Time_in_Seconds_per_rep  Number_of_repetitions");
        Console.WriteLine("USAGE:  Defaults args are:   2  2   (must give both args if give any)");
        Console.WriteLine();
        Boolean          bResult      = false;
        Co2346Replace_ss oReplaceTest = new Co2346Replace_ss();
        double           timeInSecs   = 2.0;
        int numOfReps = 2;

        try {
            if (args.Length >= 1)
            {
                timeInSecs = Convert.ToInt64(args[0]);
            }
            if (args.Length >= 2)
            {
                numOfReps = Convert.ToInt32(args[1]);
            }
        }
        catch (System.FormatException) {
            Console.WriteLine("INVALID ARGUMENTS");
            Console.WriteLine("USING DEFAULT: Co2346Replace_ss.exe  2  2 ");
            timeInSecs = 2.0;
            numOfReps  = 2;
        }
        catch (Exception exc)
        {
            Console.WriteLine("Error_abc637:  Conversion error about input args?");
            Console.WriteLine(exc.ToString());
            goto LABEL_882_RETURN_LABEL;
        }
        try {
            bResult = oReplaceTest.runTest(timeInSecs, numOfReps);
        }
        catch (Exception exc_main) {
            bResult = false;
            String strInfo = "Unexpected Exception: (runTest)";
            strInfo = strInfo + exc_main.ToString();
            Console.Error.WriteLine(strName + " " + strTest + " " + strPath);
            Console.Error.WriteLine(strInfo);
        }
        LABEL_882_RETURN_LABEL :;
        if (!bResult)
        {
            Console.Error.WriteLine("PATHTOSOURCE:  " + strPath + strTest + "   FAIL");
        }
        if (bResult == true)
        {
            Environment.ExitCode = 0;
        }
        else
        {
            Environment.ExitCode = 11;
        }
    }
コード例 #2
0
ファイル: co2346replace_ss.cs プロジェクト: ArildF/masters
 public static void Main( String[] args ) 
   {
   Console.WriteLine( " Starting "+ strName +" ..." );
   Console.WriteLine( "USAGE:  Co2346Replace_ss.exe  Time_in_Seconds_per_rep  Number_of_repetitions" );
   Console.WriteLine( "USAGE:  Defaults args are:   2  2   (must give both args if give any)" );
   Console.WriteLine();
   Boolean bResult = false;	
   Co2346Replace_ss oReplaceTest = new Co2346Replace_ss();
   double timeInSecs=2.0;
   int numOfReps=2;
   try {
   if ( args.Length >= 1 )
     timeInSecs=Convert.ToInt64(args[0]);
   if ( args.Length >= 2 )
     numOfReps = Convert.ToInt32(args[1]);			
   }
   catch (System.FormatException) {
   Console.WriteLine ("INVALID ARGUMENTS");			
   Console.WriteLine ("USING DEFAULT: Co2346Replace_ss.exe  2  2 ");
   timeInSecs=2.0;
   numOfReps=2;
   }
   catch ( Exception exc )
     {
     Console.WriteLine( "Error_abc637:  Conversion error about input args?" );
     Console.WriteLine( exc.ToString() );
     goto LABEL_882_RETURN_LABEL;
     }
   try {
   bResult = oReplaceTest.runTest(timeInSecs ,numOfReps);
   }
   catch ( Exception exc_main ) {
   bResult = false;
   String strInfo =  "Unexpected Exception: (runTest)" ;
   strInfo = strInfo + exc_main.ToString() ;
   Console.Error.WriteLine (strName+" "+strTest+" "+strPath);
   Console.Error.WriteLine (strInfo);
   }
   LABEL_882_RETURN_LABEL:;
   if ( ! bResult )
     Console.Error.WriteLine(  "PATHTOSOURCE:  " + strPath + strTest + "   FAIL"  );
   if ( bResult == true ) Environment.ExitCode = 0; else Environment.ExitCode = 11;
   }