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 TypedArray; | 8 library TypedArray; |
9 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
10 import 'dart:isolate'; | 10 import 'dart:isolate'; |
11 import 'dart:typeddata'; | 11 import 'dart:typed_data'; |
12 | 12 |
13 void main() { | 13 void main() { |
14 int8_receiver(); | 14 int8_receiver(); |
15 uint8_receiver(); | 15 uint8_receiver(); |
16 int16_receiver(); | 16 int16_receiver(); |
17 uint16_receiver(); | 17 uint16_receiver(); |
18 int32_receiver(); | 18 int32_receiver(); |
19 uint32_receiver(); | 19 uint32_receiver(); |
20 int64_receiver(); | 20 int64_receiver(); |
21 uint64_receiver(); | 21 uint64_receiver(); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 float64_sender() { | 334 float64_sender() { |
335 port.receive((len, r) { | 335 port.receive((len, r) { |
336 Expect.equals(float64.length, len); | 336 Expect.equals(float64.length, len); |
337 var a = new Float64List(len); | 337 var a = new Float64List(len); |
338 for (int i = 0; i < len; i++) { | 338 for (int i = 0; i < len; i++) { |
339 a[i] = float64[i]; | 339 a[i] = float64[i]; |
340 } | 340 } |
341 r.send(a); | 341 r.send(a); |
342 }); | 342 }); |
343 } | 343 } |
OLD | NEW |