diff options
author | Nikos Tsipinakis <nikos@tsipinakis.com> | 2024-05-01 07:35:02 +0200 |
---|---|---|
committer | Nikos Tsipinakis <nikos@tsipinakis.com> | 2024-05-01 07:40:49 +0200 |
commit | 8bc9cf0c22c42f3c4a33ad4879189d660b61dd1a (patch) | |
tree | 8fa33378f9ba1991a1a7dadc31f52f1ee8322477 | |
parent | c08ad09f91db3d7398b9637daf31bd2be0db9f2a (diff) |
Fix clang-tidy errors
-rw-r--r-- | test/configcontainer.cpp | 4 | ||||
-rw-r--r-- | test/utils.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/configcontainer.cpp b/test/configcontainer.cpp index fbbdb0b9..c04b453f 100644 --- a/test/configcontainer.cpp +++ b/test/configcontainer.cpp @@ -34,7 +34,9 @@ TEST_CASE("Parses test config without exceptions", "[ConfigContainer]") } SECTION("Tilde got expanded into path to user's home directory") { - std::string cachefilecomp = ::getenv("HOME"); + char* home = ::getenv("HOME"); + REQUIRE(home != nullptr); + std::string cachefilecomp = home; cachefilecomp.append("/foo"); REQUIRE(cfg.get_configvalue("cache-file") == cachefilecomp); } diff --git a/test/utils.cpp b/test/utils.cpp index 618f6b6f..eab913b5 100644 --- a/test/utils.cpp +++ b/test/utils.cpp @@ -2008,7 +2008,7 @@ TEST_CASE("translit() returns the value of `tocode`, maybe with \"//TRANSLIT\" a // tests checks just the bare minimum: the function doesn't crash, doesn't // throw exceptions, and returns something resembling a correct value. - const auto check = [](std::string fromcode, std::string tocode) { + const auto check = [&](std::string fromcode, std::string tocode) { DYNAMIC_SECTION(fromcode << " → " << tocode) { const auto expected1(tocode); const auto expected2(tocode + "//TRANSLIT"); |