fix tests
This commit is contained in:
parent
2a33000ace
commit
ca892c7f11
@ -409,14 +409,14 @@ TEST(file_manager, download_is_stored_after_write_if_partially_downloaded) {
|
|||||||
const auto source_path = utils::path::combine(
|
const auto source_path = utils::path::combine(
|
||||||
cfg.get_cache_directory(), {utils::create_uuid_string()});
|
cfg.get_cache_directory(), {utils::create_uuid_string()});
|
||||||
|
|
||||||
event_consumer es("download_stored", [&source_path](const event &e) {
|
event_consumer es("download_resume_added", [&source_path](const event &e) {
|
||||||
const auto &ee = dynamic_cast<const download_stored &>(e);
|
const auto &ee = dynamic_cast<const download_resume_added &>(e);
|
||||||
EXPECT_STREQ("/test_write_partial_download.txt",
|
EXPECT_STREQ("/test_write_partial_download.txt",
|
||||||
ee.get_api_path().get<std::string>().c_str());
|
ee.get_api_path().get<std::string>().c_str());
|
||||||
EXPECT_STREQ(source_path.c_str(),
|
EXPECT_STREQ(source_path.c_str(),
|
||||||
ee.get_dest_path().get<std::string>().c_str());
|
ee.get_dest_path().get<std::string>().c_str());
|
||||||
});
|
});
|
||||||
event_capture ec({"download_stored"},
|
event_capture ec({"download_resume_added"},
|
||||||
{"file_upload_completed", "file_upload_queued"});
|
{"file_upload_completed", "file_upload_queued"});
|
||||||
|
|
||||||
const auto now = utils::time::get_time_now();
|
const auto now = utils::time::get_time_now();
|
||||||
@ -499,7 +499,7 @@ TEST(file_manager, download_is_stored_after_write_if_partially_downloaded) {
|
|||||||
fm.stop();
|
fm.stop();
|
||||||
ec.wait_for_empty();
|
ec.wait_for_empty();
|
||||||
|
|
||||||
event_capture ec2({"download_restored", "download_stored"},
|
event_capture ec2({"download_restored", "download_resume_added"},
|
||||||
{"file_upload_completed", "file_upload_queued"});
|
{"file_upload_completed", "file_upload_queued"});
|
||||||
EXPECT_EQ(std::size_t(0u), fm.get_open_file_count());
|
EXPECT_EQ(std::size_t(0u), fm.get_open_file_count());
|
||||||
EXPECT_EQ(std::size_t(0u), fm.get_open_handle_count());
|
EXPECT_EQ(std::size_t(0u), fm.get_open_handle_count());
|
||||||
@ -1633,7 +1633,7 @@ TEST(file_manager, can_queue_and_remove_upload) {
|
|||||||
event_system::instance().start();
|
event_system::instance().start();
|
||||||
|
|
||||||
{
|
{
|
||||||
event_capture ec({"file_upload_queued", "download_stored_removed"});
|
event_capture ec({"file_upload_queued", "download_resume_removed"});
|
||||||
|
|
||||||
app_config cfg(provider_type::sia, file_manager_dir);
|
app_config cfg(provider_type::sia, file_manager_dir);
|
||||||
cfg.set_enable_chunk_downloader_timeout(false);
|
cfg.set_enable_chunk_downloader_timeout(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user