Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(773)

Side by Side Diff: tests/standalone/byte_array_test.dart

Issue 12263010: Optimize stores to ExternalUint8Array and ExternalUint8ClampedArray in the optimizer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 byte arrays. 5 // Dart test program for testing native byte 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 ByteArrayTest; 8 library ByteArrayTest;
9 9
10 import 'dart:scalarlist'; 10 import 'dart:scalarlist';
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 Expect.isTrue(externalClampedByteArray is Uint8ClampedList); 47 Expect.isTrue(externalClampedByteArray is Uint8ClampedList);
48 Expect.isFalse(externalClampedByteArray is Uint8List); 48 Expect.isFalse(externalClampedByteArray is Uint8List);
49 Expect.equals(0, externalClampedByteArray.length); 49 Expect.equals(0, externalClampedByteArray.length);
50 Expect.equals(0, externalClampedByteArray.lengthInBytes()); 50 Expect.equals(0, externalClampedByteArray.lengthInBytes());
51 51
52 externalClampedByteArray = new Uint8ClampedList.transferable(10); 52 externalClampedByteArray = new Uint8ClampedList.transferable(10);
53 Expect.equals(10, externalClampedByteArray.length); 53 Expect.equals(10, externalClampedByteArray.length);
54 for (int i = 0; i < 10; i++) { 54 for (int i = 0; i < 10; i++) {
55 Expect.equals(0, externalClampedByteArray[i]); 55 Expect.equals(0, externalClampedByteArray[i]);
56 } 56 }
57 57 for (int i = 0; i < 10; i++) {
58 externalClampedByteArray[i] = i + 250;
59 }
60 for (int i = 0; i < 10; i++) {
61 Expect.equals(i + 250 > 255 ? 255 : i + 250, externalClampedByteArray[i]);
62 }
58 } 63 }
59 64
60 void testUnsignedByteArrayRange(bool check_throws) { 65 void testUnsignedByteArrayRange(bool check_throws) {
61 Uint8List byteArray; 66 Uint8List byteArray;
62 byteArray = new Uint8List(10); 67 byteArray = new Uint8List(10);
63 68
64 byteArray[1] = 255; 69 byteArray[1] = 255;
65 Expect.equals(255, byteArray[1]); 70 Expect.equals(255, byteArray[1]);
66 byteArray[1] = 0; 71 byteArray[1] = 0;
67 Expect.equals(0, byteArray[1]); 72 Expect.equals(0, byteArray[1]);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 testSetRange(); 276 testSetRange();
272 testIndexOutOfRange(); 277 testIndexOutOfRange();
273 testIndexOf(); 278 testIndexOf();
274 testSubArray(); 279 testSubArray();
275 } 280 }
276 testByteArrayRange(true); 281 testByteArrayRange(true);
277 testUnsignedByteArrayRange(true); 282 testUnsignedByteArrayRange(true);
278 testExternalClampedUnsignedByteArrayRange(true); 283 testExternalClampedUnsignedByteArrayRange(true);
279 } 284 }
280 285
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698