HasMoreValues() public méthode

public HasMoreValues ( ) : Boolean
Résultat Boolean
 public virtual bool runTest()
   {
   Console.WriteLine( s_strTFPath +" "+ s_strTFName +" ,for "+ s_strComponentBeingTested +"  ,Source ver "+ s_strDtTmVer );
   String strBaseLoc;
   try
     {
     m_strLoc = "Loc_normalTests";
     String testStr = "";
     UInt16 testUI;
     XenoUInt16 xeno = new XenoUInt16();
     UInt16 x;
     while( xeno.HasMoreValues() ) {
     x = ((UInt16) xeno.GetNextValue() );
     iCountTestcases++;
     testUI = ((UInt16) x );
     if ( testUI.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;
     }
   }
    public Boolean runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " ,for " + s_strComponentBeingTested + "  ,Source ver " + s_strDtTmVer);
        String strBaseLoc;

        try
        {
            m_strLoc = "Loc_normalTests";
            UInt16     testUI;
            XenoUInt16 xeno = new XenoUInt16();
            UInt16     i;
            while (xeno.HasMoreValues())
            {
                i      = (UInt16)xeno.GetNextValue();
                testUI = (UInt16)i;
                iCountTestcases++;
                if ((UInt16)testUI.GetHashCode() == 0 && testUI != 0)
                {
                    iCountErrors++;
                    Console.WriteLine("Error occured with value of " + i);
                }
            }
        }
        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 #3
0
    public virtual bool runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " ,for " + s_strComponentBeingTested + "  ,Source ver " + s_strDtTmVer);
        String strBaseLoc;

        try
        {
            m_strLoc = "Loc_normalTests";
            String     testStr = "";
            UInt16     testUI;
            XenoUInt16 xeno = new XenoUInt16();
            UInt16     x;
            while (xeno.HasMoreValues())
            {
                x = ((UInt16)xeno.GetNextValue());
                iCountTestcases++;
                testUI = ((UInt16)x);
                if (testUI.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);
        }
    }
 public Boolean runTest()
   {
   Console.WriteLine( s_strTFPath +" "+ s_strTFName +" ,for "+ s_strComponentBeingTested +"  ,Source ver "+ s_strDtTmVer );
   String strBaseLoc;
   try
     {
     m_strLoc = "Loc_normalTests";
     UInt16 testUI;
     XenoUInt16 xeno = new XenoUInt16();
     UInt16 i;
     while( xeno.HasMoreValues() ) {
     i = (UInt16) xeno.GetNextValue() ;
     testUI = (UInt16) i ;
     iCountTestcases++;
     if ( (UInt16) testUI.GetHashCode() == 0 && testUI != 0 ) {
     iCountErrors++;
     Console.WriteLine( "Error occured with value of " + i );
     }
     }
     }
   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 #5
0
    public Boolean runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " ,for " + s_strComponentBeingTested + "  ,Source ver " + s_strDtTmVer);
        String     strBaseLoc;
        XenoUInt16 xeno = new XenoUInt16();
        UInt16     i    = ((UInt16)0);

        try
        {
            m_strLoc = "Loc_normalTests";
            String testStr = "";
            UInt16 testUI;
            while (xeno.HasMoreValues())
            {
                i = ((UInt16)xeno.GetNextValue());
                iCountTestcases++;
                testStr = i.ToString("d");
                testUI  = UInt16.Parse(testStr, NumberStyles.Any);
                if (testUI != i)
                {
                    Console.WriteLine("Fail! " + testUI + " != " + i);
                    iCountErrors++;
                }
                iCountTestcases++;
                testUI = UInt16.Parse(testStr.PadLeft(i, ' '), NumberStyles.Any);
                if (testUI != i)
                {
                    Console.WriteLine("Fail! (pad left)" + testUI + " != " + i);
                    iCountErrors++;
                }
                iCountTestcases++;
                testUI = UInt16.Parse(testStr.PadRight(i, ' '), NumberStyles.Any);
                if (testUI != i)
                {
                    Console.WriteLine("Fail! (pad right)" + testUI + " != " + i);
                    iCountErrors++;
                }
                iCountTestcases++;
                testUI = UInt16.Parse(testStr.PadRight(i, ' ').PadLeft(i, ' '), NumberStyles.Any);
                if (testUI != i)
                {
                    Console.WriteLine("Fail! (pad right+left) " + testUI + " != " + i);
                    iCountErrors++;
                }
                try {
                    iCountTestcases++;
                    testStr = i.ToString("E");
                    testUI  = UInt16.Parse(testStr, NumberStyles.AllowCurrencySymbol);
                    iCountErrors++;
                    Console.WriteLine("Failed! NumberStyle.AllowCurrencySymbol::No exception Thrown! String = '" + testStr + "'");
                }
                catch (FormatException fe) {}
                catch (Exception e) {
                    iCountErrors++;
                    Console.WriteLine("Failed! Wrong exception: '" + e + "'");
                }
            }
            try {
                iCountTestcases++;
                testStr = i.ToString("E");
                testUI  = UInt16.Parse(testStr, NumberStyles.AllowLeadingSign);
                iCountErrors++;
                Console.WriteLine("Failed! No exception Thrown! String = '" + testStr + "'");
            }
            catch (FormatException fe) {}
            catch (Exception e) {
                iCountErrors++;
                Console.WriteLine("Failed! Wrong exception: '" + e + "'");
            }
            try {
                iCountTestcases++;
                UInt16 UI = UInt16.Parse(null, NumberStyles.Any);
                iCountErrors++;
                Console.WriteLine("Failed! No exception Thrown! String = '" + testStr + "'");
            }
            catch (ArgumentException ae) {}
            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 );
   String strBaseLoc;
   XenoUInt16 xeno = new XenoUInt16();
   UInt16 i = ((UInt16) 0 );
   try
     {
     m_strLoc = "Loc_normalTests";
     String testStr = "";
     UInt16 testUI;
     while( xeno.HasMoreValues() ) {
     i = ((UInt16) xeno.GetNextValue() );
     iCountTestcases++;
     testStr =  i.ToString( "d");
     testUI = UInt16.Parse( testStr );
     if ( testUI != i ) {
     Console.WriteLine( "Fail! " + testUI + " != " + i );
     iCountErrors++;
     }
     iCountTestcases++;
     testUI = UInt16.Parse( testStr.PadLeft( i, ' ') );
     if ( testUI != i ) {
     Console.WriteLine( "Fail! (pad left)" + testUI + " != " + i );
     iCountErrors++;
     }
     iCountTestcases++;
     testUI = UInt16.Parse( testStr.PadRight( i, ' ') );
     if ( testUI != i ) {
     Console.WriteLine( "Fail! (pad right)" + testUI + " != " + i );
     iCountErrors++;
     }
     iCountTestcases++;
     testUI = UInt16.Parse( testStr.PadRight( i, ' ').PadLeft( i,' ' ) );
     if ( testUI != i ) {
     Console.WriteLine( "Fail! (pad right+left) " + testUI + " != " + i );
     iCountErrors++;
     }
     try {
     iCountTestcases++;
     testStr =  i.ToString( "E");
     testUI = UInt16.Parse( testStr );
     iCountErrors++;
     Console.WriteLine( "Failed! No exception Thrown! String = '"+testStr+"'" );
     }
     catch( FormatException fe ) {}
     catch( Exception e ) {
     iCountErrors++;
     Console.WriteLine( "Failed! Wrong exception: '" + e + "'" );
     }
     }
     try {
     iCountTestcases++;
     testStr =  i.ToString( "E");
     testUI = UInt16.Parse( testStr );
     iCountErrors++;
     Console.WriteLine( "Failed! No exception Thrown! String = '"+testStr+"'" );
     }
     catch( FormatException fe ) {}
     catch( Exception e ) {
     iCountErrors++;
     Console.WriteLine( "Failed! Wrong exception: '" + e + "'" );
     }
     try {
     iCountTestcases++;
     UInt16 UI = UInt16.Parse( null );
     iCountErrors++;
     Console.WriteLine( "Failed! No exception Thrown! String = '"+testStr+"'" );
     }
     catch( ArgumentException ae ) {}
     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;
     }
   }