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

Unified Diff: tests/standalone/typed_data_test.dart

Issue 13834008: Add fromList constructor to typeddata typed lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« runtime/lib/typeddata.dart ('K') | « sdk/lib/typeddata/typeddata.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 3745914b02c89c38c8b77e2e09581dd0cebf0cdf..b23eccea547c8ffe75ca902c9d9c07e60275b092 100644
--- a/tests/standalone/typed_data_test.dart
+++ b/tests/standalone/typed_data_test.dart
@@ -314,6 +314,23 @@ testWhere() {
Expect.equals(5, bytes.where((v) => v > 0).length);
}
+testCreationFromList() {
+ var intList =
+ [-10000000000000000000, -255, -127, 0, 128, 256, 1000000000000000000000];
+ var list = new Int8List.fromList(intList);
+ list = new Int16List.fromList(intList);
+ list = new Int32List.fromList(intList);
+ list = new Int64List.fromList(intList);
+ list = new Uint8List.fromList(intList);
+ list = new Uint16List.fromList(intList);
+ list = new Uint32List.fromList(intList);
+ list = new Uint64List.fromList(intList);
+ var doubleList =
+ [-123123123123.123123123123, -123.0, 0.0, 123.0, 123123123123.123123123];
+ list = new Float32List.fromList(doubleList);
+ list = new Float64List.fromList(doubleList);
+}
+
main() {
for (int i = 0; i < 2000; i++) {
testCreateUint8TypedData();
@@ -372,5 +389,6 @@ main() {
testExternalClampedUnsignedTypedDataRange(true);
testViewCreation();
testWhere();
+ testCreationFromList();
}
« runtime/lib/typeddata.dart ('K') | « sdk/lib/typeddata/typeddata.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698