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

Unified Diff: tests/language/nan_identical_test.dart

Issue 1830563003: Fix language test that failed on mips hardware, because the created NaN happened (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comment Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/nan_identical_test.dart
diff --git a/tests/language/nan_identical_test.dart b/tests/language/nan_identical_test.dart
index 5f171be5c4c6ba6893663414bd65f82cbeb0239b..07b66f34d88572f897a8bb4bcbdba02799145a0b 100644
--- a/tests/language/nan_identical_test.dart
+++ b/tests/language/nan_identical_test.dart
@@ -8,15 +8,14 @@ import 'dart:typed_data';
import "package:expect/expect.dart";
-double uint64toDouble(int i) {
+double createOtherNAN() {
var buffer = new Uint8List(8).buffer;
var bdata = new ByteData.view(buffer);
- bdata.setUint64(0, i);
- return bdata.getFloat64(0);
-}
-
-double createOtherNAN() {
- return uint64toDouble((1 << 64) - 2);
+ bdata.setFloat64(0, double.NAN);
+ bdata.setInt8(7, bdata.getInt8(7) ^ 1); // Flip bit 0, big endian.
+ double result = bdata.getFloat64(0);
+ Expect.isTrue(result.isNaN);
+ return result;
}
main() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698