Eliot Miranda uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-eem.401.mcz ==================== Summary ==================== Name: Tests-eem.401 Author: eem Time: 17 June 2018, 2:52:24.947642 pm UUID: 070c7737-c1af-4b75-b796-a71f0e497af1 Ancestors: Tests-ul.400 Refactor the BitmapStreamTests to use assert:equals: to ease debugging the failing tests there-in. =============== Diff against Tests-ul.400 =============== Item was changed: ----- Method: BitmapStreamTests>>testOtherClasses (in category 'tests-misc') ----- testOtherClasses #(WordArrayForSegment FloatArray PointArray IntegerArray SoundBuffer String ShortPointArray ShortIntegerArray WordArray Array ByteArray Bitmap ColorArray ) do: [:s | | a | a := (Smalltalk at: s) new: 3. + self assert: a byteSize equals: a basicSize * a bytesPerBasicElement. ] - self assert: (a basicSize * a bytesPerBasicElement = a byteSize). ] ! Item was changed: ----- Method: BitmapStreamTests>>testShortIntegerArrayReadRefStream2 (in category 'tests-ShortIntegerArray') ----- testShortIntegerArrayReadRefStream2 | refStrm | refStrm := ReferenceStream on: #[20 6 17 83 104 111 114 116 73 110 116 101 103 101 114 65 114 114 97 121 0 0 0 2 0 0 0 1 0 2 0 3 ] readStream. + self assert: (ShortIntegerArray with: 0 with: 1 with: 2 with: 3) + equals: refStrm next! - self assert: (refStrm next = (ShortIntegerArray with: 0 with: 1 with: 2 with: 3)).! Item was changed: ----- Method: BitmapStreamTests>>testShortIntegerArrayWithRefStream2 (in category 'tests-ShortIntegerArray') ----- testShortIntegerArrayWithRefStream2 array := ShortIntegerArray with: 0 with: 1 with: 2 with: 3. self validateRefStream. + self + assert: #[20 6 17 83 104 111 114 116 73 110 116 101 103 101 114 65 114 114 97 121 0 0 0 2 0 0 0 1 0 2 0 3] + equals: stream byteStream contents - self assert: stream byteStream contents = #[20 6 17 83 104 111 114 116 73 110 116 101 103 101 114 65 114 114 97 121 0 0 0 2 0 0 0 1 0 2 0 3] ! Item was changed: ----- Method: BitmapStreamTests>>testShortIntegerArrayWithSmartRefStream2 (in category 'tests-ShortIntegerArray') ----- testShortIntegerArrayWithSmartRefStream2 array := ShortIntegerArray with: 0 with: 1 with: 2 with: 3. self validateSmartRefStream. + self assert: #[0 0 0 2 0 0 0 1 0 2 0 3 33 13 13] equals: (stream contents asByteArray last: 15) - self assert: (stream contents asByteArray last: 15) = #[0 0 0 2 0 0 0 1 0 2 0 3 33 13 13] ! Item was changed: ----- Method: BitmapStreamTests>>testShortPointArrayWithRefStream2 (in category 'tests-ShortPointArray') ----- testShortPointArrayWithRefStream2 array := ShortPointArray with: 0@1 with: 2@3. self validateRefStream. + self + assert: #[20 6 15 83 104 111 114 116 80 111 105 110 116 65 114 114 97 121 0 0 0 2 0 0 0 1 0 2 0 3] + equals: stream byteStream contents - self assert: stream byteStream contents = #[20 6 15 83 104 111 114 116 80 111 105 110 116 65 114 114 97 121 0 0 0 2 0 0 0 1 0 2 0 3 ] ! Item was changed: ----- Method: BitmapStreamTests>>testShortPointArrayWithSmartRefStream2 (in category 'tests-ShortPointArray') ----- testShortPointArrayWithSmartRefStream2 array := ShortPointArray with: 0@1 with: 2@3. self validateSmartRefStream. + self assert: #[0 0 0 2 0 0 0 1 0 2 0 3 33 13 13] equals: (stream contents asByteArray last: 15) - self assert: (stream contents asByteArray last: 15) = #[0 0 0 2 0 0 0 1 0 2 0 3 33 13 13 ] ! Item was changed: ----- Method: BitmapStreamTests>>testShortRunArrayWithSmartRefStream2 (in category 'tests-ShortRunArray') ----- testShortRunArrayWithSmartRefStream2 array := self createSampleShortRunArray. self validateSmartRefStream. + self assert: #[0 0 0 4 0 1 0 0 0 2 0 1 0 3 0 2 0 4 0 3 33 13 13] equals: (stream contents asByteArray last: 23) - self assert: (stream contents asByteArray last: 23) = #[0 0 0 4 0 1 0 0 0 2 0 1 0 3 0 2 0 4 0 3 33 13 13 ] ! Item was changed: ----- Method: BitmapStreamTests>>validateImageSegment (in category 'private') ----- validateImageSegment "array is set up with an array." | other filename | filename := 'bitmapStreamTest.extSeg'. FileDirectory default deleteFileNamed: filename ifAbsent: [ ]. (ImageSegment copyFromRootsForExport: {array}) writeForExport: filename. other := (FileDirectory default readOnlyFileNamed: filename) fileInObjectAndCode. + self assert: other originalRoots first equals: array. - self assert: array = other originalRoots first. "clean up disk" FileDirectory default deleteFileNamed: filename ifAbsent: [ ]! Item was changed: ----- Method: BitmapStreamTests>>validateRefStream (in category 'private') ----- validateRefStream "array is set up with an array." | other rwstream | rwstream := RWBinaryOrTextStream on: (ByteArray new: array basicSize * 6). stream := ReferenceStream on: rwstream. stream nextPut: array; close. rwstream position: 0. stream := ReferenceStream on: rwstream. other := stream next. stream close. + self assert: other equals: array! - self assert: array = other! Item was changed: ----- Method: BitmapStreamTests>>validateRefStreamOnDisk (in category 'private') ----- validateRefStreamOnDisk "array is set up with an array." | other filename | filename := 'bitmapStreamTest.ref'. FileDirectory default deleteFileNamed: filename ifAbsent: [ ]. stream := ReferenceStream fileNamed: filename. stream nextPut: array; close. stream := ReferenceStream fileNamed: filename. other := stream next. stream close. + self assert: other equals: array. - self assert: array = other. "clean up disk" FileDirectory default deleteFileNamed: filename ifAbsent: [ ]! Item was changed: ----- Method: BitmapStreamTests>>validateSmartRefStream (in category 'private') ----- validateSmartRefStream "array is set up with an array." | other | stream := RWBinaryOrTextStream on: (ByteArray new: array basicSize * 6). stream binary. stream fileOutClass: nil andObject: array. stream position: 0. stream binary. other := stream fileInObjectAndCode. + self assert: other equals: array! - self assert: array = other! Item was changed: ----- Method: BitmapStreamTests>>validateSmartRefStreamOnDisk (in category 'private') ----- validateSmartRefStreamOnDisk "array is set up with an array." | other filename | filename := 'bitmapStreamTest.ref'. FileDirectory default deleteFileNamed: filename ifAbsent: [ ]. stream := FileDirectory default fileNamed: filename. stream fileOutClass: nil andObject: array. stream close. stream := FileDirectory default fileNamed: filename. other := stream fileInObjectAndCode. stream close. + self assert: other equals: array. - self assert: array = other. "clean up disk" FileDirectory default deleteFileNamed: filename ifAbsent: [ ]! |
Free forum by Nabble | Edit this page |