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

Side by Side Diff: tests/language/math_vm_test.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/language/map_test.dart ('k') | tests/language/optimization_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Tests that the VM does not crash on weird corner cases of class Math. 4 // Tests that the VM does not crash on weird corner cases of class Math.
5 // VMOptions=--optimization_counter_threshold=100 5 // VMOptions=--optimization_counter_threshold=100
6 6
7 library math_vm_test; 7 library math_vm_test;
8 8
9 import 'dart:math'; 9 import 'dart:math';
10 10
11 class FakeNumber { 11 class FakeNumber {
12 const FakeNumber(); 12 const FakeNumber();
13 void toDouble() {} 13 void toDouble() {}
14 } 14 }
15 15
16 class MathTest { 16 class MathTest {
17 static bool testParseInt(x) { 17 static bool testParseInt(x) {
18 try { 18 try {
19 parseInt(x); // Expects string. 19 int.parse(x); // Expects string.
20 return true; 20 return true;
21 } catch (e) { 21 } catch (e) {
22 return false; 22 return false;
23 } 23 }
24 } 24 }
25 25
26 static bool testSqrt(x) { 26 static bool testSqrt(x) {
27 try { 27 try {
28 sqrt(x); // Expects number. 28 sqrt(x); // Expects number.
29 return true; 29 return true;
30 } catch (e) { 30 } catch (e) {
31 return false; 31 return false;
32 } 32 }
33 } 33 }
34 34
35 static void testMain() { 35 static void testMain() {
36 Expect.equals(false, testParseInt(5)); 36 Expect.equals(false, testParseInt(5));
37 Expect.equals(false, testSqrt(const FakeNumber())); 37 Expect.equals(false, testSqrt(const FakeNumber()));
38 } 38 }
39 } 39 }
40 main() { 40 main() {
41 for (int i = 0; i < 200; i++) { 41 for (int i = 0; i < 200; i++) {
42 MathTest.testMain(); 42 MathTest.testMain();
43 } 43 }
44 } 44 }
OLDNEW
« no previous file with comments | « tests/language/map_test.dart ('k') | tests/language/optimization_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698