test_resume fix

This commit is contained in:
Arvid Norberg 2019-11-18 20:07:15 +01:00 committed by Arvid Norberg
parent 5145664562
commit afb5d842ff
3 changed files with 18 additions and 13 deletions

View File

@ -60,26 +60,26 @@ build_script:
# examples
- cd %ROOT_DIRECTORY%\examples
- if defined bjam (
b2.exe --abbreviate-paths openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on
b2.exe --hash openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on
)
# tools
- cd %ROOT_DIRECTORY%\tools
- if defined bjam (
b2.exe --abbreviate-paths openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on
b2.exe --hash openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on
)
# test
- cd %ROOT_DIRECTORY%\test
- if defined bjam (
b2.exe --abbreviate-paths openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on testing.execute=off
b2.exe --hash openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on testing.execute=off
)
# python binding
- cd %ROOT_DIRECTORY%\bindings\python
# we use 64 bit python builds
- if defined python (
b2.exe --abbreviate-paths openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on libtorrent-link=shared stage_module stage_dependencies
b2.exe --hash openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on libtorrent-link=shared stage_module stage_dependencies
)
# simulations
@ -99,7 +99,7 @@ build_script:
test_script:
- cd %ROOT_DIRECTORY%\test
- if defined bjam (
appveyor-retry b2.exe -l500 --abbreviate-paths openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on win-tests
appveyor-retry b2.exe -l500 --hash openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on win-tests
)
- cd %ROOT_DIRECTORY%\bindings\python

View File

@ -214,7 +214,7 @@ alert const* wait_for_alert(lt::session& ses, int type, char const* name
while (true)
{
time_point now = clock_type::now();
time_point const now = clock_type::now();
if (now > end_time) return nullptr;
alert const* ret = nullptr;

View File

@ -50,6 +50,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include <fstream>
#ifdef TORRENT_WINDOWS
#define SEP "\\"
#else
#define SEP "/"
#endif
using namespace lt;
namespace {
@ -277,13 +282,13 @@ TORRENT_TEST(piece_slots)
std::shared_ptr<torrent_info> ti = generate_torrent();
error_code ec;
create_directories(combine_path("add_torrent_params_test", "test_resume"), ec);
create_directories("add_torrent_params_test" SEP "test_resume", ec);
{
std::vector<char> a(128 * 1024 * 8);
std::vector<char> b(128 * 1024);
std::ofstream("add_torrent_params_test/test_resume/tmp1").write(a.data(), std::streamsize(a.size()));
std::ofstream("add_torrent_params_test/test_resume/tmp2").write(b.data(), std::streamsize(b.size()));
std::ofstream("add_torrent_params_test/test_resume/tmp3").write(b.data(), std::streamsize(b.size()));
std::ofstream("add_torrent_params_test" SEP "test_resume" SEP "tmp1").write(a.data(), std::streamsize(a.size()));
std::ofstream("add_torrent_params_test" SEP "test_resume" SEP "tmp2").write(b.data(), std::streamsize(b.size()));
std::ofstream("add_torrent_params_test" SEP "test_resume" SEP "tmp3").write(b.data(), std::streamsize(b.size()));
}
add_torrent_params p;
@ -340,9 +345,9 @@ void test_piece_slots_seed(settings_pack const& sett)
{
std::vector<char> a(128 * 1024 * 8);
std::vector<char> b(128 * 1024);
std::ofstream("add_torrent_params_test/test_resume/tmp1").write(a.data(), std::streamsize(a.size()));
std::ofstream("add_torrent_params_test/test_resume/tmp2").write(b.data(), std::streamsize(b.size()));
std::ofstream("add_torrent_params_test/test_resume/tmp3").write(b.data(), std::streamsize(b.size()));
std::ofstream("add_torrent_params_test" SEP "test_resume" SEP "tmp1").write(a.data(), std::streamsize(a.size()));
std::ofstream("add_torrent_params_test" SEP "test_resume" SEP "tmp2").write(b.data(), std::streamsize(b.size()));
std::ofstream("add_torrent_params_test" SEP "test_resume" SEP "tmp3").write(b.data(), std::streamsize(b.size()));
}
add_torrent_params p;