author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 03 Oct 2017 11:38:15 +0100 | |
branch | jv |
changeset 8188 | 00df122d8bd4 |
parent 7775 | 27321d1dfbc4 |
child 8269 | 5382a417a503 |
permissions | -rw-r--r-- |
7315
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'stx:libview/tests' }" |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
|
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
4 |
|
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
TestCase subclass:#FormTests |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
instanceVariableNames:'' |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
classVariableNames:'' |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
poolDictionaries:'' |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
category:'Compatibility-ST80-Graphics-Display Objects-Tests' |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
! |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
|
7774
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
12 |
|
7315
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
13 |
!FormTests methodsFor:'running'! |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
|
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
setUp |
7721
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
16 |
Display isNil ifTrue:[ |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
17 |
Smalltalk openDisplay |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
18 |
]. |
7315
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
self skipIf: Display isNil description: 'Display connection not available' |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
|
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
21 |
"Created: / 25-04-2016 / 20:30:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
! ! |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
|
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
24 |
!FormTests methodsFor:'tests - regression'! |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
|
7721
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
26 |
test_issue_25a |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
27 |
" |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
28 |
https://swing.fit.cvut.cz/projects/stx-jv/ticket/25 |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
29 |
" |
7774
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
30 |
| form font bits1 bits2 | |
7721
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
31 |
|
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
32 |
self skipIf: ConfigurableFeatures hasXFT not description: 'XFT support not compiled in'. |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
33 |
form := Form width:32 height:32 depth:24. |
7774
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
34 |
self assert: form device blackpixel = 0. |
7721
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
35 |
form paint: Color black on: Color white. |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
36 |
form clear. |
7774
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
37 |
bits1 := form bits. |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
38 |
self assert: (bits1 size \\ 4) == 0. |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
39 |
1 to: bits1 size by: 4 do:[:i | |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
40 |
self assert: ((i \\ 4) == 0 or:[ (bits1 at: i) == 255 ]) |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
41 |
]. |
7721
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
42 |
font := XftFontDescription for: SimpleView defaultFont. |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
43 |
form font: font. |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
44 |
form displayString: 'X' x: 16 y: 16. |
7774
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
45 |
bits2 := form bits. |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
46 |
self assert: (bits1 size \\ 4) == 0. |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
47 |
self assert: (bits1 asArray = bits2 asArray) not |
7721
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
48 |
|
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
49 |
"Created: / 26-11-2016 / 00:23:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7774
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
50 |
"Modified: / 10-01-2017 / 23:22:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7721
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
51 |
! |
97e40cfd96bb
Issue #25: Added tests to check XFT rendering into pixmaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
52 |
|
7315
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
53 |
test_issue_82 |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
" |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
https://swing.fit.cvut.cz/projects/stx-jv/ticket/82 |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
" |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
| f | |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
f := Form width:8 height:8 depth:1. |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
59 |
f colorMap:(Array with:Screen current blackColor with: Screen current whiteColor). |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
60 |
f clear. |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
f paint:(Color colorId:1). |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
self assert: (f bits allSatisfy:[:byte | byte = 0 ]) |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
63 |
|
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
64 |
"Created: / 25-04-2016 / 20:04:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7764
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
65 |
|
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
66 |
! |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
67 |
|
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
68 |
test_issue_88a |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
69 |
" |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
70 |
https://swing.fit.cvut.cz/projects/stx-jv/ticket/88 |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
71 |
" |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
72 |
| f | |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
73 |
f := Form width:8 height:8 depth:1. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
74 |
f colorMap:(Array with:Screen current blackColor with: Screen current whiteColor). |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
75 |
f paint:(Color colorId:0) on: (Color colorId:1). |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
76 |
f clear. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
77 |
f displayPointX: 1 y: 0. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
78 |
f displayPointX: 3 y: 0. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
79 |
f displayPointX: 5 y: 0. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
80 |
f displayPointX: 7 y: 0. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
81 |
f displayPointX: 1 y: 2. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
82 |
f displayPointX: 1 y: 4. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
83 |
f displayPointX: 1 y: 6. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
84 |
f getBits. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
85 |
self assert: f bits = #[ 2r10101010 2r11111111 2r10111111 2r11111111 2r10111111 2r11111111 2r10111111 2r11111111]. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
86 |
|
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
87 |
f releaseFromDevice. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
88 |
f setDevice:Screen current id:nil gcId:nil. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
89 |
f recreate. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
90 |
|
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
91 |
self assert: f bits = #[ 2r10101010 2r11111111 2r10111111 2r11111111 2r10111111 2r11111111 2r10111111 2r11111111]. |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
92 |
|
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
93 |
"Created: / 05-05-2016 / 22:59:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
94 |
! |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
95 |
|
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
96 |
test_issue_88b |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
97 |
" |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
98 |
https://swing.fit.cvut.cz/projects/stx-jv/ticket/88 |
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
99 |
" |
7775 | 100 |
| form bits | |
101 |
form := Form width:8 height:8 depth:24. |
|
102 |
form paint: Color black on: Color white. |
|
103 |
form clear. |
|
104 |
bits := form bits. |
|
105 |
self assert: (bits size \\ 4) == 0. |
|
106 |
1 to: bits size by: 4 do:[:i | |
|
107 |
self assert: ((i \\ 4) == 0 or:[ (bits at: i) == 255 ]) |
|
108 |
]. |
|
109 |
form displayPointX: 1 y: 0. |
|
110 |
form displayPointX: 3 y: 0. |
|
111 |
form displayPointX: 5 y: 0. |
|
112 |
form displayPointX: 7 y: 0. |
|
113 |
form displayPointX: 1 y: 2. |
|
114 |
form displayPointX: 1 y: 4. |
|
115 |
form displayPointX: 1 y: 6. |
|
116 |
form getBits. |
|
117 |
bits := form bits. |
|
118 |
self assert: (bits size \\ 4) == 0. |
|
119 |
self |
|
120 |
"/ [0, 0] |
|
121 |
assert: (bits at: (0*4)+1) == 16rFF; |
|
122 |
assert: (bits at: (0*4)+2) == 16rFF; |
|
123 |
assert: (bits at: (0*4)+3) == 16rFF; |
|
124 |
"/ [1, 0] |
|
125 |
assert: (bits at: (1*4)+1) == 16r00; |
|
126 |
assert: (bits at: (1*4)+2) == 16r00; |
|
127 |
assert: (bits at: (1*4)+3) == 16r00; |
|
128 |
"/ [2, 0] |
|
129 |
assert: (bits at: (2*4)+1) == 16rFF; |
|
130 |
assert: (bits at: (2*4)+2) == 16rFF; |
|
131 |
assert: (bits at: (2*4)+3) == 16rFF. |
|
132 |
||
133 |
form releaseFromDevice. |
|
134 |
form setDevice:Screen current id:nil gcId:nil. |
|
135 |
form recreate. |
|
7764
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
136 |
|
7775 | 137 |
bits := form bits. |
138 |
self |
|
139 |
"/ [0, 0] |
|
140 |
assert: (bits at: (0*4)+1) == 16rFF; |
|
141 |
assert: (bits at: (0*4)+2) == 16rFF; |
|
142 |
assert: (bits at: (0*4)+3) == 16rFF; |
|
143 |
"/ [1, 0] |
|
144 |
assert: (bits at: (1*4)+1) == 16r00; |
|
145 |
assert: (bits at: (1*4)+2) == 16r00; |
|
146 |
assert: (bits at: (1*4)+3) == 16r00; |
|
147 |
"/ [2, 0] |
|
148 |
assert: (bits at: (2*4)+1) == 16rFF; |
|
149 |
assert: (bits at: (2*4)+2) == 16rFF; |
|
150 |
assert: (bits at: (2*4)+3) == 16rFF. |
|
7764
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
151 |
|
618f2a37eee2
Issue #88: Added tests check that bitmaps/pixmaps can be recreated properly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7315
diff
changeset
|
152 |
"Created: / 05-05-2016 / 23:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7775 | 153 |
"Modified: / 12-01-2017 / 13:35:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
154 |
! |
|
155 |
||
156 |
test_issue_88c |
|
157 |
" |
|
158 |
https://swing.fit.cvut.cz/projects/stx-jv/ticket/88 |
|
159 |
" |
|
160 |
| form bits1 bits2 bits3 | |
|
161 |
form := Form width:8 height:8 depth:24. |
|
162 |
form paint: (Color redByte:16r10 greenByte:16r10 blueByte:16r10) on: Color white. |
|
163 |
form clear. |
|
164 |
bits1 := form bits. |
|
165 |
self assert: (bits1 size \\ 4) == 0. |
|
166 |
1 to: bits1 size by: 4 do:[:i | |
|
167 |
self assert: ((i \\ 4) == 0 or:[ (bits1 at: i) == 255 ]) |
|
168 |
]. |
|
169 |
form displayPointX: 1 y: 0. |
|
170 |
form displayPointX: 3 y: 0. |
|
171 |
form displayPointX: 5 y: 0. |
|
172 |
form displayPointX: 7 y: 0. |
|
173 |
form displayPointX: 1 y: 2. |
|
174 |
form displayPointX: 1 y: 4. |
|
175 |
form displayPointX: 1 y: 6. |
|
176 |
form getBits. |
|
177 |
bits2 := form bits. |
|
178 |
self assert: (bits1 size \\ 4) == 0. |
|
179 |
||
180 |
form releaseFromDevice. |
|
181 |
form setDevice:Screen current id:nil gcId:nil. |
|
182 |
form recreate. |
|
183 |
||
184 |
bits3 := form bits. |
|
185 |
self assert: bits2 = bits3. |
|
186 |
||
187 |
"Created: / 12-01-2017 / 13:36:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
188 |
"Modified: / 12-01-2017 / 21:19:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
7315
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
189 |
! ! |
aed1314a2448
Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
190 |
|
7774
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
191 |
!FormTests class methodsFor:'documentation'! |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
192 |
|
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
193 |
version_HG |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
194 |
|
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
195 |
^ '$Changeset: <not expanded> $' |
7775 | 196 |
|
7774
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
197 |
! ! |
af9b89907c6e
Fixed `FormTests>>test_issue_25a` to work under Xvfb
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7721
diff
changeset
|
198 |