public Boolean runTest()
   {
   int iCountErrors = 0;
   int iCountTestcases = 0;
   String strLoc="123_er";
   Console.Out.Write( s_strClassMethod );
   Console.Out.Write( ": " );
   Console.Out.Write( s_strTFPath + s_strTFName );
   Console.Out.Write( ": " );
   Console.Out.Write( s_strDtTmVer );
   Console.Out.WriteLine( " runTest started..." );
   ValueType vt1;
   MyStruct1 mystr1;
   MyStruct2 mystr2;
   Int64 lVal;
   try {
   mystr1 = new MyStruct1(5);								
   iCountTestcases++;
   if(!mystr1.ToString().Equals("MyStruct1")) {
   iCountErrors++;
   Console.WriteLine("Err_53vd! ValueType change detected, please take a look");
   }									
   vt1 = mystr1;
   iCountTestcases++;
   if(!vt1.ToString().Equals("MyStruct1")) {
   iCountErrors++;
   Console.WriteLine("Err_8536cd! ValueType change detected, please take a look");
   }			
   lVal = 50;
   mystr2 = new MyStruct2(lVal);
   iCountTestcases++;
   if(!mystr2.ToString().Equals("50")) {
   iCountErrors++;
   Console.WriteLine("Err_210cdp! ValueType change detected, please take a look, " + mystr2);
   }			
   vt1 = mystr2;
   iCountTestcases++;
   if(!vt1.ToString().Equals("50")) {
   iCountErrors++;
   Console.WriteLine("Err_93246cds! ValueType change detected, please take a look, " + vt1);
   }			
   }catch (Exception exc_general){
   ++iCountErrors;
   Console.WriteLine( s_strTFAbbrev +"Error Err_8888yyy!  strLoc=="+ strLoc +" ,exc_general=="+ exc_general );
   }
   if ( iCountErrors == 0 ){
   Console.Error.WriteLine( "paSs.   "+ s_strTFPath +" "+ s_strTFName +"  ,iCountTestcases=="+ iCountTestcases );
   return true;
   } else {
   Console.Error.WriteLine( "FAiL!   "+ s_strTFPath +" "+ s_strTFName +"  ,iCountErrors=="+ iCountErrors +" ,BugNums?: "+ s_strActiveBugNums );
   return false;
   }
   }
Пример #2
0
    public Boolean runTest()
    {
        int    iCountErrors    = 0;
        int    iCountTestcases = 0;
        String strLoc          = "123_er";

        Console.Out.Write(s_strClassMethod);
        Console.Out.Write(": ");
        Console.Out.Write(s_strTFPath + s_strTFName);
        Console.Out.Write(": ");
        Console.Out.Write(s_strDtTmVer);
        Console.Out.WriteLine(" runTest started...");
        ValueType vt1;
        MyStruct1 mystr1;
        MyStruct2 mystr2;
        Int64     lVal;

        try {
            mystr1 = new MyStruct1(5);
            iCountTestcases++;
            if (!mystr1.ToString().Equals("MyStruct1"))
            {
                iCountErrors++;
                Console.WriteLine("Err_53vd! ValueType change detected, please take a look");
            }
            vt1 = mystr1;
            iCountTestcases++;
            if (!vt1.ToString().Equals("MyStruct1"))
            {
                iCountErrors++;
                Console.WriteLine("Err_8536cd! ValueType change detected, please take a look");
            }
            lVal   = 50;
            mystr2 = new MyStruct2(lVal);
            iCountTestcases++;
            if (!mystr2.ToString().Equals("50"))
            {
                iCountErrors++;
                Console.WriteLine("Err_210cdp! ValueType change detected, please take a look, " + mystr2);
            }
            vt1 = mystr2;
            iCountTestcases++;
            if (!vt1.ToString().Equals("50"))
            {
                iCountErrors++;
                Console.WriteLine("Err_93246cds! ValueType change detected, please take a look, " + vt1);
            }
        }catch (Exception exc_general) {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + "Error Err_8888yyy!  strLoc==" + strLoc + " ,exc_general==" + exc_general);
        }
        if (iCountErrors == 0)
        {
            Console.Error.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + "  ,iCountTestcases==" + iCountTestcases);
            return(true);
        }
        else
        {
            Console.Error.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + "  ,iCountErrors==" + iCountErrors + " ,BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }