Line | |
---|
1 | #include <stdlib.h> |
---|
2 | #include <glib.h> |
---|
3 | #include <gmodule.h> |
---|
4 | #include <check.h> |
---|
5 | #include "bitlbee.h" |
---|
6 | #include "testsuite.h" |
---|
7 | |
---|
8 | global_t global; /* Against global namespace pollution */ |
---|
9 | |
---|
10 | gboolean g_io_channel_pair(GIOChannel **ch1, GIOChannel **ch2) |
---|
11 | { |
---|
12 | int sock[2]; |
---|
13 | if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, sock) < 0) { |
---|
14 | perror("socketpair"); |
---|
15 | return FALSE; |
---|
16 | } |
---|
17 | |
---|
18 | *ch1 = g_io_channel_unix_new(sock[0]); |
---|
19 | *ch2 = g_io_channel_unix_new(sock[1]); |
---|
20 | return TRUE; |
---|
21 | } |
---|
22 | |
---|
23 | double gettime() |
---|
24 | { |
---|
25 | struct timeval time[1]; |
---|
26 | |
---|
27 | gettimeofday( time, 0 ); |
---|
28 | return( (double) time->tv_sec + (double) time->tv_usec / 1000000 ); |
---|
29 | } |
---|
30 | |
---|
31 | /* From check_util.c */ |
---|
32 | Suite *util_suite(void); |
---|
33 | |
---|
34 | /* From check_nick.c */ |
---|
35 | Suite *nick_suite(void); |
---|
36 | |
---|
37 | /* From check_md5.c */ |
---|
38 | Suite *md5_suite(void); |
---|
39 | |
---|
40 | int main (void) |
---|
41 | { |
---|
42 | int nf; |
---|
43 | SRunner *sr = srunner_create(util_suite()); |
---|
44 | srunner_add_suite(sr, nick_suite()); |
---|
45 | srunner_add_suite(sr, md5_suite()); |
---|
46 | srunner_run_all (sr, CK_NORMAL); |
---|
47 | nf = srunner_ntests_failed(sr); |
---|
48 | srunner_free(sr); |
---|
49 | return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; |
---|
50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.