1678
|
1 |
"{ Package: 'stx:goodies/regression' }"
|
|
2 |
|
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
|
5 |
TestCase subclass:#ImageTests
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'tests-Regression'
|
|
10 |
!
|
|
11 |
|
|
12 |
!ImageTests class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
documentation
|
|
15 |
"
|
|
16 |
Tests for the image classes in libview, i.e. Image,
|
|
17 |
Depth1Image, Depth2Image, etc.
|
|
18 |
|
|
19 |
[author:]
|
|
20 |
mawalch
|
|
21 |
|
|
22 |
[instance variables:]
|
|
23 |
|
|
24 |
[class variables:]
|
|
25 |
|
|
26 |
[see also:]
|
|
27 |
|
|
28 |
"
|
|
29 |
! !
|
|
30 |
|
|
31 |
!ImageTests methodsFor:'tests'!
|
|
32 |
|
|
33 |
testFillWhite
|
|
34 |
|depths colors rectangle|
|
|
35 |
|
|
36 |
"/ So far not really supported for other depths (at least not in this straightforward way).
|
|
37 |
depths := { 24. 32 }.
|
|
38 |
colors := { Color red. Color green. Color blue. Color white. Color black }.
|
|
39 |
rectangle := Rectangle left:0 top:0 width:1 height:1.
|
|
40 |
|
|
41 |
depths do:[ :depth |
|
|
42 |
|img|
|
|
43 |
|
|
44 |
img := Image extent:1@1 depth:depth.
|
|
45 |
img createPixelStore.
|
|
46 |
|
|
47 |
colors do:[ :color |
|
|
48 |
img fillRectangle:rectangle withColor:color.
|
|
49 |
self assert:((img colorAt:0@0) = color).
|
|
50 |
].
|
|
51 |
].
|
|
52 |
|
|
53 |
"Created: / 22-08-2017 / 17:30:55 / mawalch"
|
|
54 |
! !
|
|
55 |
|
|
56 |
!ImageTests class methodsFor:'documentation'!
|
|
57 |
|
|
58 |
version
|
|
59 |
^ '$Header$'
|
|
60 |
!
|
|
61 |
|
|
62 |
version_CVS
|
|
63 |
^ '$Header$'
|
|
64 |
! !
|
|
65 |
|