PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/test/kilim/test/ex/ExTaskArgTypes.java

http://github.com/kilim/kilim
Java | 32 lines | 27 code | 4 blank | 1 comment | 10 complexity | 2ef9efd8820f534eb75e623b331f7113 MD5 | raw file
 1package kilim.test.ex;
 2
 3import kilim.Pausable;
 4import kilim.Task;
 5
 6public class ExTaskArgTypes extends Task {
 7    
 8    public void execute() throws Pausable {
 9        int i = 99;
10        double d = Math.PI;
11        String s = "foobar";
12        long l = Long.MAX_VALUE;
13        float f = 10.5f;
14        check(f, l, s, d, i);
15//        Task.yield();
16        assert i == 99 : "Int wrong";
17        assert d == Math.PI: "Double wrong";
18        assert s == "foobar" : "String wrong";
19        assert l == Long.MAX_VALUE : "Long wrong";
20        assert f == 10.5f: "Float wrong";
21        Task.exit("Done");
22    }
23 
24    void check(float f, long l, Object s, double d, int i) throws Pausable {
25        assert d == Math.PI;
26        assert l == Long.MAX_VALUE;
27        assert f == 10.5f;
28        Task.yield();
29        assert i == 99;
30        assert l == Long.MAX_VALUE;
31    }
32}