PageRenderTime 18ms CodeModel.GetById 1ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 1ms

/test/kilim/test/ex/ExYieldBase.java

http://github.com/kilim/kilim
Java | 95 lines | 75 code | 20 blank | 0 comment | 18 complexity | 3ba3bcb6230d1f0258e79928b5ff0e88 MD5 | raw file
 1package kilim.test.ex;
 2
 3import kilim.Task;
 4
 5public class ExYieldBase extends Task {
 6    public static int        fi          = 10;
 7    public static double     fd          = 10.0;
 8    public static long       fl          = 10L;
 9    public static float      ff          = 10.0f;
10    public static char       fc          = 10;
11    public static byte       fb          = 10;
12    public static short      fsh         = 10;
13    public static String     fs          = "10";
14    public static String[][] fa          = { { "10" } };
15
16    public boolean doPause = false;
17    
18    public int testCase; // set by TestYield.runTask
19
20    public static void verify(int i) {
21    	verify(i, fi);
22    }
23
24    public static void verify(int i, int compareTo) {
25        if (i != compareTo) {
26            throw new RuntimeException("i = " + i);
27        }
28    }
29    
30    public static void verify(short s, short compareTo) {
31        if (s != compareTo) {
32            throw new RuntimeException("s = " + s);
33        }
34    }
35    
36    public static void verify(short s) {
37    	verify(s, fsh);
38    }
39
40    
41    public static void verify(double d) {
42    	verify(d, fd);
43    }
44    
45    public static void verify(double d, double compareTo) {
46        if (d != compareTo) {
47            throw new RuntimeException("d = " + d);
48        }
49    }
50
51    public static void verify(long l) {
52    	verify(l, fl);
53    }
54
55    public static void verify(long l, long compareTo) {
56        if (l != compareTo) {
57            throw new RuntimeException("l = " + l);
58        }
59    }
60
61    public static void verify(char c) {
62        if (c != fc) {
63            throw new RuntimeException("c = " + c);
64        }
65    }
66
67    
68    public static void verify(float f) {
69    	verify(f, ff);
70    }
71    
72    public static void verify(float f, float compareTo) {
73        if (f != compareTo) {
74            throw new RuntimeException("f = " + f);
75        }
76    }
77
78    public static void verify(byte b) {
79        if (b != fb) {
80            throw new RuntimeException("b = " + b);
81        }
82    }
83
84    public static void verify(String s) {
85        if (s != fs) {
86            throw new RuntimeException("s = " + s);
87        }
88    }
89
90    public static void verify(String[][] a) {
91        if (a != fa) {
92            throw new RuntimeException("a = " + a);
93        }
94    }
95}