Commit Graph

540 Commits

Author SHA1 Message Date
iphydf
11ad5471b9
Use spdx license identifier instead of GPL blurb. 2020-03-14 13:06:19 +00:00
zugz (tox)
c644ef7681
use -1 rather than ~0 in unsigned integer types
Using ~0 involves a bitwise operation on int, so depends on
the internal representation of signed integers.
2020-03-14 00:00:02 +00:00
iphydf
e671490989
Use rules_cc instead of native cc_library rules. 2020-03-12 12:20:54 +00:00
iphydf
0f7138c010
Upgrade bazel to 2.1.1.
Removed av_test, because it depends on an ancient opencv that starts to
really not exist on modern systems anymore.
2020-03-02 14:23:44 +00:00
sudden6
1b7d7b66c5
synchronize call control actions to tox_iterate 2020-01-02 11:58:42 +01:00
Robin Linden
79748dd9e5
Allow Bazel to rerun tests marked as flaky 2019-11-17 01:24:02 +01:00
Robin Linden
f6235b5f8d
Update tests to use a working bootstrap node 2019-11-02 15:35:21 +01:00
zugz (tox)
306dd1f21f
add configurable limit on number of stored frozen peers 2019-05-19 18:51:28 +02:00
sudden6
b3100c977c
add undef guard in tox_many_tcp_test
This fixes an redefinition error when creating amalgamation.cc during
static analysis
2019-05-01 14:24:46 +02:00
zugz (tox)
efff822aef
Disable failing TCP server test
The test's intermittent failure may well be exposing a real bug in the
TCP relay and/or onion systems, but we can't find the bug, and keeping
the test is disrupting our CI.
2019-04-01 19:43:32 +02:00
zugz (tox)
959f468eac
add API function to test whether av is enabled 2019-02-10 00:00:00 +00:00
zugz (tox)
49e2406ffa
Expose api functions for enabling and disabling AV in AV groups
A group loaded from a savefile starts with AV disabled.
2019-02-10 00:00:00 +00:00
zoff99
78bc9e7403
Added test and patch for VLA stack overflow vuln.
Also added and used the new crypto_malloc and crypto_free.

The latter also zeroes out the memory safely. The former only exists for
symmetry (static analysis can detect asymmetric usages).
2019-01-03 11:13:27 +00:00
zugz (tox)
9770880e97
Implement conferences saving
* add global friend_connection status callback, used for group rejoining
* stop leaving groups on killing tox
2018-11-29 21:52:23 +01:00
zugz (tox)
caca350f43
Avoid format truncation in save compatibility test
(without this, gcc-8.2.0 issues a warning)
2018-11-23 18:09:45 +01:00
zugz (tox)
744dc2f5da
Make saving and loading the responsibility of Tox rather than Messenger 2018-10-20 11:03:10 +02:00
zugz (tox)
4dd86f1f29
ensure save data unchanged after save and load 2018-10-11 00:21:39 +02:00
iphydf
605dfe882c
Consistently use camel case enum names.
Including in tests and implementation files.
2018-10-09 17:33:37 +00:00
iphydf
b2b96b1aa1
Avoid use of IPv6 in tests if not supported (e.g. on Travis). 2018-10-06 21:27:02 +00:00
iphydf
4f266f913d
Use a working DHT node for bootstrap tests.
A lot of bootstrap nodes are down :(.
2018-09-25 21:19:07 +00:00
zugz (tox)
e43b2eadc0
Send rejoin packets on conference disconnection
We were mistakenly not making a rejoin attempt on freezing connections
due to all closest connections going down. This fixes that, and tweaks
the test. I've still only done tens rather than hundreds of tests, but
I'm fairly confident that the conference test now consistently passes.
2018-09-20 22:30:28 +02:00
yangfl
d3d5b701cb
Fix typos 2018-09-19 18:16:13 +00:00
iphydf
49bb43f662
Standardise header guards.
Using the full path including the repo name.
2018-09-14 19:09:10 +00:00
hugbubby
0688877fba
Use run_auto_test fixture in typing_test.c 2018-09-14 13:51:41 +00:00
iphydf
d9541d542c
Use (void) for empty parameter lists in C.
Because `()` means "some unknown number of parameters".
2018-09-08 10:59:30 +00:00
zugz
1b2322284f
Add mechanism for recovering from disconnections in conferences
* add freezing and unfreezing of peers
  * add rejoin packet
  * revise handling of temporary invited connections
  * rename "peer kill" packet to "peer leave" packet
  * test rejoining in conference test
  * use custom clock in conference test
2018-09-05 20:56:26 +02:00
iphydf
6872c14e1a
Avoid use of global mutable state in mono_time on win32.
This uses a trick to get read-write access to `this` from a `const`
member function, similar to C++ `mutable`, but uglier.
2018-09-03 20:03:47 +00:00
zugz (tox)
9764285ab1
Use test clock in run_auto_test tests and dht test 2018-08-31 17:08:35 +02:00
zugz (tox)
66ab386d6f
try ipv6 connections even after udp timeout
Also adds a test (auto_reconnect_test) which fails without this change.
2018-08-27 22:27:01 +02:00
iphydf
473cde24d8
Update copyright to 2018. 2018-08-26 18:57:29 +00:00
iphydf
64ddb7fff2
Call abort instead of exit on test failure.
This raises a signal, so we can more easily catch it with gdb.
2018-08-26 13:18:43 +00:00
iphydf
80f8458146
Run save_compatibility_test in the autotools build. 2018-08-25 23:25:15 +00:00
iphydf
17e8195a8f
Fix the PORT_ALLOC failure of save_compatibility_test.
`tox_new_log` has a much larger range of ports it can select from.
2018-08-25 22:28:38 +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
853a2a10b1
Stop using massive macros in toxav_basic_test.
Turned a huge macro into a function. Macros are a pain to debug.
2018-08-25 13:46:47 +00:00
zugz (tox)
efcda6c319
Fix auto_tests Makefile
* specify correct source files
* add save_compatibility_test (commented out for now)
* reformat TESTS to one line per test, and set check_PROGRAMS := TESTS
* add run_auto_test.h to EXTRA_DIST
* Fix `AUTO_TEST_CFLAGS` -> `AUTOTEST_CFLAGS`.
2018-08-25 14:30:04 +02:00
endoffile78
76f4ae64b7
Add check to make sure tox was created successfully 2018-08-22 10:12:46 +00:00
iphydf
7aa57afeba
Avoid redefining macros from different files. 2018-08-19 23:15:01 +00:00
iphydf
0fa700b55b
Make the save_compatibility_test work with bazel. 2018-08-19 22:08:02 +00:00
endoffile78
30960dcc7e
Add save file generator, save compatibility test, and generate a save file 2018-08-19 10:38:51 +00:00
iphydf
d6d305feeb
Use per-instance Mono_Time for Messenger and onion. 2018-08-16 21:01:43 +00:00
iphydf
54066f338f
Reduce the number of times unix_time_update is called.
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-16 21:01:38 +00:00
iphydf
c0db255425
Limit the size of a save file in file_saving_test.
Limited to 4GiB. That ought to be enough for any save file.
2018-08-16 10:15:01 +00:00
Leonid Bobrov
006b4f4e5c
Prune long long warnings. 2018-08-16 09:57:37 +00:00
iphydf
a509d25324
Fix some printf format specifiers. 2018-08-13 11:02:32 +00:00
zugz (tox)
d56ab5aaff
add callback for successful connection to a conference 2018-08-12 22:46:06 +02:00
iphydf
d92c96e783
Fix a few warnings from clang.
Also remove the use of a VLA in a context where there can be unbounded
memory allocations.
2018-08-12 14:09:59 +00:00
iphydf
f0f456398d
Check that the save file size isn't larger than our address space. 2018-08-12 12:05:01 +00:00
zugz
aa63c1330c
Fix problems with initial connections and name-setting in conferences
* 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-08-02 22:03:18 +01:00
hugbubby
3a4987da18
Fix autotools build
Mosts of the tests in auto_tests weren't running when the project
was built using autotools. This fixes that.
2018-07-30 12:48:21 +00:00