Commit Graph

7 Commits

Author SHA1 Message Date
iphydf
f98137d697
refactor: Move tox_new_log to auto_test_support.
This is only used in auto tests.
2022-02-21 17:39:10 +00:00
iphydf
6b75f8b889
chore: Remove config.h.
This aligns the autotools build with the cmake build, which doesn't have
a config.h file. It also removes the ambiguity of config.h and
other/bootstrap_daemon/src/config.h.
2021-12-15 10:26:50 +00:00
iphydf
94b06818fb
Use do-while instead of while in tests.
This forces all the loop bodies to be executed at least once, which is
harmless since it just means one more tox event loop iteration. This
reduces the jitter we see in coverage measurements, which is partially
caused by loops sometimes being entered and sometimes not (because their
condition happens to randomly already be true).
2018-08-25 15:25:33 +00:00
iphydf
7245ac11ef
Avoid implementations in .h files or #including .c files.
Also, avoid the need for putting `_XOPEN_SOURCE` in every test file.
2018-07-21 20:44:26 +00:00
hugbubby
47a527509d
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.
2018-07-06 10:25:47 +00:00
iphydf
3dc8cf6df8
Disable lan discovery in most tests. 2018-02-18 21:32:28 +00:00
iphydf
8a0e98bab8
Fix LAN discovery on FreeBSD.
Also, add an auto-test for bootstrap and for LAN discovery.

Bootstrap is never tested otherwise, and LAN discovery is a prerequisite
for everything else. Having these two tests lets us rule out or identify
LAN discovery as a possible cause for test failures.
2018-02-08 14:57:34 +00:00