more tests of edge case settings

This commit is contained in:
arvidn 2017-02-16 20:21:29 -05:00 committed by Arvid Norberg
parent 799cd8163b
commit a12bfe3164
1 changed files with 45 additions and 0 deletions

View File

@ -489,6 +489,14 @@ TORRENT_TEST(default_connections_limit)
);
}
TORRENT_TEST(default_connections_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::connections_limit, -1); }
);
}
TORRENT_TEST(redundant_have)
{
test_settings([](lt::settings_pack& pack) {
@ -524,6 +532,13 @@ TORRENT_TEST(active_seeds)
);
}
TORRENT_TEST(active_seeds_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::active_seeds, -1); }
);
}
TORRENT_TEST(active_limit)
{
test_settings([](lt::settings_pack& pack) {
@ -531,6 +546,13 @@ TORRENT_TEST(active_limit)
);
}
TORRENT_TEST(active_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::active_limit, -1); }
);
}
TORRENT_TEST(upload_rate_limit)
{
test_settings([](lt::settings_pack& pack) {
@ -538,6 +560,13 @@ TORRENT_TEST(upload_rate_limit)
);
}
TORRENT_TEST(upload_rate_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::upload_rate_limit, -1); }
);
}
TORRENT_TEST(download_rate_limit)
{
test_settings([](lt::settings_pack& pack) {
@ -545,6 +574,14 @@ TORRENT_TEST(download_rate_limit)
);
}
TORRENT_TEST(download_rate_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::download_rate_limit, -1); }
);
}
TORRENT_TEST(unchoke_slots_limit)
{
test_settings([](lt::settings_pack& pack) {
@ -552,6 +589,14 @@ TORRENT_TEST(unchoke_slots_limit)
);
}
TORRENT_TEST(unchoke_slots_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::unchoke_slots_limit, -1);
pack.set_int(settings_pack::choking_algorithm, settings_pack::fixed_slots_choker);
});
}
// TODO: add test that makes sure a torrent in graceful pause mode won't make
// outgoing connections
// TODO: add test that makes sure a torrent in graceful pause mode won't accept