unit test fixes
This commit is contained in:
@@ -128,6 +128,7 @@ TEST_F(file_manager_test, can_start_and_stop) {
|
||||
|
||||
TEST_F(file_manager_test, can_create_and_close_file) {
|
||||
cfg->set_enable_download_timeout(true);
|
||||
cfg->set_download_timeout_secs(1U);
|
||||
|
||||
EXPECT_CALL(mp, is_read_only()).WillRepeatedly(Return(false));
|
||||
EXPECT_CALL(mp, get_pinned_files())
|
||||
@@ -156,7 +157,7 @@ TEST_F(file_manager_test, can_create_and_close_file) {
|
||||
auto now = utils::time::get_time_now();
|
||||
auto meta = create_meta_attributes(now, FILE_ATTRIBUTE_ARCHIVE, now + 1U,
|
||||
now + 2U, false, 1, "key", 2, now + 3U,
|
||||
3U, 4U, source_path, 10U, now + 4U);
|
||||
0U, 4U, source_path, 10U, now + 4U);
|
||||
|
||||
EXPECT_CALL(mp, create_file("/test_create.txt", meta))
|
||||
.WillOnce(Return(api_error::success));
|
||||
@@ -235,6 +236,7 @@ TEST_F(file_manager_test, can_create_and_close_file) {
|
||||
|
||||
TEST_F(file_manager_test, can_open_and_close_file) {
|
||||
cfg->set_enable_download_timeout(true);
|
||||
cfg->set_download_timeout_secs(1U);
|
||||
|
||||
EXPECT_CALL(mp, is_read_only()).WillRepeatedly(Return(false));
|
||||
EXPECT_CALL(mp, get_pinned_files())
|
||||
@@ -261,7 +263,7 @@ TEST_F(file_manager_test, can_open_and_close_file) {
|
||||
auto now = utils::time::get_time_now();
|
||||
auto meta = create_meta_attributes(now, FILE_ATTRIBUTE_ARCHIVE, now + 1U,
|
||||
now + 2U, false, 1U, "key", 2U, now + 3U,
|
||||
3U, 4U, source_path, 10U, now + 4U);
|
||||
0U, 4U, source_path, 10U, now + 4U);
|
||||
|
||||
EXPECT_CALL(mp, create_file).Times(0U);
|
||||
|
||||
@@ -356,7 +358,7 @@ TEST_F(file_manager_test, can_open_and_close_multiple_handles_for_same_file) {
|
||||
auto now = utils::time::get_time_now();
|
||||
auto meta = create_meta_attributes(now, FILE_ATTRIBUTE_ARCHIVE, now + 1U,
|
||||
now + 2U, false, 1U, "key", 2U, now + 3U,
|
||||
3U, 4U, source_path, 10U, now + 4U);
|
||||
0U, 4U, source_path, 10U, now + 4U);
|
||||
|
||||
EXPECT_CALL(mp, create_file).Times(0U);
|
||||
|
||||
@@ -558,6 +560,7 @@ TEST_F(file_manager_test,
|
||||
|
||||
TEST_F(file_manager_test, upload_occurs_after_write_if_fully_downloaded) {
|
||||
cfg->set_enable_download_timeout(true);
|
||||
cfg->set_download_timeout_secs(1U);
|
||||
|
||||
EXPECT_CALL(mp, is_read_only()).WillRepeatedly(Return(false));
|
||||
EXPECT_CALL(mp, get_pinned_files())
|
||||
@@ -698,7 +701,7 @@ TEST_F(file_manager_test, can_evict_file) {
|
||||
|
||||
auto meta = create_meta_attributes(now, FILE_ATTRIBUTE_ARCHIVE, now + 1u,
|
||||
now + 2U, false, 1, "key", 2, now + 3u, 3u,
|
||||
4u, source_path, 10, now + 4u);
|
||||
0U, source_path, 10, now + 4u);
|
||||
std::uint64_t handle{};
|
||||
{
|
||||
std::shared_ptr<i_open_file> open_file;
|
||||
@@ -891,7 +894,7 @@ TEST_F(file_manager_test, evict_file_fails_if_file_is_uploading) {
|
||||
|
||||
auto meta = create_meta_attributes(now, FILE_ATTRIBUTE_ARCHIVE, now + 1u,
|
||||
now + 2U, false, 1, "", 2, now + 3u, 3u,
|
||||
4u, source_path, 10, now + 4u);
|
||||
0U, source_path, 10, now + 4u);
|
||||
std::uint64_t handle{};
|
||||
{
|
||||
std::shared_ptr<i_open_file> open_file;
|
||||
@@ -1087,7 +1090,7 @@ TEST_F(file_manager_test, file_is_not_opened_if_provider_create_file_fails) {
|
||||
auto now = utils::time::get_time_now();
|
||||
auto meta = create_meta_attributes(now, FILE_ATTRIBUTE_ARCHIVE, now + 1u,
|
||||
now + 2U, false, 1, "", 2, now + 3u, 3u,
|
||||
4u, "/test_create.src", 10, now + 4u);
|
||||
0U, "/test_create.src", 10, now + 4u);
|
||||
file_manager mgr(*cfg, mp);
|
||||
|
||||
EXPECT_CALL(mp, create_file("/test_create.txt", meta))
|
||||
@@ -1479,7 +1482,7 @@ TEST_F(file_manager_test, can_queue_and_remove_upload) {
|
||||
|
||||
TEST_F(file_manager_test, file_is_closed_after_download_timeout) {
|
||||
cfg->set_enable_download_timeout(true);
|
||||
cfg->set_download_timeout_secs(3U);
|
||||
cfg->set_download_timeout_secs(1U);
|
||||
|
||||
polling::instance().start(cfg.get());
|
||||
|
||||
@@ -1658,7 +1661,7 @@ TEST_F(file_manager_test,
|
||||
auto now = utils::time::get_time_now();
|
||||
auto meta = create_meta_attributes(now, FILE_ATTRIBUTE_ARCHIVE, now + 1U,
|
||||
now + 2U, false, 1U, "key", 2, now + 3U,
|
||||
3U, 4U, source_path, 10U, now + 4U);
|
||||
0U, 0U, source_path, 10U, now + 4U);
|
||||
|
||||
EXPECT_CALL(mp, create_file("/test_create.txt", meta))
|
||||
.WillOnce(Return(api_error::success));
|
||||
|
Reference in New Issue
Block a user