author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 29 Jun 2016 21:40:53 +0100 | |
branch | jv |
changeset 1499 | 26a16a04219b |
parent 1485 | 5a1aadddbc7f |
child 1500 | d406a10b2965 |
permissions | -rw-r--r-- |
1485 | 1 |
"{ Encoding: utf8 }" |
2 |
||
1499
26a16a04219b
Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1485
diff
changeset
|
3 |
"{ Package: 'stx:goodies/regression' }" |
1113 | 4 |
|
5 |
"{ NameSpace: RegressionTests }" |
|
6 |
||
7 |
TestCase subclass:#UninterpretedBytesTest |
|
8 |
instanceVariableNames:'' |
|
9 |
classVariableNames:'' |
|
10 |
poolDictionaries:'' |
|
11 |
category:'tests-Regression-Collections' |
|
12 |
! |
|
13 |
||
14 |
||
1485 | 15 |
!UninterpretedBytesTest class methodsFor:'queries'! |
16 |
||
17 |
coveredClassNames |
|
18 |
^ #( UninterpretedBytes) |
|
19 |
! ! |
|
20 |
||
1113 | 21 |
!UninterpretedBytesTest methodsFor:'tests'! |
22 |
||
1485 | 23 |
test00_byteAccess |
24 |
|bytes| |
|
25 |
||
26 |
bytes := #[ 16r10 16r20 16r30 16r40 ]. |
|
27 |
||
28 |
self assert:(bytes byteAt:1) == 16r10. |
|
29 |
self assert:(bytes byteAt:2) == 16r20. |
|
30 |
self assert:(bytes byteAt:3) == 16r30. |
|
31 |
self assert:(bytes byteAt:4) == 16r40. |
|
32 |
||
33 |
self assert:(bytes signedByteAt:1) == 16r10. |
|
34 |
self assert:(bytes signedByteAt:2) == 16r20. |
|
35 |
self assert:(bytes signedByteAt:3) == 16r30. |
|
36 |
self assert:(bytes signedByteAt:4) == 16r40. |
|
37 |
||
38 |
bytes := #[ 16rFF 16r7F 16r80 16r81 ]. |
|
39 |
||
40 |
self assert:(bytes byteAt:1) == 16rFF. |
|
41 |
self assert:(bytes byteAt:2) == 16r7F. |
|
42 |
self assert:(bytes byteAt:3) == 16r80. |
|
43 |
self assert:(bytes byteAt:4) == 16r81. |
|
44 |
||
45 |
self assert:(bytes signedByteAt:1) == -1. |
|
46 |
self assert:(bytes signedByteAt:2) == 127. |
|
47 |
self assert:(bytes signedByteAt:3) == -128. |
|
48 |
self assert:(bytes signedByteAt:4) == -127. |
|
49 |
||
50 |
bytes := bytes copy. |
|
51 |
||
52 |
bytes byteAt:1 put:16r10. |
|
53 |
self assert:(bytes byteAt:1) == 16r10. |
|
54 |
self assert:(bytes signedByteAt:1) == 16r10. |
|
55 |
||
56 |
bytes byteAt:1 put:16r80. |
|
57 |
self assert:(bytes byteAt:1) == 16r80. |
|
58 |
self assert:(bytes signedByteAt:1) == -128. |
|
59 |
||
60 |
bytes signedByteAt:1 put:16r10. |
|
61 |
self assert:(bytes byteAt:1) == 16r10. |
|
62 |
self assert:(bytes signedByteAt:1) == 16r10. |
|
63 |
||
64 |
bytes signedByteAt:1 put:-1. |
|
65 |
self assert:(bytes byteAt:1) == 16rFF. |
|
66 |
self assert:(bytes signedByteAt:1) == -1. |
|
67 |
||
68 |
"/ check immutablility checks |
|
69 |
bytes := #[ 16rFF 16r00 ] beImmutable. |
|
70 |
self |
|
71 |
should:[ |
|
72 |
bytes byteAt:1 put:0 |
|
73 |
] |
|
74 |
raise:NoModificationError. |
|
75 |
self assert:(bytes at:1) == 16rFF. |
|
76 |
||
77 |
"/ check bounds checks |
|
78 |
#(3 0 -1 -2) do:[:badIndex | |
|
79 |
self |
|
80 |
should:[ |
|
81 |
#[ 16rFF 16r00 ] byteAt:badIndex |
|
82 |
] |
|
83 |
raise:SubscriptOutOfBoundsError. |
|
84 |
||
85 |
self |
|
86 |
should:[ |
|
87 |
#[ 16rFF 16r00 ] signedByteAt:badIndex |
|
88 |
] |
|
89 |
raise:SubscriptOutOfBoundsError. |
|
90 |
||
91 |
self |
|
92 |
should:[ |
|
93 |
#[ 16rFF 16r00 ] byteAt:badIndex put:0 |
|
94 |
] |
|
95 |
raise:SubscriptOutOfBoundsError. |
|
96 |
||
97 |
self |
|
98 |
should:[ |
|
99 |
#[ 16rFF 16r00 ] signedByteAt:badIndex put:0 |
|
100 |
] |
|
101 |
raise:SubscriptOutOfBoundsError. |
|
102 |
] |
|
103 |
||
104 |
" |
|
105 |
self run:#test00_byteAccess |
|
106 |
" |
|
107 |
! |
|
108 |
||
109 |
test01_int16Access |
|
110 |
|check bytes| |
|
111 |
||
112 |
check := |
|
113 |
[:bytes1 :bytes2 | |
|
114 |
|wBytes| |
|
115 |
||
116 |
"/ bytes1 := #[ 16r10 16r20 16r30 16r40 ]. |
|
117 |
self assert:(bytes1 unsignedInt16At:1 MSB:true) = 16r1020. |
|
118 |
self assert:(bytes1 unsignedInt16At:1 MSB:false) = 16r2010. |
|
119 |
self assert:(bytes1 unsignedInt16At:2 MSB:true) = 16r2030. |
|
120 |
self assert:(bytes1 unsignedInt16At:2 MSB:false) = 16r3020. |
|
121 |
self assert:(bytes1 unsignedInt16At:3 MSB:true) = 16r3040. |
|
122 |
self assert:(bytes1 unsignedInt16At:3 MSB:false) = 16r4030. |
|
123 |
||
124 |
self assert:(bytes1 signedInt16At:1 MSB:true) = 16r1020. |
|
125 |
self assert:(bytes1 signedInt16At:1 MSB:false) = 16r2010. |
|
126 |
self assert:(bytes1 signedInt16At:2 MSB:true) = 16r2030. |
|
127 |
self assert:(bytes1 signedInt16At:2 MSB:false) = 16r3020. |
|
128 |
self assert:(bytes1 signedInt16At:3 MSB:true) = 16r3040. |
|
129 |
self assert:(bytes1 signedInt16At:3 MSB:false) = 16r4030. |
|
130 |
||
131 |
"/ bytes2 := #[ 16rFF 16r7F 16r80 16r81 ]. |
|
132 |
self assert:(bytes2 unsignedInt16At:1 MSB:true) = 16rFF7F. |
|
133 |
self assert:(bytes2 unsignedInt16At:1 MSB:false) = 16r7FFF. |
|
134 |
self assert:(bytes2 unsignedInt16At:2 MSB:true) = 16r7F80. |
|
135 |
self assert:(bytes2 unsignedInt16At:2 MSB:false) = 16r807F. |
|
136 |
self assert:(bytes2 unsignedInt16At:3 MSB:true) = 16r8081. |
|
137 |
self assert:(bytes2 unsignedInt16At:3 MSB:false) = 16r8180. |
|
138 |
||
139 |
self assert:(bytes2 signedInt16At:1 MSB:true) = -129. "/ 16rFF7F signExtendedShortValue |
|
140 |
self assert:(bytes2 signedInt16At:1 MSB:false) = 16r7FFF. |
|
141 |
self assert:(bytes2 signedInt16At:2 MSB:true) = 16r7F80. |
|
142 |
self assert:(bytes2 signedInt16At:2 MSB:false) = -32641. "/ 16r807F signExtendedShortValue. |
|
143 |
self assert:(bytes2 signedInt16At:3 MSB:true) = -32639. "/ 16r8081 signExtendedShortValue. |
|
144 |
self assert:(bytes2 signedInt16At:3 MSB:false) = -32384. "/ 16r8180 signExtendedShortValue. |
|
145 |
||
146 |
wBytes := bytes2 copy. |
|
147 |
||
148 |
wBytes unsignedInt16At:1 put:16r1020 MSB:false. |
|
149 |
self assert:(wBytes unsignedInt16At:1 MSB:false) = 16r1020. |
|
150 |
self assert:(wBytes signedInt16At:1 MSB:false) = 16r1020. |
|
151 |
||
152 |
wBytes unsignedInt16At:1 put:16r1020 MSB:true. |
|
153 |
self assert:(wBytes unsignedInt16At:1 MSB:false) = 16r2010. |
|
154 |
self assert:(wBytes signedInt16At:1 MSB:false) = 16r2010. |
|
155 |
||
156 |
wBytes unsignedInt16At:1 put:16rFFFE MSB:false. |
|
157 |
self assert:(wBytes unsignedInt16At:1 MSB:false) = 16rFFFE. |
|
158 |
self assert:(wBytes signedInt16At:1 MSB:false) = -2. |
|
159 |
||
160 |
wBytes unsignedInt16At:1 put:16rFFFE MSB:true. |
|
161 |
self assert:(wBytes unsignedInt16At:1 MSB:false) = 16rFEFF. |
|
162 |
self assert:(wBytes signedInt16At:1 MSB:false) = -257. "/ 16rFEFF signExtendedShortValue |
|
163 |
||
164 |
wBytes signedInt16At:1 put:16r1020 MSB:false. |
|
165 |
self assert:(wBytes unsignedInt16At:1 MSB:false) = 16r1020. |
|
166 |
self assert:(wBytes signedInt16At:1 MSB:false) = 16r1020. |
|
167 |
||
168 |
wBytes signedInt16At:1 put:16r1020 MSB:true. |
|
169 |
self assert:(wBytes unsignedInt16At:1 MSB:false) = 16r2010. |
|
170 |
self assert:(wBytes signedInt16At:1 MSB:false) = 16r2010. |
|
171 |
||
172 |
wBytes signedInt16At:1 put:-3 MSB:false. |
|
173 |
self assert:(wBytes unsignedInt16At:1 MSB:false) = 16rFFFD. |
|
174 |
self assert:(wBytes signedInt16At:1 MSB:false) = -3. |
|
175 |
]. |
|
176 |
||
177 |
check |
|
178 |
value: #[ 16r10 16r20 16r30 16r40 ] |
|
179 |
value: #[ 16rFF 16r7F 16r80 16r81 ]. |
|
180 |
||
181 |
check |
|
182 |
value: (WordArray with:16r2010 with:16r4030) |
|
183 |
value: (WordArray with:16r7FFF with:16r8180). |
|
184 |
||
185 |
check |
|
186 |
value: (IntegerArray with:16r40302010) |
|
187 |
value: (IntegerArray with:16r81807FFF). |
|
188 |
||
189 |
"/ check immutablility checks |
|
190 |
bytes := #[ 1 2 ] beImmutable. |
|
191 |
self |
|
192 |
should:[ |
|
193 |
bytes unsignedInt16At:1 put:0 |
|
194 |
] |
|
195 |
raise:NoModificationError. |
|
196 |
self assert:(bytes at:1) == 1. |
|
197 |
self assert:(bytes at:2) == 2. |
|
198 |
||
199 |
"/ check bounds checks |
|
200 |
#(2 0 -1 -2) do:[:badIndex | |
|
201 |
self |
|
202 |
should:[ |
|
203 |
#[ 16rFF 16r00 ] unsignedInt16At:badIndex MSB:true |
|
204 |
] |
|
205 |
raise:SubscriptOutOfBoundsError. |
|
206 |
||
207 |
self |
|
208 |
should:[ |
|
209 |
#[ 16rFF 16r00 ] unsignedInt16At:badIndex MSB:false |
|
210 |
] |
|
211 |
raise:SubscriptOutOfBoundsError. |
|
212 |
] |
|
213 |
||
214 |
" |
|
215 |
self run:#test01_int16Access |
|
216 |
" |
|
217 |
! |
|
218 |
||
219 |
test02_int32Access |
|
220 |
|bytes| |
|
221 |
||
222 |
bytes := #[ 16r10 16r20 16r30 16r40 16r50 ]. |
|
223 |
||
224 |
self assert:(bytes unsignedInt32At:1 MSB:true) = 16r10203040. |
|
225 |
self assert:(bytes unsignedInt32At:1 MSB:false) = 16r40302010. |
|
226 |
self assert:(bytes unsignedInt32At:2 MSB:true) = 16r20304050. |
|
227 |
self assert:(bytes unsignedInt32At:2 MSB:false) = 16r50403020. |
|
228 |
||
229 |
self assert:(bytes signedInt32At:1 MSB:true) = 16r10203040. |
|
230 |
self assert:(bytes signedInt32At:1 MSB:false) = 16r40302010. |
|
231 |
self assert:(bytes signedInt32At:2 MSB:true) = 16r20304050. |
|
232 |
self assert:(bytes signedInt32At:2 MSB:false) = 16r50403020. |
|
233 |
||
234 |
||
235 |
bytes := #[ 16r80 16rFF 16r01 16r03 16r80 ]. |
|
236 |
||
237 |
self assert:(bytes unsignedInt32At:1 MSB:true) = 16r80FF0103. |
|
238 |
self assert:(bytes unsignedInt32At:1 MSB:false) = 16r0301FF80. |
|
239 |
self assert:(bytes unsignedInt32At:2 MSB:true) = 16rFF010380. |
|
240 |
self assert:(bytes unsignedInt32At:2 MSB:false) = 16r800301FF. |
|
241 |
||
242 |
self assert:(bytes signedInt32At:1 MSB:true) = -2130771709. "/ 16r80FF0103 signExtendedLongValue |
|
243 |
self assert:(bytes signedInt32At:1 MSB:false) = 16r0301FF80. |
|
244 |
self assert:(bytes signedInt32At:2 MSB:true) = -16710784. "/ 16rFF010380 signExtendedLongValue. |
|
245 |
self assert:(bytes signedInt32At:2 MSB:false) = -2147286529. "/ 16r800301FF signExtendedLongValue. |
|
246 |
||
247 |
bytes := bytes copy. |
|
248 |
||
249 |
bytes unsignedInt32At:1 put:16r10203040 MSB:false. |
|
250 |
self assert:(bytes unsignedInt32At:1 MSB:false) = 16r10203040. |
|
251 |
self assert:(bytes signedInt32At:1 MSB:false) = 16r10203040. |
|
252 |
||
253 |
bytes unsignedInt32At:1 put:16r10203040 MSB:true. |
|
254 |
self assert:(bytes unsignedInt32At:1 MSB:false) = 16r40302010. |
|
255 |
self assert:(bytes signedInt32At:1 MSB:false) = 16r40302010. |
|
256 |
||
257 |
bytes unsignedInt32At:1 put:16r10203080 MSB:true. |
|
258 |
self assert:(bytes unsignedInt32At:1 MSB:false) = 16r80302010. |
|
259 |
self assert:(bytes signedInt32At:1 MSB:false) = -2144329712. "/ 16r80302010 signExtendedLongValue. |
|
260 |
||
261 |
bytes unsignedInt32At:1 put:16rFFFFFFFE MSB:false. |
|
262 |
self assert:(bytes unsignedInt32At:1 MSB:false) = 16rFFFFFFFE. |
|
263 |
self assert:(bytes signedInt32At:1 MSB:false) = -2. |
|
264 |
||
265 |
bytes signedInt32At:1 put:16r40302010 MSB:false. |
|
266 |
self assert:(bytes unsignedInt32At:1 MSB:false) = 16r40302010. |
|
267 |
self assert:(bytes signedInt32At:1 MSB:false) = 16r40302010. |
|
268 |
||
269 |
bytes signedInt32At:1 put:-3 MSB:false. |
|
270 |
self assert:(bytes unsignedInt32At:1 MSB:false) = 16rFFFFFFFD. |
|
271 |
self assert:(bytes signedInt32At:1 MSB:false) = -3. |
|
272 |
||
273 |
"/ check immutablility checks |
|
274 |
bytes := #[ 1 2 3 4 ] beImmutable. |
|
275 |
self |
|
276 |
should:[ |
|
277 |
bytes unsignedInt32At:1 put:0 |
|
278 |
] |
|
279 |
raise:NoModificationError. |
|
280 |
self assert:(bytes at:1) == 1. |
|
281 |
self assert:(bytes at:2) == 2. |
|
282 |
self assert:(bytes at:3) == 3. |
|
283 |
self assert:(bytes at:4) == 4. |
|
284 |
||
285 |
"/ check bounds checks |
|
286 |
#(2 0 -1 -2) do:[:badIndex | |
|
287 |
self |
|
288 |
should:[ |
|
289 |
#[ 16rFF 16r01 16r02 16r03 ] unsignedInt32At:badIndex MSB:true |
|
290 |
] |
|
291 |
raise:SubscriptOutOfBoundsError. |
|
292 |
||
293 |
self |
|
294 |
should:[ |
|
295 |
#[ 16rFF 16r01 16r02 16r03 ] unsignedInt32At:badIndex MSB:false |
|
296 |
] |
|
297 |
raise:SubscriptOutOfBoundsError. |
|
298 |
] |
|
299 |
||
300 |
" |
|
301 |
self run:#test02_int32Access |
|
302 |
" |
|
303 |
! |
|
304 |
||
305 |
test03_int64Access |
|
306 |
|bytes| |
|
307 |
||
308 |
bytes := #[ 16r10 16r20 16r30 16r40 16r50 16r60 16r70 16r80 16r90]. |
|
309 |
||
310 |
self assert:(bytes unsignedInt64At:1 MSB:true) = 16r1020304050607080. |
|
311 |
self assert:(bytes unsignedInt64At:1 MSB:false) = 16r8070605040302010. |
|
312 |
self assert:(bytes unsignedInt64At:2 MSB:true) = 16r2030405060708090. |
|
313 |
self assert:(bytes unsignedInt64At:2 MSB:false) = 16r9080706050403020. |
|
314 |
||
315 |
self assert:(bytes signedInt64At:1 MSB:true) = 16r1020304050607080. |
|
316 |
self assert:(bytes signedInt64At:1 MSB:false) = -9191740941672636400. "/ 16r8070605040302010 signExtendedLongLongValue |
|
317 |
self assert:(bytes signedInt64At:2 MSB:true) = 16r2030405060708090. |
|
318 |
self assert:(bytes signedInt64At:2 MSB:false) = -8034298176263409632. "/ 16r9080706050403020 signExtendedLongLongValue. |
|
319 |
||
320 |
bytes := bytes copy. |
|
321 |
bytes unsignedInt64At:1 put:16r30405060708090A0 MSB:true. |
|
322 |
self assert:(bytes unsignedInt64At:1 MSB:true) = 16r30405060708090A0. |
|
323 |
self assert:(bytes unsignedInt64At:1 MSB:false) = 16rA090807060504030. |
|
324 |
self assert:(bytes signedInt64At:1 MSB:true) = 16r30405060708090A0. |
|
325 |
self assert:(bytes signedInt64At:1 MSB:false) = -6876855410854182864. "/ 16rA090807060504030 signExtendedLongLongValue. |
|
326 |
||
327 |
bytes signedInt64At:1 put:-6876855410854182864 MSB:true. |
|
328 |
self assert:(bytes unsignedInt64At:1 MSB:true) = 16rA090807060504030. |
|
329 |
self assert:(bytes signedInt64At:1 MSB:true) = -6876855410854182864. |
|
330 |
||
331 |
bytes signedInt64At:1 put:-6876855410854182864 MSB:false. |
|
332 |
self assert:(bytes unsignedInt64At:1 MSB:false) = 16rA090807060504030. |
|
333 |
self assert:(bytes signedInt64At:1 MSB:false) = -6876855410854182864. |
|
334 |
||
335 |
bytes unsignedInt64At:1 put:16r30405060708090A0 MSB:false. |
|
336 |
self assert:(bytes unsignedInt64At:1 MSB:true) = 16rA090807060504030. |
|
337 |
self assert:(bytes unsignedInt64At:1 MSB:false) = 16r30405060708090A0. |
|
338 |
self assert:(bytes signedInt64At:1 MSB:true) = -6876855410854182864. "/ 16rA090807060504030 signExtendedLongLongValue. |
|
339 |
self assert:(bytes signedInt64At:1 MSB:false) = 16r30405060708090A0. |
|
340 |
||
341 |
"/ check immutablility checks |
|
342 |
bytes := #[ 1 2 3 4 5 6 7 8 ] beImmutable. |
|
343 |
self |
|
344 |
should:[ |
|
345 |
bytes unsignedInt64At:1 put:0 |
|
346 |
] |
|
347 |
raise:NoModificationError. |
|
348 |
self assert:(bytes at:1) == 1. |
|
349 |
self assert:(bytes at:2) == 2. |
|
350 |
self assert:(bytes at:3) == 3. |
|
351 |
self assert:(bytes at:4) == 4. |
|
352 |
self assert:(bytes at:5) == 5. |
|
353 |
self assert:(bytes at:6) == 6. |
|
354 |
self assert:(bytes at:7) == 7. |
|
355 |
self assert:(bytes at:8) == 8. |
|
356 |
||
357 |
"/ check bounds checks |
|
358 |
#(2 0 -1 -2) do:[:badIndex | |
|
359 |
self |
|
360 |
should:[ |
|
361 |
#[ 16rFF 16r01 16r02 16r03 16r04 16r05 16r06 16r07 ] unsignedInt64At:badIndex MSB:true |
|
362 |
] |
|
363 |
raise:SubscriptOutOfBoundsError. |
|
364 |
||
365 |
self |
|
366 |
should:[ |
|
367 |
#[ 16rFF 16r01 16r02 16r03 16r04 16r05 16r06 16r07 ] unsignedInt64At:badIndex MSB:false |
|
368 |
] |
|
369 |
raise:SubscriptOutOfBoundsError. |
|
370 |
] |
|
371 |
||
372 |
" |
|
373 |
self run:#test03_int64Access |
|
374 |
" |
|
375 |
! |
|
376 |
||
377 |
test10_floatAccess |
|
1113 | 378 |
|bytes| |
379 |
||
380 |
bytes := ByteArray new:4. |
|
381 |
bytes floatAt:1 put:1.234. |
|
382 |
self assert:(bytes = #[182 243 157 63]). |
|
383 |
||
384 |
bytes floatAt:1 put:2.345 asShortFloat. |
|
385 |
self assert:(bytes = #[123 20 22 64]). |
|
386 |
||
387 |
bytes floatAt:1 put:345. |
|
388 |
self assert:(bytes = #[0 128 172 67]). |
|
389 |
||
390 |
||
391 |
bytes := ByteArray new:8. |
|
392 |
bytes doubleAt:1 put:1.234. |
|
393 |
self assert:(bytes = #[88 57 180 200 118 190 243 63]). |
|
394 |
||
395 |
bytes doubleAt:1 put:2.345 asShortFloat. |
|
396 |
self assert:(bytes = #[0 0 0 96 143 194 2 64]). |
|
397 |
||
398 |
bytes doubleAt:1 put:345. |
|
399 |
self assert:(bytes = #[0 0 0 0 0 144 117 64]). |
|
400 |
||
1485 | 401 |
"/ check bounds checks |
402 |
#(2 0 -1 -2) do:[:badIndex | |
|
403 |
self |
|
404 |
should:[ |
|
405 |
#[ 16rFF 16r01 16r02 16r03 ] floatAt:badIndex MSB:true |
|
406 |
] |
|
407 |
raise:SubscriptOutOfBoundsError. |
|
408 |
||
409 |
self |
|
410 |
should:[ |
|
411 |
#[ 16rFF 16r01 16r02 16r03 ] floatAt:badIndex MSB:false |
|
412 |
] |
|
413 |
raise:SubscriptOutOfBoundsError. |
|
414 |
||
415 |
self |
|
416 |
should:[ |
|
417 |
#[ 16rFF 16r01 16r02 16r03 16rFF 16r01 16r02 16r03 ] doubleAt:badIndex MSB:true |
|
418 |
] |
|
419 |
raise:SubscriptOutOfBoundsError. |
|
420 |
||
421 |
self |
|
422 |
should:[ |
|
423 |
#[ 16rFF 16r01 16r02 16r03 16rFF 16r01 16r02 16r03 ] doubleAt:badIndex MSB:false |
|
424 |
] |
|
425 |
raise:SubscriptOutOfBoundsError. |
|
426 |
] |
|
427 |
||
1113 | 428 |
" |
1485 | 429 |
self run:#test10_floatAccess |
430 |
" |
|
431 |
! |
|
432 |
||
433 |
test90_backwardCompatibility |
|
434 |
"/ backward compatibility stuff |
|
435 |
self assert:(#[ 16r10 16r20 ] wordAt:1 MSB:true) = 16r1020. |
|
436 |
self assert:(#[ 16r10 16r20 ] wordAt:1 MSB:false) = 16r2010. |
|
437 |
self assert:(#[ 16r80 16r20 ] wordAt:1 MSB:true) = 16r8020. |
|
438 |
self assert:(#[ 16r80 16r20 ] wordAt:1 MSB:false) = 16r2080. |
|
439 |
||
440 |
self assert:(#[ 16r10 16r20 ] signedWordAt:1 MSB:true) = 16r1020. |
|
441 |
self assert:(#[ 16r10 16r20 ] signedWordAt:1 MSB:false) = 16r2010. |
|
442 |
self assert:(#[ 16r80 16r20 ] signedWordAt:1 MSB:true) = -32736. "/ 16r8020 signExtendedShortValue. |
|
443 |
self assert:(#[ 16r80 16r20 ] signedWordAt:1 MSB:false) = 16r2080. |
|
444 |
||
445 |
self assert:(#[ 16r10 16r20 16r30 16r40 ] longAt:1 bigEndian:true) = 16r10203040. |
|
446 |
self assert:(#[ 16r10 16r20 16r30 16r40 ] longAt:1 bigEndian:false) = 16r40302010. |
|
447 |
self assert:(#[ 16r80 16r20 16r30 16r40 ] longAt:1 bigEndian:true) = -2145374144. "/ 16r80203040 signExtendedLongValue. |
|
448 |
self assert:(#[ 16r80 16r20 16r30 16r40 ] longAt:1 bigEndian:false) = 16r40302080. |
|
449 |
||
450 |
" |
|
451 |
self run:#test90_backwardCompatibility |
|
1113 | 452 |
" |
453 |
! ! |
|
454 |
||
455 |
!UninterpretedBytesTest class methodsFor:'documentation'! |
|
456 |
||
457 |
version |
|
458 |
^ '$Header$' |
|
459 |
! |
|
460 |
||
461 |
version_CVS |
|
462 |
^ '$Header$' |
|
463 |
! ! |
|
464 |