summaryrefslogtreecommitdiff
path: root/auto_tests/invalid_tcp_proxy_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-16 22:46:02 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-21 20:44:26 +0000
commit7245ac11ef9be2420c8356c12acc79f93ea211bb (patch)
treee971c5c6e10c2310afe4b2cd80212feac9839f2a /auto_tests/invalid_tcp_proxy_test.c
parent7c2b95ef5e4ccdae01bd104aa7400294c9ea391b (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/invalid_tcp_proxy_test.c')
-rw-r--r--auto_tests/invalid_tcp_proxy_test.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/auto_tests/invalid_tcp_proxy_test.c b/auto_tests/invalid_tcp_proxy_test.c
index edbc3237..211b04eb 100644
--- a/auto_tests/invalid_tcp_proxy_test.c
+++ b/auto_tests/invalid_tcp_proxy_test.c
@@ -1,10 +1,14 @@
1// Test to make sure that when UDP is disabled, and we set an invalid proxy, 1// Test to make sure that when UDP is disabled, and we set an invalid proxy,
2// i.e. one that doesn't run a proxy server, then we don't get any connection. 2// i.e. one that doesn't run a proxy server, then we don't get any connection.
3#ifndef _XOPEN_SOURCE 3
4#define _XOPEN_SOURCE 600 4#ifdef HAVE_CONFIG_H
5#include "config.h"
5#endif 6#endif
6 7
7#include "helpers.h" 8#include <stdio.h>
9
10#include "../testing/misc_tools.h"
11#include "check_compat.h"
8 12
9static uint8_t const key[] = { 13static uint8_t const key[] = {
10 0x15, 0xE9, 0xC3, 0x09, 0xCF, 0xCB, 0x79, 0xFD, 14 0x15, 0xE9, 0xC3, 0x09, 0xCF, 0xCB, 0x79, 0xFD,
@@ -37,7 +41,9 @@ int main(void)
37 tox_iterate(tox, nullptr); 41 tox_iterate(tox, nullptr);
38 c_sleep(ITERATION_INTERVAL); 42 c_sleep(ITERATION_INTERVAL);
39 // None of the iterations should have a connection. 43 // None of the iterations should have a connection.
40 assert(tox_self_get_connection_status(tox) == TOX_CONNECTION_NONE); 44 const TOX_CONNECTION status = tox_self_get_connection_status(tox);
45 ck_assert_msg(status == TOX_CONNECTION_NONE,
46 "unexpectedly got a connection (%d)", status);
41 } 47 }
42 48
43 tox_kill(tox); 49 tox_kill(tox);