|
From: | Graham J Lee |
Subject: | Re: Test base library stable branch please |
Date: | Thu, 25 Jan 2007 23:06:30 +0000 |
On 25 Jan 2007, at 22:49, David Ayers wrote:
Graham J Lee schrieb:I still haven't been able to duplicate that. Maybe if you're going toFOSDEM we could meet up and have a mini-hackfest to see WTF is happening :-)The issue was not a bug in NSNumberFormatter. It was a bug in the implementation of NSDecimalNumber - (id) initWithBytes: (const void*)value objCType: (const char*)type which called: [[NSString alloc] initWithFormat: @"%g",v]; instead of [[NSString alloc] initWithFormat: @"%g" locale: GSPrivateDefaultLocale(), v]; It's just that due to the missing tests for NSDecimalNumber, the issuedidn't show up in the test suite until the tests for the formatter whereadded.
Ah, OK. I'm happy to write a few more tests for [NG]SDecimalNumber. If you could send me some examples of things you found broken which are fixed by your patch or by Richard's fixes, I'll incorporate those to avoid dupliacting them myself ;-)
[...] My patch proposal tries to handle most of the other types that could be passed to the method. And it also tries to handle INF and NAN double and float values better. But I must admit that I do not have a Cocoa reference implementation to verify whether Cocoa handles INF/NAN "correctly".
OK, I tend to run tests on both Cocoa and GS to look for differences, so I'll check into that anyway. Again, any example you already have cooked up for this would be welcome ;-)
Cheers, Graham.P.S. I think we definitely could do with NSLocale for formatting and so forth. I think I could implement this for POSIX-esque systems so will give it a go; having no clue HTF Windows i18n works I will avoid offering a cross-platform solution though ;-). But, having never implemented a GS class from scratch before, especially one which isn't part of the OpenStep specification: any copyright/left pitfalls? Any API-matching @interface of a Cocoa class is obviously going to look remarkably similar to an Apple header file, is using their API documentation and writing my own header file from scratch appropriate?
[Prev in Thread] | Current Thread | [Next in Thread] |