Age | Commit message (Collapse) | Author |
|
`BS_LIST` would be a constant. `BS_List` is a type name.
|
|
This is now a style rule: you can only use typedef'd function types.
Previous rules now applied in `onion_*.c`:
* `struct`s must have a name (typedef of unnamed struct is not allowed).
* `++i` for increment-stmt, not `i++`, e.g. in loops.
* Only a single declarator per struct member declaration.
* Type_Names vs. variable_names.
|
|
Also:
* No inner structs.
* One declarator per member declaration.
* Function names are snake_case.
* Names ending in `_cb` are function types.
* `++i` is preferred over `i++`.
|
|
Also use `net_pack_u16` in that function instead of manual ntohs+memcpy
and `net_unpack_u16` in its receiving counterpart.
|
|
We used to pass the actual peer numbers of peers leaving, but we no
longer know these in the PGC world, so we don't pass them anymore.
|
|
Also, renamed simple_conference_test to conference_simple_test so it's
sorted together with the other conference tests.
Next step is to use run_auto_test.h for the conference test.
|
|
|
|
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.
|
|
Most of the auto-tests should use this fixture, but I've only done a few
to set an example.
|
|
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
|
|
|
|
These can serve as documentation until we write actual api docs, probably
using apidsl.
|
|
Have one script per build. This means more duplication between the
scripts, but it's much easier to understand and to run locally.
|
|
|
|
|
|
These display some idea, but the tests are not implemented correctly. We
will need to implement the idea correctly later, but for now we can't use
these.
|
|
|
|
* Consistently use `num_packets_array` to get the packet count in the
packet buffer.
* Use `const` in more places.
* Typo fix: begginning.
* Rewrite `length < 1` for unsigned int to `length == 0`.
* Limit scope of some loop variables by using for-init-decl.
* Use early return in error paths to reduce indentation and for clarity.
* Use `net_unpack_*` instead of manual `ntohs`.
* Fix an uninitialised stack variable copy.
* Fix a potential null pointer dereference.
* Consistently use `get_crypto_connection`. It was inlined in some
places. I de-inlined it now.
* Add Loggers to some functions in preparation for adding log statements.
|
|
Mostly documentation + comments. Some cases where code was removed
in exchange for more compact/less sprawly for loops. Introduced a
function that removed like 30 lines of repeated code.
|
|
|
|
Rename args `host:port` from `address:port`.
The *address* is well known as *Tox Address* in this project. Then we
should reserve *addres* to it, and use *host* to express the hostname or
IP address in TCP domain.
|
|
|
|
|
|
These were deleted earlier.
|
|
|
|
Fixes #946.
|
|
It's annoying to have a test touch every source file. It causes a
recompile of everything after every test run.
|
|
|
|
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
|
|
This one has ASAN enabled, unlike Travis.
|
|
In preparation for adding log statements.
Also, fix an uninitialised variable warning in cppcheck.
|
|
In Persistent Group Chats (PGC), this will cause a use-after-free. This
test ensures that we fix this bug before merging PGC.
|
|
Currently, toxcore does not support UDP over proxies. In the future, we
can relax this by disabling UDP only if the proxy doesn't support it.
|
|
The C compiler warns because the value is initialised in a loop and used
outside of it. In this case, it's always initialised, but changing the
value of `NUM_PORTS` can change that.
|
|
|
|
I.e. make tox_new(0, 0) behave the same as tox_new(tox_options_new(0), 0).
Changing defaults in the options does not currently affect NULL options.
|
|
This can be used as a random stress test for toxcore.
Adjust the weights to make certain actions more or less likely.
|
|
Related: https://github.com/qTox/qTox/issues/5174
|
|
Better error messages, better sleep() call placements, etc.
Did not modify large chunk of function because I couldn't explain
it. Maybe I'll come back later once I've regained lost brain cells.
|
|
It was a list of #defines, but clearly this is a discrete and limited set
of named values, so an enum is more appropriate.
|
|
|
|
Tests all ports instead of just one, also adds some comments/changes
error messages to be more descriptive
|
|
This triggers a code path in Persistent Group Chats that causes a memory
leak. I'm adding this test now, so that we don't merge PGC without fixing
the memory leak first.
|
|
This test has never caught a bug. It's better to catch these with asan or
the likes.
|
|
`-fsanitize=address` also needs to be passed to the linker.
|
|
By making it run in a port range far away from other tests. This test
creates 100 DHTs and makes either itself or other tests run out of ports.
|
|
|
|
|
|
|
|
|