summaryrefslogtreecommitdiff
path: root/auto_tests/lan_discovery_test.c
diff options
context:
space:
mode:
authorhugbubby <hugbubby@protonmail.com>2018-07-04 11:21:43 -0700
committeriphydf <iphydf@users.noreply.github.com>2018-07-06 10:25:47 +0000
commit47a527509d1b9855fcc1bafe33177d7ed726faf8 (patch)
tree9872c612caefee2f532f27fe75887f3df381c81d /auto_tests/lan_discovery_test.c
parent597f23bdd99e0962a6912231938543b42e6f43ab (diff)
lan_discovery_test and version_test cleanup
Removed a pointless declaration of a function in lan_discovery_test and cleaned up the one error message there. Did an entire restructuring of the version_test using macros that resulted in fewer lines of code but more thorough testing. Formatting of version_test.c back to old way, save comments and one change Missing space My greatest enemy Add `#include <cstdio>` for `std::printf`. Make tox.c unambiguously parseable. Rules: 1. Constants are uppercase names: THE_CONSTANT. 2. SUE[1] types start with an uppercase letter and have at least one lowercase letter in it: The_Type, THE_Type. 3. Function types end in "_cb": tox_friend_connection_cb. 4. Variable and function names are all lowercase: the_function. This makes it easier for humans reading the code to determine what an identifier means. I'm not convinced by the enum type name change, but I don't know a better rule. Currently, a lot of enum types are spelled like constants, which is confusing. [1] struct/union/enum Use run_auto_test.h test fixture for some auto-tests. Most of the auto-tests should use this fixture, but I've only done a few to set an example.
Diffstat (limited to 'auto_tests/lan_discovery_test.c')
-rw-r--r--auto_tests/lan_discovery_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/auto_tests/lan_discovery_test.c b/auto_tests/lan_discovery_test.c
index 237b51bb..3192fc28 100644
--- a/auto_tests/lan_discovery_test.c
+++ b/auto_tests/lan_discovery_test.c
@@ -10,7 +10,7 @@ int main(void)
10 Tox *tox1 = tox_new_log_lan(nullptr, nullptr, nullptr, /* lan_discovery */true); 10 Tox *tox1 = tox_new_log_lan(nullptr, nullptr, nullptr, /* lan_discovery */true);
11 Tox *tox2 = tox_new_log_lan(nullptr, nullptr, nullptr, /* lan_discovery */true); 11 Tox *tox2 = tox_new_log_lan(nullptr, nullptr, nullptr, /* lan_discovery */true);
12 12
13 printf("Waiting for LAN discovery"); 13 printf("Waiting for LAN discovery. This loop will attempt to run until successful.");
14 14
15 while (tox_self_get_connection_status(tox1) == TOX_CONNECTION_NONE || 15 while (tox_self_get_connection_status(tox1) == TOX_CONNECTION_NONE ||
16 tox_self_get_connection_status(tox2) == TOX_CONNECTION_NONE) { 16 tox_self_get_connection_status(tox2) == TOX_CONNECTION_NONE) {