#QUALITY by cg
class: RegressionTests::CollectionTests
category of:
#testByteArrayReverse
#testByteArrayReversed
--- a/RegressionTests__CollectionTests.st Wed Apr 20 12:53:45 2016 +0200
+++ b/RegressionTests__CollectionTests.st Wed Apr 20 12:54:11 2016 +0200
@@ -73,6 +73,34 @@
nonEmpty := OrderedCollection with: #x.
! !
+!CollectionTests methodsFor:'tests-byteArray'!
+
+testByteArrayReverse
+ 1 to:1024 do:[:i|
+ |bytes test rBytes|
+
+ bytes := ((1 to:i) asArray collect:[:i | i bitAnd:255]) asByteArray.
+ test := ((i to:1 by:-1) asArray collect:[:i | i bitAnd:255]) asByteArray.
+ rBytes := bytes copy.
+ self assert:(rBytes reverse = test).
+
+ rBytes := bytes copy.
+ self assert:(rBytes reverse reverse = bytes).
+ ].
+!
+
+testByteArrayReversed
+ 1 to:1024 do:[:i|
+ |bytes test rBytes|
+
+ bytes := ((1 to:i) asArray collect:[:i | i bitAnd:255]) asByteArray.
+ test := ((i to:1 by:-1) asArray collect:[:i | i bitAnd:255]) asByteArray.
+ self assert:(bytes reversed = test).
+
+ self assert:(bytes reversed reversed = bytes).
+ ].
+! !
+
!CollectionTests methodsFor:'tests-dictionary'!
testDictionary01
@@ -1178,32 +1206,6 @@
!CollectionTests methodsFor:'tests-sorting'!
-testByteArrayReverse
- 1 to:1024 do:[:i|
- |bytes test rBytes|
-
- bytes := ((1 to:i) asArray collect:[:i | i bitAnd:255]) asByteArray.
- test := ((i to:1 by:-1) asArray collect:[:i | i bitAnd:255]) asByteArray.
- rBytes := bytes copy.
- self assert:(rBytes reverse = test).
-
- rBytes := bytes copy.
- self assert:(rBytes reverse reverse = bytes).
- ].
-!
-
-testByteArrayReversed
- 1 to:1024 do:[:i|
- |bytes test rBytes|
-
- bytes := ((1 to:i) asArray collect:[:i | i bitAnd:255]) asByteArray.
- test := ((i to:1 by:-1) asArray collect:[:i | i bitAnd:255]) asByteArray.
- self assert:(bytes reversed = test).
-
- self assert:(bytes reversed reversed = bytes).
- ].
-!
-
testLargest
| col |