Commit Graph

459 Commits

Author SHA1 Message Date
hugbubby
820e45dece
Better TCP testing (beginnings)
Tests all ports instead of just one, also adds some comments/changes
error messages to be more descriptive
2018-06-20 22:11:08 +00:00
iphydf
2296d07e09
Add test for creating multiple conferences in one tox.
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-19 21:00:26 +00:00
iphydf
3a85d88fb1
Remove resource_leak_test.
This test has never caught a bug. It's better to catch these with asan or
the likes.
2018-06-18 19:25:30 +00:00
iphydf
16f5cc8c24
Make dht_test more stable.
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-17 23:41:42 +00:00
Robin Lindén
2f80e2206c
Only check full rtp offset if RTP_LARGE_FRAME is set 2018-06-16 22:50:07 +00:00
iphydf
8a4a5c2aa2
Log only the filename, not the full path in LOGGER.
Fixes #900.
2018-06-04 12:39:28 +00:00
iphydf
21675ce0d2
Finish @Diadlo's network Family abstraction.
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.
2018-05-20 19:35:28 +00:00
iphydf
be797d4b03
Move system header includes from network.h to network.c 2018-05-20 15:42:42 +00:00
Maxim Biro
7d399cedcf
Improve network error reporting on Windows
Windows doesn't report network errors though errno, it has its own facilities.
2018-04-17 19:07:50 -04:00
Evgeny Kurnevsky
6b97acb773
Restrict packet kinds that can be sent through onion path. 2018-04-15 09:51:41 +03:00
iphydf
37d4a0b2ca
Avoid the use of rand() in tests.
We control the random functions in crypto_core, so we can make them
deterministic more easily. This will help test reproducibility in the
future.
2018-04-03 17:43:22 +00:00
iphydf
9706d9a0f0
Disallow stderr logger by default. 2018-03-17 15:04:03 +00:00
iphydf
a2496af71a
Add logging to the onion_test.
Makes debugging easier.
2018-03-17 15:04:03 +00:00
iphydf
aa05095419
Remove the use of the 'hh' format specifier.
It's not supported in mingw.

See https://github.com/TokTok/c-toxcore/issues/786.
2018-03-16 01:57:26 +00:00
iphydf
bd62d11860
Make file transfers 50% faster.
By increasing a magic number.. Also, added more verbose logging to the
file transfer test.
2018-03-02 13:56:49 +00:00
iphydf
1282ef5741
Remove deprecated conference namelist change callback. 2018-02-27 04:30:37 +00:00
iphydf
1334d16517
Fix auto_tests to stop using the deprecated conference API. 2018-02-27 04:30:37 +00:00
iphydf
d3b286cb43
Fix a bunch of compiler warnings and remove suppressions. 2018-02-24 22:20:22 +00:00
iphydf
b2a2a0bbc7
Link all tests to the android cpufeatures library if available.
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.
2018-02-23 01:05:00 +00:00
iphydf
95c03e0e85
Make the "persistent conference" callback changes new functions.
We can now revert the changes to the callbacks and keep supporting them
until clients have moved off them.
2018-02-20 21:36:05 +00:00
iphydf
097f41f264
Make some sizeof tests linux-only.
net_crypto has pthread types in its struct, so its size is system
dependent. In particular, the sizes are wrong on FreeBSD.
2018-02-19 13:35:41 +00:00
Robin Lindén
ec8b911d7c
Increase range of ports available to Toxes during tests 2018-02-18 23:59:22 +00:00
iphydf
3dc8cf6df8
Disable lan discovery in most tests. 2018-02-18 21:32:28 +00:00
iphydf
d016eb3f0e
Remove tox_test from autotools build. 2018-02-18 17:17:28 +00:00
Robin Lindén
c3515c49e0
Split up tox_test into multiple smaller tests 2018-02-18 14:50:18 +00:00
iphydf
83f7beacc5
Don't print trace level logging in tests. 2018-02-18 14:09:42 +00:00
iphydf
746c624a09
Add static asserts for all the struct sizes in toxcore.
This forces us to record size changes (for LP64) and helps estimate
memory consumption of internal data structures.
2018-02-17 17:08:37 +00:00
zoff99
82662d4e16
Make outgoing Filetransfers round-robin.
Instead of 1 FT blocking all others.
2018-02-17 16:32:25 +00:00
iphydf
35f13ef51d
Get rid of the only GNU extension we used. 2018-02-14 20:51:55 +00:00
iphydf
6cd4fcdec4
Remove libcheck from the dependencies.
We're not gaining much from this library, and it's a burden, especially
for windows development.
2018-02-09 20:51:39 +00:00
iphydf
8a0e98bab8
Fix LAN discovery on FreeBSD.
Also, add an auto-test for bootstrap and for LAN discovery.

Bootstrap is never tested otherwise, and LAN discovery is a prerequisite
for everything else. Having these two tests lets us rule out or identify
LAN discovery as a possible cause for test failures.
2018-02-08 14:57:34 +00:00
iphydf
835b9fbdc9
Improve stability of crypto_memcmp test.
Also reduce number of people in conference to 5, because on Circle CI the
test times out trying to connect more than 6 or 7 people. The persistent
conferences PR will improve this so we can set it much higher then.
2018-02-06 20:21:27 +00:00
iphydf
feaefbcbb3
Format .cpp files with format-source. 2018-02-06 13:44:03 +00:00
iphydf
d9413d5576
Improve conference test stability. 2018-02-01 14:58:00 +00:00
iphydf
92ffad1a72
Use nullptr as NULL pointer constant instead of NULL or 0.
This changes only code, no string literals or comments.
2018-01-30 23:35:50 +00:00
iphydf
6e0ac337c9
Avoid clashes with "build" directories on case-insensitive file systems. 2018-01-28 15:17:34 +00:00
xhe
651ef3adb6
Make audio/video bit rates "properties"
follow TokTok#731. This commit
completely removed all things in namespace bit_rate, and deprecated
functions are to be added back in another commit. set_xxx() is treadted
as a property of namespace audio&video, same as bit_rate change event.

toxav_basic_test is fixed, either.
2018-01-28 13:21:57 +00:00
iphydf
9c03439ad0
Fix out of bounds read in error case in messenger_test.
Also got rid of two VLAs. They are overused a bit in toxcore. In
irc_syncbot, the array was uninitialised and then filled by a recv system
call. This can cause uninitialised reads if recv doesn't fill the entire
array. It could not cause out of bounds read directly, because a
NUL-terminator was in place, but both cases are undefined behaviour.
2018-01-26 01:30:06 +00:00
xhe
0becafd272
Split bit_rate_set(), one for audio, one for video.
Fixes #572.

As discussed in the issue, there's a risk that toxcore may not hold the
maximum bitrates libvpx supports, if toxcore insists on using integer
type. I initially proposed to have another flag in set(), so that we can
use unsigned type instead. iphydf came up with a better solution, that is
splitting the original functions, one for audio, one for video. Now, we
could safely replace int32_t with uint32_t.

Also: clean video_bit_rate_invalid()

Though this is not a part of issue #572, as it's used in the
toxav_bit_rate_set(), i cleaned the code. As mannol said, there should be
a check. Uint32_t is large enough to hold the maximum bitrates libvpx
supports, but user may pass a value larger than uint while smaller than
uint32_t. Thanks to the reminding from nurupo, it's no longer a stub
function.

Bitrate error enums are shared for both audio and video
https://github.com/TokTok/c-toxcore/pull/578#issuecomment-360095609, just
as iphydf said.
2018-01-25 14:29:01 +00:00
iphydf
033965b8cc
Make the monolith test a C++ binary.
This way, developers compile toxcore, toxav, and toxencryptsave as C++ at
least once at home, reducing the likelyhood of running into travis
failures where we compile as C++ in the windows build.
2018-01-21 20:56:30 +00:00
iphydf
52778aed93
Make BUILD files more finely-grained.
This allows us to precisely see which libraries depend on which and lets
us split them up more, if necessary.
2018-01-21 19:44:09 +00:00
iphydf
822dd2fac2
Don't allocate or dereference Tox_Options in tests.
This struct will soon become opaque.
2018-01-21 00:14:43 +00:00
iphydf
b030b4d8c0
Fix log message in simple_conference_test: invite -> message. 2018-01-20 13:25:58 +00:00
iphydf
7c2e4dd403
Add a simple conference test with 3 friends.
This tests that a message from tox1 is relayed via tox2 to tox3 when tox1
and tox3 are not friends.
2018-01-20 12:22:52 +00:00
iphydf
25d3001556
Use larger arrays in crypto timing tests.
Increasing from 256K to 1M and increasing the number of iterations from
1000 to 2000. This makes the test more accurate and less flaky.
2018-01-19 18:15:17 +00:00
iphydf
0a5be3cbc5
Use C99 standard in bazel builds. 2018-01-18 21:52:31 +00:00
iphydf
18a33169b8
Add bazel build scripts for c-toxcore.
This allows us and users to reproducibly build verified versions of the
library with checksums. It will power the toktok-stack continuous build
with checked-in checksums at specific git revisions.
2018-01-18 16:11:52 +00:00
iphydf
643eea60bb
Make DHT a module-private type. 2018-01-16 20:06:07 +00:00
iphydf
22db2b9fe5
Make Net_Crypto a module-private type. 2018-01-16 15:46:13 +00:00
iphydf
1eea3f0ab6
Fix some memory or file descriptor leaks in test code.
Also some missing return value checks for `fopen`.
2018-01-14 19:15:28 +00:00