mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-06 06:09:22 +00:00
Range-check global throttle rates before narrowing them to kB.
Multiplying kB back to bytes in unsigned int wrapped 2^32 to 0, which means unlimited.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include "test/helpers/test_fixture.h"
|
||||
|
||||
class TestCommandThrottle : public test_fixture {
|
||||
CPPUNIT_TEST_SUITE(TestCommandThrottle);
|
||||
|
||||
CPPUNIT_TEST(test_global_rate_in_range);
|
||||
CPPUNIT_TEST(test_global_rate_kb_out_of_range);
|
||||
CPPUNIT_TEST(test_global_rate_bytes_out_of_range);
|
||||
CPPUNIT_TEST(test_global_rate_negative);
|
||||
CPPUNIT_TEST(test_named_rate_in_range);
|
||||
CPPUNIT_TEST(test_named_rate_out_of_range);
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
void test_global_rate_in_range();
|
||||
void test_global_rate_kb_out_of_range();
|
||||
void test_global_rate_bytes_out_of_range();
|
||||
void test_global_rate_negative();
|
||||
void test_named_rate_in_range();
|
||||
void test_named_rate_out_of_range();
|
||||
};
|
||||
Reference in New Issue
Block a user