|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32test\math\trealxd1.cpp |
|
15 // TREALXD1.CPP - Test data for TRealX |
|
16 // |
|
17 // |
|
18 |
|
19 |
|
20 #include "t_realxd.h" |
|
21 |
|
22 const STwoOpTest BinaryOpNaNTests[] = |
|
23 { |
|
24 STwoOpTest( |
|
25 SRealX(0xffff0000,0xc0000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), |
|
26 SRealX(0xffff0000,0xc0000000,0x00000000), KErrArgument |
|
27 ), |
|
28 STwoOpTest( |
|
29 SRealX(0xffff0000,0xc0000000,0x00000000), SRealX(0x7fff0000,0xb504f333,0xf9de6484), |
|
30 SRealX(0xffff0000,0xc0000000,0x00000000), KErrArgument |
|
31 ), |
|
32 STwoOpTest( |
|
33 SRealX(0xffff0000,0xc0000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), |
|
34 SRealX(0xffff0000,0xc0000000,0x00000000), KErrArgument |
|
35 ), |
|
36 STwoOpTest( |
|
37 SRealX(0xffff0000,0xadf85458,0xa2bb4a9a), SRealX(0x00000000,0x00000000,0x00000000), |
|
38 SRealX(0xffff0000,0xedf85458,0xa2bb4a9a), KErrArgument |
|
39 ), |
|
40 STwoOpTest( |
|
41 SRealX(0xffff0000,0xadf85458,0xa2bb4a9a), SRealX(0x7fff0000,0x80000000,0x00000000), |
|
42 SRealX(0xffff0000,0xedf85458,0xa2bb4a9a), KErrArgument |
|
43 ), |
|
44 STwoOpTest( |
|
45 SRealX(0xffff0000,0xadf85458,0xa2bb4a9a), SRealX(0xffff0000,0x80000000,0x00000000), |
|
46 SRealX(0xffff0000,0xedf85458,0xa2bb4a9a), KErrArgument |
|
47 ), |
|
48 STwoOpTest( |
|
49 SRealX(0xffff0000,0xddb3d742,0xc265539e), SRealX(0x00000000,0x00000000,0x00000000), |
|
50 SRealX(0xffff0000,0xddb3d742,0xc265539e), KErrArgument |
|
51 ), |
|
52 STwoOpTest( |
|
53 SRealX(0xffff0000,0xddb3d742,0xc265539e), SRealX(0x7fff0000,0x80000000,0x00000000), |
|
54 SRealX(0xffff0000,0xddb3d742,0xc265539e), KErrArgument |
|
55 ), |
|
56 STwoOpTest( |
|
57 SRealX(0xffff0000,0xddb3d742,0xc265539e), SRealX(0xffff0000,0x80000000,0x00000000), |
|
58 SRealX(0xffff0000,0xddb3d742,0xc265539e), KErrArgument |
|
59 ), |
|
60 STwoOpTest( |
|
61 SRealX(0xffff0000,0xddb3d742,0xc265539e), SRealX(0xffff0000,0xc0000000,0x00000000), |
|
62 SRealX(0xffff0000,0xddb3d742,0xc265539e), KErrArgument |
|
63 ), |
|
64 STwoOpTest( |
|
65 SRealX(0xffff0000,0xddb3d742,0xc265539e), SRealX(0xffff0000,0xddb3d742,0xc265539f), |
|
66 SRealX(0xffff0000,0xddb3d742,0xc265539f), KErrArgument |
|
67 ), |
|
68 STwoOpTest( |
|
69 SRealX(0xffff0000,0xadf85458,0xa2bb4a9a), SRealX(0xffff0000,0x80000000,0x00000001), |
|
70 SRealX(0xffff0000,0xedf85458,0xa2bb4a9a), KErrArgument |
|
71 ), |
|
72 STwoOpTest( |
|
73 SRealX(0xffff0000,0xadf85458,0xa2bb4a9a), SRealX(0xffff0000,0xadf85458,0xa2bb4a9b), |
|
74 SRealX(0xffff0000,0xedf85458,0xa2bb4a9b), KErrArgument |
|
75 ), |
|
76 STwoOpTest( |
|
77 SRealX(0xffff0000,0x80000000,0x00000001), SRealX(0xffff0000,0x80000000,0x00000002), |
|
78 SRealX(0xffff0000,0xc0000000,0x00000002), KErrArgument |
|
79 ), |
|
80 STwoOpTest( |
|
81 SRealX(0xffff0000,0xadf85458,0xa2bb4a9a), SRealX(0xffff0000,0xddb3d742,0xc265539e), |
|
82 SRealX(0xffff0000,0xddb3d742,0xc265539e), KErrArgument |
|
83 ) |
|
84 }; |
|
85 |
|
86 const STwoOpTest AdditionTests[] = |
|
87 { |
|
88 STwoOpTest( |
|
89 SRealX(0x00300000,0x80000000,0x00000000), SRealX(0x00300001,0x80000000,0x00008000), |
|
90 SRealX(0x00000001,0x00000000,0x00000000), KErrUnderflow |
|
91 ), |
|
92 STwoOpTest( |
|
93 SRealX(0x00000000,0x00000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), |
|
94 SRealX(0x00000000,0x00000000,0x00000000), KErrNone |
|
95 ), |
|
96 STwoOpTest( |
|
97 SRealX(0x00000001,0x00000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), |
|
98 SRealX(0x00000001,0x00000000,0x00000000), KErrNone |
|
99 ), |
|
100 STwoOpTest( |
|
101 SRealX(0x00000000,0x00000000,0x00000000), SRealX(0x7fff0000,0xb504f333,0xf9de6484), |
|
102 SRealX(0x7fff0000,0xb504f333,0xf9de6484), KErrNone |
|
103 ), |
|
104 STwoOpTest( |
|
105 SRealX(0x00000001,0x00000000,0x00000000), SRealX(0x7fff0000,0xb504f333,0xf9de6484), |
|
106 SRealX(0x7fff0000,0xb504f333,0xf9de6484), KErrNone |
|
107 ), |
|
108 STwoOpTest( |
|
109 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), |
|
110 SRealX(0x80000000,0x80000000,0x00000000), KErrNone |
|
111 ), |
|
112 STwoOpTest( |
|
113 SRealX(0x80000000,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), |
|
114 SRealX(0x80000000,0xc0000000,0x00000000), KErrNone |
|
115 ), |
|
116 STwoOpTest( |
|
117 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fdf0000,0xb504f333,0xf9de6484), |
|
118 SRealX(0x7fff0200,0x80000000,0xb504f334), KErrNone |
|
119 ), |
|
120 STwoOpTest( |
|
121 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fdb0000,0xb504f333,0xf9de6484), |
|
122 SRealX(0x7fff0100,0x80000000,0x0b504f33), KErrNone |
|
123 ), |
|
124 STwoOpTest( |
|
125 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fe30000,0xb504f333,0xf9de6484), |
|
126 SRealX(0x7fff0200,0x8000000b,0x504f3340), KErrNone |
|
127 ), |
|
128 STwoOpTest( |
|
129 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fef0000,0xb504f333,0xf9de6484), |
|
130 SRealX(0x7fff0100,0x8000b504,0xf333f9de), KErrNone |
|
131 ), |
|
132 STwoOpTest( |
|
133 SRealX(0x7fff0000,0xb504f333,0xf9de0000), SRealX(0x7fef0000,0x80000001,0x64840000), |
|
134 SRealX(0x7fff0000,0xb5057333,0xf9df6484), KErrNone |
|
135 ), |
|
136 STwoOpTest( |
|
137 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fc00000,0x80000000,0x00000000), |
|
138 SRealX(0x7fff0000,0x80000000,0x00000001), KErrNone |
|
139 ), |
|
140 STwoOpTest( |
|
141 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fbf0000,0x80000000,0x00000000), |
|
142 SRealX(0x7fff0100,0x80000000,0x00000000), KErrNone |
|
143 ), |
|
144 STwoOpTest( |
|
145 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fbf0000,0x80000000,0x00000001), |
|
146 SRealX(0x7fff0200,0x80000000,0x00000001), KErrNone |
|
147 ), |
|
148 STwoOpTest( |
|
149 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fc00000,0xc0000000,0x00000000), |
|
150 SRealX(0x7fff0200,0x80000000,0x00000002), KErrNone |
|
151 ), |
|
152 STwoOpTest( |
|
153 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fc00000,0xbfffffff,0xffffffff), |
|
154 SRealX(0x7fff0100,0x80000000,0x00000001), KErrNone |
|
155 ), |
|
156 STwoOpTest( |
|
157 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fbe0000,0xffffffff,0xffffffff), |
|
158 SRealX(0x7fff0100,0x80000000,0x00000000), KErrNone |
|
159 ), |
|
160 STwoOpTest( |
|
161 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x7fbe0000,0xffffffff,0xffffffff), |
|
162 SRealX(0x7fff0201,0x80000000,0x00000000), KErrNone |
|
163 ), |
|
164 STwoOpTest( |
|
165 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), |
|
166 SRealX(0x00000000,0x00000000,0x00000000), KErrNone |
|
167 ), |
|
168 STwoOpTest( |
|
169 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x80050000,0xc8000000,0x00000000), |
|
170 SRealX(0x80050000,0xc6000000,0x00000000), KErrNone |
|
171 ), |
|
172 STwoOpTest( |
|
173 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fff0001,0x8d04f333,0xf9de6484), |
|
174 SRealX(0x7ffb0001,0xd04f333f,0x9de64840), KErrNone |
|
175 ), |
|
176 STwoOpTest( |
|
177 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x80000000), |
|
178 SRealX(0x7fdf0000,0x80000000,0x00000000), KErrNone |
|
179 ), |
|
180 STwoOpTest( |
|
181 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000001), |
|
182 SRealX(0x7fc00000,0x80000000,0x00000000), KErrNone |
|
183 ), |
|
184 STwoOpTest( |
|
185 SRealX(0x00300001,0x80000000,0x00000000), SRealX(0x00300000,0x80000000,0x00000000), |
|
186 SRealX(0x00000000,0x00000000,0x00000000), KErrNone |
|
187 ), |
|
188 STwoOpTest( |
|
189 SRealX(0x00200001,0x80000000,0x00000000), SRealX(0x00200000,0x80000000,0x00000000), |
|
190 SRealX(0x00000000,0x00000000,0x00000000), KErrNone |
|
191 ), |
|
192 STwoOpTest( |
|
193 SRealX(0x00100001,0x80000000,0x00000000), SRealX(0x00100000,0x80000000,0x00000000), |
|
194 SRealX(0x00000000,0x00000000,0x00000000), KErrNone |
|
195 ), |
|
196 STwoOpTest( |
|
197 SRealX(0x00300001,0x80000000,0x00000000), SRealX(0x00300000,0x80000000,0x80000000), |
|
198 SRealX(0x00100000,0x80000000,0x00000000), KErrNone |
|
199 ), |
|
200 STwoOpTest( |
|
201 SRealX(0x00300001,0x80000000,0x00000000), SRealX(0x00300000,0x80000000,0x00010000), |
|
202 SRealX(0x00010000,0x80000000,0x00000000), KErrNone |
|
203 ), |
|
204 STwoOpTest( |
|
205 SRealX(0x00300001,0x80000000,0x00000000), SRealX(0x00300000,0x80000000,0x00008000), |
|
206 SRealX(0x00000000,0x00000000,0x00000000), KErrUnderflow |
|
207 ), |
|
208 STwoOpTest( |
|
209 SRealX(0xfffe0000,0x80000000,0x00000000), SRealX(0xfffe0000,0x80000000,0x00000000), |
|
210 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
211 ), |
|
212 STwoOpTest( |
|
213 SRealX(0xfffe0000,0xb504f333,0xf9de6484), SRealX(0xfffe0000,0xddb3d742,0xc265539e), |
|
214 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
215 ), |
|
216 STwoOpTest( |
|
217 SRealX(0xfffe0000,0x80000000,0x00000000), SRealX(0xfffd0000,0xffffffff,0xf0000000), |
|
218 SRealX(0xfffe0000,0xffffffff,0xf8000000), KErrNone |
|
219 ), |
|
220 STwoOpTest( |
|
221 SRealX(0xfffe0000,0x80000000,0x00000000), SRealX(0xfffd0000,0xffffffff,0xfffffffe), |
|
222 SRealX(0xfffe0000,0xffffffff,0xffffffff), KErrNone |
|
223 ), |
|
224 STwoOpTest( |
|
225 SRealX(0xfffe0000,0x80000000,0x00000000), SRealX(0xfffd0000,0xffffffff,0xffffffff), |
|
226 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
227 ), |
|
228 STwoOpTest( |
|
229 SRealX(0xfffe0000,0xf0000000,0x00000000), SRealX(0xfffa0000,0xffffffff,0xfffffff0), |
|
230 SRealX(0xfffe0000,0xffffffff,0xffffffff), KErrNone |
|
231 ), |
|
232 STwoOpTest( |
|
233 SRealX(0xfffe0000,0xf0000000,0x00000000), SRealX(0xfffa0000,0xffffffff,0xfffffff7), |
|
234 SRealX(0xfffe0100,0xffffffff,0xffffffff), KErrNone |
|
235 ), |
|
236 STwoOpTest( |
|
237 SRealX(0xfffe0000,0xf0000000,0x00000000), SRealX(0xfffa0000,0xffffffff,0xfffffff8), |
|
238 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
239 ), |
|
240 STwoOpTest( |
|
241 SRealX(0xfffe0001,0xf0000000,0x00000000), SRealX(0xfffa0001,0xffffffff,0xfffffff0), |
|
242 SRealX(0xfffe0001,0xffffffff,0xffffffff), KErrNone |
|
243 ), |
|
244 STwoOpTest( |
|
245 SRealX(0xfffe0001,0xf0000000,0x00000000), SRealX(0xfffa0001,0xffffffff,0xfffffff7), |
|
246 SRealX(0xfffe0101,0xffffffff,0xffffffff), KErrNone |
|
247 ), |
|
248 STwoOpTest( |
|
249 SRealX(0xfffe0001,0xf0000000,0x00000000), SRealX(0xfffa0001,0xffffffff,0xfffffff8), |
|
250 SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
251 ), |
|
252 STwoOpTest( |
|
253 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xfffe0001,0xffffffff,0xffffffff), |
|
254 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
255 ), |
|
256 STwoOpTest( |
|
257 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), |
|
258 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
259 ), |
|
260 STwoOpTest( |
|
261 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), |
|
262 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
263 ), |
|
264 STwoOpTest( |
|
265 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xfffe0000,0xffffffff,0xffffffff), |
|
266 SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
267 ), |
|
268 STwoOpTest( |
|
269 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), |
|
270 SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
271 ), |
|
272 STwoOpTest( |
|
273 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), |
|
274 SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
275 ), |
|
276 STwoOpTest( |
|
277 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), |
|
278 SRealX(0xffff0001,0xc0000000,0x00000000), KErrArgument |
|
279 ) |
|
280 }; |
|
281 |
|
282 const STwoOpTest MultiplicationTests[] = |
|
283 { |
|
284 STwoOpTest( |
|
285 SRealX(0x00000000,0x00000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), |
|
286 SRealX(0x00000000,0x00000000,0x00000000), KErrNone |
|
287 ), |
|
288 STwoOpTest( |
|
289 SRealX(0x00000000,0x00000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), |
|
290 SRealX(0x00000001,0x00000000,0x00000000), KErrNone |
|
291 ), |
|
292 STwoOpTest( |
|
293 SRealX(0x00000001,0x00000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), |
|
294 SRealX(0x00000000,0x00000000,0x00000000), KErrNone |
|
295 ), |
|
296 STwoOpTest( |
|
297 SRealX(0x7fff0000,0xb504f333,0xf9de6484), SRealX(0x00000001,0x00000000,0x00000000), |
|
298 SRealX(0x00000001,0x00000000,0x00000000), KErrNone |
|
299 ), |
|
300 STwoOpTest( |
|
301 SRealX(0x7fff0001,0xb504f333,0xf9de6484), SRealX(0x00000001,0x00000000,0x00000000), |
|
302 SRealX(0x00000000,0x00000000,0x00000000), KErrNone |
|
303 ), |
|
304 STwoOpTest( |
|
305 SRealX(0x7fff0000,0xb504f333,0xf9de6484), SRealX(0x7fff0000,0xb504f333,0xf9de6484), |
|
306 SRealX(0x7fff0100,0xffffffff,0xffffffff), KErrNone |
|
307 ), |
|
308 STwoOpTest( |
|
309 SRealX(0x7fff0000,0xffffffff,0x00000000), SRealX(0x7fff0000,0xffffffff,0x00000000), |
|
310 SRealX(0x80000000,0xfffffffe,0x00000001), KErrNone |
|
311 ), |
|
312 STwoOpTest( |
|
313 SRealX(0x7fff0000,0xffffffff,0xf0000000), SRealX(0x7fff0000,0xffffffff,0xf0000000), |
|
314 SRealX(0x80000100,0xffffffff,0xe0000000), KErrNone |
|
315 ), |
|
316 STwoOpTest( |
|
317 SRealX(0x7fff0000,0xcccccccc,0xcccccccd), SRealX(0x7fff0000,0xcccccccc,0xcccccccd), |
|
318 SRealX(0x80000200,0xa3d70a3d,0x70a3d70b), KErrNone |
|
319 ), |
|
320 STwoOpTest( |
|
321 SRealX(0x7ffe0000,0xcccccccc,0xcccccccd), SRealX(0x80010000,0xa0000000,0x00000000), |
|
322 SRealX(0x80010100,0x80000000,0x00000000), KErrNone |
|
323 ), |
|
324 STwoOpTest( |
|
325 SRealX(0x80000000,0xadf85458,0xa2bb4a9a), SRealX(0x7ffd0000,0xbc5ab1b1,0x6779be36), |
|
326 SRealX(0x7fff0200,0x80000000,0x00000000), KErrNone |
|
327 ), |
|
328 STwoOpTest( |
|
329 SRealX(0x80000001,0xadf85458,0xa2bb4a9a), SRealX(0x7ffd0000,0xbc5ab1b1,0x6779be36), |
|
330 SRealX(0x7fff0201,0x80000000,0x00000000), KErrNone |
|
331 ), |
|
332 STwoOpTest( |
|
333 SRealX(0x80000001,0xadf85458,0xa2bb4a9a), SRealX(0x7ffd0001,0xbc5ab1b1,0x6779be36), |
|
334 SRealX(0x7fff0200,0x80000000,0x00000000), KErrNone |
|
335 ), |
|
336 STwoOpTest( |
|
337 SRealX(0x80000000,0xadf85458,0xa2bb4a9a), SRealX(0x80000000,0xc90fdaa2,0x2168c235), |
|
338 SRealX(0x80020200,0x88a2c05a,0x2ea3a4f3), KErrNone |
|
339 ), |
|
340 STwoOpTest( |
|
341 SRealX(0x7fff0000,0xc0000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000002), |
|
342 SRealX(0x7fff0000,0xc0000000,0x00000003), KErrNone |
|
343 ), |
|
344 STwoOpTest( |
|
345 SRealX(0x7fff0000,0xc0000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000001), |
|
346 SRealX(0x7fff0200,0xc0000000,0x00000002), KErrNone |
|
347 ), |
|
348 STwoOpTest( |
|
349 SRealX(0x7fff0000,0xa0000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000004), |
|
350 SRealX(0x7fff0000,0xa0000000,0x00000005), KErrNone |
|
351 ), |
|
352 STwoOpTest( |
|
353 SRealX(0x7fff0000,0xa0000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000002), |
|
354 SRealX(0x7fff0100,0xa0000000,0x00000002), KErrNone |
|
355 ), |
|
356 STwoOpTest( |
|
357 SRealX(0x65630000,0xb504f333,0xf9de6485), SRealX(0x1a9c0000,0xb504f333,0xf9de6485), |
|
358 SRealX(0x00010200,0x80000000,0x00000001), KErrNone |
|
359 ), |
|
360 STwoOpTest( |
|
361 SRealX(0x65630000,0xb504f333,0xf9de6484), SRealX(0x1a9c0000,0xb504f333,0xf9de6484), |
|
362 SRealX(0x00000000,0x00000000,0x00000000), KErrUnderflow |
|
363 ), |
|
364 STwoOpTest( |
|
365 SRealX(0x65630000,0xb504f333,0xf9de6484), SRealX(0x1a9b0000,0xc90fdaa2,0x2168c235), |
|
366 SRealX(0x00000000,0x00000000,0x00000000), KErrUnderflow |
|
367 ), |
|
368 STwoOpTest( |
|
369 SRealX(0x00010000,0xb504f333,0xf9de6484), SRealX(0x00010000,0xc90fdaa2,0x2168c235), |
|
370 SRealX(0x00000000,0x00000000,0x00000000), KErrUnderflow |
|
371 ), |
|
372 STwoOpTest( |
|
373 SRealX(0xaf6a0000,0xb504f333,0xf9de6484), SRealX(0xd0930000,0xb504f333,0xf9de6484), |
|
374 SRealX(0xfffe0100,0xffffffff,0xffffffff), KErrNone |
|
375 ), |
|
376 STwoOpTest( |
|
377 SRealX(0xaf6a0000,0xb504f333,0xf9de6485), SRealX(0xd0930000,0xb504f333,0xf9de6485), |
|
378 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
379 ), |
|
380 STwoOpTest( |
|
381 SRealX(0xaf6a0000,0xb504f333,0xf9de6484), SRealX(0xd0940000,0xc90fdaa2,0x2168c235), |
|
382 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
383 ), |
|
384 STwoOpTest( |
|
385 SRealX(0xfffe0000,0xb504f333,0xf9de6484), SRealX(0xfffd0000,0xc90fdaa2,0x2168c235), |
|
386 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
387 ), |
|
388 STwoOpTest( |
|
389 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), |
|
390 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
391 ), |
|
392 STwoOpTest( |
|
393 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), |
|
394 SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
395 ), |
|
396 STwoOpTest( |
|
397 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), |
|
398 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
399 ), |
|
400 STwoOpTest( |
|
401 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0x00010000,0x80000000,0x00000000), |
|
402 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
403 ), |
|
404 STwoOpTest( |
|
405 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), |
|
406 SRealX(0xffff0001,0xc0000000,0x00000000), KErrArgument |
|
407 ) |
|
408 }; |
|
409 |
|
410 const STwoOpTest DivisionTests[] = |
|
411 { |
|
412 STwoOpTest( |
|
413 SRealX(0x80050000,0xc8000000,0x00000000), SRealX(0x80010000,0xa0000000,0x00000000), |
|
414 SRealX(0x80030000,0xa0000000,0x00000000), KErrNone |
|
415 ), |
|
416 STwoOpTest( |
|
417 SRealX(0x80190000,0xbebc2000,0x00000000), SRealX(0x80050000,0xc8000000,0x00000000), |
|
418 SRealX(0x80120000,0xf4240000,0x00000000), KErrNone |
|
419 ), |
|
420 STwoOpTest( |
|
421 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x80000000,0xc0000000,0x00000000), |
|
422 SRealX(0x7ffd0200,0xaaaaaaaa,0xaaaaaaab), KErrNone |
|
423 ), |
|
424 STwoOpTest( |
|
425 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x80010000,0xa0000000,0x00000000), |
|
426 SRealX(0x7ffc0200,0xcccccccc,0xcccccccd), KErrNone |
|
427 ), |
|
428 STwoOpTest( |
|
429 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x80050000,0xc8000000,0x00000000), |
|
430 SRealX(0x7ff80100,0xa3d70a3d,0x70a3d70a), KErrNone |
|
431 ), |
|
432 STwoOpTest( |
|
433 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fff0000,0xb504f333,0xf9de6484), |
|
434 SRealX(0x7ffe0200,0xb504f333,0xf9de6485), KErrNone |
|
435 ), |
|
436 STwoOpTest( |
|
437 SRealX(0x80000000,0xc90fdaa2,0x2168c235), SRealX(0x80000000,0xadf85458,0xa2bb4a9a), |
|
438 SRealX(0x7fff0200,0x93eedfb1,0x38edef80), KErrNone |
|
439 ), |
|
440 STwoOpTest( |
|
441 SRealX(0x80000001,0xc90fdaa2,0x2168c235), SRealX(0x80000000,0xadf85458,0xa2bb4a9a), |
|
442 SRealX(0x7fff0201,0x93eedfb1,0x38edef80), KErrNone |
|
443 ), |
|
444 STwoOpTest( |
|
445 SRealX(0x80000001,0xc90fdaa2,0x2168c235), SRealX(0x80000001,0xadf85458,0xa2bb4a9a), |
|
446 SRealX(0x7fff0200,0x93eedfb1,0x38edef80), KErrNone |
|
447 ), |
|
448 STwoOpTest( |
|
449 SRealX(0x80000001,0xc90fdaa2,0x2168c235), SRealX(0x80000000,0x80000000,0x00000000), |
|
450 SRealX(0x7fff0001,0xc90fdaa2,0x2168c235), KErrNone |
|
451 ), |
|
452 STwoOpTest( |
|
453 SRealX(0xc0000000,0xc90fdaa2,0x2168c235), SRealX(0x40010000,0x80000000,0x00000000), |
|
454 SRealX(0xfffe0000,0xc90fdaa2,0x2168c235), KErrNone |
|
455 ), |
|
456 STwoOpTest( |
|
457 SRealX(0xc0000000,0xc90fdaa2,0x2168c235), SRealX(0x40000000,0x80000000,0x00000000), |
|
458 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
459 ), |
|
460 STwoOpTest( |
|
461 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xfffe0000,0xffffffff,0xffffffff), |
|
462 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
463 ), |
|
464 STwoOpTest( |
|
465 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), |
|
466 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
467 ), |
|
468 STwoOpTest( |
|
469 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), |
|
470 SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
471 ), |
|
472 STwoOpTest( |
|
473 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), |
|
474 SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
475 ), |
|
476 STwoOpTest( |
|
477 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), |
|
478 SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
479 ), |
|
480 STwoOpTest( |
|
481 SRealX(0x00010000,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), |
|
482 SRealX(0xffff0000,0x80000000,0x00000000), KErrDivideByZero |
|
483 ), |
|
484 STwoOpTest( |
|
485 SRealX(0x00010001,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), |
|
486 SRealX(0xffff0001,0x80000000,0x00000000), KErrDivideByZero |
|
487 ), |
|
488 STwoOpTest( |
|
489 SRealX(0x00010000,0x80000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), |
|
490 SRealX(0xffff0001,0x80000000,0x00000000), KErrDivideByZero |
|
491 ), |
|
492 STwoOpTest( |
|
493 SRealX(0x00010001,0x80000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), |
|
494 SRealX(0xffff0000,0x80000000,0x00000000), KErrDivideByZero |
|
495 ), |
|
496 STwoOpTest( |
|
497 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), |
|
498 SRealX(0xffff0001,0xc0000000,0x00000000), KErrArgument |
|
499 ) |
|
500 }; |
|
501 |
|
502 |
|
503 const SCompareTest ComparisonTests[] = |
|
504 { |
|
505 SCompareTest( |
|
506 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), 2 |
|
507 ), |
|
508 SCompareTest( |
|
509 SRealX(0x80050000,0xc8000000,0x00000000), SRealX(0x80010000,0xa0000000,0x00000000), 4 |
|
510 ), |
|
511 SCompareTest( |
|
512 SRealX(0x80050001,0xc8000000,0x00000000), SRealX(0x80010001,0xa0000000,0x00000000), 1 |
|
513 ), |
|
514 SCompareTest( |
|
515 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x7fff0001,0x80000000,0x00000000), 2 |
|
516 ), |
|
517 SCompareTest( |
|
518 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fff0001,0x80000000,0x00000000), 4 |
|
519 ), |
|
520 SCompareTest( |
|
521 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), 1 |
|
522 ), |
|
523 SCompareTest( |
|
524 SRealX(0x00000000,0x00000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), 2 |
|
525 ), |
|
526 SCompareTest( |
|
527 SRealX(0x00000000,0x00000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), 2 |
|
528 ), |
|
529 SCompareTest( |
|
530 SRealX(0x7fff0000,0xb504f333,0xf9de6484), SRealX(0x7fff0000,0xb504f333,0xf9de6484), 2 |
|
531 ), |
|
532 SCompareTest( |
|
533 SRealX(0x7fff0001,0xb504f333,0xf9de6484), SRealX(0x7fff0001,0xb504f333,0xf9de6484), 2 |
|
534 ), |
|
535 SCompareTest( |
|
536 SRealX(0x7fff0000,0xb504f333,0xf9de6485), SRealX(0x7fff0000,0xb504f333,0xf9de6484), 4 |
|
537 ), |
|
538 SCompareTest( |
|
539 SRealX(0x7fff0001,0xb504f333,0xf9de6485), SRealX(0x7fff0001,0xb504f333,0xf9de6484), 1 |
|
540 ), |
|
541 SCompareTest( |
|
542 SRealX(0x7fff0000,0xb504f333,0xf9de6484), SRealX(0x7fff0000,0xb504f333,0xf9de6485), 1 |
|
543 ), |
|
544 SCompareTest( |
|
545 SRealX(0x7fff0001,0xb504f333,0xf9de6484), SRealX(0x7fff0001,0xb504f333,0xf9de6485), 4 |
|
546 ), |
|
547 SCompareTest( |
|
548 SRealX(0x7fff0000,0xb504f333,0xf9de6484), SRealX(0x7ffe0000,0xb504f333,0xf9de6484), 4 |
|
549 ), |
|
550 SCompareTest( |
|
551 SRealX(0x7fff0000,0xb504f333,0xf9de6484), SRealX(0x80000000,0xb504f333,0xf9de6484), 1 |
|
552 ), |
|
553 SCompareTest( |
|
554 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xfffe0000,0xffffffff,0xffffffff), 4 |
|
555 ), |
|
556 SCompareTest( |
|
557 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), 4 |
|
558 ), |
|
559 SCompareTest( |
|
560 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), 4 |
|
561 ), |
|
562 SCompareTest( |
|
563 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), 4 |
|
564 ), |
|
565 SCompareTest( |
|
566 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xfffe0001,0xffffffff,0xffffffff), 1 |
|
567 ), |
|
568 SCompareTest( |
|
569 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), 1 |
|
570 ), |
|
571 SCompareTest( |
|
572 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), 1 |
|
573 ), |
|
574 SCompareTest( |
|
575 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), 1 |
|
576 ), |
|
577 SCompareTest( |
|
578 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), 2 |
|
579 ), |
|
580 SCompareTest( |
|
581 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), 2 |
|
582 ), |
|
583 SCompareTest( |
|
584 SRealX(0xffff0001,0xc0000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), 8 |
|
585 ), |
|
586 SCompareTest( |
|
587 SRealX(0xffff0001,0xc0000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), 8 |
|
588 ), |
|
589 SCompareTest( |
|
590 SRealX(0xffff0000,0x80000000,0x00000001), SRealX(0x7fff0001,0x80000000,0x00000000), 8 |
|
591 ), |
|
592 SCompareTest( |
|
593 SRealX(0xffff0000,0x80000000,0x00000001), SRealX(0xffff0001,0xddb3d742,0xc265539e), 8 |
|
594 ), |
|
595 SCompareTest( |
|
596 SRealX(0x00000000,0x00000000,0x00000000), SRealX(0xffff0001,0xddb3d742,0xc265539e), 8 |
|
597 ), |
|
598 SCompareTest( |
|
599 SRealX(0xffee0000,0x80005000,0x40000000), SRealX(0xffff0001,0xddb3d742,0xc265539e), 8 |
|
600 ), |
|
601 SCompareTest( |
|
602 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xffff0001,0xddb3d742,0xc265539e), 8 |
|
603 ) |
|
604 }; |
|
605 |
|
606 const SOneOpTest UnaryPlusTests[] = |
|
607 { |
|
608 SOneOpTest( |
|
609 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), 0 |
|
610 ), |
|
611 SOneOpTest( |
|
612 SRealX(0x7fff0000,0xb504f333,0xf9de6484), SRealX(0x7fff0000,0xb504f333,0xf9de6484), 0 |
|
613 ), |
|
614 SOneOpTest( |
|
615 SRealX(0xffff0001,0xb504f333,0xf9de6484), SRealX(0xffff0001,0xb504f333,0xf9de6484), 0 |
|
616 ), |
|
617 }; |
|
618 |
|
619 const SOneOpTest UnaryMinusTests[] = |
|
620 { |
|
621 SOneOpTest( |
|
622 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x7fff0001,0x80000000,0x00000000), 0 |
|
623 ), |
|
624 SOneOpTest( |
|
625 SRealX(0x7fff0000,0xb504f333,0xf9de6484), SRealX(0x7fff0001,0xb504f333,0xf9de6484), 0 |
|
626 ), |
|
627 SOneOpTest( |
|
628 SRealX(0xffff0000,0xb504f333,0xf9de6484), SRealX(0xffff0001,0xb504f333,0xf9de6484), 0 |
|
629 ), |
|
630 SOneOpTest( |
|
631 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), 0 |
|
632 ), |
|
633 SOneOpTest( |
|
634 SRealX(0x00000000,0x00000000,0x00000000), SRealX(0x00000001,0x00000000,0x00000000), 0 |
|
635 ), |
|
636 }; |
|
637 |
|
638 const SOneOpTest IncTests[] = |
|
639 { |
|
640 SOneOpTest( |
|
641 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x80000000,0x80000000,0x00000000), 0 |
|
642 ), |
|
643 SOneOpTest( |
|
644 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), 0 |
|
645 ), |
|
646 SOneOpTest( |
|
647 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
648 ), |
|
649 SOneOpTest( |
|
650 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
651 ), |
|
652 SOneOpTest( |
|
653 SRealX(0xffff0000,0xb504f333,0xf9de6484), SRealX(0xffff0000,0xf504f333,0xf9de6484), KErrArgument |
|
654 ), |
|
655 SOneOpTest( |
|
656 SRealX(0x00000001,0x00000000,0x00000000), SRealX(0x7fff0000,0x80000000,0x00000000), KErrNone |
|
657 ), |
|
658 SOneOpTest( |
|
659 SRealX(0x803e0000,0xddb3d742,0xffffffff), SRealX(0x803e0000,0xddb3d743,0x00000000), KErrNone |
|
660 ) |
|
661 }; |
|
662 |
|
663 const SOneOpTest DecTests[] = |
|
664 { |
|
665 SOneOpTest( |
|
666 SRealX(0x7fff0000,0x80000000,0x00000000), SRealX(0x00000000,0x00000000,0x00000000), 0 |
|
667 ), |
|
668 SOneOpTest( |
|
669 SRealX(0x7fff0001,0x80000000,0x00000000), SRealX(0x80000001,0x80000000,0x00000000), 0 |
|
670 ), |
|
671 SOneOpTest( |
|
672 SRealX(0xffff0000,0x80000000,0x00000000), SRealX(0xffff0000,0x80000000,0x00000000), KErrOverflow |
|
673 ), |
|
674 SOneOpTest( |
|
675 SRealX(0xffff0001,0x80000000,0x00000000), SRealX(0xffff0001,0x80000000,0x00000000), KErrOverflow |
|
676 ), |
|
677 SOneOpTest( |
|
678 SRealX(0xffff0000,0xb504f333,0xf9de6484), SRealX(0xffff0000,0xf504f333,0xf9de6484), KErrArgument |
|
679 ), |
|
680 SOneOpTest( |
|
681 SRealX(0x00000001,0x00000000,0x00000000), SRealX(0x7fff0001,0x80000000,0x00000000), KErrNone |
|
682 ), |
|
683 SOneOpTest( |
|
684 SRealX(0x803e0000,0xddb3d743,0x00000000), SRealX(0x803e0000,0xddb3d742,0xffffffff), KErrNone |
|
685 ) |
|
686 }; |
|
687 |
|
688 GLDEF_D const TInt NumBinaryOpNaNTests=sizeof(BinaryOpNaNTests)/sizeof(STwoOpTest); |
|
689 GLDEF_D const TInt NumAdditionTests=sizeof(AdditionTests)/sizeof(STwoOpTest); |
|
690 GLDEF_D const TInt NumMultiplicationTests=sizeof(MultiplicationTests)/sizeof(STwoOpTest); |
|
691 GLDEF_D const TInt NumDivisionTests=sizeof(DivisionTests)/sizeof(STwoOpTest); |
|
692 GLDEF_D const TInt NumComparisonTests=sizeof(ComparisonTests)/sizeof(SCompareTest); |
|
693 GLDEF_D const TInt NumUnaryPlusTests=sizeof(UnaryPlusTests)/sizeof(SOneOpTest); |
|
694 GLDEF_D const TInt NumUnaryMinusTests=sizeof(UnaryMinusTests)/sizeof(SOneOpTest); |
|
695 GLDEF_D const TInt NumIncTests=sizeof(IncTests)/sizeof(SOneOpTest); |
|
696 GLDEF_D const TInt NumDecTests=sizeof(DecTests)/sizeof(SOneOpTest); |