Skip to content

Commit 6fb676d

Browse files
committed
- Fixing encoding of timestamp before Unix Epoch.
- Adding more tests - Added 1.2.8 description
1 parent 4760c68 commit 6fb676d

File tree

10 files changed

+36
-9
lines changed

10 files changed

+36
-9
lines changed

repository/ConfigurationOfMessagePack.package/ConfigurationOfMessagePack.class/instance/stable..st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ symbolic versions
22
stable: spec
33
<symbolicVersion: #stable>
44

5-
spec for: #'common' version: '1.2.7'.
5+
spec for: #'common' version: '1.2.8'.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
versions
2+
version128: spec
3+
<version: '1.2.8' imports: #('1.2.0-baseline') >
4+
5+
spec for: #common do: [
6+
spec blessing: #development.
7+
spec author: 'Masashi Umezawa'.
8+
spec
9+
package: 'MessagePack-Core' with: 'MessagePack-Core-MasashiUmezawa.40';
10+
package: 'MessagePackTest' with: 'MessagePackTest-MasashiUmezawa.16' ].
11+
spec for: #squeakCommon do: [
12+
spec
13+
package: 'MessagePack-Squeak-Core' with: 'MessagePack-Squeak-Core-MasashiUmezawa.10'].

repository/ConfigurationOfMessagePack.package/ConfigurationOfMessagePack.class/methodProperties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
"version101:" : "mu 11/23/2011 22:44",
1414
"baseline101:" : "dkh 8/26/2011 03:32",
1515
"version121:" : "MasashiUmezawa 6/27/2015 15:14",
16+
"version128:" : "MasashiUmezawa 8/14/2017 23:28",
1617
"version103:" : "mu 11/23/2011 22:58",
1718
"version100:" : "MasashiUmezawa 6/27/2015 15:15",
1819
"version123:" : "MasashiUmezawa 6/4/2016 14:28",
1920
"version120:" : "MasashiUmezawa 10/15/2013 01:09",
2021
"version102:" : "mu 11/23/2011 22:44",
21-
"stable:" : "MasashiUmezawa 8/13/2017 14:36"
22+
"stable:" : "MasashiUmezawa 8/14/2017 23:27"
2223
},
2324
"class" : {
2425
"catalogDescription" : "MasashiUmezawa 1/3/2016 13:00",

repository/ConfigurationOfMessagePack.package/monticello.meta/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(name 'ConfigurationOfMessagePack-MasashiUmezawa.20' message 'Added 1.2.7 description' id 'ef5d49ac-fd12-0d00-961f-b4000ade5bf7' date '13 August 2017' time '2:37:03.754209 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.19' message 'Added 1.2.6 description' id 'f54d5f4d-d812-0d00-95f8-65870032bcd7' date '11 August 2017' time '6:01:57.566283 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.18' message 'Added 1.2.5 description' id '7d266ebd-2393-4bf8-afec-c56aba4b2310' date '4 February 2017' time '10:24:14.164838 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.17' message 'Fixed MessagePackTest version' id 'e326c514-2014-4f41-b650-98c956d8f38b' date '13 November 2016' time '12:08:39.897191 am' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.16' message 'Added version 1.2.4 description' id '70af5567-66c7-844b-b599-c0f82e81fef3' date '12 November 2016' time '11:33:10.891191 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.15' message 'Added version 1.2.3 description' id '936b7750-5fb4-5444-8cfd-e7432e9428ab' date '4 June 2016' time '2:31:00.743615 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.14' message 'Added catalog info' id '5277f5e5-8777-5940-b186-d7ffcd49a2af' date '3 January 2016' time '1:05:15.708623 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.13' message 'Stable version is set to 1.2.2' id '230be898-eb51-da41-b725-47ac066d10d3' date '3 January 2016' time '12:39:11.809623 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MU.12' message '- Added version 1.2.2 configuration.- 1.2.2 is the latest development version' id '98f7cbdf-e808-d24a-9ccf-c0f51af91146' date '19 December 2015' time '11:33:43.022 pm' author 'MU' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.11' message 'Fixed some validation errors' id '9c90c6e4-5bf0-456e-9533-fbab3071731e' date '27 June 2015' time '3:20:08.758362 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.10' message 'Added version 1.2.1 spec' id '6876af65-f092-4be5-959d-590593da4246' date '14 June 2015' time '11:35:30.409191 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.9' message 'Added version120' id 'ee574050-6c95-3245-8ba4-bc08d0988c47' date '15 October 2013' time '1:11:56.97 am' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-mu.8' message 'Added baseline120' id '8cd96180-b269-7b4f-85e6-bf51f30d07b8' date '15 October 2013' time '12:50:15.76 am' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.7' message 'Added config for 1.0.4' id '33f88b08-2d95-c542-9be2-8928b1b0b569' date '2 May 2012' time '1:03:06.151 pm' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.6' message 'version 1.0.3' id '6630ca6a-3817-eb45-8125-504dc91a9c3a' date '23 November 2011' time '11:02:08.711 pm' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-AlexandreBergel.5' message 'Dale fixed a number of errors in it' id '38f583fb-c3ca-43c2-a4ad-fafed0bfdbf3' date '29 August 2011' time '3:53:13 pm' author 'AlexandreBergel' ancestors ((name 'ConfigurationOfMessagePack-mu.4' message 'version 1.0.2 (bug fix of negative fix num)' id '64136094-779f-2b48-8b72-1dfbaaa928b1' date '16 July 2011' time '1:14:22.239 am' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.3' message 'version 1.0.1' id '631d161f-3466-8144-9eb4-77fbf7be6644' date '7 June 2011' time '9:29:42.702 pm' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.2' message 'Fixed version' id 'ae6267f7-d91c-454f-9b9f-199903c2592e' date '2 June 2011' time '5:48:45.344 pm' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.1' message 'Initial version: http://code.google.com/p/messagepack-st/' id 'e64620bc-880e-2e4e-9814-4c8bb9e6675f' date '2 June 2011' time '3:55:04.744 pm' author 'mu' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
1+
(name 'ConfigurationOfMessagePack-MasashiUmezawa.21' message 'Added 1.2.8 description' id 'b35f363b-1913-0d00-bf29-23f6069d6816' date '14 August 2017' time '11:29:45.768235 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.20' message 'Added 1.2.7 description' id 'ef5d49ac-fd12-0d00-961f-b4000ade5bf7' date '13 August 2017' time '2:37:03.754209 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.19' message 'Added 1.2.6 description' id 'f54d5f4d-d812-0d00-95f8-65870032bcd7' date '11 August 2017' time '6:01:57.566283 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.18' message 'Added 1.2.5 description' id '7d266ebd-2393-4bf8-afec-c56aba4b2310' date '4 February 2017' time '10:24:14.164838 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.17' message 'Fixed MessagePackTest version' id 'e326c514-2014-4f41-b650-98c956d8f38b' date '13 November 2016' time '12:08:39.897191 am' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.16' message 'Added version 1.2.4 description' id '70af5567-66c7-844b-b599-c0f82e81fef3' date '12 November 2016' time '11:33:10.891191 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.15' message 'Added version 1.2.3 description' id '936b7750-5fb4-5444-8cfd-e7432e9428ab' date '4 June 2016' time '2:31:00.743615 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.14' message 'Added catalog info' id '5277f5e5-8777-5940-b186-d7ffcd49a2af' date '3 January 2016' time '1:05:15.708623 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.13' message 'Stable version is set to 1.2.2' id '230be898-eb51-da41-b725-47ac066d10d3' date '3 January 2016' time '12:39:11.809623 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MU.12' message '- Added version 1.2.2 configuration.- 1.2.2 is the latest development version' id '98f7cbdf-e808-d24a-9ccf-c0f51af91146' date '19 December 2015' time '11:33:43.022 pm' author 'MU' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.11' message 'Fixed some validation errors' id '9c90c6e4-5bf0-456e-9533-fbab3071731e' date '27 June 2015' time '3:20:08.758362 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.10' message 'Added version 1.2.1 spec' id '6876af65-f092-4be5-959d-590593da4246' date '14 June 2015' time '11:35:30.409191 pm' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-MasashiUmezawa.9' message 'Added version120' id 'ee574050-6c95-3245-8ba4-bc08d0988c47' date '15 October 2013' time '1:11:56.97 am' author 'MasashiUmezawa' ancestors ((name 'ConfigurationOfMessagePack-mu.8' message 'Added baseline120' id '8cd96180-b269-7b4f-85e6-bf51f30d07b8' date '15 October 2013' time '12:50:15.76 am' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.7' message 'Added config for 1.0.4' id '33f88b08-2d95-c542-9be2-8928b1b0b569' date '2 May 2012' time '1:03:06.151 pm' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.6' message 'version 1.0.3' id '6630ca6a-3817-eb45-8125-504dc91a9c3a' date '23 November 2011' time '11:02:08.711 pm' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-AlexandreBergel.5' message 'Dale fixed a number of errors in it' id '38f583fb-c3ca-43c2-a4ad-fafed0bfdbf3' date '29 August 2011' time '3:53:13 pm' author 'AlexandreBergel' ancestors ((name 'ConfigurationOfMessagePack-mu.4' message 'version 1.0.2 (bug fix of negative fix num)' id '64136094-779f-2b48-8b72-1dfbaaa928b1' date '16 July 2011' time '1:14:22.239 am' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.3' message 'version 1.0.1' id '631d161f-3466-8144-9eb4-77fbf7be6644' date '7 June 2011' time '9:29:42.702 pm' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.2' message 'Fixed version' id 'ae6267f7-d91c-454f-9b9f-199903c2592e' date '2 June 2011' time '5:48:45.344 pm' author 'mu' ancestors ((name 'ConfigurationOfMessagePack-mu.1' message 'Initial version: http://code.google.com/p/messagepack-st/' id 'e64620bc-880e-2e4e-9814-4c8bb9e6675f' date '2 June 2011' time '3:55:04.744 pm' author 'mu' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
actions
22
unixSecondsWithNanosecondsFrom: timestamp
3-
| duration |
3+
| duration secs nanos |
44
duration := (timestamp offset: 0) - DateAndTime unixEpoch.
5-
^Array with: duration asSeconds with: duration nanoSeconds
5+
secs := duration asSeconds.
6+
nanos := duration nanoSeconds.
7+
(nanos ~= 0 and: [duration < 0 nanoSeconds]) ifTrue: [
8+
secs := secs - 1.
9+
nanos := 1000000000 + nanos.
10+
].
11+
^Array with: secs with: nanos

repository/MessagePack-Squeak-Core.package/MpSqPortableUtil.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"timestampFromSeconds:nanos:" : "MasashiUmezawa 8/11/2017 17:24",
99
"writeInt16:to:" : "mu 4/29/2011 15:51",
1010
"writeUint32:to:" : "mu 4/29/2011 15:41",
11-
"unixSecondsWithNanosecondsFrom:" : "MasashiUmezawa 8/11/2017 13:23",
11+
"unixSecondsWithNanosecondsFrom:" : "MasashiUmezawa 8/14/2017 23:21",
1212
"readDoubleFrom:" : "mu 5/30/2011 00:00",
1313
"readUint16From:" : "mu 4/29/2011 15:41",
1414
"writeUint16:to:" : "mu 4/29/2011 15:41",

repository/MessagePack-Squeak-Core.package/monticello.meta/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(name 'MessagePack-Squeak-Core-MasashiUmezawa.9' message 'Added MpSqPortableUtil>>timestampFromSeconds:nanos:' id 'af77c9cf-d712-0d00-ab4c-55d3014acda9' date '11 August 2017' time '5:26:50.59475 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MasashiUmezawa.8' message 'Added unixSecondsWithNanosecondsFrom:' id '1331c15e-d512-0d00-99f5-fc61006f5111' date '11 August 2017' time '2:32:04.293869 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MasashiUmezawa.7' message 'Implemented MpSqPortableUtil>>stringFromBytes: for decoding utf8 strings' id '9a4fd85e-597d-794e-8a6a-e633e2e63e8e' date '12 November 2016' time '11:28:33.274191 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MasashiUmezawa.6' message 'Added #symbolAsString/symbolAsError for changing Symbol encoding behavior' id 'b0371b80-07e7-8d4c-88db-748d7a17ce1f' date '4 June 2016' time '2:26:03.490615 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MU.5' message '- Fixed MpSqEncodeTypeMapper class>>defineDoubleActionTo:- BoxedFloat64 and SmallFloat64 encode mappings were added for Spur VM.' id 'bdd0165b-4dc7-444a-a30c-98087488bede' date '19 December 2015' time '11:25:14.479 pm' author 'MU' ancestors ((name 'MessagePack-Squeak-Core-mu.4' message '- Adding encoder support for new specification (https://github.com/msgpack/msgpack/blob/master/spec.md).- MpSettings >> formatVersion will be used for switching new/old formats' id 'b611d926-78c1-d044-a2dd-7b61d7b780a2' date '19 August 2013' time '1:38:43.346 am' author 'mu' ancestors ((name 'MessagePack-Squeak-Core-mu.3' message 'Added #stringAsBytes setting. If true, String will be enceded as MessagePack raw bytes.' id '8a797bfd-5150-4e42-8655-7db9019c69f1' date '2 May 2012' time '12:59:10.973 pm' author 'mu' ancestors ((name 'MessagePack-Squeak-Core-mu.2' message 'Added MpMemoryWriteStream for bulk write performance tuning' id '42d08a68-5df4-2b4f-98d8-4b26e4b58470' date '23 October 2011' time '12:06:45.085 am' author 'mu' ancestors ((name 'MessagePack-Squeak-Core-mu.1' message 'Isolated package' id 'a44b229c-f324-7e44-b25a-09386b468ebe' date '2 June 2011' time '10:58:25.013 am' author 'mu' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
1+
(name 'MessagePack-Squeak-Core-MasashiUmezawa.10' message 'Fixing encoding of timestamp before Unix Epoch' id '3026ba2d-1913-0d00-bf27-80cf069d6816' date '14 August 2017' time '11:25:59.52342 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MasashiUmezawa.9' message 'Added MpSqPortableUtil>>timestampFromSeconds:nanos:' id 'af77c9cf-d712-0d00-ab4c-55d3014acda9' date '11 August 2017' time '5:26:50.59475 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MasashiUmezawa.8' message 'Added unixSecondsWithNanosecondsFrom:' id '1331c15e-d512-0d00-99f5-fc61006f5111' date '11 August 2017' time '2:32:04.293869 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MasashiUmezawa.7' message 'Implemented MpSqPortableUtil>>stringFromBytes: for decoding utf8 strings' id '9a4fd85e-597d-794e-8a6a-e633e2e63e8e' date '12 November 2016' time '11:28:33.274191 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MasashiUmezawa.6' message 'Added #symbolAsString/symbolAsError for changing Symbol encoding behavior' id 'b0371b80-07e7-8d4c-88db-748d7a17ce1f' date '4 June 2016' time '2:26:03.490615 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Squeak-Core-MU.5' message '- Fixed MpSqEncodeTypeMapper class>>defineDoubleActionTo:- BoxedFloat64 and SmallFloat64 encode mappings were added for Spur VM.' id 'bdd0165b-4dc7-444a-a30c-98087488bede' date '19 December 2015' time '11:25:14.479 pm' author 'MU' ancestors ((name 'MessagePack-Squeak-Core-mu.4' message '- Adding encoder support for new specification (https://github.com/msgpack/msgpack/blob/master/spec.md).- MpSettings >> formatVersion will be used for switching new/old formats' id 'b611d926-78c1-d044-a2dd-7b61d7b780a2' date '19 August 2013' time '1:38:43.346 am' author 'mu' ancestors ((name 'MessagePack-Squeak-Core-mu.3' message 'Added #stringAsBytes setting. If true, String will be enceded as MessagePack raw bytes.' id '8a797bfd-5150-4e42-8655-7db9019c69f1' date '2 May 2012' time '12:59:10.973 pm' author 'mu' ancestors ((name 'MessagePack-Squeak-Core-mu.2' message 'Added MpMemoryWriteStream for bulk write performance tuning' id '42d08a68-5df4-2b4f-98d8-4b26e4b58470' date '23 October 2011' time '12:06:45.085 am' author 'mu' ancestors ((name 'MessagePack-Squeak-Core-mu.1' message 'Isolated package' id 'a44b229c-f324-7e44-b25a-09386b468ebe' date '2 June 2011' time '10:58:25.013 am' author 'mu' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())

repository/MessagePackTest.package/MpPackUnpackTestCase.class/instance/testPackUnpackTimestamp.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ testPackUnpackTimestamp
6565
self assert: secondsAndNanos first = -1.
6666
self assert: secondsAndNanos last = 0.
6767

68+
packed := (self unixEpochTimestamp - 1 nanoSeconds) messagePacked: [:settings | settings formatVersion: 2013].
69+
self assert: packed size = 15.
70+
unpacked := Object fromMessagePack: packed.
71+
secondsAndNanos := MpPortableUtil default unixSecondsWithNanosecondsFrom: unpacked.
72+
self assert: secondsAndNanos first = -1.
73+
self assert: secondsAndNanos last = 999999999.
74+
6875
packed := (self max96Timestamp) messagePacked: [:settings | settings formatVersion: 2013].
6976
self assert: packed size = 15.
7077
unpacked := Object fromMessagePack: packed.

repository/MessagePackTest.package/MpPackUnpackTestCase.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"testPackUnpackComplexMap" : "mu 6/23/2011 12:43",
2525
"testPackUnpackStrBytes" : "mu 8/25/2013 23:49",
2626
"min96Timestamp" : "MasashiUmezawa 8/13/2017 14:31",
27-
"testPackUnpackTimestamp" : "MasashiUmezawa 8/13/2017 14:33",
27+
"testPackUnpackTimestamp" : "MasashiUmezawa 8/14/2017 23:23",
2828
"max96Timestamp" : "MasashiUmezawa 8/13/2017 14:11",
2929
"rawFixExtValueArray" : "mu 12/8/2013 15:25",
3030
"testPackUnpackFloatingPoint" : "mu 5/1/2011 21:43",

0 commit comments

Comments
 (0)