From ad787d2a4fedc17b06adbf35ed715b3bf739f79e Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 18 Nov 2019 08:43:23 +0100 Subject: [PATCH] fix test_flags (for windows) --- test/test_flags.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/test_flags.cpp b/test/test_flags.cpp index 570a5ff04..da70524c5 100644 --- a/test/test_flags.cpp +++ b/test/test_flags.cpp @@ -35,6 +35,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/session.hpp" #include "libtorrent/torrent_handle.hpp" #include "libtorrent/torrent_info.hpp" +#include "libtorrent/aux_/path.hpp" #include "settings.hpp" using namespace libtorrent; @@ -42,13 +43,19 @@ namespace lt = libtorrent; namespace { +std::string file(std::string name) +{ + return combine_path(parent_path(current_working_directory()) + , combine_path("test_torrents", name)); +} + void test_add_and_get_flags(torrent_flags_t const flags) { session ses(settings()); add_torrent_params p; p.save_path = "."; error_code ec; - p.ti = std::make_shared("../test_torrents/base.torrent", + p.ti = std::make_shared(file("base.torrent"), std::ref(ec)); TEST_CHECK(!ec); p.flags = flags; @@ -63,7 +70,7 @@ void test_set_after_add(torrent_flags_t const flags) add_torrent_params p; p.save_path = "."; error_code ec; - p.ti = std::make_shared("../test_torrents/base.torrent", + p.ti = std::make_shared(file("base.torrent"), std::ref(ec)); TEST_CHECK(!ec); p.flags = torrent_flags::all & ~flags; @@ -80,7 +87,7 @@ void test_unset_after_add(torrent_flags_t const flags) add_torrent_params p; p.save_path = "."; error_code ec; - p.ti = std::make_shared("../test_torrents/base.torrent", + p.ti = std::make_shared(file("base.torrent"), std::ref(ec)); TEST_CHECK(!ec); p.flags = flags;