Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20102 SmallInteger>>#digitAt: not ready for 64-bit - Some Kernel-Tests-Numbers fail to take 64-bit into account https://pharo.fogbugz.com/f/cases/20102 20070 terminal color not reset after a error message https://pharo.fogbugz.com/f/cases/20070 19949 ensureEndsWith: does not handle start of stream case https://pharo.fogbugz.com/f/cases/19949 20101 Typos and general writing of release welcome text https://pharo.fogbugz.com/f/cases/20101 http://files.pharo.org/image/60/60499.zip
- Loading branch information
Jenkins Build Server
authored and
ci
committed
Jun 6, 2017
1 parent
31c6d36
commit ba76c8e
Showing
27 changed files
with
201 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Collections-Streams.package/WriteStream.class/instance/accessing/ensureEndsWith_.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
ensureEndsWith: anObject | ||
"Append anObject to the receiver IFF there is not one on the end." | ||
"Append anObject to the receiver IFF it is non-empty and there is not one on the end." | ||
|
||
(position > 0 and: [(collection at: position) = anObject]) ifTrue: [^self]. | ||
(position == 0 or: [(collection at: position) = anObject]) ifTrue: [^self]. | ||
self nextPut: anObject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 15 additions & 6 deletions
21
Kernel-Tests.package/IntegerTest.class/instance/tests - bitLogic/testBitString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
testBitString | ||
"self debug: #testBitString" | ||
|
||
self assert: 2 bitString = '0000000000000000000000000000010'. | ||
self assert: -1 bitString = '1111111111111111111111111111111'. | ||
self assert: -2 bitString = '1111111111111111111111111111110'. | ||
self assert: 2 bitStringLength = 31. | ||
"32 minus 1 for immediate encoding = 31 = 30 for number + 1 for sign" | ||
self assert: 2 bitStringLength = (SmallInteger maxVal highBit + 1). | ||
Smalltalk vm wordSize = 4 | ||
ifTrue: [ | ||
self assert: 2 bitString equals: '0000000000000000000000000000010'. | ||
self assert: -1 bitString equals: '1111111111111111111111111111111'. | ||
self assert: -2 bitString equals: '1111111111111111111111111111110'. | ||
self assert: 2 bitStringLength equals: 31 ]. | ||
Smalltalk vm wordSize = 8 | ||
ifTrue: [ | ||
self assert: 2 bitString equals: '0000000000000000000000000000000000000000000000000000000000010'. | ||
self assert: -1 bitString equals: '1111111111111111111111111111111111111111111111111111111111111'. | ||
self assert: -2 bitString equals: '1111111111111111111111111111111111111111111111111111111111110'. | ||
self assert: 2 bitStringLength equals: 61 ]. | ||
"32 minus 1 for immediate encoding = 31 = 30 for number + 1 for sign" | ||
"64 minus 3 for immediate encoding = 61 = 60 for number + 1 for sign" | ||
self assert: 2 bitStringLength equals: (SmallInteger maxVal highBit + 1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
Kernel-Tests.package/SmallIntegerTest.class/instance/tests - Class Methods/testMaxVal.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
testMaxVal | ||
|
||
self assert: (SmallInteger maxVal = 16r3FFFFFFF). | ||
Smalltalk vm wordSize = 4 | ||
ifTrue: [ self assert: SmallInteger maxVal = 16r3FFFFFFF ]. | ||
Smalltalk vm wordSize = 8 | ||
ifTrue: [ self assert: SmallInteger maxVal = 16rFFFFFFFFFFFFFFF ] |
6 changes: 4 additions & 2 deletions
6
Kernel-Tests.package/SmallIntegerTest.class/instance/tests - Class Methods/testMinVal.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
testMinVal | ||
|
||
self assert: (SmallInteger minVal = -16r40000000). | ||
Smalltalk vm wordSize = 4 | ||
ifTrue: [ self assert: SmallInteger minVal = -16r40000000 ]. | ||
Smalltalk vm wordSize = 8 | ||
ifTrue: [ self assert: SmallInteger minVal = -16r1000000000000000 ] |
47 changes: 28 additions & 19 deletions
47
Kernel-Tests.package/SmallIntegerTest.class/instance/tests - printing/testPrintString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
testPrintString | ||
self assert: 1 printString = '1'. | ||
self assert: -1 printString = '-1'. | ||
self assert: SmallInteger minVal printString = '-1073741824'. | ||
self assert: SmallInteger maxVal printString = '1073741823'. | ||
self assert: 12345 printString = '12345'. | ||
self assert: -54321 printString = '-54321'. | ||
|
||
self assert: 0 decimalDigitLength = 1. | ||
self assert: 4 decimalDigitLength = 1. | ||
self assert: 12 decimalDigitLength = 2. | ||
self assert: 123 decimalDigitLength = 3. | ||
self assert: 1234 decimalDigitLength = 4. | ||
self assert: 56789 decimalDigitLength = 5. | ||
self assert: 657483 decimalDigitLength = 6. | ||
self assert: 6571483 decimalDigitLength = 7. | ||
self assert: 65174383 decimalDigitLength = 8. | ||
self assert: 625744831 decimalDigitLength = 9. | ||
self assert: 1000001111 decimalDigitLength = 10. | ||
self assert: SmallInteger maxVal decimalDigitLength = 10. | ||
self assert: 1 printString equals: '1'. | ||
self assert: -1 printString equals: '-1'. | ||
Smalltalk vm wordSize = 4 | ||
ifTrue: [ | ||
self assert: SmallInteger minVal printString equals: '-1073741824'. | ||
self assert: SmallInteger maxVal printString equals: '1073741823' ]. | ||
Smalltalk vm wordSize = 8 | ||
ifTrue: [ | ||
self assert: SmallInteger minVal printString equals: '-1152921504606846976'. | ||
self assert: SmallInteger maxVal printString equals: '1152921504606846975' ]. | ||
self assert: 12345 printString equals: '12345'. | ||
self assert: -54321 printString equals: '-54321'. | ||
|
||
self assert: 0 decimalDigitLength equals: 1. | ||
self assert: 4 decimalDigitLength equals: 1. | ||
self assert: 12 decimalDigitLength equals: 2. | ||
self assert: 123 decimalDigitLength equals: 3. | ||
self assert: 1234 decimalDigitLength equals: 4. | ||
self assert: 56789 decimalDigitLength equals: 5. | ||
self assert: 657483 decimalDigitLength equals: 6. | ||
self assert: 6571483 decimalDigitLength equals: 7. | ||
self assert: 65174383 decimalDigitLength equals: 8. | ||
self assert: 625744831 decimalDigitLength equals: 9. | ||
self assert: 1000001111 decimalDigitLength equals: 10. | ||
Smalltalk vm wordSize = 4 | ||
ifTrue: [ self assert: SmallInteger maxVal decimalDigitLength equals: 10 ]. | ||
Smalltalk vm wordSize = 8 | ||
ifTrue: [ self assert: SmallInteger maxVal decimalDigitLength equals: 19 ]. |
23 changes: 13 additions & 10 deletions
23
Kernel.package/SmallInteger.class/instance/system primitives/digitAt_.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
digitAt: n | ||
"Answer the value of an indexable field in the receiver. LargePositiveInteger uses bytes of base two number, and each is a 'digit' base 256. Fail if the argument (the index) is not an Integer or is out of bounds." | ||
n>4 ifTrue: [^ 0]. | ||
self < 0 | ||
ifTrue: | ||
[self = SmallInteger minVal ifTrue: | ||
["Can't negate minVal -- treat specially" | ||
^ #(0 0 0 64) at: n]. | ||
^ ((0-self) bitShift: (1-n)*8) bitAnd: 16rFF] | ||
ifFalse: [^ (self bitShift: (1-n)*8) bitAnd: 16rFF] | ||
digitAt: n | ||
"Answer the value of an apparent byte-indexable field in the receiver, | ||
analogous to the large integers, which are organized as bytes." | ||
|
||
n = 1 | ||
ifTrue: [ | ||
"Negate carefully in case the receiver is SmallInteger minVal" | ||
^ self < 0 | ||
ifTrue: [ -256 - self bitAnd: 255 ] | ||
ifFalse: [ self bitAnd: 255 ] ]. | ||
^ self < 0 | ||
ifTrue: [ (-256 - self bitShift: -8) + 1 digitAt: n - 1 ] | ||
ifFalse: [ (self bitShift: 8 - (n bitShift: 3)) bitAnd: 255 ] |
1 change: 1 addition & 0 deletions
1
Pharo-Help.package/PharoWelcomePage.class/class/opening/open.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
open | ||
<script> | ||
| group welcome help zen about window | | ||
|
||
welcome := WelcomeHelp open. | ||
|
1 change: 1 addition & 0 deletions
1
Pharo-Help.package/PharoWelcomePage.class/class/opening/openForRelease.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
openForRelease | ||
<script> | ||
| window | | ||
|
||
World submorphs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.