]> www.ginac.de Git - cln.git/blob - tests/exam.cc
Make GCC compiler flags default to -O
[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
15 int test_elementary (void)
16 {
17         int error = 0;
18         error |= test_integer();
19         error |= test_rational();
20         error |= test_sfloat();
21         error |= test_ffloat();
22         error |= test_dfloat();
23         error |= test_lfloat();
24         return error;
25 }
26
27 extern int test_gcd (void);
28 extern int test_xgcd (void);
29 extern int test_sqrtp (void);
30
31 int test_all (void)
32 {
33         int error = 0;
34         error |= test_elementary();
35         error |= test_gcd();
36         error |= test_xgcd();
37         error |= test_sqrtp();
38         return error;
39 }
40
41 int main ()
42 {
43         if (!test_all()) {
44                 cout << "Tests passed." << endl;
45                 exit(0);
46         } else {
47                 cout << "Tests failed" << endl;
48                 exit(1);
49         }
50 }