summaryrefslogtreecommitdiff
path: root/auto_tests
AgeCommit message (Collapse)Author
2018-08-19Make the save_compatibility_test work with bazel.iphydf
2018-08-19Add save file generator, save compatibility test, and generate a save fileendoffile78
2018-08-16Use per-instance `Mono_Time` for Messenger and onion.iphydf
2018-08-16Reduce the number of times `unix_time_update` is called.iphydf
Reduced by, e.g.: * `file_transfer_test`: 33% of the `clock_gettime` calls. * `tox_many_test`: 53% of the `clock_gettime` calls. Other tests will see similar improvements. Real world applications will be closer to 40-50% improvement, since tox_many_test has 100 nodes, while file_transfer_test has 2 nodes.
2018-08-16Limit the size of a save file in file_saving_test.iphydf
Limited to 4GiB. That ought to be enough for any save file.
2018-08-16Prune long long warnings.Leonid Bobrov
2018-08-13Fix some printf format specifiers.iphydf
2018-08-12add callback for successful connection to a conferencezugz (tox)
2018-08-12Fix a few warnings from clang.iphydf
Also remove the use of a VLA in a context where there can be unbounded memory allocations.
2018-08-12Check that the save file size isn't larger than our address space.iphydf
2018-08-02Fix problems with initial connections and name-setting in conferenceszugz
* test names in conference_test * raise error on attempt to invite friend to group before we are connected * revise handling of temporary invited connections We are now careful not to prematurely delete a connection to a peer established during the invitation process; namely, before we have sufficient other connections and have confirmed that we have an alternative route to the peer. * process out-of-order messages from a peer * don't reset names when handling a Peer Response
2018-07-30Fix autotools buildhugbubby
Mosts of the tests in auto_tests weren't running when the project was built using autotools. This fixes that.
2018-07-28auto_test fixture and filenameshugbubby
Renamed a poorly named test, fixed up a few printf statements, substituted some unsigned integers with fixed size counterparts, and implemmented the auto_run_test.h fixture for the lossy and lossless packet tests.
2018-07-23More fixed_width ints and incorporating file_saving_test.chugbubby
The file_saving_test.c was not included in the cmake list and thus was ignored by travis and "make check". I found this out while introducing ck_assert_msg into the integration test. Furthermore, removed some variable width integers from encryptsave_test.c, and the SRunner utilization. Implemmented ck_assert_msg, reorganized some loops, and removed some longs in file_transfer_test.c.
2018-07-22Run Clang global static analysis on Travis.iphydf
This uses a single .cc file containing almost all the code in the repository to perform whole program analysis.
2018-07-21Avoid implementations in .h files or #including .c files.iphydf
Also, avoid the need for putting `_XOPEN_SOURCE` in every test file.
2018-07-21Remove redundant casts to the same type.iphydf
Also removed an unused identifier in messenger_test.c.
2018-07-21Add github usernames to TODOs.iphydf
2018-07-21Add missing braces in dht_test.c.iphydf
astyle doesn't catch all of these.
2018-07-21Run buildifier on c-toxcore BUILD files.iphydf
2018-07-18Wrong use of unsigned integer.hugbubby
2018-07-18Using stdint instead of int/longhugbubby
Did my best to surmise the size requirements of these integers, will do the rest of the tests soon. Also added a todo and made an obsessive change to a for loop.
2018-07-12Style fixes in TCP code; remove MIN and PAIR from util.h.iphydf
* 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.
2018-07-12Fix style in DHT.c.iphydf
* 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.
2018-07-09Factor out time keeping code into its own module: mono_time.c.iphydf
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 ```
2018-07-08Rename `BS_LIST` to `BS_List` to follow the naming conventions.iphydf
`BS_LIST` would be a constant. `BS_List` is a type name.
2018-07-07Factor out the actual test code from conference_test.iphydf
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.
2018-07-06Add a test that reproduces the NULL peer nick bug.iphydf
2018-07-06lan_discovery_test and version_test cleanuphugbubby
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-05Use run_auto_test.h test fixture for some auto-tests.iphydf
Most of the auto-tests should use this fixture, but I've only done a few to set an example.
2018-07-05Make tox.c unambiguously parseable.iphydf
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
2018-06-29Add a test to try and overflow the send queue in net_crypto.iphydf
2018-06-29Remove broken conference tests.iphydf
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.
2018-06-28Fix leak of Logger instances in dht_test.iphydf
2018-06-28Another TCP_test.c upgradehugbubby
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.
2018-06-24Use clang-format for C++ code.iphydf
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
2018-06-24Add new Circle CI configuration.iphydf
This one has ASAN enabled, unlike Travis.
2018-06-24Add a test for double conference invite.iphydf
In Persistent Group Chats (PGC), this will cause a use-after-free. This test ensures that we fix this bug before merging PGC.
2018-06-23Disable UDP when proxy is enabled.iphydf
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.
2018-06-23Avoid conditional-uninitialised warning for tcp test.iphydf
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.
2018-06-23Add assertions to bootstrap tests for correct connection type.iphydf
2018-06-23Add tests for what happens when passing an invalid proxy host.iphydf
Related: https://github.com/qTox/qTox/issues/5174
2018-06-22Clarify/Improve test_some testhugbubby
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.
2018-06-20Better TCP testing (beginnings)hugbubby
Tests all ports instead of just one, also adds some comments/changes error messages to be more descriptive
2018-06-19Add test for creating multiple conferences in one tox.iphydf
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.
2018-06-18Remove resource_leak_test.iphydf
This test has never caught a bug. It's better to catch these with asan or the likes.
2018-06-17Make dht_test more stable.iphydf
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.
2018-06-16Only check full rtp offset if RTP_LARGE_FRAME is setRobin Lindén
2018-06-04Log only the filename, not the full path in LOGGER.iphydf
Fixes #900.
2018-05-20Finish @Diadlo's network Family abstraction.iphydf
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.