remove remaining references to storage_mode_compact (since it's been deprecated for quite a while now, and no longer implemented)

This commit is contained in:
arvidn 2016-03-20 16:31:17 -04:00
parent 2dd28c1708
commit f5c112eefc
6 changed files with 11 additions and 40 deletions

View File

@ -129,8 +129,7 @@ enum proxy_type_t
enum storage_mode_t
{
storage_mode_allocate = 0,
storage_mode_sparse,
storage_mode_compact
storage_mode_sparse
};
enum state_t
@ -144,7 +143,7 @@ enum state_t
allocating,
checking_resume_data
};
struct torrent_status
{
enum state_t state;

View File

@ -663,9 +663,6 @@ void bind_session()
enum_<storage_mode_t>("storage_mode_t")
.value("storage_mode_allocate", storage_mode_allocate)
.value("storage_mode_sparse", storage_mode_sparse)
#ifndef TORRENT_NO_DEPRECATE
.value("storage_mode_compact", storage_mode_compact)
#endif
;
enum_<lt::session::options_t>("options_t")

View File

@ -55,14 +55,7 @@ namespace libtorrent
// All pieces will be written to the place where they belong and sparse files
// will be used. This is the recommended, and default mode.
storage_mode_sparse,
// internal
internal_storage_mode_compact_deprecated
#ifndef TORRENT_NO_DEPRECATE
, // comma here to avoid compiler warning
storage_mode_compact = internal_storage_mode_compact_deprecated
#endif
storage_mode_sparse
};
// see default_storage::default_storage()
@ -78,7 +71,7 @@ namespace libtorrent
std::vector<boost::uint8_t> const* priorities; // optional
torrent_info const* info; // optional
};
typedef boost::function<storage_interface*(storage_params const& params)> storage_constructor_type;
// the constructor function for the regular file storage. This is the

View File

@ -478,10 +478,6 @@ void test_check_files(std::string const& test_path
io.set_num_threads(0);
}
#ifdef TORRENT_NO_DEPRECATE
#define storage_mode_compact storage_mode_sparse
#endif
// TODO: 2 split this test up into smaller parts
void run_test(bool unbuffered)
{
@ -531,7 +527,7 @@ void run_test(bool unbuffered)
std::cerr << "=== test 1 === " << (unbuffered?"unbuffered":"buffered") << std::endl;
// run_storage_tests writes piece 0, 1 and 2. not 3
run_storage_tests(info, fs, test_path, storage_mode_compact, unbuffered);
run_storage_tests(info, fs, test_path, storage_mode_sparse, unbuffered);
// make sure the files have the correct size
std::string base = combine_path(test_path, "temp_storage");
@ -575,7 +571,7 @@ void run_test(bool unbuffered)
std::cerr << "=== test 3 ===" << std::endl;
run_storage_tests(info, fs, test_path, storage_mode_compact, unbuffered);
run_storage_tests(info, fs, test_path, storage_mode_sparse, unbuffered);
TEST_EQUAL(file_size(combine_path(test_path, combine_path("temp_storage", "test1.tmp"))), piece_size * 3);
remove_all(combine_path(test_path, "temp_storage"), ec);
@ -608,7 +604,7 @@ void run_test(bool unbuffered)
std::cerr << "=== test 6 ===" << std::endl;
test_check_files(test_path, storage_mode_sparse, unbuffered);
test_check_files(test_path, storage_mode_compact, unbuffered);
test_check_files(test_path, storage_mode_sparse, unbuffered);
std::cerr << "=== test 7 ===" << std::endl;
test_rename(test_path);
@ -653,7 +649,7 @@ TORRENT_TEST(fastresume)
add_torrent_params p;
p.ti = boost::make_shared<torrent_info>(boost::cref(*t));
p.save_path = combine_path(test_path, "tmp1");
p.storage_mode = storage_mode_compact;
p.storage_mode = storage_mode_sparse;
torrent_handle h = ses.add_torrent(p, ec);
TEST_CHECK(exists(combine_path(p.save_path, "temporary")));
if (!exists(combine_path(p.save_path, "temporary")))
@ -714,7 +710,7 @@ TORRENT_TEST(fastresume)
p.flags &= ~add_torrent_params::flag_auto_managed;
p.ti = boost::make_shared<torrent_info>(boost::cref(*t));
p.save_path = combine_path(test_path, "tmp1");
p.storage_mode = storage_mode_compact;
p.storage_mode = storage_mode_sparse;
bencode(std::back_inserter(p.resume_data), resume);
torrent_handle h = ses.add_torrent(p, ec);
@ -769,7 +765,7 @@ TORRENT_TEST(rename_file_fastresume)
add_torrent_params p;
p.ti = boost::make_shared<torrent_info>(boost::cref(*t));
p.save_path = combine_path(test_path, "tmp2");
p.storage_mode = storage_mode_compact;
p.storage_mode = storage_mode_sparse;
torrent_handle h = ses.add_torrent(p, ec);
h.rename_file(0, "testing_renamed_files");
@ -817,7 +813,7 @@ TORRENT_TEST(rename_file_fastresume)
add_torrent_params p;
p.ti = boost::make_shared<torrent_info>(boost::cref(*t));
p.save_path = combine_path(test_path, "tmp2");
p.storage_mode = storage_mode_compact;
p.storage_mode = storage_mode_sparse;
bencode(std::back_inserter(p.resume_data), resume);
torrent_handle h = ses.add_torrent(p, ec);

View File

@ -431,14 +431,3 @@ TORRENT_TEST(allocate)
cleanup();
}
#ifndef TORRENT_NO_DEPRECATE
TORRENT_TEST(compact)
{
using namespace libtorrent;
fprintf(stderr, "compact mode\n");
test_transfer(0, settings_pack(), false, storage_mode_compact);
cleanup();
}
#endif

View File

@ -139,9 +139,6 @@ void test_transfer(lt::session& ses, boost::shared_ptr<torrent_info> torrent_fil
p.flags |= add_torrent_params::flag_sequential_download;
p.ti = torrent_file;
p.save_path = save_path;
#ifndef TORRENT_NO_DEPRECATE
p.storage_mode = storage_mode_compact;
#endif
torrent_handle th = ses.add_torrent(p, ec);
printf("adding torrent, save_path = \"%s\" cwd = \"%s\" torrent = \"%s\"\n"
, save_path.c_str(), current_working_directory().c_str()