# HG changeset patch # User Claus Gittinger # Date 1461149651 -7200 # Node ID 2d62a289b79e47497b3dbb8befe686517b5cd527 # Parent 7fb21e6bc3abe5943e4e94f46ee2189ddbbf5e07 #QUALITY by cg class: RegressionTests::CollectionTests category of: #testByteArrayReverse #testByteArrayReversed diff -r 7fb21e6bc3ab -r 2d62a289b79e RegressionTests__CollectionTests.st --- 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 |