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 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.dart"); | 8 #library("ByteArrayTest.dart"); |
9 | 9 |
10 #import('dart:scalarlist'); | 10 #import('dart:scalarlist'); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 Expect.equals(0, array.subByteArray(10, null).lengthInBytes()); | 124 Expect.equals(0, array.subByteArray(10, null).lengthInBytes()); |
125 Expect.equals(5, array.subByteArray(0, 5).lengthInBytes()); | 125 Expect.equals(5, array.subByteArray(0, 5).lengthInBytes()); |
126 Expect.equals(5, array.subByteArray(5, 5).lengthInBytes()); | 126 Expect.equals(5, array.subByteArray(5, 5).lengthInBytes()); |
127 Expect.equals(5, array.subByteArray(5).lengthInBytes()); | 127 Expect.equals(5, array.subByteArray(5).lengthInBytes()); |
128 Expect.equals(5, array.subByteArray(5, null).lengthInBytes()); | 128 Expect.equals(5, array.subByteArray(5, null).lengthInBytes()); |
129 Expect.equals(10, array.subByteArray(0, 10).lengthInBytes()); | 129 Expect.equals(10, array.subByteArray(0, 10).lengthInBytes()); |
130 Expect.equals(10, array.subByteArray(0).lengthInBytes()); | 130 Expect.equals(10, array.subByteArray(0).lengthInBytes()); |
131 Expect.equals(10, array.subByteArray(0, null).lengthInBytes()); | 131 Expect.equals(10, array.subByteArray(0, null).lengthInBytes()); |
132 Expect.equals(10, array.subByteArray().lengthInBytes()); | 132 Expect.equals(10, array.subByteArray().lengthInBytes()); |
133 testThrowsIndex(function) { | 133 testThrowsIndex(function) { |
134 Expect.throws(function, (e) => e is IndexOutOfRangeException); | 134 Expect.throws(function, (e) => e is RangeError); |
135 } | 135 } |
136 testThrowsIndex(() => array.subByteArray(0, -1)); | 136 testThrowsIndex(() => array.subByteArray(0, -1)); |
137 testThrowsIndex(() => array.subByteArray(1, -1)); | 137 testThrowsIndex(() => array.subByteArray(1, -1)); |
138 testThrowsIndex(() => array.subByteArray(10, -1)); | 138 testThrowsIndex(() => array.subByteArray(10, -1)); |
139 testThrowsIndex(() => array.subByteArray(-1, 0)); | 139 testThrowsIndex(() => array.subByteArray(-1, 0)); |
140 testThrowsIndex(() => array.subByteArray(-1)); | 140 testThrowsIndex(() => array.subByteArray(-1)); |
141 testThrowsIndex(() => array.subByteArray(-1, null)); | 141 testThrowsIndex(() => array.subByteArray(-1, null)); |
142 testThrowsIndex(() => array.subByteArray(11, 0)); | 142 testThrowsIndex(() => array.subByteArray(11, 0)); |
143 testThrowsIndex(() => array.subByteArray(11)); | 143 testThrowsIndex(() => array.subByteArray(11)); |
144 testThrowsIndex(() => array.subByteArray(11, null)); | 144 testThrowsIndex(() => array.subByteArray(11, null)); |
(...skipping 15 matching lines...) Expand all Loading... |
160 testCreateByteArray(); | 160 testCreateByteArray(); |
161 testByteArrayRange(); | 161 testByteArrayRange(); |
162 testUnsignedByteArrayRange(); | 162 testUnsignedByteArrayRange(); |
163 testSetRange(); | 163 testSetRange(); |
164 testIndexOutOfRange(); | 164 testIndexOutOfRange(); |
165 testIndexOf(); | 165 testIndexOf(); |
166 testSubArray(); | 166 testSubArray(); |
167 } | 167 } |
168 } | 168 } |
169 | 169 |
OLD | NEW |