Index: runtime/tests/vm/dart/double_to_smi_test.dart |
diff --git a/runtime/tests/vm/dart/double_materialize_test.dart b/runtime/tests/vm/dart/double_to_smi_test.dart |
similarity index 58% |
copy from runtime/tests/vm/dart/double_materialize_test.dart |
copy to runtime/tests/vm/dart/double_to_smi_test.dart |
index 2cab01ca6be4925b8852ceff2b78fe231f1f502c..06d6139fb80ada70fc604e9b9aebb262836ad402 100644 |
--- a/runtime/tests/vm/dart/double_materialize_test.dart |
+++ b/runtime/tests/vm/dart/double_to_smi_test.dart |
@@ -6,18 +6,18 @@ |
import "package:expect/expect.dart"; |
-double f(double x, double five, dynamic y) { |
- double z = x + five; |
- var a = y + 5; |
- return z + a.toDouble(); |
+int convert(dynamic d) { |
+ return d.toInt(); |
} |
-void main() { |
- double x = 1.0; |
- for (int i = 0; i < 1000; i++) { |
- x = f(x, 5.0, i); |
+main() { |
+ double x = -100.0; |
+ int count = 0; |
+ while (x < 100.0) { |
+ count = count + convert(x); |
+ x = x + 0.5; |
} |
- x = f(x, 5.0, 1.0); |
- Expect.equals(509512.0, x); |
+ Expect.equals(-100, count); |
+ count = convert(42); |
+ Expect.equals(42, count); |
} |
- |