updated build system
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
@ -25,11 +25,10 @@
|
||||
|
||||
#include "utils/config.hpp"
|
||||
|
||||
#include "utils/file.hpp"
|
||||
#include "utils/hash.hpp"
|
||||
#include "utils/types/file/i_file.hpp"
|
||||
|
||||
namespace repertory::utils::encryption {
|
||||
|
||||
class encrypting_reader final {
|
||||
public:
|
||||
encrypting_reader(std::string_view file_name, std::string_view source_path,
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "utils/config.hpp"
|
||||
|
||||
#include "utils/path.hpp"
|
||||
#include "utils/string.hpp"
|
||||
#include "utils/types/file/i_directory.hpp"
|
||||
#include "utils/types/file/i_file.hpp"
|
||||
#include "utils/types/file/i_fs_item.hpp"
|
||||
|
@ -19,8 +19,8 @@
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef FIFTHGRID_TEST_INCLUDE_TEST_HPP_
|
||||
#define FIFTHGRID_TEST_INCLUDE_TEST_HPP_
|
||||
#ifndef REPERTORY_TEST_INCLUDE_TEST_HPP_
|
||||
#define REPERTORY_TEST_INCLUDE_TEST_HPP_
|
||||
|
||||
#if defined(U)
|
||||
#undef U
|
||||
@ -36,7 +36,7 @@ using namespace ::testing;
|
||||
|
||||
#include "utils/all.hpp"
|
||||
|
||||
namespace fifthgrid::test {
|
||||
namespace repertory::test {
|
||||
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
||||
[[nodiscard]] auto
|
||||
create_random_file(std::size_t size) -> utils::file::i_file &;
|
||||
@ -58,6 +58,6 @@ auto generate_test_directory() -> utils::file::i_directory &;
|
||||
[[nodiscard]] auto get_test_input_dir() -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_test_output_dir() -> std::string;
|
||||
} // namespace fifthgrid::test
|
||||
} // namespace repertory::test
|
||||
|
||||
#endif // FIFTHGRID_TEST_INCLUDE_TEST_HPP_
|
||||
#endif // REPERTORY_TEST_INCLUDE_TEST_HPP_
|
||||
|
@ -24,15 +24,15 @@
|
||||
namespace {
|
||||
static std::recursive_mutex file_mtx{};
|
||||
|
||||
static std::vector<std::unique_ptr<fifthgrid::utils::file::i_fs_item>>
|
||||
static std::vector<std::unique_ptr<repertory::utils::file::i_fs_item>>
|
||||
generated_files{};
|
||||
|
||||
static void delete_generated_files() {
|
||||
fifthgrid::recur_mutex_lock lock{file_mtx};
|
||||
repertory::recur_mutex_lock lock{file_mtx};
|
||||
std::optional<std::string> parent_path;
|
||||
for (auto &&path : generated_files) {
|
||||
if (parent_path->empty()) {
|
||||
parent_path = fifthgrid::utils::path::get_parent_path(path->get_path());
|
||||
parent_path = repertory::utils::path::get_parent_path(path->get_path());
|
||||
}
|
||||
|
||||
[[maybe_unused]] auto removed = path->remove();
|
||||
@ -41,7 +41,7 @@ static void delete_generated_files() {
|
||||
|
||||
if (parent_path.has_value()) {
|
||||
EXPECT_TRUE(
|
||||
fifthgrid::utils::file::directory(*parent_path).remove_recursively());
|
||||
repertory::utils::file::directory(*parent_path).remove_recursively());
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ struct file_deleter final {
|
||||
static auto deleter{std::make_unique<file_deleter>()};
|
||||
} // namespace
|
||||
|
||||
namespace fifthgrid::test {
|
||||
namespace repertory::test {
|
||||
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
||||
auto create_random_file(std::size_t size) -> utils::file::i_file & {
|
||||
recur_mutex_lock lock{file_mtx};
|
||||
@ -134,4 +134,4 @@ auto get_test_output_dir() -> std::string {
|
||||
|
||||
return test_path;
|
||||
}
|
||||
} // namespace fifthgrid::test
|
||||
} // namespace repertory::test
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "test.hpp"
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
TEST(utils_collection, excludes) {
|
||||
auto data = {"cow", "moose", "dog", "chicken"};
|
||||
EXPECT_FALSE(utils::collection::excludes(data, "chicken"));
|
||||
@ -247,4 +247,4 @@ TEST(utils_collection, remove_element) {
|
||||
EXPECT_EQ(static_cast<std::uint8_t>(0xEE), col.at(1U));
|
||||
}
|
||||
}
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "test.hpp"
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
TEST(utils_common, calculate_read_size) {
|
||||
auto read_size = utils::calculate_read_size(0U, 0U, 0U);
|
||||
EXPECT_EQ(0U, read_size);
|
||||
@ -273,7 +273,7 @@ TEST(utils_common, get_environment_variable) {
|
||||
std::string path;
|
||||
|
||||
#if defined(_WIN32)
|
||||
path.resize(fifthgrid::max_path_length + 1U);
|
||||
path.resize(repertory::max_path_length + 1U);
|
||||
auto size = ::GetEnvironmentVariableA(path_env.c_str(), path.data(), 0U);
|
||||
|
||||
path.resize(size);
|
||||
@ -305,4 +305,4 @@ TEST(utils_common, get_next_available_port_fails_if_starting_point_is_zero) {
|
||||
EXPECT_EQ(0U, available_port);
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_BOOST)
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#if defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST)
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
TEST(utils_encrypting_reader, read_file_data) {
|
||||
const auto token = std::string("moose");
|
||||
auto &source_file = test::create_random_file(
|
||||
@ -220,6 +220,6 @@ TEST(utils_encrypting_reader, read_file_data_in_multiple_chunks_as_stream) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
||||
#endif // defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST)
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
static constexpr const std::string_view token{"moose"};
|
||||
static constexpr const std::wstring_view token_w{L"moose"};
|
||||
|
||||
@ -278,6 +278,6 @@ TEST(utils_encryption, decrypt_file_path) {
|
||||
}
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_BOOST)
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
||||
#endif // defined(PROJECT_ENABLE_LIBSODIUM)
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "test.hpp"
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
template <typename T, typename U>
|
||||
constexpr bool is_decay_equ = std::is_same_v<std::decay_t<T>, U>;
|
||||
|
||||
@ -63,4 +63,4 @@ TEST(utils_error, can_override_exception_handler) {
|
||||
|
||||
utils::error::set_exception_handler(&utils::error::default_exception_handler);
|
||||
}
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
@ -25,7 +25,7 @@ namespace {
|
||||
static constexpr const auto file_type_count{1U};
|
||||
}
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
TEST(utils_file, can_create_file) {
|
||||
for (auto idx = 0U; idx < file_type_count; ++idx) {
|
||||
auto path = test::generate_test_file_name("utils_file");
|
||||
@ -300,4 +300,4 @@ TEST(util_file, file_exists_in_path) {
|
||||
utils::string::from_utf8(test_dir.get_path()), L"moose.txt"));
|
||||
}
|
||||
}
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
TEST(utils_hash, hash_type_sizes) {
|
||||
EXPECT_EQ(32U, utils::encryption::hash_256_t{}.size());
|
||||
EXPECT_EQ(48U, utils::encryption::hash_384_t{}.size());
|
||||
@ -181,6 +181,6 @@ TEST(utils_hash, sha512) {
|
||||
"5ac3bcc80844b7d50b1cc6603444bbe7cfcf8fc0aa1ee3c636d9e339",
|
||||
hash.c_str());
|
||||
}
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
||||
#endif // defined(PROJECT_ENABLE_LIBSODIUM)
|
||||
|
@ -25,27 +25,27 @@
|
||||
namespace {
|
||||
static const auto test_path = [](std::string str) -> std::string {
|
||||
#if defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
|
||||
if (fifthgrid::utils::string::begins_with(str, "\\")) {
|
||||
str = fifthgrid::utils::string::to_lower(
|
||||
if (repertory::utils::string::begins_with(str, "\\")) {
|
||||
str = repertory::utils::string::to_lower(
|
||||
std::filesystem::current_path().string().substr(0U, 2U)) +
|
||||
str;
|
||||
}
|
||||
|
||||
str = std::string{fifthgrid::utils::path::long_notation} + str;
|
||||
str = std::string{repertory::utils::path::long_notation} + str;
|
||||
#else // !defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
|
||||
if (fifthgrid::utils::string::begins_with(str, "\\")) {
|
||||
str = fifthgrid::utils::string::to_lower(
|
||||
if (repertory::utils::string::begins_with(str, "\\")) {
|
||||
str = repertory::utils::string::to_lower(
|
||||
std::filesystem::current_path().string().substr(0U, 2U)) +
|
||||
str;
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
|
||||
|
||||
return fifthgrid::utils::string::right_trim(str, '\\');
|
||||
return repertory::utils::string::right_trim(str, '\\');
|
||||
};
|
||||
} // namespace
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
TEST(utils_path, constants) {
|
||||
EXPECT_EQ(std::string_view{"\\"}, utils::path::backslash);
|
||||
EXPECT_EQ(std::wstring_view{L"\\"}, utils::path::backslash_w);
|
||||
@ -400,7 +400,7 @@ TEST(utils_path, absolute_can_resolve_path_variables) {
|
||||
std::string home{};
|
||||
|
||||
#if defined(_WIN32)
|
||||
home.resize(fifthgrid::max_path_length + 1U);
|
||||
home.resize(repertory::max_path_length + 1U);
|
||||
auto size = ::GetEnvironmentVariableA("USERPROFILE", home.data(), 0U);
|
||||
|
||||
home.resize(size);
|
||||
@ -546,4 +546,4 @@ TEST(utils_path, does_not_contain_trash_directory) {
|
||||
}
|
||||
#endif // defined(_WIN32)
|
||||
}
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "test.hpp"
|
||||
|
||||
namespace fifthgrid {
|
||||
namespace repertory {
|
||||
TEST(utils_string, begins_with) {
|
||||
std::string str{"moose"};
|
||||
EXPECT_TRUE(utils::string::begins_with(str, "m"));
|
||||
@ -134,4 +134,4 @@ TEST(utils_string, to_bool) {
|
||||
EXPECT_FALSE(utils::string::to_bool("0"));
|
||||
EXPECT_FALSE(utils::string::to_bool("00000.00000"));
|
||||
}
|
||||
} // namespace fifthgrid
|
||||
} // namespace repertory
|
||||
|
Reference in New Issue
Block a user