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

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

Issue 10919267: Introduce a VM-only dart:scalarlist library for byte arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move init call for scalarlist lib Created 8 years, 3 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/vm.gypi ('k') | tests/standalone/io/http_parser_test.dart » ('j') | 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) 2011, 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 #import('dart:scalarlist');
8
7 void testCreateByteArray() { 9 void testCreateByteArray() {
8 Uint8List byteArray; 10 Uint8List byteArray;
9 11
10 byteArray = new Uint8List(0); 12 byteArray = new Uint8List(0);
11 Expect.equals(0, byteArray.length); 13 Expect.equals(0, byteArray.length);
12 14
13 byteArray = new Uint8List(10); 15 byteArray = new Uint8List(10);
14 Expect.equals(10, byteArray.length); 16 Expect.equals(10, byteArray.length);
15 for (int i = 0; i < 10; i++) { 17 for (int i = 0; i < 10; i++) {
16 Expect.equals(0, byteArray[i]); 18 Expect.equals(0, byteArray[i]);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 76 }
75 77
76 main() { 78 main() {
77 for (int i = 0; i < 2000; i++) { 79 for (int i = 0; i < 2000; i++) {
78 testCreateByteArray(); 80 testCreateByteArray();
79 testSetRange(); 81 testSetRange();
80 testIndexOutOfRange(); 82 testIndexOutOfRange();
81 testIndexOf(); 83 testIndexOf();
82 } 84 }
83 } 85 }
OLDNEW
« no previous file with comments | « runtime/vm/vm.gypi ('k') | tests/standalone/io/http_parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698