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/conference_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/conference_test.c')
-rw-r--r-- | auto_tests/conference_test.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/auto_tests/conference_test.c b/auto_tests/conference_test.c index 706dad38..92e805c9 100644 --- a/auto_tests/conference_test.c +++ b/auto_tests/conference_test.c | |||
@@ -1,25 +1,19 @@ | |||
1 | /* Auto Tests: Conferences. | 1 | /* Auto Tests: Conferences. |
2 | */ | 2 | */ |
3 | 3 | ||
4 | #ifndef _XOPEN_SOURCE | ||
5 | #define _XOPEN_SOURCE 600 | ||
6 | #endif | ||
7 | |||
8 | #ifdef HAVE_CONFIG_H | 4 | #ifdef HAVE_CONFIG_H |
9 | #include "config.h" | 5 | #include "config.h" |
10 | #endif | 6 | #endif |
11 | 7 | ||
12 | #include "check_compat.h" | ||
13 | |||
14 | #include <inttypes.h> | ||
15 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <string.h> | ||
16 | #include <time.h> | 10 | #include <time.h> |
17 | 11 | ||
12 | #include "../testing/misc_tools.h" | ||
18 | #include "../toxcore/crypto_core.h" | 13 | #include "../toxcore/crypto_core.h" |
19 | #include "../toxcore/tox.h" | 14 | #include "../toxcore/tox.h" |
20 | #include "../toxcore/util.h" | 15 | #include "../toxcore/util.h" |
21 | 16 | #include "check_compat.h" | |
22 | #include "helpers.h" | ||
23 | 17 | ||
24 | #define NUM_GROUP_TOX 5 | 18 | #define NUM_GROUP_TOX 5 |
25 | #define GROUP_MESSAGE "Install Gentoo" | 19 | #define GROUP_MESSAGE "Install Gentoo" |
@@ -125,8 +119,8 @@ static void run_conference_tests(Tox **toxes, uint32_t *tox_index) | |||
125 | for (uint16_t i = 0; i < k - 1; ++i) { | 119 | for (uint16_t i = 0; i < k - 1; ++i) { |
126 | uint32_t peer_count = tox_conference_peer_count(toxes[i], 0, nullptr); | 120 | uint32_t peer_count = tox_conference_peer_count(toxes[i], 0, nullptr); |
127 | ck_assert_msg(peer_count == (k - 1), "\n\tBad number of group peers (post check)." | 121 | ck_assert_msg(peer_count == (k - 1), "\n\tBad number of group peers (post check)." |
128 | "\n\t\t\tExpected: %u but tox_instance(%u) only has: %" PRIu32 "\n\n", | 122 | "\n\t\t\tExpected: %u but tox_instance(%u) only has: %u\n\n", |
129 | (k - 1), i, peer_count); | 123 | k - 1, i, (unsigned)peer_count); |
130 | } | 124 | } |
131 | } | 125 | } |
132 | } | 126 | } |
@@ -240,8 +234,8 @@ static void test_many_group(void) | |||
240 | uint32_t peer_count = tox_conference_peer_count(toxes[i], 0, nullptr); | 234 | uint32_t peer_count = tox_conference_peer_count(toxes[i], 0, nullptr); |
241 | 235 | ||
242 | ck_assert_msg(peer_count == NUM_GROUP_TOX, "\n\tBad number of group peers (pre check)." | 236 | ck_assert_msg(peer_count == NUM_GROUP_TOX, "\n\tBad number of group peers (pre check)." |
243 | "\n\t\t\tExpected: %u but tox_instance(%u) only has: %" PRIu32 "\n\n", | 237 | "\n\t\t\tExpected: %u but tox_instance(%u) only has: %u\n\n", |
244 | NUM_GROUP_TOX, i, peer_count); | 238 | NUM_GROUP_TOX, i, (unsigned)peer_count); |
245 | 239 | ||
246 | uint8_t title[2048]; | 240 | uint8_t title[2048]; |
247 | size_t ret = tox_conference_get_title_size(toxes[i], 0, nullptr); | 241 | size_t ret = tox_conference_get_title_size(toxes[i], 0, nullptr); |