You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.4 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. #include <iostream>
  2. // Elementary operations.
  3. extern int test_I_abs (int iterations);
  4. extern int test_I_compare (int iterations);
  5. extern int test_I_plus (int iterations);
  6. extern int test_I_minus (int iterations);
  7. extern int test_I_plus1 (int iterations);
  8. extern int test_I_minus1 (int iterations);
  9. extern int test_I_mul (int iterations);
  10. extern int test_I_div (int iterations);
  11. // Euclidean ring operations.
  12. extern int test_I_gcd (int iterations);
  13. extern int test_I_xgcd (int iterations);
  14. // Bit vector operations.
  15. extern int test_I_ash (int iterations);
  16. extern int test_I_evenp (int iterations);
  17. extern int test_I_oddp (int iterations);
  18. extern int test_I_lognot (int iterations);
  19. extern int test_I_logand (int iterations);
  20. extern int test_I_logandc1 (int iterations);
  21. extern int test_I_logandc2 (int iterations);
  22. extern int test_I_logior (int iterations);
  23. extern int test_I_logorc1 (int iterations);
  24. extern int test_I_logorc2 (int iterations);
  25. extern int test_I_logxor (int iterations);
  26. extern int test_I_lognand (int iterations);
  27. extern int test_I_lognor (int iterations);
  28. extern int test_I_logeqv (int iterations);
  29. extern int test_I_boole (int iterations);
  30. extern int test_I_logbitp (int iterations);
  31. extern int test_I_logtest (int iterations);
  32. extern int test_I_ldb (int iterations);
  33. extern int test_I_ldb_test (int iterations);
  34. extern int test_I_mask_field (int iterations);
  35. extern int test_I_dpb (int iterations);
  36. extern int test_I_deposit_field (int iterations);
  37. extern int test_I_logcount (int iterations);
  38. extern int test_I_integer_length (int iterations);
  39. extern int test_I_ord2 (int iterations);
  40. extern int test_I_power2p (int iterations);
  41. // More complex operations.
  42. extern int test_I_isqrt (int iterations);
  43. extern int test_I_sqrtp (int iterations);
  44. // Miscellaneous.
  45. extern int test_I_io (int iterations);
  46. extern int test_I_GV (int iterations);
  47. #define RUN(tester,iterations) \
  48. std::cout << "Testing "#tester"..." << std::endl; \
  49. error |= tester (iterations);
  50. int test_I (int iterations)
  51. {
  52. int error = 0;
  53. // Elementary operations.
  54. RUN(test_I_abs,iterations);
  55. RUN(test_I_compare,iterations);
  56. RUN(test_I_plus,iterations);
  57. RUN(test_I_minus,iterations);
  58. RUN(test_I_plus1,iterations);
  59. RUN(test_I_minus1,iterations);
  60. RUN(test_I_mul,iterations);
  61. RUN(test_I_div,iterations);
  62. // Euclidean ring operations.
  63. RUN(test_I_gcd,iterations);
  64. RUN(test_I_xgcd,iterations);
  65. // Bit vector operations.
  66. RUN(test_I_ash,iterations);
  67. RUN(test_I_evenp,iterations);
  68. RUN(test_I_oddp,iterations);
  69. RUN(test_I_lognot,iterations);
  70. RUN(test_I_logand,iterations);
  71. RUN(test_I_logandc1,iterations);
  72. RUN(test_I_logandc2,iterations);
  73. RUN(test_I_logior,iterations);
  74. RUN(test_I_logorc1,iterations);
  75. RUN(test_I_logorc2,iterations);
  76. RUN(test_I_logxor,iterations);
  77. RUN(test_I_lognand,iterations);
  78. RUN(test_I_lognor,iterations);
  79. RUN(test_I_logeqv,iterations);
  80. RUN(test_I_boole,iterations);
  81. RUN(test_I_logbitp,iterations);
  82. RUN(test_I_logtest,iterations);
  83. RUN(test_I_ldb,iterations);
  84. RUN(test_I_ldb_test,iterations);
  85. RUN(test_I_mask_field,iterations);
  86. RUN(test_I_dpb,iterations);
  87. RUN(test_I_deposit_field,iterations);
  88. RUN(test_I_logcount,iterations);
  89. RUN(test_I_integer_length,iterations);
  90. RUN(test_I_ord2,iterations);
  91. RUN(test_I_power2p,iterations);
  92. // More complex operations.
  93. RUN(test_I_isqrt,iterations);
  94. RUN(test_I_sqrtp,iterations);
  95. // Miscellaneous.
  96. RUN(test_I_io,iterations);
  97. RUN(test_I_GV,iterations);
  98. return error;
  99. }