fix test_flags (for windows)
This commit is contained in:
parent
8abd878ed4
commit
ad787d2a4f
@ -35,6 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "libtorrent/session.hpp"
|
#include "libtorrent/session.hpp"
|
||||||
#include "libtorrent/torrent_handle.hpp"
|
#include "libtorrent/torrent_handle.hpp"
|
||||||
#include "libtorrent/torrent_info.hpp"
|
#include "libtorrent/torrent_info.hpp"
|
||||||
|
#include "libtorrent/aux_/path.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
@ -42,13 +43,19 @@ namespace lt = libtorrent;
|
|||||||
|
|
||||||
namespace {
|
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)
|
void test_add_and_get_flags(torrent_flags_t const flags)
|
||||||
{
|
{
|
||||||
session ses(settings());
|
session ses(settings());
|
||||||
add_torrent_params p;
|
add_torrent_params p;
|
||||||
p.save_path = ".";
|
p.save_path = ".";
|
||||||
error_code ec;
|
error_code ec;
|
||||||
p.ti = std::make_shared<torrent_info>("../test_torrents/base.torrent",
|
p.ti = std::make_shared<torrent_info>(file("base.torrent"),
|
||||||
std::ref(ec));
|
std::ref(ec));
|
||||||
TEST_CHECK(!ec);
|
TEST_CHECK(!ec);
|
||||||
p.flags = flags;
|
p.flags = flags;
|
||||||
@ -63,7 +70,7 @@ void test_set_after_add(torrent_flags_t const flags)
|
|||||||
add_torrent_params p;
|
add_torrent_params p;
|
||||||
p.save_path = ".";
|
p.save_path = ".";
|
||||||
error_code ec;
|
error_code ec;
|
||||||
p.ti = std::make_shared<torrent_info>("../test_torrents/base.torrent",
|
p.ti = std::make_shared<torrent_info>(file("base.torrent"),
|
||||||
std::ref(ec));
|
std::ref(ec));
|
||||||
TEST_CHECK(!ec);
|
TEST_CHECK(!ec);
|
||||||
p.flags = torrent_flags::all & ~flags;
|
p.flags = torrent_flags::all & ~flags;
|
||||||
@ -80,7 +87,7 @@ void test_unset_after_add(torrent_flags_t const flags)
|
|||||||
add_torrent_params p;
|
add_torrent_params p;
|
||||||
p.save_path = ".";
|
p.save_path = ".";
|
||||||
error_code ec;
|
error_code ec;
|
||||||
p.ti = std::make_shared<torrent_info>("../test_torrents/base.torrent",
|
p.ti = std::make_shared<torrent_info>(file("base.torrent"),
|
||||||
std::ref(ec));
|
std::ref(ec));
|
||||||
TEST_CHECK(!ec);
|
TEST_CHECK(!ec);
|
||||||
p.flags = flags;
|
p.flags = flags;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user