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.

50 lines
864 B

25 years ago
25 years ago
25 years ago
25 years ago
  1. #include <stdlib.h>
  2. #include <cln/io.h>
  3. #include <cln/real.h>
  4. using namespace std;
  5. using namespace cln;
  6. extern int test_integer();
  7. extern int test_rational();
  8. extern int test_sfloat();
  9. extern int test_ffloat();
  10. extern int test_dfloat();
  11. extern int test_lfloat();
  12. int test_elementary (void)
  13. {
  14. int error = 0;
  15. error |= test_integer();
  16. error |= test_rational();
  17. error |= test_sfloat();
  18. error |= test_ffloat();
  19. error |= test_dfloat();
  20. error |= test_lfloat();
  21. return error;
  22. }
  23. extern int test_gcd (void);
  24. extern int test_xgcd (void);
  25. extern int test_sqrtp (void);
  26. int test_all (void)
  27. {
  28. int error = 0;
  29. error |= test_elementary();
  30. error |= test_gcd();
  31. error |= test_xgcd();
  32. error |= test_sqrtp();
  33. return error;
  34. }
  35. int main ()
  36. {
  37. if (!test_all()) {
  38. cout << "Tests passed." << endl;
  39. exit(0);
  40. } else {
  41. cout << "Tests failed" << endl;
  42. exit(1);
  43. }
  44. }