Commit Graph

4534 Commits

Author SHA1 Message Date
iphydf e0f9f2f3a7 Use most recent version of Bazel (0.17.1). 2018-09-14 22:19:28 +00:00
iphydf 49bb43f662 Standardise header guards.
Using the full path including the repo name.
2018-09-14 19:09:10 +00:00
iphydf 7821cd8412 Use C++ style casts in C++ code. 2018-09-14 14:08:27 +00:00
hugbubby 0688877fba Use run_auto_test fixture in typing_test.c 2018-09-14 13:51:41 +00:00
iphydf 9f1757e3a5 Assert that we don't kill tox before killing toxav.
Possibly this is what's happening in #1149.
2018-09-10 18:51:51 +00:00
iphydf 33c2f5138f Always use the passed logger (from Messenger) in msi_kill. 2018-09-08 22:47:32 +00:00
iphydf 93cc178cfe Add tool to find directly recursive calls in toxcore.
We should avoid recursion, as it makes reasoning about stack growth
harder. This tool shows (currently) 4 (non-tail) recursive functions, at
least 2 of which are easy to fix.
2018-09-08 22:08:34 +00:00
iphydf ab4477d931 Fix typo: tcp_replays -> tcp_relays. 2018-09-08 20:07:12 +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
iphydf 08cc4184a1 Add messenger state plugin system.
This is for modules like groups to hook into to have their own state
management in the `tox_savedata` format.
2018-09-07 12:22:10 -05:00
iphydf 1cd1836917 Avoid recursion in ip_is_lan and ip_is_local. 2018-09-06 20:07:23 +00:00
iphydf f59e6ff0cb Ignore "unused-result" warning in super_donators code. 2018-09-06 13:28:08 +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
iphydf d296490a74 Use code font for tool names and flags in INSTALL.md. 2018-09-02 21:36:41 +00:00
Maxim Biro 1a6e8b908b Fix login issue on Travis-CI FreeBSD build 2018-09-01 06:35:17 -04:00
zugz (tox) 9764285ab1 Use test clock in run_auto_test tests and dht test 2018-08-31 17:08:35 +02:00
Maxim Biro 2e4cae692e Use our own logging facility to log toxcore's logs 2018-08-30 22:44:18 +00:00
cotox deb82006e5 Feature bootstrap trace/debug log output
Don't know why codes with macro dosen't work.
As it's only a few expensive, just code it without macro for now.

\#if (MIN_LOGGER_LEVEL == LOG_TRACE) || (MIN_LOGGER_LEVEL == LOG_DEBUG)
    fprintf(stderr, "[%s] %s:%d(%s) %s\n", strlevel, file, line, func, message);
\#endif
2018-08-30 22:44:18 +00:00
iphydf 36f0caaf07 Simplify configure.ac for faster autotools build.
* Remove ability to disable logging.
* Remove unused `NCURSES_FOUND`.
* Remove checks for stdbool and existence of int types.
  These mostly exist, and if they don't, we'll just fail to compile.
* Remove checks for various functions.
* Add check for `explicit_bzero` and `memset_s`.
2018-08-30 22:15:04 +00:00
iphydf 730e4cfe82 Remove the use of CLOCK_MONOTONIC_RAW.
The raw clock isn't subject to NTP adjustments. It may run less
accurately than the regular monotonic clock. I see no reason why raw
would be better for tox than the normal one.

This avoids one piece of OS-specific ifdef'd code.
2018-08-30 21:57:35 +00:00
iphydf a5cd4764aa Clean up add_to_list function a bit.
Can't trivially get rid of recursion here, since it's a non-linear
recursive function.
2018-08-30 21:33:15 +00:00
iphydf 515196dfa2 Include necessary opencv2 header on OSX.
opencv2 is deprecated and homebrew ships with opencv3 now.
2018-08-30 21:11:17 +00:00
Robin Lindén 18117581bd Release 0.2.7 v0.2.7 2018-08-30 22:43:11 +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 0075374f2b Make ip_is_lan return bool instead of 0/-1.
This inverts the truthiness of the return value. Previously, 0 meant
`true` and -1 meant `false`. Now, `true` (1) means `true` and `false` (0)
means `false`.
2018-08-27 12:54:46 +00:00
Maxim Biro 25a477a7e4 Enable FreeBSD Travis-CI build 2018-08-27 05:05:10 -04:00
Maxim Biro 53c1989eba Fix FreeBSD VM on Travis not shutting down 2018-08-27 01:50:47 -04:00
iphydf 9a70a2c185 Use bool in place of 0/1 int values. 2018-08-26 20:58:37 +00:00
iphydf 5352f48301 Make the tsan build fail instead of swallowing its errors.
We'll make it non-required, but we want to know about these failures so
we are incentivised to fix them.
2018-08-26 20:23:27 +00:00
zugz (tox) 01e2cc55cb Add support for setting a custom monotonic time function in mono_time 2018-08-26 22:05:37 +02:00
iphydf acc19a202f Format crypto_core.c.
Changes:
* 100 columns maximum (not strict, can be a bit more sometimes).
* No space after cast.
2018-08-26 19:15:44 +00:00
iphydf 473cde24d8 Update copyright to 2018. 2018-08-26 18:57:29 +00:00
iphydf 368e7e37bc Fix test class name for mono_time_test.
Was: Util, should be: MonoTime.
2018-08-26 18:18:47 +00:00
iphydf a1035cf814 Add some tests for ping_array.
No timeout test here yet, because we don't yet have the ability to
manipulate time at will, so we would have to actually sleep.
2018-08-26 17:32:19 +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 e99c13120f Change while-loop to for-loop to express for-each-frame.
* Assignments can't be used as expressions, therefore `while` loops
  should not be used as a `for-each` construct. Use `for`, instead.
2018-08-25 20:39:24 +00:00
zugz (tox) d380c41131 fix leave callback calling in del_groupchat 2018-08-25 15:39:31 +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 0935aab927 Run all tests (and compilation) in parallel with autotools.
With distcheck, it's all or nothing, so we build with -j50 and run tests
with -j50.
2018-08-25 14:16:30 +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
iphydf ff342a5ba6 Force storing the result of crypto_memcmp in the test.
So we don't accidentally elide the call given that it's a pure function
and its result isn't used.
2018-08-23 22:26:46 +00:00
iphydf 2730c95699 Install the DHT_bootstrap binary on make install.
We didn't install it before, only `tox-bootstrapd`.
2018-08-23 21:33:54 +00:00
endoffile78 76f4ae64b7 Add check to make sure tox was created successfully 2018-08-22 10:12:46 +00:00
zugz (tox) 21b178396a consistently use 'mono_time' rather than 'monotime' 2018-08-21 23:11:39 +02:00
iphydf 46b48f06ed Always print output on failure in cmake tests on Travis.
Not only the second time it fails.
2018-08-21 17:52:56 +00:00
iphydf 2b73b6298b Run project tests like yamllint_test.
We check that:
* The license is GPLv3.
* .travis.yml conforms with the toktok style specification.
* There exists a README.md file.
2018-08-21 17:31:22 +00:00