[Seaside-dev] seaside portability improvements (gst)
philippe.marschall at gmail.com
Wed Feb 13 18:10:04 UTC 2008
2008/2/12, Paolo Bonzini <bonzini at gnu.org>:
> Here are my first findings.
> 1) WACodecTest should be separated in a Seaside-Adapters-Tests package.
> Maybe it's overkill, though.
> 2) There are NULL characters in testUtf16.
Yes, it's utf-16. GST can't deal with 0 Characters like C? If that-s
the case then I'll change it.
> It would be nice if the
> strings there could be expressed as byte-arrays or, even better, created
> from the ISO-8859-1 strings using something like:
> utf16 := String new: iso88591 size * 2.
> iso88591 with: (2 to: utf16 size by: 2) do: [ :ch :index |
> utf16 at: index put: ch ].
> 3) in the WAPlatformTest #testNewDayMonthNumberYear, Date>>#day is
> expected to return the day of year; in GNU Smalltalk it returns the day
> of month. I suggest creating an extension Date>>#dayOfYear and using
> it. Nowhere else in Seaside I see Date>>#day called.
> 4) in WAPlatformTest>>#testDaysInMonthForYear, Month is sent a message.
> There is no such class in GNU Smalltalk; I suggest creating an
> extension Date class>>#daysInMonthNumber:forYear:.
As you might guess, we did this exactly for Cincom (sending to Month
instead of Date). Honestly this is a horrible minefield and I'd prefer
it to have something else than a class extension.
> 5) in #testToString, I have rounding errors on "0.1 toString asNumber";
> this is my fault of course, but anyway I find it brittle to perform
> equality test on floating-point numbers.
That's true, I wondered when the first person would complain.
> Maybe it's better to test an
> integer there.
No we have to make sure #toString works on Floats. I'm open for
suggestions. I assume #closeTo: is not portable.
0.1 toString asNumber class = 0.1 class
1.0 - (0.1 toString asNumber) between: 0.89 and: 0.91
> 6) Seaside relies on a Color class provided by the system. GNU
> Smalltalk does not have one. If you provide me with a list of required
> methods, I can write a WAColor class for Seaside 2.9.
Do you refer to #testColorAsHtmlColor? That's the only reference I
could find. If that's the only problem I'd say we move it to it's own
package (might also solve problems for the kernel image).
More information about the seaside-dev