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

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: 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..59a30bf8a12b8f7240ada7150734b26b9791b712 100644
--- a/tests/language/nan_identical_test.dart
+++ b/tests/language/nan_identical_test.dart
@@ -8,17 +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);
+ bdata.setFloat64(0, double.NAN);
+ bdata.setInt8(0, bdata.getInt8(0) ^ 1);
return bdata.getFloat64(0);
rmacnak 2016/03/23 22:12:11 var result = bdata.getFloat64(0); Expect.isTrue(re
regis 2016/03/23 22:42:59 Done.
}
-double createOtherNAN() {
- return uint64toDouble((1 << 64) - 2);
-}
-
main() {
var otherNAN = createOtherNAN();
for (int i = 0; i < 100; i++) {
« 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