OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 | 4 |
5 #library('MandelIsolateTest'); | 5 #library('MandelIsolateTest'); |
6 #import('dart:isolate'); | 6 #import('dart:isolate'); |
7 #import('../../../lib/unittest/unittest.dart'); | 7 #import('../../lib/unittest/unittest.dart'); |
8 | 8 |
9 final TERMINATION_MESSAGE = -1; | 9 final TERMINATION_MESSAGE = -1; |
10 final N = 100; | 10 final N = 100; |
11 final ISOLATES = 20; | 11 final ISOLATES = 20; |
12 | 12 |
13 main() { | 13 main() { |
14 test("Render Mandelbrot in parallel", () { | 14 test("Render Mandelbrot in parallel", () { |
15 final state = new MandelbrotState(); | 15 final state = new MandelbrotState(); |
16 state._validated.future.then(expectAsync1((result) { | 16 state._validated.future.then(expectAsync1((result) { |
17 expect(result).isTrue(); | 17 expect(result).isTrue(); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 Trv = Zrv * Zrv; | 144 Trv = Zrv * Zrv; |
145 Tiv = Ziv * Ziv; | 145 Tiv = Ziv * Ziv; |
146 } while (((Trv + Tiv) <= 4.0) && (--i > 0)); | 146 } while (((Trv + Tiv) <= 4.0) && (--i > 0)); |
147 | 147 |
148 result[x] = i; | 148 result[x] = i; |
149 } | 149 } |
150 return result; | 150 return result; |
151 } | 151 } |
152 } | 152 } |
OLD | NEW |