diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2025-01-04 09:56:12 -0600 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2025-01-04 09:56:12 -0600 |
commit | 0b400af9519444deef4cc6ad2c43c30e2092ab4f (patch) | |
tree | e6b0d78a2c292a7df5724f150e123b55d7871819 /test/test_fud.cpp | |
parent | 253385f4bca5ccd2fee22fea8333dfe435c0df0a (diff) |
Fix bug related to string copying.
Diffstat (limited to 'test/test_fud.cpp')
-rw-r--r-- | test/test_fud.cpp | 11 |
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 |