fix test_receive_buffer. print errors in test_utp.cpp

This commit is contained in:
Arvid Norberg 2019-11-18 00:16:18 +01:00 committed by Arvid Norberg
parent 54edd434f4
commit fbb7c1e2e3
2 changed files with 9 additions and 3 deletions

View File

@ -215,11 +215,11 @@ TORRENT_TEST(receive_buffer_watermark)
{
receive_buffer b;
b.reset(0x4000);
b.reserve(35000000);
b.received(35000000);
b.reserve(33500000);
b.received(33500000);
b.normalize();
TEST_EQUAL(b.watermark(), 35000000);
TEST_EQUAL(b.watermark(), 33500000);
}
#if !defined(TORRENT_DISABLE_ENCRYPTION) && !defined(TORRENT_DISABLE_EXTENSIONS)

View File

@ -84,7 +84,13 @@ void test_transfer()
torrent_handle tor1;
torrent_handle tor2;
ec.clear();
create_directory("./tmp1_utp", ec);
if (ec)
{
std::printf("ERROR: failed to create test directory \"./tmp1_utp\": (%d) %s\n"
, ec.value(), ec.message().c_str());
}
std::ofstream file("./tmp1_utp/temporary");
std::shared_ptr<torrent_info> t = ::create_torrent(&file, "temporary", 128 * 1024, 6, false);
file.close();