[squeak-dev] The Trunk: KernelTests-nice.259.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jan 14 23:25:46 UTC 2014


Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-nice.259.mcz

==================== Summary ====================

Name: KernelTests-nice.259
Author: nice
Time: 15 January 2014, 12:25:14.371 am
UUID: 0f7301b0-612c-49d8-936f-775995b35e0f
Ancestors: KernelTests-fbs.258

Add a non regression test for recently discovered NumberParser error (truncating the last digits due to incorrect position of last non zero digit).

=============== Diff against KernelTests-fbs.258 ===============

Item was added:
+ ----- Method: NumberParsingTest>>testFloatmin (in category 'tests - Float') -----
+ testFloatmin
+ 	"Note that these are originally tests cases for former bugs of libc dtoa from netlib.
+ 	ref http://www.exploringbinary.com/gays-strtod-returns-zero-for-inputs-just-above-2-1075/
+ 	ref http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/testsuite/gcc.dg/float-exact-1.c?view=markup&pathrev=205119
+ 	They are also non regression for a bug of NumberParser related to incorrect position of last non zero digit.
+ 	ref https://pharo.fogbugz.com/f/cases/12642/bug-in-NumberParser-when-reading-a-number-with-fraction-part"
+ 	| halfMin moreThanHalfmin |
+ 	halfMin := SqNumberParser parse: (Float fmin asTrueFraction / 2 printShowingDecimalPlaces: 1 - Float fmin exponent).
+ 	self assert: halfMin equals: 0.0 description: 'nearest even of 0.5*Float fmin is zero'.
+ 	moreThanHalfmin := SqNumberParser parse: (Float fmin asTrueFraction / 2 + (10 raisedTo: Float fmin exponent - 4) printShowingDecimalPlaces: 4 - Float fmin exponent).
+ 	self assert: moreThanHalfmin equals: Float fmin description: 'nearest Float of a Fraction > 0.5*Float fmin is Float fmin'.!



More information about the Squeak-dev mailing list