From 5581e163c36003a78f283e585f5338ecd3327a35 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Mon, 28 Feb 2022 13:29:17 +0100 Subject: Tests: Avoid std::tmpnam as it is considered unsafe ... and therefore produces linker warnings. --- test/buildtool/build_engine/base_maps/test_repo.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/buildtool/build_engine/base_maps/test_repo.hpp') diff --git a/test/buildtool/build_engine/base_maps/test_repo.hpp b/test/buildtool/build_engine/base_maps/test_repo.hpp index 1269d2da..82dd1fc5 100644 --- a/test/buildtool/build_engine/base_maps/test_repo.hpp +++ b/test/buildtool/build_engine/base_maps/test_repo.hpp @@ -28,8 +28,10 @@ static auto const kJsonTreeId = [[nodiscard]] static inline auto CreateTestRepo() -> std::optional { - auto repo_path = GetTestDir() / "test_repo" / - std::filesystem::path{std::tmpnam(nullptr)}.filename(); + static std::atomic counter{}; + auto repo_path = + GetTestDir() / "test_repo" / + std::filesystem::path{std::to_string(counter++)}.filename(); auto cmd = fmt::format( "git clone --bare {} {}", kBundlePath.string(), repo_path.string()); if (std::system(cmd.c_str()) == 0) { -- cgit v1.2.3