Alexander Lazarević uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-laza.86.mcz==================== Summary ====================
Name: KernelTests-laza.86
Author: laza
Time: 28 August 2009, 12:37:04 pm
UUID: 47bd0541-efc8-4b23-8cee-ea8f7b52a4cf
Ancestors: KernelTests-ar.85
vm clocks seem to work differently across platforms. The following gives different results on windows (always 0) and linux (0 and 1).
50 timesRepeat: [Transcript show: (Time dateAndTimeNow last asSeconds - Time now asSeconds) printString; cr].
This is the reason TimeTest>>#testGeneralInquiries is nondeterministic.on linux.
This adjusts the test by introducing an epsilon.
=============== Diff against KernelTests-ar.85 ===============
Item was changed:
----- Method: TimeTest>>testGeneralInquiries (in category 'Tests') -----
testGeneralInquiries
+ | now d t dt epsilon |
- | now d t dt |
+ "vm clocks seem to work differently across platforms, so an epsilon is required"
+ epsilon := 1. "second"
now := self timeClass dateAndTimeNow.
self
assert: now size = 2;
+ assert: (now last asSeconds - self timeClass now asSeconds) abs <= epsilon.
- assert: now last <= self timeClass now.
self should: [ self timeClass timeWords ] raise: MessageNotUnderstood.
d := '2 June 1973' asDate.
t := '4:02:47 am' asTime.
dt := self timeClass dateAndTimeFromSeconds: (2285280000 + 14567).
self
assert: dt = {d. t.}.
!