diff --git a/test/libdnf5/repo/test_temp_files_memory.cpp b/test/libdnf5/repo/test_temp_files_memory.cpp index c1437c2778..7ba62ee6c5 100644 --- a/test/libdnf5/repo/test_temp_files_memory.cpp +++ b/test/libdnf5/repo/test_temp_files_memory.cpp @@ -79,6 +79,15 @@ void TempFilesMemoryTest::test_add_files_when_empty_storage() { CPPUNIT_ASSERT_EQUAL(new_paths, memory.get_files()); } +void TempFilesMemoryTest::test_add_no_files_when_empty_storage() { + TempFilesMemory memory(base.get_weak_ptr(), parent_dir_path); + CPPUNIT_ASSERT(memory.get_files().empty()); + + std::vector empty_paths = {}; + memory.add_files(empty_paths); + CPPUNIT_ASSERT(memory.get_files().empty()); +} + void TempFilesMemoryTest::test_add_files_when_existing_storage() { std::vector new_paths = {"path3", "path4"}; libdnf5::utils::fs::File(full_path, "w") diff --git a/test/libdnf5/repo/test_temp_files_memory.hpp b/test/libdnf5/repo/test_temp_files_memory.hpp index 42f23f9836..f552f257fb 100644 --- a/test/libdnf5/repo/test_temp_files_memory.hpp +++ b/test/libdnf5/repo/test_temp_files_memory.hpp @@ -34,6 +34,7 @@ class TempFilesMemoryTest : public BaseTestCase { CPPUNIT_TEST(test_get_files_throws_exception_when_invalid_format); CPPUNIT_TEST(test_get_files_returns_stored_values); CPPUNIT_TEST(test_add_files_when_empty_storage); + CPPUNIT_TEST(test_add_no_files_when_empty_storage); CPPUNIT_TEST(test_add_files_when_existing_storage); CPPUNIT_TEST(test_add_files_deduplicates_and_sorts_data); CPPUNIT_TEST(test_clear_deletes_storage_content); @@ -48,6 +49,7 @@ class TempFilesMemoryTest : public BaseTestCase { void test_get_files_throws_exception_when_invalid_format(); void test_get_files_returns_stored_values(); void test_add_files_when_empty_storage(); + void test_add_no_files_when_empty_storage(); void test_add_files_when_existing_storage(); void test_add_files_deduplicates_and_sorts_data(); void test_clear_deletes_storage_content();