-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexam.cc
50 lines (44 loc) · 863 Bytes
/
exam.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <cstdlib>
#include <cln/io.h>
#include <cln/real.h>
using namespace std;
using namespace cln;
extern int test_integer();
extern int test_rational();
extern int test_sfloat();
extern int test_ffloat();
extern int test_dfloat();
extern int test_lfloat();
int test_elementary (void)
{
int error = 0;
error |= test_integer();
error |= test_rational();
error |= test_sfloat();
error |= test_ffloat();
error |= test_dfloat();
error |= test_lfloat();
return error;
}
extern int test_gcd (void);
extern int test_xgcd (void);
extern int test_sqrtp (void);
int test_all (void)
{
int error = 0;
error |= test_elementary();
error |= test_gcd();
error |= test_xgcd();
error |= test_sqrtp();
return error;
}
int main ()
{
if (!test_all()) {
cout << "Tests passed." << endl;
exit(0);
} else {
cout << "Tests failed" << endl;
exit(1);
}
}