From 50ca25c08a310379216b35bb86d6767571985577 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 17 Jun 2013 15:56:58 +0000 Subject: [PATCH] fix test_torrent_parse for windows --- test/test_torrent_parse.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_torrent_parse.cpp b/test/test_torrent_parse.cpp index 15912cb85..c3e345058 100644 --- a/test/test_torrent_parse.cpp +++ b/test/test_torrent_parse.cpp @@ -110,11 +110,12 @@ test_failing_torrent_t test_error_torrents[] = int test_main() { + std::string root_dir = parent_path(current_working_directory()); for (int i = 0; i < sizeof(test_torrents)/sizeof(test_torrents[0]); ++i) { error_code ec; fprintf(stderr, "loading %s\n", test_torrents[i].file); - boost::intrusive_ptr ti(new torrent_info(combine_path(combine_path("..", "test_torrents"), test_torrents[i].file), ec)); + boost::intrusive_ptr ti(new torrent_info(combine_path(combine_path(root_dir, "test_torrents"), test_torrents[i].file), ec)); TEST_CHECK(!ec); if (ec) fprintf(stderr, " -> failed %s\n", ec.message().c_str()); @@ -217,7 +218,7 @@ int test_main() { error_code ec; fprintf(stderr, "loading %s\n", test_error_torrents[i].file); - boost::intrusive_ptr ti(new torrent_info(combine_path(combine_path("..", "test_torrents"), test_error_torrents[i].file), ec)); + boost::intrusive_ptr ti(new torrent_info(combine_path(combine_path(root_dir, "test_torrents"), test_error_torrents[i].file), ec)); fprintf(stderr, "E: %s\nexpected: %s\n", ec.message().c_str(), test_error_torrents[i].error.message().c_str()); TEST_EQUAL(ec, test_error_torrents[i].error); }