replaced boost.filesystem with custom functions (improves efficiency and drops unnecessary dependencies and improves libtorrent portability)
This commit is contained in:
@@ -34,15 +34,12 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "libtorrent/hasher.hpp"
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
|
||||
#include "test.hpp"
|
||||
#include "setup_transfer.hpp"
|
||||
#include "libtorrent/extensions/metadata_transfer.hpp"
|
||||
#include "libtorrent/extensions/ut_metadata.hpp"
|
||||
|
||||
using boost::filesystem::remove_all;
|
||||
using boost::tuples::ignore;
|
||||
|
||||
void test_transfer(bool clear_files, bool disconnect
|
||||
@@ -104,16 +101,15 @@ void test_transfer(bool clear_files, bool disconnect
|
||||
TEST_CHECK(tor2.is_seed());
|
||||
if (tor2.is_seed()) std::cerr << "done\n";
|
||||
|
||||
using boost::filesystem::remove_all;
|
||||
remove_all("./tmp1_meta");
|
||||
remove_all("./tmp2_meta");
|
||||
remove_all("./tmp3_meta");
|
||||
error_code ec;
|
||||
remove_all("./tmp1_meta", ec);
|
||||
remove_all("./tmp2_meta", ec);
|
||||
remove_all("./tmp3_meta", ec);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
{
|
||||
using namespace libtorrent;
|
||||
using namespace boost::filesystem;
|
||||
|
||||
// test to disconnect one client prematurely
|
||||
test_transfer(true, true, &create_metadata_plugin);
|
||||
@@ -129,8 +125,9 @@ int test_main()
|
||||
// test where both have data (to trigger the file check)
|
||||
test_transfer(false, false, &create_ut_metadata_plugin);
|
||||
|
||||
remove_all("./tmp1");
|
||||
remove_all("./tmp2");
|
||||
error_code ec;
|
||||
remove_all("./tmp1", ec);
|
||||
remove_all("./tmp2", ec);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user