summaryrefslogtreecommitdiff
path: root/test/test_fud.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_fud.cpp')
-rw-r--r--test/test_fud.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_fud.cpp b/test/test_fud.cpp
index f84ad20..8dea206 100644
--- a/test/test_fud.cpp
+++ b/test/test_fud.cpp
@@ -33,6 +33,7 @@ TEST(FudTest, FudFud)
auto compareResult = compareMem(
fudInfo.revision.data(),
fudInfo.revision.size(),
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
FudGitHash,
fudInfo.revision.size() - 1);
ASSERT_TRUE(compareResult.isOkay());
@@ -52,14 +53,18 @@ TEST(FudTest, GetEnv)
ASSERT_EQ(fudVarResult.getError(), FudStatus::NullPointer);
fudVarResult = std::move(getEnv(testVarName));
- ASSERT_TRUE(fudVarResult.isError());
- ASSERT_EQ(fudVarResult.getError(), FudStatus::NotFound);
+ ASSERT_TRUE(fudVarResult.isOkay());
+ ASSERT_TRUE(fudVarResult.getOkay().isNone());
ASSERT_EQ(setenv(testVarName, testVarValue, 1), 0);
+ ASSERT_NE(getenv(testVarName), nullptr);
+ ASSERT_STREQ(getenv(testVarName), testVarValue);
+
fudVarResult = getEnv(testVarName);
ASSERT_TRUE(fudVarResult.isOkay());
auto fudVar{fudVarResult.takeOkay()};
- ASSERT_STREQ(fudVar.c_str(), testVarValue);
+ ASSERT_TRUE(fudVar.hasValue());
+ ASSERT_STREQ(fudVar.value().c_str(), testVarValue);
}
} // namespace fud