XenoUInt64.GetNextValue C# (CSharp) Method

GetNextValue() public method

public GetNextValue ( ) : System.UInt64
return System.UInt64
 public UInt64 GetNextValue() {
 if ( AllFinished == false ) {
 if ( LowFinished == false ) {
 CurrentMid = (UInt64) (Convert.ToDouble(CurrentMid)*LowEpsilon);
 if ( CurrentMid <= 0 ) {
 IsValidMid();
 LowFinished = true;
 return Minimum;
 }
 return UInt64.Parse(  (Minimum + CurrentMid).ToString() );
 }
 if ( HighFinished == false ) {
 CurrentMid = (UInt64) (Convert.ToDouble(CurrentMid)*HighEpsilon);
 if ( CurrentMid <= 0 ) {
 IsValidMid();
 HighFinished = true;
 return Maximum;
 }
 return UInt64.Parse(  (Maximum - CurrentMid).ToString() );
 }
 AllFinished = true;
 IsValidMid();
 return CurrentMid;
 }
 throw new OverflowException( "No more values in Range" );
 }
}

Usage Example

Ejemplo n.º 1
0
 public Boolean runTest()
 {
     Console.WriteLine(s_strTFPath + " " + s_strTFName + " ,for " + s_strComponentBeingTested + "  ,Source ver " + s_strDtTmVer);
     try
     {
         m_strLoc = "Loc_normalTests";
         XenoUInt64 xeno = new XenoUInt64();
         UInt64     x;
         while (xeno.HasMoreValues())
         {
             x = 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);
     }
 }
All Usage Examples Of XenoUInt64::GetNextValue