| 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 | 7 // VMOptions=--optimization_counter_threshold=10 |
| 8 | 8 |
| 9 // Library tag to be able to run in html test framework. | 9 // Library tag to be able to run in html test framework. |
| 10 library TypedDataTest; | 10 library TypedDataTest; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 for (int i = 0; i < 10; i++) { | 25 for (int i = 0; i < 10; i++) { |
| 26 Expect.equals(0, typed_data[i]); | 26 Expect.equals(0, typed_data[i]); |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 void testCreateClampedUint8TypedData() { | 30 void testCreateClampedUint8TypedData() { |
| 31 Uint8ClampedList typed_data; | 31 Uint8ClampedList typed_data; |
| 32 | 32 |
| 33 typed_data = new Uint8ClampedList(0); | 33 typed_data = new Uint8ClampedList(0); |
| 34 Expect.isTrue(typed_data is Uint8ClampedList); | 34 Expect.isTrue(typed_data is Uint8ClampedList); |
| 35 Expect.isFalse(typed_data is Uint8List); | 35 Expect.isTrue(typed_data is Uint8List); |
| 36 Expect.equals(0, typed_data.length); | 36 Expect.equals(0, typed_data.length); |
| 37 Expect.equals(0, typed_data.lengthInBytes); | 37 Expect.equals(0, typed_data.lengthInBytes); |
| 38 | 38 |
| 39 typed_data = new Uint8ClampedList(10); | 39 typed_data = new Uint8ClampedList(10); |
| 40 Expect.equals(10, typed_data.length); | 40 Expect.equals(10, typed_data.length); |
| 41 for (int i = 0; i < 10; i++) { | 41 for (int i = 0; i < 10; i++) { |
| 42 Expect.equals(0, typed_data[i]); | 42 Expect.equals(0, typed_data[i]); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 testSetAtIndex(float64list, 1.4260258159703532e-105, true); | 371 testSetAtIndex(float64list, 1.4260258159703532e-105, true); |
| 372 testGetAtIndex(float64list, 1.4260258159703532e-105); | 372 testGetAtIndex(float64list, 1.4260258159703532e-105); |
| 373 } | 373 } |
| 374 testTypedDataRange(true); | 374 testTypedDataRange(true); |
| 375 testUnsignedTypedDataRange(true); | 375 testUnsignedTypedDataRange(true); |
| 376 testViewCreation(); | 376 testViewCreation(); |
| 377 testWhere(); | 377 testWhere(); |
| 378 testCreationFromList(); | 378 testCreationFromList(); |
| 379 } | 379 } |
| 380 | 380 |
| OLD | NEW |