I guess, your idea was to not use optimized encoding, right? But that would have meant to serialize an extra DateAndTime object. So I hacked together this quick fix (see attachment) that simply encodes another int32 on the stream with the offset. The materialization method took care of creating a new DateAndTime object anyway.
With the fix, the Date tests pass.
Cheers, Max
|
Date class-materializeFrom.st
Description: Binary data
Date-serializeOn.st
Description: Binary data
On Mon, Oct 8, 2012 at 8:30 AM, Max Leske <[email protected]> wrote:
Looking at the failing tests I see that the objects really are supposed to be different (comparison with #~~). What fails is the equality check (#=) and for Date that is the method Timespan>>=. The problem that occurs there is a really old (and annoying one), namely that the timezone offset is handled inconsistently: the materialized object has the correct offset while the original object doesn't.
I think it could work if you just remove Date>>fuelAccept: . Can you try?
So: - FLBasicSerializationTest>>testDate fails because of timezone offset - FLBasicSerializationTest>>testGradientFillStyle fails because Object>>= isn't overridden in any subclass and therefore identity is checked, which fails
- (same as above for FLBasicInMemorySerializationTest)
The other failures seem to be due to implementation differences between Pharo and Squeak (I didn't really look into them) but I couldn't find one test that seemed to fail because of hashing problems.
Yes, I didn't really understand the thing with the hashes. I don't think there should be a problem there. Something obvious is that a normal object that is serialized will probabyt have a different identityHash than the materialized object.
Thanks! I'll see if I can come up with a test case.
Cheers, Max
The two objects I looked at where a string and an OrderedCollection. I wouldn't conclude that the problem is class specific... On 07.10.2012, at 16:12, "Edgar J. De Cleene" < [email protected]> wrote:
On 10/7/12 10:51 AM, "Max Leske" <[email protected]> wrote:
Following you example, in Squeak FLBasicSerializationTest>>#testDate
materialized largeIdentityHash = 2571
anObject. largeIdentityHash = 1094
So why Date serializaded object gives this and the rest of objects no ?
Edgar
-- Mariano http://marianopeck.wordpress.com
|