From 26358b1e67084ceddddd7caa05ae58b3f75a9da7 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 25 Jan 2025 06:20:50 -0600 Subject: [PATCH] unit tests and fixes --- repertory/librepertory/src/db/impl/rdb_file_db.cpp | 10 +++------- repertory/repertory_test/src/file_db_test.cpp | 4 +++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/repertory/librepertory/src/db/impl/rdb_file_db.cpp b/repertory/librepertory/src/db/impl/rdb_file_db.cpp index 255f60f6..8e1e1810 100644 --- a/repertory/librepertory/src/db/impl/rdb_file_db.cpp +++ b/repertory/librepertory/src/db/impl/rdb_file_db.cpp @@ -171,10 +171,6 @@ void rdb_file_db::enumerate_item_list( callback(list); list.clear(); } - - if (not list.empty()) { - callback(list); - } } { @@ -194,10 +190,10 @@ void rdb_file_db::enumerate_item_list( callback(list); list.clear(); } + } - if (not list.empty()) { - callback(list); - } + if (not list.empty()) { + callback(list); } } diff --git a/repertory/repertory_test/src/file_db_test.cpp b/repertory/repertory_test/src/file_db_test.cpp index 397a6b52..6708a218 100644 --- a/repertory/repertory_test/src/file_db_test.cpp +++ b/repertory/repertory_test/src/file_db_test.cpp @@ -21,6 +21,7 @@ */ #include "fixtures/file_db_fixture.hpp" +#include namespace { const auto get_stop_requested = []() -> bool { return false; }; @@ -343,7 +344,8 @@ TYPED_TEST(file_db_test, item_not_found_is_returned_for_non_existing_api_path) { TYPED_TEST(file_db_test, can_enumerate_item_list) { this->file_db->clear(); - EXPECT_EQ(api_error::success, this->file_db->add_directory("/", "c:\\test")); + EXPECT_EQ(api_error::success, + this->file_db->add_directory("/", std::filesystem::current_path())); EXPECT_EQ(api_error::success, this->file_db->add_or_update_file({ "/file", 0U,