File: rendering-tests.cfdg

package info (click to toggle)
contextfree 3.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,260 kB
  • sloc: cpp: 37,992; lex: 414; makefile: 123; sh: 43; python: 34
file content (183 lines) | stat: -rw-r--r-- 4,314 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
startshape Tests

rule Tests {
	// borders should be 8 pixels beyond these pins
	Pin { x 0 y 0 r 135 s 0.5 }
	Pin { x 20 y 0 r -135 s 0.5 }
	Pin { x 0 y 20 r 45 s 0.5 }
	Pin { x 20 y 20 r -45 s 0.5 }

	// top row, left to right
	TouchingTestsSized { x 2 y 5.5 }
	TouchingTestsRotated { x 7.5 y 5.5 }
	SizeTests { x 11 y 17 s 0.5 r -90 }
	SquareEdge { x 13 y 6 }
	CircleLine { x 15 y 6 }
	BrightnessLines { x 17 y 6 }

	// bottom row
	TouchingTestsJittered { x 1.5 y 2 b 0.5 }
}

rule TouchingTestsSized {
	TouchingTests { x 0 }
	TouchingTests { y 5 s 0.7 }
	TouchingTests { y 8.5 s 0.4 }
}
rule TouchingTestsRotated {
	TouchingTests { x 0 y 9 s 0.4 r 45 }
	TouchingTests { x 0 y 6.5 s 0.4 r 30 }
	TouchingTests { x 0 y 4.2 s 0.4 r 15 }	
	TouchingTests { x 0 y 2 s 0.4 r 5 }	
	TouchingTests { x 0 y -0.25 s 0.4 r 2 }	
}
rule TouchingTestsJittered {
	// at 2000pixels, 1 unit = 100pixels
	// important: there should be no scaling between the startshape and here!
	// optimally, only the rightmost pair should touch
	TouchPair { x 00 y 0.0200 }	// 2 pixel gap
	TouchPair { x 01 y 0.0150 }	// 1.5 pixel gap
	TouchPair { x 02 y 0.0100 }	// 1 pixel gap
	TouchPair { x 03 y 0.0090 }
	TouchPair { x 04 y 0.0080 }
	TouchPair { x 05 y 0.0070 }
	TouchPair { x 06 y 0.0060 }
	TouchPair { x 07 y 0.0050 }
	TouchPair { x 08 y 0.0040 }
	TouchPair { x 09 y 0.0030 }
	TouchPair { x 10 y 0.0020 }
	TouchPair { x 11 y 0.0010 }
	TouchPair { x 12 y 0.0000 }	// exact
	TouchFixed { x 00 }
	TouchFixed { x 01 }
	TouchFixed { x 02 }
	TouchFixed { x 03 }
	TouchFixed { x 04 }
	TouchFixed { x 05 }
	TouchFixed { x 06 }
	TouchFixed { x 07 }
	TouchFixed { x 08 }
	TouchFixed { x 09 }
	TouchFixed { x 10 }
	TouchFixed { x 11 }
	TouchFixed { x 12 }
}
rule TouchPair {
	SQUARE { x 0 y 0.0 s 0.5 b 0.0 }
	SQUARE { x 0 y 0.5 s 0.5 b 0.0 }
}
rule TouchFixed {
	SQUARE { x 0 y 1 s 0.5 b 0.0 }
}
	
rule TouchingTests {
	SquareAbutTest { x 0 y 2.5 }
	OverlapTest { x 3 y 2.5 }
	CircleAbutTest { x 0 y 0 }
	CircleInSquaresTest { x 3 y 0 }
}
rule SquareAbutTest {
// there should be no white showing between these
	SQUARE { x -0.5 }
	SQUARE { x 0.5 }
	SQUARE { y 1 }
}

rule CircleInSquaresTest {
// the circle should just touch the squares
	CIRCLE { }
	SQUARE { x -1 }
	SQUARE { x 1 }
	SQUARE { y 1 }
}

rule CircleAbutTest {
// the circles should just touch
	CIRCLE { x -0.5 }
	CIRCLE { x 0.5 }
	CIRCLE { y 1 x -0.5 }
	CIRCLE { y 1 x 0.5 }
}

rule OverlapTest {
// center should be a clean cross-hair
	SQUARE { x -0.5 }
	SQUARE { x 0.5 b 0.5 }
	SQUARE { x -0.5 y 1 b 0.75 }
	SQUARE { x 0.5 y 1 b 0.25 }
}

rule SizeTests {
// the progression of shapes should appear smooth
	SizeSquareTests { y -0.75 }
	SizeCircleTests { y 0.75 }
}
rule SizeCircleTests {
	CIRCLE {  }
	SizeCircleTests { x 2.25 s 0.90 }
}
rule SizeSquareTests {
	SQUARE {  }
	SizeSquareTests { x 2.25 s 0.90 }
}

rule SquareEdge {
// there should be no white space between the squares as they get smaller, and the right edge should be a straight line
	SQUARE { }
	SquareEdge { y 0.95 x 0.05 s 0.90 }
}

rule CircleLine {
// the circles should just touch as they get smaller
	CIRCLE { }
	CircleLine { y 0.95 s 0.90 }
}

rule BrightnessLines {
	BrightnessLinePerCent { x 0 }
	BrightnessLineHex { x 0.84375 y -0.15625 s 0.6875 }
	Pin { x -0.5 y 10.5 r -135 s 0.25 }
	Pin { x 1.1875 y 10.5 r 135 s 0.25 }
}
rule BrightnessLinePerCent {
// eleven even gradations from white to black
	SQUARE { b 0.0 y 0 }
	SQUARE { b 0.1 y 1 }
	SQUARE { b 0.2 y 2 }
	SQUARE { b 0.3 y 3 }
	SQUARE { b 0.4 y 4 }
	SQUARE { b 0.5 y 5 }
	SQUARE { b 0.6 y 6 }
	SQUARE { b 0.7 y 7 }
	SQUARE { b 0.8 y 8 }
	SQUARE { b 0.9 y 9 }
	SQUARE { b 1.0 y 10 }
}
rule BrightnessLineHex {
// sixteen even gradations from white to black
	SQUARE { b 0.0 y 0 }
	SQUARE { b 0.0666666667 y 1 }
	SQUARE { b 0.1333333333 y 2 }
	SQUARE { b 0.2000000000 y 3 }
	SQUARE { b 0.2666666667 y 4 }
	SQUARE { b 0.3333333333 y 5 }
	SQUARE { b 0.4000000000 y 6 }
	SQUARE { b 0.4666666667 y 7 }
	SQUARE { b 0.5333333333 y 8 }
	SQUARE { b 0.6000000000 y 9 }
	SQUARE { b 0.6666666667 y 10 }
	SQUARE { b 0.7333333333 y 11 }
	SQUARE { b 0.8000000000 y 12 }
	SQUARE { b 0.8666666667 y 13 }
	SQUARE { b 0.9333333333 y 14 }
	SQUARE { b 1.0000000000 y 15 }
}

rule Pin {
	PinLine { y -1 s 0.2 }
}

rule PinLine {
	CIRCLE { }
	PinLine { y 0.25 s 0.95 }
}