Commit Graph

417 Commits

Author SHA1 Message Date
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
iphydf
bacd74c4dd
Make TCP_Client_Connection a module-private type. 2018-01-14 19:13:32 +00:00
iphydf
c28d362dd2
Make Onion_Client a module-private type. 2018-01-14 16:20:43 +00:00
iphydf
4b54d14d9c
Make Onion_Announce a module-private type. 2018-01-14 14:20:20 +00:00
iphydf
c38d3de604
Filter out annoying log statements in unit tests.
These may be useful when debugging toxcore locally, but are not useful in
unit tests.
2018-01-14 10:52:13 +00:00
yangfl
449c3f12cc Fix some typos in code and cmake comments 2018-01-12 21:22:44 +08:00
iphydf
2fbed5b4c5
Move Networking_Core struct into the .c file.
To make it an abstract type everywhere except in network.c.
2018-01-11 11:59:14 +00:00
iphydf
54ec162558
Fix formatting in some C files.
Also replace &(x) with &x for consistency.
2018-01-10 18:57:37 +00:00
iphydf
d26f0eb3bc
Change toxencryptsave API to never overwrite pass keys. 2017-12-29 23:24:54 +00:00
Diadlo
998f584b0d
Fix Travis fail on addr_resolve testing 2017-12-12 22:18:00 +01:00
Diadlo
05c35462f3
Fix bootstrap port
Test uses the first node as bootstrap, but the port is hardcoded.
2017-11-20 16:53:21 +03:00
Diadlo
8a8442a30c
Remove upper bound of save size 2017-11-20 16:53:21 +03:00
Diadlo
c506d73d5d
Fix assert for the first port value
Port of the first tox instance will be 33445 only if this port was not
in use during testing
2017-11-20 16:53:19 +03:00
yangfl
2651193b99
Fix typo 2017-11-19 23:52:23 +01:00
Diadlo
4d94a07d25
Add workaround for conference test 2017-11-15 21:36:22 +03:00
Diadlo
dd50da48f3
Don't use IPv6 in test if it's unsupported 2017-11-15 15:57:07 +03:00
Diadlo
d037f93811
Fix IPv4 and IPv6 loopbacks 2017-11-15 15:21:39 +03:00
Diadlo
f084f2c621
Add loopback and broadcast constants 2017-08-24 21:09:40 +03:00
Diadlo
e28d48130f
Add platform independent constants 2017-08-24 20:09:08 +03:00
Diadlo
66b8a7685e
AF_INET -> TOX_AF_INET 2017-08-24 20:09:08 +03:00
Maxim Biro
b02f68bb4b Remove unused variable 2017-06-06 15:37:02 -04:00
iphydf
cb69b8a986
Build tests on appveyor, the MSVC build.
Tests are not actually ran on appveyor for now, since they all fault for
some reason. For now, we just build them. Also, some tests are disabled
on msvc entirely, because they don't even compile. We'll need to look
into those, later. They are disabled using `MSVC_DONT_BUILD`.
2017-06-05 13:45:20 +00:00
pranomostro
7f5b057b05
Add test for changing the conference title and not receiving a callback. 2017-06-05 12:50:58 +00:00
iphydf
1e8fa85aad
Add a monolith_test that includes all toxcore sources.
This requires that every symbol, even if static (file-scope), is unique.
The idea is that we can easily run "whole" program static analysis on
programs that include monolith.h ("whole" is in quotes, as we don't
include dependencies like libsodium in this static analysis).
2017-06-04 17:48:23 +00:00
pranomostro
03f99bde2e
Test for memberlist not changing after changing own name.
This test shows that the conference members callback is not invoked when
the own name changes.
2017-06-04 13:40:44 +00:00
pranomostro
7ef27a9105 Make variable names in file saving test less cryptic. 2017-05-13 22:59:50 +02:00
Maxim Biro
c25e3d2d7c Revert "initial version of tox_loop"
This reverts commit 200ee1cace.
2017-04-22 15:31:25 -04:00
Maxim Biro
c7f63737eb Revert "Implement tox_loop"
This reverts commit 5ff099763b.
2017-04-22 15:31:25 -04:00
Diadlo
e565523640
Add test for DHT pack_nodes and unpack_nodes 2017-04-13 20:25:19 +00:00
Ansa89
5ff099763b
Implement tox_loop 2017-04-01 17:47:34 +02:00
michael bishop
200ee1cace
initial version of tox_loop 2017-04-01 17:47:34 +02:00
Diadlo
50c526e1a5
Move c_sleep to helpers.h and misc_tools.h
Also fix a mistake with forgotten braces around parameter
2017-03-25 20:40:34 +03:00
Maxim Biro
def92ab029 Add test for tox_strncasecmp() 2017-03-01 20:43:30 -05:00
Diadlo
b19a9e5464
Add part of platform-independent network API implementation
socket      -> net_socket
htons       -> net_htons
htonl       -> net_htonl
connect     -> net_connect
sendto      -> net_sendto_ip4
getaddrinfo -> net_getipport
sa_family_t -> Family
2017-02-26 23:16:16 +03:00
iphydf
6ae33c16cf
Add VLA compatibility macro for C89-ish compilers. 2017-01-28 20:49:12 +00:00
Diadlo
f00006cf1d
Add platform-independent Socket and IP implementation 2017-01-26 23:11:15 +03:00
zugz
b630121f2f reduce thread-unsafe use of static variables
- rework ip_ntoa() to avoid use of static variables
- rework sort_client_list() to avoid use of static variables
- move static 'lastdump' into Messenger struct
- rework ID2String() to avoid use of static variables; rename to id_to_string()
- fetch_broadcast_info(): attempt to mitigate risks from concurrent execution
- current_time_monotonic(): attempt to mitigate risks from concurrent execution
- comment on non-thread-safety of unix_time_update
2017-01-21 22:08:52 +01:00
iphydf
8f96ca6d86
Update license headers and remove redundant file name comment.
"All rights reserved" was incorrect. The project was licensed under GPL3,
which means a lot of rights are licensed to everybody in the world, i.e.
not reserved to the "Tox Project".
2017-01-19 00:01:44 +00:00
iphydf
8f1dbaa2c5
Set up autotools build to build against vanilla NaCl.
Fixes #363.
2017-01-08 15:27:26 +00:00
endoffile78
d41bb3a8d4
Fix issues in crypto_test.c 2017-01-07 11:47:31 -06:00
endoffile78
e667ec23b9
Replace make_quick_sort with qsort 2017-01-07 11:47:30 -06:00
iphydf
3fb683115c
Add logging callback to messenger_test.
So we can see what went wrong if it fails.
2017-01-06 23:25:46 +00:00
David Zero
8ef1f35ca7 Revert "Revert "Portability fixes""
This reverts commit 59e2a844f0, and
defines _DARWIN_C_SOURCE in toxcore/network.c
2017-01-06 04:20:00 -08:00