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

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

Issue 386943004: Revert "Don't use a float32list as storage for simd." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « sdk/lib/_internal/lib/native_typed_data.dart ('k') | tests/lib/typed_data/int32x4_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_test.dart
diff --git a/tests/lib/typed_data/float32x4_test.dart b/tests/lib/typed_data/float32x4_test.dart
index 7e5753865e7730fbf9fe9f02d4e5a306d4447fcc..c7df4a3ba4b3ed41ef52bff19631f0dee06c1fe2 100644
--- a/tests/lib/typed_data/float32x4_test.dart
+++ b/tests/lib/typed_data/float32x4_test.dart
@@ -395,109 +395,6 @@ void testConstructor() {
Expect.equals(4.0, f.w);
}
-void testBadArguments() {
- Expect.throws(() => new Float32x4(null, 2.0, 3.0, 4.0),
- (e) => e is ArgumentError);
- Expect.throws(() => new Float32x4(1.0, null, 3.0, 4.0),
- (e) => e is ArgumentError);
- Expect.throws(() => new Float32x4(1.0, 2.0, null, 4.0),
- (e) => e is ArgumentError);
- Expect.throws(() => new Float32x4(1.0, 2.0, 3.0, null),
- (e) => e is ArgumentError);
- // Use local variable typed as "var" to avoid static warnings.
- var str = "foo";
- Expect.throws(() => new Float32x4(str, 2.0, 3.0, 4.0),
- (e) => e is ArgumentError || e is TypeError);
- Expect.throws(() => new Float32x4(1.0, str, 3.0, 4.0),
- (e) => e is ArgumentError || e is TypeError);
- Expect.throws(() => new Float32x4(1.0, 2.0, str, 4.0),
- (e) => e is ArgumentError || e is TypeError);
- Expect.throws(() => new Float32x4(1.0, 2.0, 3.0, str),
- (e) => e is ArgumentError || e is TypeError);
-}
-
-void testSpecialValues() {
-
- /// Same as Expect.identical, but also works with NaNs and -0.0 for dart2js.
- void checkEquals(expected, actual) {
- if (expected.isNaN) {
- Expect.isTrue(actual.isNaN);
- } else if (expected == 0.0 && expected.isNegative) {
- Expect.isTrue(actual == 0.0 && actual.isNegative);
- } else {
- Expect.equals(expected, actual);
- }
- }
-
- var pairs = [
- [0.0, 0.0],
- [5e-324, 0.0],
- [2.225073858507201e-308, 0.0],
- [2.2250738585072014e-308, 0.0],
- [0.9999999999999999, 1.0],
- [1.0, 1.0],
- [1.0000000000000002, 1.0],
- [4294967295.0, 4294967296.0],
- [4294967296.0, 4294967296.0],
- [4503599627370495.5, 4503599627370496.0],
- [9007199254740992.0, 9007199254740992.0],
- [1.7976931348623157e+308, double.INFINITY],
- [0.49999999999999994, 0.5],
- [4503599627370497.0, 4503599627370496.0],
- [9007199254740991.0, 9007199254740992.0],
- [double.INFINITY, double.INFINITY],
- [double.NAN, double.NAN],
- ];
-
- var conserved = [
- 1.401298464324817e-45,
- 1.1754942106924411e-38,
- 1.1754943508222875e-38,
- 0.9999999403953552,
- 1.0000001192092896,
- 8388607.5,
- 8388608.0,
- 3.4028234663852886e+38,
- 8388609.0,
- 16777215.0,
- ];
-
- var minusPairs = pairs.map((pair) {
- return [-pair[0], -pair[1]];
- });
- var conservedPairs = conserved.map((value) => [value, value]);
-
- var allTests = [pairs, minusPairs, conservedPairs].expand((x) => x);
-
- for (var pair in allTests) {
- var input = pair[0];
- var expected = pair[1];
- var f;
- f = new Float32x4(input, 2.0, 3.0, 4.0);
- checkEquals(expected, f.x);
- Expect.equals(2.0, f.y);
- Expect.equals(3.0, f.z);
- Expect.equals(4.0, f.w);
-
- f = new Float32x4(1.0, input, 3.0, 4.0);
- Expect.equals(1.0, f.x);
- checkEquals(expected, f.y);
- Expect.equals(3.0, f.z);
- Expect.equals(4.0, f.w);
-
- f = new Float32x4(1.0, 2.0, input, 4.0);
- Expect.equals(1.0, f.x);
- Expect.equals(2.0, f.y);
- checkEquals(expected, f.z);
- Expect.equals(4.0, f.w);
-
- f = new Float32x4(1.0, 2.0, 3.0, input);
- Expect.equals(1.0, f.x);
- Expect.equals(2.0, f.y);
- Expect.equals(3.0, f.z);
- checkEquals(expected, f.w);
- }
-}
main() {
for (int i = 0; i < 20; i++) {
@@ -524,7 +421,5 @@ main() {
testSqrt();
testReciprocal();
testReciprocalSqrt();
- testBadArguments();
- testSpecialValues();
}
}
« no previous file with comments | « sdk/lib/_internal/lib/native_typed_data.dart ('k') | tests/lib/typed_data/int32x4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698