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

Unified Diff: tests/standalone/typed_data_test.dart

Issue 364833002: Add typed data view creation functions on ByteBuffer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/typed_data/typed_data.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/typed_data_test.dart
diff --git a/tests/standalone/typed_data_test.dart b/tests/standalone/typed_data_test.dart
index 669bee077943103f626834dceda6663ca08b1506..f73c5aff8aef818d4cb3c4f2e94e7bcf310ee007 100644
--- a/tests/standalone/typed_data_test.dart
+++ b/tests/standalone/typed_data_test.dart
@@ -303,7 +303,8 @@ void testSetAtIndex(TypedData list,
testViewCreation() {
var bytes = new Uint8List(1024).buffer;
- var view = new ByteData.view(bytes, 24);
+ var view;
+ view = new ByteData.view(bytes, 24);
Søren Gjesse 2014/07/02 13:06:14 Please add tests passing the length optional argum
Expect.equals(1000, view.lengthInBytes);
view = new Uint8List.view(bytes, 24);
Expect.equals(1000, view.lengthInBytes);
@@ -327,6 +328,31 @@ testViewCreation() {
Expect.equals(1000, view.lengthInBytes);
view = new Float64List.view(bytes, 24);
Expect.equals(1000, view.lengthInBytes);
+
+ view = bytes.asByteData(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asUint8List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asInt8List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asUint8ClampedList(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asUint16List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asInt16List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asUint32List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asInt32List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asUint64List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asInt64List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asFloat32List(24);
+ Expect.equals(1000, view.lengthInBytes);
+ view = bytes.asFloat64List(24);
+ Expect.equals(1000, view.lengthInBytes);
}
testWhere() {
« no previous file with comments | « sdk/lib/typed_data/typed_data.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698