예제 #1
0
    public static void Main(String[] args)
    {
        bool           bResult = false;
        Co3756Copy_aai oCbTest = new Co3756Copy_aai();

        try
        {
            Console.WriteLine();
            Console.WriteLine("CommandLine Arg Information:");
            Console.WriteLine("\t1 - For all Array Copy Exception information (Source and Target types)");
            Console.WriteLine("\t2 - Array copy to be confirmed through reflection (using Convert.ToXXX)");
            Console.WriteLine("\t3 - Debug Information; Point to where the error is occuring");
            Console.WriteLine();
            oCbTest.fExceptionInfo = false;
            oCbTest.fReflection    = false;
            for (int aa = 0; aa < args.Length; aa++)
            {
                if (args[aa].Equals("1") == true)
                {
                    oCbTest.fExceptionInfo = true;
                }
                else if (args[aa].Equals("2") == true)
                {
                    oCbTest.fReflection = true;
                }
                else if (args[aa].Equals("3") == true)
                {
                    oCbTest.fDebug = true;
                }
            }
            DateTime dtStartedTime = DateTime.Now;
            bResult = oCbTest.runTest();
            Console.WriteLine("Execution Time(mm:ss)=" + (new DateTime((DateTime.Now - dtStartedTime).Ticks)).Minute + ":" + (new DateTime((DateTime.Now - dtStartedTime).Ticks)).Second);
        }
        catch (Exception exc_main)
        {
            bResult = false;
            Console.WriteLine(s_strTFAbbrev + "FAiL!  Error Err_9999zzz!  Uncaught Exception caught in main(), exc_main==" + exc_main);
        }
        if (!bResult)
        {
            Console.WriteLine(s_strTFAbbrev + s_strTFPath);
            Console.Error.WriteLine(" ");
            Console.Error.WriteLine("FAiL!  " + s_strTFAbbrev);
            Console.Error.WriteLine(" ");
        }
        if (bResult == true)
        {
            Environment.ExitCode = 0;
        }
        else
        {
            Environment.ExitCode = 11;
        }
    }
 public static void Main( String[] args )
   {
   bool bResult = false;	
   Co3756Copy_aai oCbTest = new Co3756Copy_aai();
   try
     {
     Console.WriteLine();
     Console.WriteLine("CommandLine Arg Information:");
     Console.WriteLine("\t1 - For all Array Copy Exception information (Source and Target types)");
     Console.WriteLine("\t2 - Array copy to be confirmed through reflection (using Convert.ToXXX)");
     Console.WriteLine("\t3 - Debug Information; Point to where the error is occuring");
     Console.WriteLine();
     oCbTest.fExceptionInfo=false;
     oCbTest.fReflection=false;
     for ( int aa = 0 ; aa < args.Length ;aa++ )
       {
       if ( args[aa].Equals( "1" ) == true )
	 oCbTest.fExceptionInfo=true;
       else if ( args[aa].Equals( "2" ) == true )
	 oCbTest.fReflection=true;
       else if ( args[aa].Equals( "3" ) == true )
	 oCbTest.fDebug=true;
       }
     DateTime dtStartedTime = DateTime.Now;
     bResult = oCbTest.runTest();
     Console.WriteLine("Execution Time(mm:ss)=" + (new DateTime((DateTime.Now-dtStartedTime).Ticks)).Minute + ":" + (new DateTime((DateTime.Now-dtStartedTime).Ticks)).Second);
     }
   catch ( Exception exc_main )
     {
     bResult = false;
     Console.WriteLine( s_strTFAbbrev + "FAiL!  Error Err_9999zzz!  Uncaught Exception caught in main(), exc_main=="+ exc_main );
     }
   if ( ! bResult )
     {
     Console.WriteLine( s_strTFAbbrev + s_strTFPath );
     Console.Error.WriteLine( " " );
     Console.Error.WriteLine( "FAiL!  "+ s_strTFAbbrev );  
     Console.Error.WriteLine( " " );
     }
   if ( bResult == true ) Environment.ExitCode = 0; else Environment.ExitCode = 11; 
   }