File: tests.cc

package info (click to toggle)
cln 1.3.7-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,996 kB
  • sloc: cpp: 80,860; sh: 5,138; ansic: 3,174; makefile: 1,274
file content (38 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (10)
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
#include <cstdlib>
#include <cstring>
#include <cln/io.h>

extern int test_I (int iterations);
extern int test_MI (int iterations);
extern int test_nt (int iterations);

using namespace std;
using namespace cln;

int test_all (int iterations)
{
	int error = 0;
	error |= test_I(iterations);
	error |= test_MI(iterations);
	error |= test_nt(iterations);
	return error;
}

int main (int argc, char* argv[])
{
	int iterations = 10000;
	if ((argc >= 3) && !::strcmp(argv[1],"-i")) {
		iterations = atoi(argv[2]);
		argc -= 2; argv += 2;
	}
	if (argc < 1)
		exit(1);

	if (!test_all(iterations)) {
		cout << "Tests passed." << endl;
		exit(0);
	} else {
		cout << "Tests failed." << endl;
		exit(1);
	}
}