1899
|
1 |
"{ Package: 'stx:goodies/regression' }"
|
|
2 |
|
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
|
5 |
TestCase subclass:#FormDrawingTests
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'tests-Regression-Graphics'
|
|
10 |
!
|
|
11 |
|
|
12 |
!FormDrawingTests class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
documentation
|
|
15 |
"
|
|
16 |
documentation to be added.
|
|
17 |
|
|
18 |
[author:]
|
|
19 |
cg
|
|
20 |
|
|
21 |
[instance variables:]
|
|
22 |
|
|
23 |
[class variables:]
|
|
24 |
|
|
25 |
[see also:]
|
|
26 |
|
|
27 |
"
|
|
28 |
! !
|
|
29 |
|
|
30 |
!FormDrawingTests methodsFor:'initialize / release'!
|
|
31 |
|
|
32 |
setUp
|
|
33 |
"common setup - invoked before testing."
|
|
34 |
|
|
35 |
super setUp
|
|
36 |
!
|
|
37 |
|
|
38 |
tearDown
|
|
39 |
"common cleanup - invoked after testing."
|
|
40 |
|
|
41 |
super tearDown
|
|
42 |
! !
|
|
43 |
|
|
44 |
!FormDrawingTests methodsFor:'tests'!
|
|
45 |
|
|
46 |
test01_copyBitmap
|
|
47 |
"it seems that XQuartz has trouble with that..."
|
|
48 |
|
|
49 |
|form1 form2|
|
|
50 |
|
|
51 |
form1 := Form width:16 height:16.
|
|
52 |
form2 := Form width:16 height:16.
|
|
53 |
|
|
54 |
form1 fill:(Color colorId:0).
|
|
55 |
self assert:(form1 pixelAt:0@0) = 0.
|
|
56 |
self assert:(form1 pixelAt:15@15) = 0.
|
|
57 |
|
|
58 |
form2 fill:(Color colorId:1).
|
|
59 |
self assert:(form2 pixelAt:0@0) = 1.
|
|
60 |
self assert:(form2 pixelAt:15@15) = 1.
|
|
61 |
|
|
62 |
form1 function:#copy.
|
|
63 |
form1 copyFrom:form2 x:0 y:0 toX:0 y:0 width:16 height:16.
|
|
64 |
|
|
65 |
self assert:(form1 pixelAt:0@0) = 1.
|
|
66 |
self assert:(form1 pixelAt:7@7) = 1.
|
|
67 |
self assert:(form1 pixelAt:8@8) = 0.
|
|
68 |
self assert:(form1 pixelAt:15@15) = 0.
|
|
69 |
|
|
70 |
"
|
|
71 |
self run:#test1
|
|
72 |
self new test1
|
|
73 |
"
|
|
74 |
!
|
|
75 |
|
|
76 |
test02_copyPixmap
|
|
77 |
"it seems that XQuartz has trouble with that..."
|
|
78 |
|
|
79 |
|form1 form2|
|
|
80 |
|
|
81 |
form1 := Form width:16 height:16 depth:8 .
|
|
82 |
form2 := Form width:16 height:16 depth:8 .
|
|
83 |
|
|
84 |
form1 fill:(Color colorId:0).
|
|
85 |
self assert:(form1 pixelAt:0@0) = 0.
|
|
86 |
self assert:(form1 pixelAt:15@15) = 0.
|
|
87 |
|
|
88 |
form2 fill:(Color colorId:1).
|
|
89 |
self assert:(form2 pixelAt:0@0) = 1.
|
|
90 |
self assert:(form2 pixelAt:15@15) = 1.
|
|
91 |
|
|
92 |
form1 function:#copy.
|
|
93 |
form1 copyFrom:form2 x:0 y:0 toX:0 y:0 width:8 height:8.
|
|
94 |
|
|
95 |
self assert:(form1 pixelAt:0@0) = 1.
|
|
96 |
self assert:(form1 pixelAt:7@7) = 1.
|
|
97 |
self assert:(form1 pixelAt:8@8) = 0.
|
|
98 |
self assert:(form1 pixelAt:15@15) = 0.
|
|
99 |
|
|
100 |
"
|
|
101 |
self run:#test1
|
|
102 |
self new test1
|
|
103 |
"
|
|
104 |
! !
|
|
105 |
|
|
106 |
!FormDrawingTests class methodsFor:'documentation'!
|
|
107 |
|
|
108 |
version
|
|
109 |
^ '$Header$'
|
|
110 |
!
|
|
111 |
|
|
112 |
version_CVS
|
|
113 |
^ '$Header$'
|
|
114 |
! !
|
|
115 |
|