RegressionTests__ImageTests.st
author mawalch
Tue, 22 Aug 2017 17:55:05 +0200
changeset 1682 25fc2a8e5144
parent 1678 82d861aedadd
child 1686 976a342e6acf
permissions -rw-r--r--
New RegressionTests class ImageTests

"{ Package: 'stx:goodies/regression' }"

"{ NameSpace: RegressionTests }"

TestCase subclass:#ImageTests
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'tests-Regression'
!

!ImageTests class methodsFor:'documentation'!

documentation
"
    Tests for the image classes in libview, i.e. Image,
    Depth1Image, Depth2Image, etc.

    [author:]
        mawalch

    [instance variables:]

    [class variables:]

    [see also:]

"
! !

!ImageTests methodsFor:'tests'!

testFillWhite
    |depths colors rectangle|

    "/ So far not really supported for other depths (at least not in this straightforward way).
    depths := { 24. 32 }.
    colors := { Color red. Color green. Color blue. Color white. Color black }.
    rectangle := Rectangle left:0 top:0 width:1 height:1.

    depths do:[ :depth |
        |img|

        img := Image extent:1@1 depth:depth.
        img createPixelStore.

        colors do:[ :color |
            img fillRectangle:rectangle withColor:color.
            self assert:((img colorAt:0@0) = color).
        ].
    ].

    "Created: / 22-08-2017 / 17:30:55 / mawalch"
! !

!ImageTests class methodsFor:'documentation'!

version
    ^ '$Header$'
!

version_CVS
    ^ '$Header$'
! !