Skip to content

Commit

Permalink
Use NullSafeStringView.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 722730515
  • Loading branch information
arcs-c3po committed Feb 3, 2025
1 parent 85ff04e commit bdb867b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/common/utils/test/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
namespace raksha::utils::test {

std::filesystem::path GetTestDataDir(std::string path) {
absl::string_view test_srcdir_env = std::getenv("TEST_SRCDIR");
absl::string_view test_workspace_env = std::getenv("TEST_WORKSPACE");
CHECK(test_srcdir_env != "");
CHECK(test_workspace_env != "");
return std::filesystem::path(test_srcdir_env) /
std::filesystem::path(test_workspace_env) /
std::move(path);
absl::string_view test_srcdir_env =
absl::NullSafeStringView(std::getenv("TEST_SRCDIR"));
absl::string_view test_workspace_env =
absl::NullSafeStringView(std::getenv("TEST_WORKSPACE"));
CHECK(test_srcdir_env != "");
CHECK(test_workspace_env != "");
return std::filesystem::path(test_srcdir_env) /
std::filesystem::path(test_workspace_env) / std::move(path);
}

std::vector<std::string> ReadFileLines(const std::filesystem::path& file) {
Expand Down

0 comments on commit bdb867b

Please sign in to comment.