David T. Lewis uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-dtl.235.mcz
==================== Summary ====================
Name: KernelTests-dtl.235
Author: dtl
Time: 4 November 2012, 1:08:04.014 pm
UUID: de45cee9-3416-4fd8-a216-b5cafe70ee57
Ancestors: KernelTests-ul.234
As of Kernel-cmm.671 Timespans created in the context of an offset will start in that offset, and when no context is available the defaultOffset for a Timespan will be zero. This affects a TimeStamp created from a string representation of itself, which will now have zero offset (UTC). Update TimeStampTest to reflect to this behavior.
=============== Diff against KernelTests-ul.234 ===============
Item was changed:
----- Method: TimeStampTest>>testFromSeconds (in category 'Tests') -----
testFromSeconds
+ "A time stamp from seconds is created in the local time zone, so offset may
+ be non-zero. The test timestamp has offset zero (implying UTC). Comparison
+ to the test timestamp should succeed if and only if both time stamps are
+ created relative to the same time zone (UTC)."
+ | local utc |
+ local := self timestampClass fromSeconds: 3124958100.
+ local offset = Duration zero
+ ifTrue: [self assert: local = timestamp.]
+ ifFalse: [self deny: local = timestamp.].
+ utc := local offset: Duration zero.
+ self assert: utc = timestamp.!
- self
- assert: (self timestampClass fromSeconds: 3124958100) = timestamp.!
Item was changed:
----- Method: TimeStampTest>>testReadFromA1 (in category 'testing') -----
testReadFromA1
+ "Conversion to and from a string (with implied UTC offset) is equal if
+ and only if the time stamp has zero offset."
|ts|
+ ts := TimeStamp current offset: Duration zero. "current as UTC"
+ self assert: (ts = (TimeStamp fromString: ts asString)).
+ ts := TimeStamp current offset: (Duration hours: 1).
+ self deny: (ts = (TimeStamp fromString: ts asString)).
+ !
- ts := TimeStamp current.
- self assert: (ts = (TimeStamp fromString: ts asString)).!
David T. Lewis uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-dtl.235.mcz
==================== Summary ====================
Name: KernelTests-dtl.235
Author: dtl
Time: 4 November 2012, 1:08:04.014 pm
UUID: de45cee9-3416-4fd8-a216-b5cafe70ee57
Ancestors: KernelTests-ul.234
As of Kernel-cmm.671 Timespans created in the context of an offset will start in that offset, and when no context is available the defaultOffset for a Timespan will be zero. This affects a TimeStamp created from a string representation of itself, which will now have zero offset (UTC). Update TimeStampTest to reflect to this behavior.
=============== Diff against KernelTests-ul.234 ===============
Item was changed:
----- Method: TimeStampTest>>testFromSeconds (in category 'Tests') -----
testFromSeconds
+ "A time stamp from seconds is created in the local time zone, so offset may
+ be non-zero. The test timestamp has offset zero (implying UTC). Comparison
+ to the test timestamp should succeed if and only if both time stamps are
+ created relative to the same time zone (UTC)."
+ | local utc |
+ local := self timestampClass fromSeconds: 3124958100.
+ local offset = Duration zero
+ ifTrue: [self assert: local = timestamp.]
+ ifFalse: [self deny: local = timestamp.].
+ utc := local offset: Duration zero.
+ self assert: utc = timestamp.!
- self
- assert: (self timestampClass fromSeconds: 3124958100) = timestamp.!
Item was changed:
----- Method: TimeStampTest>>testReadFromA1 (in category 'testing') -----
testReadFromA1
+ "Conversion to and from a string (with implied UTC offset) is equal if
+ and only if the time stamp has zero offset."
|ts|
+ ts := TimeStamp current offset: Duration zero. "current as UTC"
+ self assert: (ts = (TimeStamp fromString: ts asString)).
+ ts := TimeStamp current offset: (Duration hours: 1).
+ self deny: (ts = (TimeStamp fromString: ts asString)).
+ !
- ts := TimeStamp current.
- self assert: (ts = (TimeStamp fromString: ts asString)).!
David T. Lewis uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-dtl.235.mcz
==================== Summary ====================
Name: KernelTests-dtl.235
Author: dtl
Time: 4 November 2012, 1:08:04.014 pm
UUID: de45cee9-3416-4fd8-a216-b5cafe70ee57
Ancestors: KernelTests-ul.234
As of Kernel-cmm.671 Timespans created in the context of an offset will start in that offset, and when no context is available the defaultOffset for a Timespan will be zero. This affects a TimeStamp created from a string representation of itself, which will now have zero offset (UTC). Update TimeStampTest to reflect to this behavior.
=============== Diff against KernelTests-ul.234 ===============
Item was changed:
----- Method: TimeStampTest>>testFromSeconds (in category 'Tests') -----
testFromSeconds
+ "A time stamp from seconds is created in the local time zone, so offset may
+ be non-zero. The test timestamp has offset zero (implying UTC). Comparison
+ to the test timestamp should succeed if and only if both time stamps are
+ created relative to the same time zone (UTC)."
+ | local utc |
+ local := self timestampClass fromSeconds: 3124958100.
+ local offset = Duration zero
+ ifTrue: [self assert: local = timestamp.]
+ ifFalse: [self deny: local = timestamp.].
+ utc := local offset: Duration zero.
+ self assert: utc = timestamp.!
- self
- assert: (self timestampClass fromSeconds: 3124958100) = timestamp.!
Item was changed:
----- Method: TimeStampTest>>testReadFromA1 (in category 'testing') -----
testReadFromA1
+ "Conversion to and from a string (with implied UTC offset) is equal if
+ and only if the time stamp has zero offset."
|ts|
+ ts := TimeStamp current offset: Duration zero. "current as UTC"
+ self assert: (ts = (TimeStamp fromString: ts asString)).
+ ts := TimeStamp current offset: (Duration hours: 1).
+ self deny: (ts = (TimeStamp fromString: ts asString)).
+ !
- ts := TimeStamp current.
- self assert: (ts = (TimeStamp fromString: ts asString)).!
David T. Lewis uploaded a new version of NetworkTests to project The Trunk:
http://source.squeak.org/trunk/NetworkTests-dtl.33.mcz
==================== Summary ====================
Name: NetworkTests-dtl.33
Author: dtl
Time: 3 November 2012, 2:17:02.043 pm
UUID: 3071c11f-8cef-43a2-b1b8-88c573ef9daf
Ancestors: NetworkTests-ul.32
Fix SocketTest>>testSendTimeout to accommodate platform differences.
Explanation: #sendDone means that the platform is reporting a send operation complete. The platform may or may not be able to accept addition write requests while sending is in process, depending on the buffering capability of the underlying platform. On Windows, the next write request fails immediately if a prior send is not complete, while unix platforms may be able to accept and buffer additional writes. Therefore change the test to expect a timeout exception to eventually occur, but not necessary on the next write operation.
=============== Diff against NetworkTests-ul.32 ===============
Item was changed:
----- Method: SocketTest>>testSendTimeout (in category 'tests') -----
testSendTimeout
"Test data transfer and related methods"
+ | buffer ex |
- | buffer |
self testServerAccept.
buffer := ByteArray new: 1000.
+
+ "Write to the socket until the platform reports that sending is not complete."
[serverSocket sendDone] whileTrue:[
serverSocket sendSomeData: buffer.
].
+
+ "The network layer is now either blocked or in the process of sending data in its buffers.
+ It may or may not be able buffer additional write requests, depending on the platform
+ implemention. Keep sending data until the network reports that it is unable to process
+ the request, at which time a exception will be raised. On Windows, the exception will
+ be raised on the next write request, while unix platforms may provide additional buffering
+ that permit write requests to continue being accepted."
+ ex := nil.
+ [[serverSocket sendSomeData: buffer startIndex: 1 count: buffer size for: 1]
+ on: ConnectionTimedOut
+ do: [ :e | ex := e ].
+ ex isNil] whileTrue: [].
+ self assert: ex notNil.
- self should:[serverSocket sendSomeData: buffer startIndex: 1 count: buffer size for: 1]
- raise: ConnectionTimedOut.
!
David T. Lewis uploaded a new version of NetworkTests to project The Trunk:
http://source.squeak.org/trunk/NetworkTests-dtl.33.mcz
==================== Summary ====================
Name: NetworkTests-dtl.33
Author: dtl
Time: 3 November 2012, 2:17:02.043 pm
UUID: 3071c11f-8cef-43a2-b1b8-88c573ef9daf
Ancestors: NetworkTests-ul.32
Fix SocketTest>>testSendTimeout to accommodate platform differences.
Explanation: #sendDone means that the platform is reporting a send operation complete. The platform may or may not be able to accept addition write requests while sending is in process, depending on the buffering capability of the underlying platform. On Windows, the next write request fails immediately if a prior send is not complete, while unix platforms may be able to accept and buffer additional writes. Therefore change the test to expect a timeout exception to eventually occur, but not necessary on the next write operation.
=============== Diff against NetworkTests-ul.32 ===============
Item was changed:
----- Method: SocketTest>>testSendTimeout (in category 'tests') -----
testSendTimeout
"Test data transfer and related methods"
+ | buffer ex |
- | buffer |
self testServerAccept.
buffer := ByteArray new: 1000.
+
+ "Write to the socket until the platform reports that sending is not complete."
[serverSocket sendDone] whileTrue:[
serverSocket sendSomeData: buffer.
].
+
+ "The network layer is now either blocked or in the process of sending data in its buffers.
+ It may or may not be able buffer additional write requests, depending on the platform
+ implemention. Keep sending data until the network reports that it is unable to process
+ the request, at which time a exception will be raised. On Windows, the exception will
+ be raised on the next write request, while unix platforms may provide additional buffering
+ that permit write requests to continue being accepted."
+ ex := nil.
+ [[serverSocket sendSomeData: buffer startIndex: 1 count: buffer size for: 1]
+ on: ConnectionTimedOut
+ do: [ :e | ex := e ].
+ ex isNil] whileTrue: [].
+ self assert: ex notNil.
- self should:[serverSocket sendSomeData: buffer startIndex: 1 count: buffer size for: 1]
- raise: ConnectionTimedOut.
!
David T. Lewis uploaded a new version of NetworkTests to project The Trunk:
http://source.squeak.org/trunk/NetworkTests-dtl.33.mcz
==================== Summary ====================
Name: NetworkTests-dtl.33
Author: dtl
Time: 3 November 2012, 2:17:02.043 pm
UUID: 3071c11f-8cef-43a2-b1b8-88c573ef9daf
Ancestors: NetworkTests-ul.32
Fix SocketTest>>testSendTimeout to accommodate platform differences.
Explanation: #sendDone means that the platform is reporting a send operation complete. The platform may or may not be able to accept addition write requests while sending is in process, depending on the buffering capability of the underlying platform. On Windows, the next write request fails immediately if a prior send is not complete, while unix platforms may be able to accept and buffer additional writes. Therefore change the test to expect a timeout exception to eventually occur, but not necessary on the next write operation.
=============== Diff against NetworkTests-ul.32 ===============
Item was changed:
----- Method: SocketTest>>testSendTimeout (in category 'tests') -----
testSendTimeout
"Test data transfer and related methods"
+ | buffer ex |
- | buffer |
self testServerAccept.
buffer := ByteArray new: 1000.
+
+ "Write to the socket until the platform reports that sending is not complete."
[serverSocket sendDone] whileTrue:[
serverSocket sendSomeData: buffer.
].
+
+ "The network layer is now either blocked or in the process of sending data in its buffers.
+ It may or may not be able buffer additional write requests, depending on the platform
+ implemention. Keep sending data until the network reports that it is unable to process
+ the request, at which time a exception will be raised. On Windows, the exception will
+ be raised on the next write request, while unix platforms may provide additional buffering
+ that permit write requests to continue being accepted."
+ ex := nil.
+ [[serverSocket sendSomeData: buffer startIndex: 1 count: buffer size for: 1]
+ on: ConnectionTimedOut
+ do: [ :e | ex := e ].
+ ex isNil] whileTrue: [].
+ self assert: ex notNil.
- self should:[serverSocket sendSomeData: buffer startIndex: 1 count: buffer size for: 1]
- raise: ConnectionTimedOut.
!