HasMoreValues() public méthode

public HasMoreValues ( ) : Boolean
Résultat Boolean
Exemple #1
0
 public Boolean runTest()
 {
     Console.WriteLine(s_strTFPath + " " + s_strTFName + " ,for " + s_strComponentBeingTested + "  ,Source ver " + s_strDtTmVer);
     Console.WriteLine("");
     try
     {
         m_strLoc = "Loc_normalTests";
         XenoUInt32 xeno = new XenoUInt32();
         UInt32     x;
         while (xeno.HasMoreValues())
         {
             x = (UInt32)xeno.GetNextValue();
             iCountTestcases++;
             if (x.ToString(  ).Equals(x.ToString("d")) != true)
             {
                 iCountErrors++;
             }
         }
     } catch (Exception e) {
         Console.WriteLine("Unexpected exception " + e + " thrown during runTest try.");
         iCountErrors++;
     }
     Console.Write(Environment.NewLine);
     Console.WriteLine("Total Tests Ran: " + iCountTestcases + " Failed Tests: " + iCountErrors);
     if (iCountErrors == 0)
     {
         Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + "  ,iCountTestcases==" + iCountTestcases);
         return(true);
     }
     else
     {
         Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + "  ,iCountErrors==" + iCountErrors + " ,BugNums?: " + s_strActiveBugNums);
         return(false);
     }
 }
Exemple #2
0
 public Boolean runTest()
   {
   Console.WriteLine( s_strTFPath +" "+ s_strTFName +" ,for "+ s_strComponentBeingTested +"  ,Source ver "+ s_strDtTmVer );
   Console.WriteLine("");
   try
     {
     m_strLoc = "Loc_normalTests";
     UInt32 testUI;
     XenoUInt32 xeno = new XenoUInt32();
     UInt32 x;
     while( xeno.HasMoreValues() ) {
     x = (UInt32) xeno.GetNextValue();
     iCountTestcases++;
     testUI = (UInt32)x ;
     if ( testUI.ToString().Equals(  x.ToString( "d", NumberFormatInfo.GetInstance(CultureInfo.InvariantCulture) )) != true ) iCountErrors++;
     }
     } catch ( Exception e ) {
     Console.WriteLine( "Unexpected exception " + e + " thrown during runTest try." );
     iCountErrors++;
     }
   Console.Write(Environment.NewLine);
   Console.WriteLine( "Total Tests Ran: " + iCountTestcases + " Failed Tests: " + iCountErrors );
   if ( iCountErrors == 0 )
     {
     Console.WriteLine( "paSs.   "+ s_strTFPath +" "+ s_strTFName +"  ,iCountTestcases=="+ iCountTestcases );
     return true;
     }
   else
     {
     Console.WriteLine( "FAiL!   "+ s_strTFPath +" "+ s_strTFName +"  ,iCountErrors=="+ iCountErrors +" ,BugNums?: "+ s_strActiveBugNums );
     return false;
     }
   }
Exemple #3
0
 public Boolean runTest()
 {
     Console.WriteLine(s_strTFPath + " " + s_strTFName + " ,for " + s_strComponentBeingTested + "  ,Source ver " + s_strDtTmVer);
     Console.WriteLine("");
     try
     {
         m_strLoc = "Loc_normalTests";
         UInt32     testUI;
         XenoUInt32 xeno = new XenoUInt32();
         UInt32     i;
         while (xeno.HasMoreValues())
         {
             i      = (UInt32)xeno.GetNextValue();
             testUI = (UInt32)i;
             iCountTestcases++;
             if ((UInt32)testUI.GetHashCode() < 0)
             {
                 iCountErrors++;
                 Console.WriteLine("Error occured with value of " + i);
             }
             try
             {
                 hDup.Add(testUI.GetHashCode(), i);
             }
             catch (ArgumentException argexc)
             {
                 Console.WriteLine("ERROR Err_3949oo: Duplicate Hash code exists for " + i + " and " + hDup[testUI.GetHashCode()]);
             }
         }
     }
     catch (Exception exc_general)
     {
         ++iCountErrors;
         Console.WriteLine("Error Err_8888yyy (" + s_strTFAbbrev + ")!  Unexpected exception thrown sometime after m_strLoc==" + m_strLoc + " ,exc_general==" + exc_general);
     }
     Console.Write(Environment.NewLine);
     Console.WriteLine("Total Tests Ran: " + iCountTestcases + " Failed Tests: " + iCountErrors);
     if (iCountErrors == 0)
     {
         Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + "  ,iCountTestcases==" + iCountTestcases);
         return(true);
     }
     else
     {
         Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + "  ,iCountErrors==" + iCountErrors + " ,BugNums?: " + s_strActiveBugNums);
         return(false);
     }
 }
Exemple #4
0
 public Boolean runTest()
   {
   Console.WriteLine( s_strTFPath +" "+ s_strTFName +" ,for "+ s_strComponentBeingTested +"  ,Source ver "+ s_strDtTmVer );
   Console.WriteLine("");
   try
     {
     m_strLoc = "Loc_normalTests";
     UInt32 testUI;
     XenoUInt32 xeno = new XenoUInt32();
     UInt32 i;
     while( xeno.HasMoreValues() ) {
     i = (UInt32) xeno.GetNextValue();
     testUI = (UInt32) i ;
     iCountTestcases++;
     if ( (UInt32) testUI.GetHashCode() < 0 ) {
     iCountErrors++;
     Console.WriteLine( "Error occured with value of " + i );
     }
     try
       {
       hDup.Add (testUI.GetHashCode(), i);
       }
     catch(ArgumentException argexc)
       {
       Console.WriteLine( "ERROR Err_3949oo: Duplicate Hash code exists for " + i + " and " + hDup[testUI.GetHashCode()]);
       }
     }
     }
   catch( Exception exc_general )
     {
     ++iCountErrors;
     Console.WriteLine( "Error Err_8888yyy ("+ s_strTFAbbrev +")!  Unexpected exception thrown sometime after m_strLoc=="+ m_strLoc +" ,exc_general=="+ exc_general );
     }
   Console.Write(Environment.NewLine);
   Console.WriteLine( "Total Tests Ran: " + iCountTestcases + " Failed Tests: " + iCountErrors );
   if ( iCountErrors == 0 )
     {
     Console.WriteLine( "paSs.   "+ s_strTFPath +" "+ s_strTFName +"  ,iCountTestcases=="+ iCountTestcases );
     return true;
     }
   else
     {
     Console.WriteLine( "FAiL!   "+ s_strTFPath +" "+ s_strTFName +"  ,iCountErrors=="+ iCountErrors +" ,BugNums?: "+ s_strActiveBugNums );
     return false;
     }
   }
 public Boolean runTest()
   {
   Console.WriteLine( s_strTFPath +" "+ s_strTFName +" ,for "+ s_strComponentBeingTested +"  ,Source ver "+ s_strDtTmVer );
   Console.WriteLine("");
   UInt32 i = 0 ;
   XenoUInt32 xeno = new XenoUInt32();
   try
     {
     m_strLoc = "Loc_normalTests";
     String testStr = "";
     UInt32 testUI;
     while( xeno.HasMoreValues() ) {
     i = (UInt32) xeno.GetNextValue();
     iCountTestcases++;
     testStr =  i.ToString( "d");
     testUI = UInt32.Parse( testStr, NumberStyles.Any );
     if ( testUI != i ) {
     Console.WriteLine( "Fail! " + testUI + " != " + i );
     iCountErrors++;
     }
     iCountTestcases++;
     testUI = UInt32.Parse( testStr.PadLeft( 1000, ' '), NumberStyles.Any );
     if ( testUI != i ) {
     Console.WriteLine( "Fail! (pad left)" + testUI + " != " + i );
     iCountErrors++;
     }
     iCountTestcases++;
     testUI = UInt32.Parse( testStr.PadRight( 1000, ' '), NumberStyles.Any );
     if ( testUI != i ) {
     Console.WriteLine( "Fail! (pad right)" + testUI + " != " + i );
     iCountErrors++;
     }
     iCountTestcases++;
     testUI = UInt32.Parse( testStr.PadRight( 1000, ' ').PadLeft( 1000,' ' ), NumberStyles.Any );
     if ( testUI != i ) {
     Console.WriteLine( "Fail! (pad right+left) " + testUI + " != " + i );
     iCountErrors++;
     }
     try {
     iCountTestcases++;
     testStr =  i.ToString( "E");
     testUI = UInt32.Parse( testStr, NumberStyles.AllowCurrencySymbol );
     iCountErrors++;
     Console.WriteLine( "Failed! NumberStyle.AllowCurrencySymbol::No exception Thrown! String = '"+testStr+"'" );
     }
     catch( FormatException ) {}
     catch( Exception e ) {
     iCountErrors++;
     Console.WriteLine( "Failed! Wrong exception: '" + e + "'" );
     }
     }
     try {
     iCountTestcases++;
     testStr =  i.ToString( "E");
     testUI = UInt32.Parse( testStr, NumberStyles.AllowLeadingSign );
     iCountErrors++;
     Console.WriteLine( "Failed! No exception Thrown! String = '"+testStr+"'" );
     }
     catch( FormatException ) {}
     catch( Exception e ) {
     iCountErrors++;
     Console.WriteLine( "Failed! Wrong exception: '" + e + "'" );
     }
     try {
     iCountTestcases++;
     UInt32 UI = UInt32.Parse( null, NumberStyles.Any );
     iCountErrors++;
     Console.WriteLine( "Failed! No exception Thrown! String = '"+testStr+"'" );
     }
     catch( ArgumentException ) {}
     catch( Exception e ) {
     iCountErrors++;
     Console.WriteLine( "Failed! Wrong exception: '" + e + "'" );
     }
     }
   catch( Exception exc_general )
     {
     ++iCountErrors;
     Console.WriteLine( "Error Err_8888yyy ("+ s_strTFAbbrev +")!  Unexpected exception thrown sometime after m_strLoc=="+ m_strLoc +" ,exc_general=="+ exc_general );
     }
   Console.Write(Environment.NewLine);
   Console.WriteLine( "Total Tests Ran: " + iCountTestcases + " Failed Tests: " + iCountErrors );
   if ( iCountErrors == 0 )
     {
     Console.WriteLine( "paSs.   "+ s_strTFPath +" "+ s_strTFName +"  ,iCountTestcases=="+ iCountTestcases );
     return true;
     }
   else
     {
     Console.WriteLine( "FAiL!   "+ s_strTFPath +" "+ s_strTFName +"  ,iCountErrors=="+ iCountErrors +" ,BugNums?: "+ s_strActiveBugNums );
     return false;
     }
   }
Exemple #6
0
    public Boolean runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " ,for " + s_strComponentBeingTested + "  ,Source ver " + s_strDtTmVer);
        Console.WriteLine("");
        UInt32     i    = 0;
        XenoUInt32 xeno = new XenoUInt32();

        try
        {
            m_strLoc = "Loc_normalTests";
            String testStr = "";
            UInt32 testUI;
            while (xeno.HasMoreValues())
            {
                i = (UInt32)xeno.GetNextValue();
                iCountTestcases++;
                testStr = i.ToString("d");
                testUI  = UInt32.Parse(testStr, NumberStyles.Any);
                if (testUI != i)
                {
                    Console.WriteLine("Fail! " + testUI + " != " + i);
                    iCountErrors++;
                }
                iCountTestcases++;
                testUI = UInt32.Parse(testStr.PadLeft(1000, ' '), NumberStyles.Any);
                if (testUI != i)
                {
                    Console.WriteLine("Fail! (pad left)" + testUI + " != " + i);
                    iCountErrors++;
                }
                iCountTestcases++;
                testUI = UInt32.Parse(testStr.PadRight(1000, ' '), NumberStyles.Any);
                if (testUI != i)
                {
                    Console.WriteLine("Fail! (pad right)" + testUI + " != " + i);
                    iCountErrors++;
                }
                iCountTestcases++;
                testUI = UInt32.Parse(testStr.PadRight(1000, ' ').PadLeft(1000, ' '), NumberStyles.Any);
                if (testUI != i)
                {
                    Console.WriteLine("Fail! (pad right+left) " + testUI + " != " + i);
                    iCountErrors++;
                }
                try {
                    iCountTestcases++;
                    testStr = i.ToString("E");
                    testUI  = UInt32.Parse(testStr, NumberStyles.AllowCurrencySymbol);
                    iCountErrors++;
                    Console.WriteLine("Failed! NumberStyle.AllowCurrencySymbol::No exception Thrown! String = '" + testStr + "'");
                }
                catch (FormatException) {}
                catch (Exception e) {
                    iCountErrors++;
                    Console.WriteLine("Failed! Wrong exception: '" + e + "'");
                }
            }
            try {
                iCountTestcases++;
                testStr = i.ToString("E");
                testUI  = UInt32.Parse(testStr, NumberStyles.AllowLeadingSign);
                iCountErrors++;
                Console.WriteLine("Failed! No exception Thrown! String = '" + testStr + "'");
            }
            catch (FormatException) {}
            catch (Exception e) {
                iCountErrors++;
                Console.WriteLine("Failed! Wrong exception: '" + e + "'");
            }
            try {
                iCountTestcases++;
                UInt32 UI = UInt32.Parse(null, NumberStyles.Any);
                iCountErrors++;
                Console.WriteLine("Failed! No exception Thrown! String = '" + testStr + "'");
            }
            catch (ArgumentException) {}
            catch (Exception e) {
                iCountErrors++;
                Console.WriteLine("Failed! Wrong exception: '" + e + "'");
            }
        }
        catch (Exception exc_general)
        {
            ++iCountErrors;
            Console.WriteLine("Error Err_8888yyy (" + s_strTFAbbrev + ")!  Unexpected exception thrown sometime after m_strLoc==" + m_strLoc + " ,exc_general==" + exc_general);
        }
        Console.Write(Environment.NewLine);
        Console.WriteLine("Total Tests Ran: " + iCountTestcases + " Failed Tests: " + iCountErrors);
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + "  ,iCountTestcases==" + iCountTestcases);
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + "  ,iCountErrors==" + iCountErrors + " ,BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }