Commit Graph

29 Commits

Author SHA1 Message Date
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
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
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
zugz (tox)
d56ab5aaff
add callback for successful connection to a conference 2018-08-12 22:46:06 +02: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
iphydf
f627a26a7b
Run Clang global static analysis on Travis.
This uses a single .cc file containing almost all the code in the
repository to perform whole program analysis.
2018-07-22 02:34:30 +00:00
iphydf
7245ac11ef
Avoid implementations in .h files or #including .c files.
Also, avoid the need for putting `_XOPEN_SOURCE` in every test file.
2018-07-21 20:44:26 +00:00
hugbubby
a592f0fa87 Wrong use of unsigned integer. 2018-07-18 13:55:30 -07:00
hugbubby
864d1c15e4 Using stdint instead of int/long
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-18 13:55:30 -07:00
iphydf
3c1025d2dc
Factor out the actual test code from conference_test.
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-07 10:35:35 +00: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
d3b286cb43
Fix a bunch of compiler warnings and remove suppressions. 2018-02-24 22:20:22 +00:00
iphydf
3dc8cf6df8
Disable lan discovery in most tests. 2018-02-18 21:32:28 +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
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
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
yangfl
449c3f12cc Fix some typos in code and cmake comments 2018-01-12 21:22:44 +08: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
Diadlo
4d94a07d25
Add workaround for conference test 2017-11-15 21:36:22 +03: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
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
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
endoffile78
59e2a844f0 Revert "Portability fixes"
This reverts commit f3469070fe.
2017-01-05 15:16:56 -06:00
David Zero
f3469070fe Portability fixes
- CFLAG gnu99 was changed to c99.
- CXXFLAG c++98 was changed to c++11.
- CFLAG -pedantic-errors was added so that non-ISO C now throws errors.
- _XOPEN_SOURCE feature test macro added and set to 600 to expose SUSv3
  and c99 definitions in modules that required them.
- Fixed tests (and bootstrap daemon logging) that were failing due to
  the altered build flags.
- Avoid string suffix misinterpretation; explicit narrowing conversion.
- Misc. additions to .gitignore to make sure build artifacts don't wind
  up in version control.
2017-01-04 13:44:39 -08:00
iphydf
82515f92ee
Move log callback to options.
Previously, all log messages generated by tox_new (which is quite a lot)
were dropped, because client code had no chance to register a logging
callback, yet. This change allows setting the log callback from the
beginning and removes the ability to unset it.

Since the log callback is forever special, since it can't be stateless,
we don't necessarily need to treat it uniformly (with `event`).
2016-11-06 20:35:09 +00:00
iphydf
96c672aef5
Compile as C++ for windows builds.
Compiling as C++ changes nothing semantically, but ensures that we don't
break C++ compatibility while also retaining C compatibility.

C++ compatibility is useful for tooling and additional diagnostics and
analyses.
2016-11-02 18:50:41 +00:00
iphydf
6d0c8060c1
Remove duplicate tests: split tests part 2. 2016-10-11 21:29:58 +02:00
iphydf
d9f37e4c33
Duplicate tox_test to 4 other files.
In a next step, we will remove tests from each file to have a per-binary
split of tests. This will help identify which tests fail most often on
Travis CI.

In another future step, we will split the large one_test into several
auto tests, which will make testing quite a bit slower (adding about 10
seconds setup time to each), but hopefully a lot more stable ("Tox went
offline" should not happen as much anymore).
2016-10-06 16:46:35 +01:00