Index: tests/lib_strong/html/typed_arrays_simd_test.dart |
diff --git a/tests/lib_strong/html/typed_arrays_simd_test.dart b/tests/lib_strong/html/typed_arrays_simd_test.dart |
index 5de04dd76e017fd90f5cff90c920cd8309015f78..3f4919a6f27cd9a5ffc0ee447b6344183584d02b 100644 |
--- a/tests/lib_strong/html/typed_arrays_simd_test.dart |
+++ b/tests/lib_strong/html/typed_arrays_simd_test.dart |
@@ -24,59 +24,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)); |
+ } |
}); |
} |