File: test.c

package info (click to toggle)
tthsum 1.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 424 kB
  • sloc: ansic: 4,142; makefile: 78
file content (72 lines) | stat: -rw-r--r-- 2,840 bytes parent folder | download | duplicates (2)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* vim: set ts=8 sts=4 sw=4 tw=80 noet: */
/*======================================================================
Copyright (C) 2004,2005,2009,2013 Walter Doekes <walter+tthsum@wjd.nu>
This file is part of tthsum.

tthsum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

tthsum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with tthsum.  If not, see <http://www.gnu.org/licenses/>.
======================================================================*/

#include <stdio.h>


extern int base32_test(unsigned*, unsigned*, unsigned*);
extern int endian_test(unsigned*, unsigned*, unsigned*);
extern int escape_test(unsigned*, unsigned*, unsigned*);
extern int getopt_test(unsigned*, unsigned*, unsigned*);
extern int read_test(unsigned*, unsigned*, unsigned*);
#ifdef USE_TEXTS
extern int texts_test(unsigned*, unsigned*, unsigned*);
#endif /* !USE_TEXTS */
extern int thex_test(unsigned*, unsigned*, unsigned*);
extern int tiger_test(unsigned*, unsigned*, unsigned*);
extern int types_test(unsigned*, unsigned*, unsigned*);
extern int utf8_test(unsigned*, unsigned*, unsigned*);


int main() {
	unsigned success = 0;
	unsigned failure = 0;
	unsigned warning = 0;

	printf("============================================\n");
	printf("  RUNNING TESTS\n");
	printf("--------------------------------------------\n");
	printf("  Language\n--------------------------------------------\n");
	endian_test(&success, &failure, &warning);
	types_test(&success, &failure, &warning);
	printf("--------------------------------------------\n");
	printf("  Util\n--------------------------------------------\n");
	base32_test(&success, &failure, &warning);
	escape_test(&success, &failure, &warning);
	getopt_test(&success, &failure, &warning);
	read_test(&success, &failure, &warning);
	utf8_test(&success, &failure, &warning);
	printf("--------------------------------------------\n");
	printf("  App\n--------------------------------------------\n");
#ifdef USE_TEXTS
	texts_test(&success, &failure, &warning);
#endif /* USE_TEXTS */
	tiger_test(&success, &failure, &warning);
	thex_test(&success, &failure, &warning);
	printf("--------------------------------------------\n");
	printf("  Tests completed: %u succeeded, %u failed\n",
		success, failure);
	if (warning)
		printf("                   %u warning(s)\n", warning);
	printf("============================================\n");

	if (failure)
		return 1;
	return 0;
}