From f326c16bb288642246232ac173e2faa7cd4fad02 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 4 Oct 2024 14:08:11 +0200 Subject: Enable clang-analyzer-cplusplus.StringChecker check. --- test/utils/hermeticity/test_storage_config.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/utils/hermeticity/test_storage_config.hpp b/test/utils/hermeticity/test_storage_config.hpp index 5f5ecab4..4335592c 100644 --- a/test/utils/hermeticity/test_storage_config.hpp +++ b/test/utils/hermeticity/test_storage_config.hpp @@ -41,9 +41,13 @@ class TestStorageConfig final { * there. Hence we set the storage root to a fixed location under * TEST_TMPDIR which is set by the test launcher. */ + char const* const env_tmpdir = std::getenv("TEST_TMPDIR"); + if (env_tmpdir == nullptr) { + Logger::Log(LogLevel::Debug, "missing TEST_TMPDIR env variable"); + std::exit(EXIT_FAILURE); + } auto const test_tempdir = - std::filesystem::path{std::string{std::getenv("TEST_TMPDIR")}} / - ".test_build_root"; + std::filesystem::path{std::string{env_tmpdir}} / ".test_build_root"; auto temp_dir = TmpDir::Create(test_tempdir); if (temp_dir == nullptr) { -- cgit v1.2.3