Chromium Code Reviews| 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..9f21d5ce734115fd8d39460025087481225a8f47 100644 |
| --- a/runtime/tests/vm/dart/double_materialize_test.dart |
| +++ b/runtime/tests/vm/dart/double_to_smi_test.dart |
| @@ -6,18 +6,16 @@ |
| 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(double 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); |
|
Florian Schneider
2016/07/20 16:22:02
Maybe also add a case where you pass a smi, or oth
zra
2016/07/20 16:46:23
Done.
|
| } |
| - |