/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

  1. package kilim.test.ex;
  2. import kilim.Task;
  3. public class ExYieldBase extends Task {
  4. public static int fi = 10;
  5. public static double fd = 10.0;
  6. public static long fl = 10L;
  7. public static float ff = 10.0f;
  8. public static char fc = 10;
  9. public static byte fb = 10;
  10. public static short fsh = 10;
  11. public static String fs = "10";
  12. public static String[][] fa = { { "10" } };
  13. public boolean doPause = false;
  14. public int testCase; // set by TestYield.runTask
  15. public static void verify(int i) {
  16. verify(i, fi);
  17. }
  18. public static void verify(int i, int compareTo) {
  19. if (i != compareTo) {
  20. throw new RuntimeException("i = " + i);
  21. }
  22. }
  23. public static void verify(short s, short compareTo) {
  24. if (s != compareTo) {
  25. throw new RuntimeException("s = " + s);
  26. }
  27. }
  28. public static void verify(short s) {
  29. verify(s, fsh);
  30. }
  31. public static void verify(double d) {
  32. verify(d, fd);
  33. }
  34. public static void verify(double d, double compareTo) {
  35. if (d != compareTo) {
  36. throw new RuntimeException("d = " + d);
  37. }
  38. }
  39. public static void verify(long l) {
  40. verify(l, fl);
  41. }
  42. public static void verify(long l, long compareTo) {
  43. if (l != compareTo) {
  44. throw new RuntimeException("l = " + l);
  45. }
  46. }
  47. public static void verify(char c) {
  48. if (c != fc) {
  49. throw new RuntimeException("c = " + c);
  50. }
  51. }
  52. public static void verify(float f) {
  53. verify(f, ff);
  54. }
  55. public static void verify(float f, float compareTo) {
  56. if (f != compareTo) {
  57. throw new RuntimeException("f = " + f);
  58. }
  59. }
  60. public static void verify(byte b) {
  61. if (b != fb) {
  62. throw new RuntimeException("b = " + b);
  63. }
  64. }
  65. public static void verify(String s) {
  66. if (s != fs) {
  67. throw new RuntimeException("s = " + s);
  68. }
  69. }
  70. public static void verify(String[][] a) {
  71. if (a != fa) {
  72. throw new RuntimeException("a = " + a);
  73. }
  74. }
  75. }