OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import fletch.*; | 5 import dartino.*; |
6 | 6 |
7 import java.io.FileInputStream; | 7 import java.io.FileInputStream; |
8 import java.io.FileNotFoundException; | 8 import java.io.FileNotFoundException; |
9 import java.io.IOException; | 9 import java.io.IOException; |
10 | 10 |
11 import java.util.List; | 11 import java.util.List; |
12 | 12 |
13 class ConformanceTest { | 13 class ConformanceTest { |
14 public static void main(String args[]) { | 14 public static void main(String args[]) { |
15 // Expecting a snapshot of the dart service code on the command line. | 15 // Expecting a snapshot of the dart service code on the command line. |
16 if (args.length != 1) { | 16 if (args.length != 1) { |
17 System.out.println("Usage: java ConformanceTest <snapshot>"); | 17 System.out.println("Usage: java ConformanceTest <snapshot>"); |
18 System.out.println(" or: java ConformanceTest <port>"); | 18 System.out.println(" or: java ConformanceTest <port>"); |
19 System.exit(1); | 19 System.exit(1); |
20 } | 20 } |
21 | 21 |
22 // Load libfletch.so. | 22 // Load libdartino.so. |
23 System.loadLibrary("fletch"); | 23 System.loadLibrary("dartino"); |
24 | 24 |
25 // Setup Fletch. | 25 // Setup Dartino. |
26 FletchApi.Setup(); | 26 DartinoApi.Setup(); |
27 FletchServiceApi.Setup(); | 27 DartinoServiceApi.Setup(); |
28 FletchApi.AddDefaultSharedLibrary("libfletch.so"); | 28 DartinoApi.AddDefaultSharedLibrary("libdartino.so"); |
29 | 29 |
30 int port = 0; | 30 int port = 0; |
31 try { | 31 try { |
32 port = Integer.parseInt(args[0]); | 32 port = Integer.parseInt(args[0]); |
33 } catch (NumberFormatException e) { | 33 } catch (NumberFormatException e) { |
34 // Since the argument is not a number we expect it to be the snapshot. | 34 // Since the argument is not a number we expect it to be the snapshot. |
35 } | 35 } |
36 | 36 |
37 if (port > 0) { | 37 if (port > 0) { |
38 System.out.println( | 38 System.out.println( |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 builder.initRoot(root, NodeBuilder.kSize); | 309 builder.initRoot(root, NodeBuilder.kSize); |
310 buildNode(root, 10); | 310 buildNode(root, 10); |
311 int depth = ConformanceService.depth(root); | 311 int depth = ConformanceService.depth(root); |
312 assert 10 == depth; | 312 assert 10 == depth; |
313 | 313 |
314 Node node = ConformanceService.createNode(10); | 314 Node node = ConformanceService.createNode(10); |
315 assert 24680 == node.computeUsed(); | 315 assert 24680 == node.computeUsed(); |
316 assert 10 == depth(node); | 316 assert 10 == depth(node); |
317 } | 317 } |
318 } | 318 } |
OLD | NEW |