Commit Graph

12 Commits

Author SHA1 Message Date
iphydf
9c22e79cc8 test(support): add SimulatedEnvironment for deterministic testing
Introduces a new testing support library 'testing/support' that provides
a clean, modular, and fully deterministic environment for testing
toxcore components.
2026-01-07 13:06:18 +00:00
iphydf
34ec822da7 cleanup: Fix some clang-19 format warnings. 2025-07-13 12:26:15 +00:00
iphydf
4626c2e230 test: Add a Net_Crypto fuzz test. 2025-02-05 19:45:48 +00:00
iphydf
463eeae114 cleanup: Avoid clashing with global define DEBUG.
Some systems define this, breaking our test code.
2025-01-22 23:52:44 +00:00
Maxim Biro
0ec4978de5 refactor: Don't expose Tox_System in the public API
It makes no sense to include it in the public API as clients can't make
any meaningful use of it via public API, it can only be used if one also
includes other internal/private headers that we don't install.

It's used only in the testing code, which has access to the internal
headers.

Fixes #2739, at least to some degree. I decided against moving things to
a separate `tox_testing.h` and leaving only things in `tox_private.h`
that we are fine with clients using, as otherwise `tox_lock()` /
`tox_unlock()` would have to be moved out of `tox_private.h` to
somewhere else, but `tox_private.h` actually sounds like the right place
for them, naming-wise. So perhaps it's fine if we have things in
`tox_private.h` that we don't want clients to use.
2024-03-17 11:22:43 -04:00
iphydf
5bdaaaedb6 refactor: Remove Tox * from tox_dispatch.
User data can contain a tox instance if it needs to.
2024-02-04 20:18:26 +00:00
iphydf
4359e3a6bc chore: Rename C++ headers to .hh suffixes.
This helps formatters and other dump (simple) tools know what's C++ and
what's C.
2024-02-01 23:44:37 +00:00
iphydf
4cea4f9ca4 fix: Make all the fuzzers work again, and add a test for protodump.
fuzz_select_target wasn't selecting anything, so fuzzers using that
function either did nothing or would only ever select one of the
functions.
2024-01-13 15:06:30 +00:00
iphydf
32b68cffca cleanup: Some more test cleanups, removing overly smart code. 2024-01-10 12:42:37 +00:00
iphydf
a549807df7 refactor: Add mem module to allow tests to override allocators.
This will allow us to do more interesting things with memory allocation
within toxcore, and allow fuzzers to explore various allocation failure
paths.
2023-08-30 22:55:05 +00:00
iphydf
2e02d56379 chore: Add missing module dependencies.
Also flip some callback asserts, because they can be reached by fuzzing
eventually.

Also update the bootstrapd checksum, since the alpine image changed a
bit.
2023-08-10 21:01:17 +00:00
iphydf
50094b7385 test: Add a protocol dump test to generate initial fuzzer input. 2022-04-19 23:42:47 +00:00