replaced boost.filesystem with custom functions (improves efficiency and drops unnecessary dependencies and improves libtorrent portability)

This commit is contained in:
Arvid Norberg
2009-10-26 01:29:39 +00:00
parent 4412e2f1f6
commit c418165e07
60 changed files with 1555 additions and 1273 deletions

View File

@@ -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;
}