Age | Commit message (Collapse) | Author |
|
* Moved PAIR to toxav, where it's used (but really this should die).
* Replace most MIN calls with typed `min_*` calls. Didn't replace the
ones where the desired semantics are unclear. Moved the MIN macro to
the one place where it's still used.
* Avoid assignments in `while` loops. Instead, factored out the loop body
into a separate `bool`-returning function.
* Use named types for callbacks (`_cb` types).
* Avoid assignments in `if` conditions.
* Removed `MAKE_REALLOC` and expanded its two calls. We can't have
templates in C, and this fake templating is ugly and hard to analyse
and debug (it expands on a single line).
* Moved epoll system include to the .c file, out of the .h file.
* Avoid assignments in expressions (`a = b = c;`).
* Avoid multiple declarators per struct member declaration.
* Fix naming inconsistencies.
* Replace `net_to_host` macro with function.
|
|
* Removed `ARRAY_SIZE` and use NULL markers for end of array, instead.
The alternative is + size, but for these arrays, NULL markers made
sense, since they are arrays of non-null pointers.
* Made `INDEX_OF_PK` a self-contained macro, not dependent upon the
naming inside its call site. This is a minor change but makes the code
more local and reviews easier.
* No nested structs.
* Use only named function types ending in `_cb` for callbacks.
* Replaced two macros with functions.
* `++i` instead of `i++`.
* struct member names start with lowercase letters.
* It takes a bit of work to support `/**/` comments in preprocessor
macros, so I've decided not to support these. If a macro is complex
enough to need comments inside it, it's too complex. `//` comments are
allowed at the end of macro definitions.
* Callback typedefs must name their parameters.
|
|
It turns out, `unix_time` is also monotonic, and is used as such, so I've
renamed the new functions to `mono_time_*`.
2018-07-08:
```
00:01 <@irungentoo> the idea used to be that the unix_time() function
could go backward in time but I think I might have started using it like
if it could not after I changed it so that it would never go back in time
```
|
|
`BS_LIST` would be a constant. `BS_List` is a type name.
|
|
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 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.
|
|
|
|
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.
|
|
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
|
|
This one has ASAN enabled, unlike Travis.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
Fixes #900.
|
|
The Family stuff in toxcore is a big mess. I'm sure I saw a bunch of bugs
on the way, but I'm not verifying that code now, so the bugs stay.
|
|
|
|
Windows doesn't report network errors though errno, it has its own facilities.
|
|
|
|
We control the random functions in crypto_core, so we can make them
deterministic more easily. This will help test reproducibility in the
future.
|
|
|
|
Makes debugging easier.
|
|
It's not supported in mingw.
See https://github.com/TokTok/c-toxcore/issues/786.
|
|
By increasing a magic number.. Also, added more verbose logging to the
file transfer test.
|
|
|
|
|
|
|
|
This is needed for libvpx to work on android.
This also means that we can upload our test binaries to an android device
and actually run them, now that libcheck is no longer a blocker.
|
|
We can now revert the changes to the callbacks and keep supporting them
until clients have moved off them.
|
|
net_crypto has pthread types in its struct, so its size is system
dependent. In particular, the sizes are wrong on FreeBSD.
|
|
|
|
|
|
|
|
|
|
|
|
This forces us to record size changes (for LP64) and helps estimate
memory consumption of internal data structures.
|
|
Instead of 1 FT blocking all others.
|
|
|