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); } }
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; } }
public Boolean runTest() { int max = 0; Hashtable hDup = new Hashtable(); Console.WriteLine(s_strTFPath + " " + s_strTFName + " ,for " + s_strComponentBeingTested + " ,Source ver " + s_strDtTmVer); try { m_strLoc = "Loc_normalTests"; UInt64 testUI; XenoUInt64 xeno = new XenoUInt64(); UInt64 i; while (xeno.HasMoreValues()) { i = (UInt64)xeno.GetNextValue(); testUI = (UInt64)i; iCountTestcases++; if (testUI.GetHashCode() != (((int)testUI) ^ (int)(testUI >> 32))) { iCountErrors++; Console.WriteLine("ERROR Err_9284pp: The Hash code for " + i + " is negative "); } try { hDup.Add(testUI.GetHashCode(), 0); } catch (ArgumentException argexc) { hDup[testUI.GetHashCode()] = (int)hDup[testUI.GetHashCode()] + 1; if ((int)hDup[testUI.GetHashCode()] > max) { max = (int)hDup[testUI.GetHashCode()]; } } } Console.WriteLine("INFO: In_893 Maximum Duplicate hash codes that exist: " + max); if (max > 5) { iCountErrors++; Console.WriteLine("ERROR Err_9284zz: TOO MANY DUPLICATE HASH CODES"); } } 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() { int max = 0; Hashtable hDup = new Hashtable (); Console.WriteLine( s_strTFPath +" "+ s_strTFName +" ,for "+ s_strComponentBeingTested +" ,Source ver "+ s_strDtTmVer ); try { m_strLoc = "Loc_normalTests"; UInt64 testUI; XenoUInt64 xeno = new XenoUInt64(); UInt64 i; while( xeno.HasMoreValues() ) { i = (UInt64) xeno.GetNextValue(); testUI = (UInt64) i; iCountTestcases++; if (testUI.GetHashCode() != ( ((int)testUI) ^ (int)(testUI >> 32) ) ) { iCountErrors++; Console.WriteLine( "ERROR Err_9284pp: The Hash code for " + i + " is negative "); } try { hDup.Add (testUI.GetHashCode(), 0); } catch(ArgumentException argexc) { hDup[testUI.GetHashCode()] = (int) hDup[testUI.GetHashCode()] + 1; if ((int) hDup[testUI.GetHashCode()] > max) { max = (int)hDup[testUI.GetHashCode()]; } } } Console.WriteLine ("INFO: In_893 Maximum Duplicate hash codes that exist: " + max); if (max > 5) { iCountErrors++; Console.WriteLine( "ERROR Err_9284zz: TOO MANY DUPLICATE HASH CODES"); } } 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); XenoUInt64 xeno = new XenoUInt64(); UInt64 i = 0; try { NumberFormatInfo nfi = NumberFormatInfo.CurrentInfo; m_strLoc = "Loc_normalTests"; String testStr = ""; UInt64 testUI; while (xeno.HasMoreValues()) { i = xeno.GetNextValue(); iCountTestcases++; testStr = i.ToString("d"); testUI = UInt64.Parse(testStr, NumberStyles.Any, nfi); if (testUI != i) { Console.WriteLine("Fail! " + testUI + " != " + i); iCountErrors++; } iCountTestcases++; testUI = UInt64.Parse(testStr.PadLeft(1000, ' '), NumberStyles.Any, nfi); if (testUI != i) { Console.WriteLine("Fail! (pad left)" + testUI + " != " + i); iCountErrors++; } iCountTestcases++; testUI = UInt64.Parse(testStr.PadRight(1000, ' '), NumberStyles.Any, nfi); if (testUI != i) { Console.WriteLine("Fail! (pad right)" + testUI + " != " + i); iCountErrors++; } iCountTestcases++; testUI = UInt64.Parse(testStr.PadRight(1000, ' ').PadLeft(1000, ' '), NumberStyles.Any, nfi); if (testUI != i) { Console.WriteLine("Fail! (pad right+left) " + testUI + " != " + i); iCountErrors++; } try { iCountTestcases++; testStr = i.ToString("E"); testUI = UInt64.Parse(testStr, NumberStyles.AllowCurrencySymbol, nfi); 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", nfi); testUI = UInt64.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++; UInt64 UI = UInt64.Parse(null, NumberStyles.Any, nfi); iCountErrors++; Console.WriteLine("Failed! No exception Thrown! String = '" + testStr + "'"); } catch (ArgumentNullException) {} 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); } }
public Boolean runTest() { Console.WriteLine( s_strTFPath +" "+ s_strTFName +" ,for "+ s_strComponentBeingTested +" ,Source ver "+ s_strDtTmVer ); XenoUInt64 xeno = new XenoUInt64(); UInt64 i = 0; try { NumberFormatInfo nfi = NumberFormatInfo.CurrentInfo; m_strLoc = "Loc_normalTests"; String testStr = ""; UInt64 testUI; while( xeno.HasMoreValues() ) { i = xeno.GetNextValue(); iCountTestcases++; testStr = i.ToString( "d"); testUI = UInt64.Parse( testStr, NumberStyles.Any, nfi ); if ( testUI != i ) { Console.WriteLine( "Fail! " + testUI + " != " + i ); iCountErrors++; } iCountTestcases++; testUI = UInt64.Parse( testStr.PadLeft( 1000, ' '), NumberStyles.Any, nfi ); if ( testUI != i ) { Console.WriteLine( "Fail! (pad left)" + testUI + " != " + i ); iCountErrors++; } iCountTestcases++; testUI = UInt64.Parse( testStr.PadRight( 1000, ' '), NumberStyles.Any, nfi ); if ( testUI != i ) { Console.WriteLine( "Fail! (pad right)" + testUI + " != " + i ); iCountErrors++; } iCountTestcases++; testUI = UInt64.Parse( testStr.PadRight( 1000, ' ').PadLeft( 1000,' ' ), NumberStyles.Any, nfi ); if ( testUI != i ) { Console.WriteLine( "Fail! (pad right+left) " + testUI + " != " + i ); iCountErrors++; } try { iCountTestcases++; testStr = i.ToString( "E"); testUI = UInt64.Parse( testStr, NumberStyles.AllowCurrencySymbol, nfi ); 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", nfi ); testUI = UInt64.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++; UInt64 UI = UInt64.Parse( null, NumberStyles.Any, nfi ); iCountErrors++; Console.WriteLine( "Failed! No exception Thrown! String = '"+testStr+"'" ); } catch( ArgumentNullException ) {} 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; } }