diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-16 22:46:02 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-21 20:44:26 +0000 |
commit | 7245ac11ef9be2420c8356c12acc79f93ea211bb (patch) | |
tree | e971c5c6e10c2310afe4b2cd80212feac9839f2a /auto_tests/TCP_test.c | |
parent | 7c2b95ef5e4ccdae01bd104aa7400294c9ea391b (diff) |
Avoid implementations in .h files or #including .c files.
Also, avoid the need for putting `_XOPEN_SOURCE` in every test file.
Diffstat (limited to 'auto_tests/TCP_test.c')
-rw-r--r-- | auto_tests/TCP_test.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/auto_tests/TCP_test.c b/auto_tests/TCP_test.c index f5bc2471..07266543 100644 --- a/auto_tests/TCP_test.c +++ b/auto_tests/TCP_test.c | |||
@@ -1,27 +1,17 @@ | |||
1 | #ifndef _XOPEN_SOURCE | ||
2 | #define _XOPEN_SOURCE 600 | ||
3 | #endif | ||
4 | |||
5 | #ifdef HAVE_CONFIG_H | 1 | #ifdef HAVE_CONFIG_H |
6 | #include "config.h" | 2 | #include "config.h" |
7 | #endif | 3 | #endif |
8 | 4 | ||
9 | #include "check_compat.h" | ||
10 | |||
11 | #include <stdint.h> | ||
12 | #include <stdlib.h> | 5 | #include <stdlib.h> |
13 | #include <string.h> | 6 | #include <string.h> |
14 | #include <sys/types.h> | ||
15 | #include <time.h> | ||
16 | 7 | ||
8 | #include "../testing/misc_tools.h" | ||
17 | #include "../toxcore/TCP_client.h" | 9 | #include "../toxcore/TCP_client.h" |
18 | #include "../toxcore/TCP_server.h" | 10 | #include "../toxcore/TCP_server.h" |
19 | |||
20 | #include "../toxcore/crypto_core.h" | 11 | #include "../toxcore/crypto_core.h" |
21 | #include "../toxcore/mono_time.h" | 12 | #include "../toxcore/mono_time.h" |
22 | #include "../toxcore/util.h" | 13 | #include "../toxcore/util.h" |
23 | 14 | #include "check_compat.h" | |
24 | #include "helpers.h" | ||
25 | 15 | ||
26 | #define NUM_PORTS 3 | 16 | #define NUM_PORTS 3 |
27 | 17 | ||
@@ -836,8 +826,6 @@ int main(void) | |||
836 | { | 826 | { |
837 | setvbuf(stdout, nullptr, _IONBF, 0); | 827 | setvbuf(stdout, nullptr, _IONBF, 0); |
838 | 828 | ||
839 | srand((unsigned int) time(nullptr)); | ||
840 | |||
841 | Suite *TCP = TCP_suite(); | 829 | Suite *TCP = TCP_suite(); |
842 | SRunner *test_runner = srunner_create(TCP); | 830 | SRunner *test_runner = srunner_create(TCP); |
843 | 831 | ||