OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // Dart test program for testing native float arrays. | 5 // Dart test program for testing native float arrays. |
6 | 6 |
7 // Library tag to be able to run in html test framework. | 7 // Library tag to be able to run in html test framework. |
8 #library("FloatArrayTest.dart"); | 8 library FloatArrayTest; |
9 | 9 |
10 #import('dart:scalarlist'); | 10 import 'dart:scalarlist'; |
11 | 11 |
12 void testCreateFloat32Array() { | 12 void testCreateFloat32Array() { |
13 Float32List floatArray; | 13 Float32List floatArray; |
14 | 14 |
15 floatArray = new Float32List(0); | 15 floatArray = new Float32List(0); |
16 Expect.equals(0, floatArray.length); | 16 Expect.equals(0, floatArray.length); |
17 | 17 |
18 floatArray = new Float32List(10); | 18 floatArray = new Float32List(10); |
19 Expect.equals(10, floatArray.length); | 19 Expect.equals(10, floatArray.length); |
20 for (int i = 0; i < 10; i++) { | 20 for (int i = 0; i < 10; i++) { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 testBadValues32(); | 206 testBadValues32(); |
207 testBadValues64(); | 207 testBadValues64(); |
208 // Check optimized (inlined) version of []= | 208 // Check optimized (inlined) version of []= |
209 Expect.throws(() { | 209 Expect.throws(() { |
210 storeIt32(a32, 1, 2); | 210 storeIt32(a32, 1, 2); |
211 }); | 211 }); |
212 Expect.throws(() { | 212 Expect.throws(() { |
213 storeIt64(a64, 1, 2); | 213 storeIt64(a64, 1, 2); |
214 }); | 214 }); |
215 } | 215 } |
OLD | NEW |