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

Unified Diff: tests/html/typed_arrays_simd_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 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
Index: tests/html/typed_arrays_simd_test.dart
diff --git a/tests/html/typed_arrays_simd_test.dart b/tests/html/typed_arrays_simd_test.dart
index 0e3d780f3fb5522a0ca919734b341e3dc41a869a..67fc0c1474e1c35a7c4cba4b7539e621086ac58f 100644
--- a/tests/html/typed_arrays_simd_test.dart
+++ b/tests/html/typed_arrays_simd_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
library TypedArraysSimdTest;
+
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
import 'dart:html';
@@ -27,59 +28,59 @@ main() {
}
test('test Float32x4', () {
- if (Platform.supportsSimd) {
- final val = new Float32x4(1.0, 2.0, 3.0, 4.0);
- expect(val.x, floatEquals(1.0));
- expect(val.y, floatEquals(2.0));
- expect(val.z, floatEquals(3.0));
- expect(val.w, floatEquals(4.0));
- final val2 = val + val;
- expect(val2.x, floatEquals(2.0));
- expect(val2.y, floatEquals(4.0));
- expect(val2.z, floatEquals(6.0));
- expect(val2.w, floatEquals(8.0));
- }
+ if (Platform.supportsSimd) {
+ final val = new Float32x4(1.0, 2.0, 3.0, 4.0);
+ expect(val.x, floatEquals(1.0));
+ expect(val.y, floatEquals(2.0));
+ expect(val.z, floatEquals(3.0));
+ expect(val.w, floatEquals(4.0));
+ final val2 = val + val;
+ expect(val2.x, floatEquals(2.0));
+ expect(val2.y, floatEquals(4.0));
+ expect(val2.z, floatEquals(6.0));
+ expect(val2.w, floatEquals(8.0));
+ }
});
test('test Float32x4List', () {
- var counter;
- final list = new Float32List(12);
- for (int i = 0; i < list.length; ++i) {
- list[i] = i * 1.0;
+ var counter;
+ final list = new Float32List(12);
+ for (int i = 0; i < list.length; ++i) {
+ list[i] = i * 1.0;
+ }
+ if (Platform.supportsSimd) {
+ counter = new Float32x4.zero();
+ final simdlist = new Float32x4List.view(list.buffer);
+ for (int i = 0; i < simdlist.length; ++i) {
+ counter += simdlist[i];
}
- if (Platform.supportsSimd) {
- counter = new Float32x4.zero();
- final simdlist = new Float32x4List.view(list.buffer);
- for (int i = 0; i < simdlist.length; ++i) {
- counter += simdlist[i];
- }
- } else {
- counter = new MyFloat32x4();
- for (int i = 0; i < list.length; i += 4) {
- counter.x += list[i];
- counter.y += list[i+1];
- counter.z += list[i+2];
- counter.w += list[i+3];
- }
+ } else {
+ counter = new MyFloat32x4();
+ for (int i = 0; i < list.length; i += 4) {
+ counter.x += list[i];
+ counter.y += list[i + 1];
+ counter.z += list[i + 2];
+ counter.w += list[i + 3];
}
- expect(counter.x, floatEquals(12.0));
- expect(counter.y, floatEquals(15.0));
- expect(counter.z, floatEquals(18.0));
- expect(counter.w, floatEquals(21.0));
+ }
+ expect(counter.x, floatEquals(12.0));
+ expect(counter.y, floatEquals(15.0));
+ expect(counter.z, floatEquals(18.0));
+ expect(counter.w, floatEquals(21.0));
});
test('test Int32x4', () {
- if (Platform.supportsSimd) {
- final val = new Int32x4(1, 2, 3, 4);
- expect(val.x, equals(1));
- expect(val.y, equals(2));
- expect(val.z, equals(3));
- expect(val.w, equals(4));
- final val2 = val ^ val;
- expect(val2.x, equals(0));
- expect(val2.y, equals(0));
- expect(val2.z, equals(0));
- expect(val2.w, equals(0));
- }
+ if (Platform.supportsSimd) {
+ final val = new Int32x4(1, 2, 3, 4);
+ expect(val.x, equals(1));
+ expect(val.y, equals(2));
+ expect(val.z, equals(3));
+ expect(val.w, equals(4));
+ final val2 = val ^ val;
+ expect(val2.x, equals(0));
+ expect(val2.y, equals(0));
+ expect(val2.z, equals(0));
+ expect(val2.w, equals(0));
+ }
});
}

Powered by Google App Engine
This is Rietveld 408576698