From afb5d842ff589bb882e4914ef112cbaaf250b858 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 18 Nov 2019 20:07:15 +0100 Subject: [PATCH] test_resume fix --- appveyor.yml | 10 +++++----- test/setup_transfer.cpp | 2 +- test/test_resume.cpp | 19 ++++++++++++------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ab0e4425c..41635c47f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/test/setup_transfer.cpp b/test/setup_transfer.cpp index 5dd52a713..8f15bdb8a 100644 --- a/test/setup_transfer.cpp +++ b/test/setup_transfer.cpp @@ -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; diff --git a/test/test_resume.cpp b/test/test_resume.cpp index 153045397..8ee4a6265 100644 --- a/test/test_resume.cpp +++ b/test/test_resume.cpp @@ -50,6 +50,11 @@ POSSIBILITY OF SUCH DAMAGE. #include +#ifdef TORRENT_WINDOWS +#define SEP "\\" +#else +#define SEP "/" +#endif using namespace lt; namespace { @@ -277,13 +282,13 @@ TORRENT_TEST(piece_slots) std::shared_ptr 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 a(128 * 1024 * 8); std::vector 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 a(128 * 1024 * 8); std::vector 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;