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

Side by Side Diff: tests/standalone_2/double_temp_test.dart

Issue 2984363004: Migrate first block of tests in standalone to standalone_2 (Closed)
Patch Set: Remove Expect.throws Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Test correct usage of inlined double temporary objects. 4 // Test correct usage of inlined double temporary objects.
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 main() { 8 main() {
9 for (int i = 0; i < 2000; i++) { 9 for (int i = 0; i < 2000; i++) {
10 testBinaryOp(); 10 testBinaryOp();
(...skipping 16 matching lines...) Expand all
27 // VM: temporary double should be used only for "-b", otherwise the 27 // VM: temporary double should be used only for "-b", otherwise the
28 // function would always return the same object. 28 // function would always return the same object.
29 double unary(double a, double b) { 29 double unary(double a, double b) {
30 return -(a * (-b)); 30 return -(a * (-b));
31 } 31 }
32 32
33 testUnaryOp() { 33 testUnaryOp() {
34 var x = unary(1.0, 2.0); 34 var x = unary(1.0, 2.0);
35 var y = unary(3.0, 4.0); 35 var y = unary(3.0, 4.0);
36 Expect.equals(2.0, x); 36 Expect.equals(2.0, x);
37 Expect.equals(12.0, y);
37 } 38 }
OLDNEW
« no previous file with comments | « tests/standalone_2/double_smi_comparison_test.dart ('k') | tests/standalone_2/double_to_int_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698