diff --git a/test/setup_transfer.cpp b/test/setup_transfer.cpp index 5761a1597..c0205c5df 100644 --- a/test/setup_transfer.cpp +++ b/test/setup_transfer.cpp @@ -653,10 +653,11 @@ void create_random_files(std::string const& path, const int file_sizes[], int nu std::string full_path = combine_path(path, dirname); lt::create_directories(full_path, ec); - if (ec) fprintf(stderr, "create_directory(%s) failed: (%d) %s\n" + if (ec) std::printf("create_directory(%s) failed: (%d) %s\n" , full_path.c_str(), ec.value(), ec.message().c_str()); full_path = combine_path(full_path, filename); + std::printf("creating file: %s\n", full_path.c_str()); int to_write = file_sizes[i]; if (fs) fs->add_file(full_path, to_write); diff --git a/test/test_checking.cpp b/test/test_checking.cpp index c0a3a1577..0db9a6052 100644 --- a/test/test_checking.cpp +++ b/test/test_checking.cpp @@ -320,6 +320,8 @@ TORRENT_TEST(discrete_checking) file_storage fs; create_random_files("test_torrent_dir", file_sizes, num_files, &fs); + TEST_EQUAL(fs.num_files(), 2); + lt::create_torrent t(fs, piece_size, 1, lt::create_torrent::optimize_alignment); set_piece_hashes(t, ".", ec); if (ec) printf("ERROR: set_piece_hashes: (%d) %s\n", ec.value(), ec.message().c_str()); @@ -328,7 +330,10 @@ TORRENT_TEST(discrete_checking) bencode(std::back_inserter(buf), t.generate()); auto ti = std::make_shared(buf, ec, from_span); printf("generated torrent: %s test_torrent_dir\n", aux::to_hex(ti->info_hash().to_string()).c_str()); + + // we have two files, but there's a padfile now too TEST_EQUAL(ti->num_files(), 3); + { session ses1(settings()); add_torrent_params p;