Skip to content

Commit

Permalink
Merge pull request #513 from ApptiveGrid/revert-scaled-decimal
Browse files Browse the repository at this point in the history
reverted fix as no conversion is in place yet
  • Loading branch information
noha authored Nov 20, 2023
2 parents 05cae06 + 7c455f7 commit 3948543
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ SoilPrimitiveSerializationTest >> testSerializationScaledDecimal [
serialized := SoilSerializer serializeToBytes: object.

self assert: (serialized at: 1) equals: TypeCodeScaledDecimal.
self assert: serialized equals: #[9 5 10 1 2].
self assert: serialized equals: #[9 10 1 2].
materialized := SoilMaterializer materializeFromBytes: serialized.
self assert: materialized class equals: ScaledDecimal.
self assert: materialized equals: object
Expand Down
2 changes: 1 addition & 1 deletion src/Soil-Serializer/SoilBasicMaterializer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ SoilBasicMaterializer >> nextScaledDecimal: aClass [

| scaledDecimal |
scaledDecimal := aClass new
setNumerator: self nextSoilObject
setNumerator: self nextLengthEncodedInteger
denominator: self nextLengthEncodedInteger
scale: self nextLengthEncodedInteger.
self registerObject: scaledDecimal.
Expand Down
2 changes: 1 addition & 1 deletion src/Soil-Serializer/SoilBasicSerializer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ SoilBasicSerializer >> nextPutScaledDecimal: aNumber [
"we know that numerator, denominator and scale are SmallIntegers"
self
nextPutByte: TypeCodeScaledDecimal;
nextPutInteger: aNumber numerator;
nextPutLengthEncodedInteger: aNumber numerator;
nextPutLengthEncodedInteger: aNumber denominator;
nextPutLengthEncodedInteger: aNumber scale
]
Expand Down

0 comments on commit 3948543

Please sign in to comment.