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_relay_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_relay_test.c')
-rw-r--r-- | auto_tests/tcp_relay_test.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/auto_tests/tcp_relay_test.c b/auto_tests/tcp_relay_test.c index d0c70934..54a28e4a 100644 --- a/auto_tests/tcp_relay_test.c +++ b/auto_tests/tcp_relay_test.c | |||
@@ -1,8 +1,11 @@ | |||
1 | #ifndef _XOPEN_SOURCE | 1 | #ifdef HAVE_CONFIG_H |
2 | #define _XOPEN_SOURCE 600 | 2 | #include "config.h" |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #include "helpers.h" | 5 | #include <stdio.h> |
6 | |||
7 | #include "../testing/misc_tools.h" | ||
8 | #include "check_compat.h" | ||
6 | 9 | ||
7 | static uint8_t const key[] = { | 10 | static uint8_t const key[] = { |
8 | 0x15, 0xE9, 0xC3, 0x09, 0xCF, 0xCB, 0x79, 0xFD, | 11 | 0x15, 0xE9, 0xC3, 0x09, 0xCF, 0xCB, 0x79, 0xFD, |
@@ -33,8 +36,10 @@ int main(void) | |||
33 | c_sleep(ITERATION_INTERVAL); | 36 | c_sleep(ITERATION_INTERVAL); |
34 | } | 37 | } |
35 | 38 | ||
36 | assert(tox_self_get_connection_status(tox_tcp) == TOX_CONNECTION_TCP); | 39 | const TOX_CONNECTION status = tox_self_get_connection_status(tox_tcp); |
37 | printf("Connection (TCP): %d\n", tox_self_get_connection_status(tox_tcp)); | 40 | ck_assert_msg(status == TOX_CONNECTION_TCP, |
41 | "expected TCP connection, but got %d", status); | ||
42 | printf("Connection (TCP): %d\n", status); | ||
38 | 43 | ||
39 | tox_kill(tox_tcp); | 44 | tox_kill(tox_tcp); |
40 | return 0; | 45 | return 0; |