Skip to content

Commit

Permalink
test: Fix NULL being used in std::string construction
Browse files Browse the repository at this point in the history
  • Loading branch information
uristdwarf committed Aug 21, 2024
1 parent 5852fb1 commit d8b9665
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/saunafs-tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class BashTestingSuite : public testing::Test {
protected:
void run_test_case(std::string suite, std::string testCase) {
std::string testDataPath = TO_STRING(TEST_DATA_PATH);
std::string workspace = std::getenv("SFS_TEST_WORKSPACE");
if (!workspace.empty()) {
testDataPath = workspace + "/tests";
char* workspace = std::getenv("SFS_TEST_WORKSPACE");
if (workspace != nullptr) {
testDataPath = std::string(workspace) + "/tests";
}
std::string runScript = testDataPath + "/run-test.sh";
std::string testFile = testDataPath + "/test_suites/" + suite + "/" + testCase + ".sh";
Expand Down

0 comments on commit d8b9665

Please sign in to comment.