diff --git a/test/test_torrent_parse.cpp b/test/test_torrent_parse.cpp index 978df2de6..4bdda1881 100644 --- a/test/test_torrent_parse.cpp +++ b/test/test_torrent_parse.cpp @@ -261,7 +261,11 @@ int test_main() bencode(std::back_inserter(buf), torrent); torrent_info ti2(&buf[0], buf.size(), ec); std::cerr << ti2.name() << std::endl; +#ifdef TORRENT_WINDOWS + TEST_EQUAL(ti2.name(), "ctest1test2test3"); +#else TEST_EQUAL(ti2.name(), "test1test2test3"); +#endif info["name.utf-8"] = "test2/../test3/.././../../test4"; torrent["info"] = info; diff --git a/test/web_server.py b/test/web_server.py index 2baabba0a..e87091d45 100644 --- a/test/web_server.py +++ b/test/web_server.py @@ -74,7 +74,7 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler): ranges = args['ranges'].split('-') try: - filename = s.path[1:s.path.find('seed?') + 4] + filename = s.path[1:s.path.find('seed?') + 4].replace('/', '\\') #print 'filename = %s' % filename f = open(filename, 'rb') f.seek(piece * 64 * 1024 + int(ranges[0])) @@ -93,7 +93,7 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler): s.end_headers() else: try: - filename = file_path[1:] + filename = file_path[1:].replace('/', '\\') # serve file by invoking default handler f = open(filename, 'rb') size = int(os.stat(filename).st_size)