Evaluate torrent total blocks count only once. Equalize synchronization
of 'disk.disk_blocks_in_use' check used to break cycle with TEST_CHECK
statement. This makes tests that refer to web seeds execute much faster.
Numerous issues cause test fails on Windows(and Linux?). Most of them
found in print_alerts procedure.
Make print_alerts predicate check short-circuit, i.e. exit early on
first match. Fixes cases when appropriate variable may be re-assigned
multiple times with incorrect values.
Make stop_process wait until actual process successfully terminates.
This change is applicable to Windows only and helps to avoid tests
cleanup errors.
Make stop_proxy procedure do what it suppose to do. Previously it was
doing nothing with intention that all proxies are stopped after test
completion. Under Windows there are problems with proxy that has it's
socket connection abandoned. Thus failing the rest of test cases.
* Fix stop_all_proxies map using incorrect key to erase elements
* Fix wait_for_alert case with negative 'num'
* Make print_alerts predicate const& to avoid extra copy
* Make listen_alert and downloading_alert predicate procs reentrant
CMake build scripts improved to simplify configuring and building of
project and tests.
Better use of compile definitions by replacing add_definitions with
target_compile_definitions. Use INTERFACE, PUBLIC and PRIVATE keywords
to separate scope of TORRENT_BUILDING_SHARED and TORRENT_LINKING_SHARED
definitions.
* Move tests to the separate file - test/CmakeLists.txt
* Fix use of compile definitions
* Remove redundant tailqueue.cpp
16 MB is chosen to have a bit more future proof
Also rewrite the auto piece size selection algorithm, so that it will scale with
torrent content size, suggested by @ssiloti.