land libtorrent_aio branch in trunk
This commit is contained in:
@@ -34,13 +34,41 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "test.hpp"
|
||||
#include "setup_transfer.hpp"
|
||||
#include "libtorrent/alert_types.hpp"
|
||||
|
||||
using namespace libtorrent;
|
||||
namespace lt = libtorrent;
|
||||
|
||||
int test_main()
|
||||
{
|
||||
session ses(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48130, 48140), "0.0.0.0", 0);
|
||||
ses.set_alert_mask(~0);
|
||||
settings_pack p;
|
||||
p.set_int(settings_pack::alert_mask, ~0);
|
||||
lt::session ses(p, fingerprint("LT", 0, 1, 0, 0));
|
||||
|
||||
settings_pack sett;
|
||||
sett.set_int(settings_pack::cache_size, 100);
|
||||
sett.set_int(settings_pack::max_queued_disk_bytes, 1000 * 16 * 1024);
|
||||
|
||||
ses.apply_settings(sett);
|
||||
|
||||
// verify that we get the appropriate performance warning because
|
||||
// we're allowing a larger queue than we have cache.
|
||||
|
||||
|
||||
std::auto_ptr<alert> a;
|
||||
for (;;)
|
||||
{
|
||||
a = wait_for_alert(ses, performance_alert::alert_type, "ses1");
|
||||
|
||||
if (a.get() == NULL) break;
|
||||
TEST_EQUAL(a.get()->type(), performance_alert::alert_type);
|
||||
|
||||
if (alert_cast<performance_alert>(a.get())->warning_code
|
||||
== performance_alert::too_high_disk_queue_limit)
|
||||
break;
|
||||
}
|
||||
|
||||
TEST_CHECK(a.get());
|
||||
|
||||
// make sure the destructor waits properly
|
||||
// for the asynchronous call to set the alert
|
||||
|
Reference in New Issue
Block a user