]> www.ginac.de Git - cln.git/blob - tests/exam.cc
cmake build: moved cl_config.h.cmake to `autoconf`
[cln.git] / tests / exam.cc
1 #include <cstdlib>
2 #include <cln/io.h>
3 #include <cln/real.h>
4
5 using namespace std;
6 using namespace cln;
7
8 extern int test_integer();
9 extern int test_rational();
10 extern int test_sfloat();
11 extern int test_ffloat();
12 extern int test_dfloat();
13 extern int test_lfloat();
14 extern int test_factorial();
15 extern int test_doublefactorial();
16
17 int test_elementary (void)
18 {
19         int error = 0;
20         error |= test_integer();
21         error |= test_rational();
22         error |= test_sfloat();
23         error |= test_ffloat();
24         error |= test_dfloat();
25         error |= test_lfloat();
26         return error;
27 }
28
29 extern int test_gcd (void);
30 extern int test_xgcd (void);
31 extern int test_sqrtp (void);
32
33 int test_all (void)
34 {
35         int error = 0;
36         error |= test_elementary();
37         error |= test_gcd();
38         error |= test_xgcd();
39         error |= test_sqrtp();
40         error |= test_factorial();
41         error |= test_doublefactorial();
42         return error;
43 }
44
45 int main ()
46 {
47         if (!test_all()) {
48                 cout << "Tests passed." << endl;
49                 exit(0);
50         } else {
51                 cout << "Tests failed" << endl;
52                 exit(1);
53         }
54 }