diff --git a/simulation/test_swarm.cpp b/simulation/test_swarm.cpp index 47c246051..c2e94cb4e 100644 --- a/simulation/test_swarm.cpp +++ b/simulation/test_swarm.cpp @@ -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