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

Unified Diff: tests/lib/typed_data/float32x4_list_test.dart

Issue 19801005: Implement SIMD types for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | « tests/lib/lib.status ('k') | tests/lib/typed_data/float32x4_unbox_phi_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/typed_data/float32x4_list_test.dart
diff --git a/tests/lib/typed_data/float32x4_list_test.dart b/tests/lib/typed_data/float32x4_list_test.dart
index 0de949242ac965ccd8066d0ec039dca47909c367..8942186cf631d0b7ef72fb87f2a72a470efa369e 100644
--- a/tests/lib/typed_data/float32x4_list_test.dart
+++ b/tests/lib/typed_data/float32x4_list_test.dart
@@ -108,6 +108,30 @@ testView(array) {
Expect.equals(7.0, array[1].w);
}
+testSublist(array) {
+ Expect.equals(8, array.length);
+ Expect.isTrue(array is Float32x4List);
+ var a = array.sublist(0, 1);
+ Expect.equals(1, a.length);
+ Expect.equals(0.0, a[0].x);
+ Expect.equals(1.0, a[0].y);
+ Expect.equals(2.0, a[0].z);
+ Expect.equals(3.0, a[0].w);
+ a = array.sublist(1, 2);
+ Expect.equals(4.0, a[0].x);
+ Expect.equals(5.0, a[0].y);
+ Expect.equals(6.0, a[0].z);
+ Expect.equals(7.0, a[0].w);
+ a = array.sublist(0);
+ Expect.equals(a.length, array.length);
+ for (int i = 0; i < array.length; i++) {
+ Expect.equals(array[i].x, a[i].x);
+ Expect.equals(array[i].y, a[i].y);
+ Expect.equals(array[i].z, a[i].z);
+ Expect.equals(array[i].w, a[i].w);
+ }
+}
+
main() {
var list;
@@ -120,11 +144,14 @@ main() {
for (int i = 0; i < floatList.length; i++) {
floatList[i] = i.toDouble();
}
- list = new Float32x4List.view(floatList);
+ list = new Float32x4List.view(floatList.buffer);
for (int i = 0; i < 20; i++) {
testView(list);
}
for (int i = 0; i < 20; i++) {
+ testSublist(list);
+ }
+ for (int i = 0; i < 20; i++) {
testLoadStore(list);
}
for (int i = 0; i < 20; i++) {
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/typed_data/float32x4_unbox_phi_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698