| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 typed data. | 5 // Dart test program for testing typed data. |
| 6 | 6 |
| 7 // VMOptions=--optimization_counter_threshold=10 |
| 8 |
| 7 // Library tag to be able to run in html test framework. | 9 // Library tag to be able to run in html test framework. |
| 8 library TypedDataTest; | 10 library TypedDataTest; |
| 9 | 11 |
| 10 import "package:expect/expect.dart"; | 12 import "package:expect/expect.dart"; |
| 11 import 'dart:typed_data'; | 13 import 'dart:typed_data'; |
| 12 | 14 |
| 13 void testCreateUint8TypedData() { | 15 void testCreateUint8TypedData() { |
| 14 Uint8List typed_data; | 16 Uint8List typed_data; |
| 15 | 17 |
| 16 typed_data = new Uint8List(0); | 18 typed_data = new Uint8List(0); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 doubleLists.add(new Float64List.fromList(doubleList)); | 314 doubleLists.add(new Float64List.fromList(doubleList)); |
| 313 for (var ints in intLists) { | 315 for (var ints in intLists) { |
| 314 for (var doubles in doubleLists) { | 316 for (var doubles in doubleLists) { |
| 315 Expect.throws(() => ints[0] = doubles[0]); | 317 Expect.throws(() => ints[0] = doubles[0]); |
| 316 Expect.throws(() => doubles[0] = ints[0]); | 318 Expect.throws(() => doubles[0] = ints[0]); |
| 317 } | 319 } |
| 318 } | 320 } |
| 319 } | 321 } |
| 320 | 322 |
| 321 main() { | 323 main() { |
| 322 for (int i = 0; i < 2000; i++) { | 324 for (int i = 0; i < 20; i++) { |
| 323 testCreateUint8TypedData(); | 325 testCreateUint8TypedData(); |
| 324 testCreateClampedUint8TypedData(); | 326 testCreateClampedUint8TypedData(); |
| 325 testTypedDataRange(false); | 327 testTypedDataRange(false); |
| 326 testUnsignedTypedDataRange(false); | 328 testUnsignedTypedDataRange(false); |
| 327 testClampedUnsignedTypedDataRange(false); | 329 testClampedUnsignedTypedDataRange(false); |
| 328 testSetRange(); | 330 testSetRange(); |
| 329 testIndexOutOfRange(); | 331 testIndexOutOfRange(); |
| 330 testIndexOf(); | 332 testIndexOf(); |
| 331 | 333 |
| 332 var int8list = new Int8List(128); | 334 var int8list = new Int8List(128); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 testSetAtIndex(float64list, 1.4260258159703532e-105, true); | 371 testSetAtIndex(float64list, 1.4260258159703532e-105, true); |
| 370 testGetAtIndex(float64list, 1.4260258159703532e-105); | 372 testGetAtIndex(float64list, 1.4260258159703532e-105); |
| 371 } | 373 } |
| 372 testTypedDataRange(true); | 374 testTypedDataRange(true); |
| 373 testUnsignedTypedDataRange(true); | 375 testUnsignedTypedDataRange(true); |
| 374 testViewCreation(); | 376 testViewCreation(); |
| 375 testWhere(); | 377 testWhere(); |
| 376 testCreationFromList(); | 378 testCreationFromList(); |
| 377 } | 379 } |
| 378 | 380 |
| OLD | NEW |