summaryrefslogtreecommitdiff
path: root/test/http
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-06-30 23:21:32 +0300
committerEd Tanous <ed@tanous.net>2023-08-07 20:51:50 +0300
commite01d0c36af115ed46d54b5dbbacfe3ad92226bd3 (patch)
tree3355d0c47cc9af8068a0a3f7329a8109573f9eb1 /test/http
parent1ccf70f116b28a0f78404b914a789ce05f411ddf (diff)
downloadbmcweb-e01d0c36af115ed46d54b5dbbacfe3ad92226bd3.tar.xz
Fix bugprone-unchecked-optional-access findings
Clang-tidy has the aforementioned check, which shows a few places in the core where we ignored the required optional checks. Fix all uses. Note, we cannot enable the check that this time because of some weird code in health.hpp that crashes tidy[1]. That will need to be a future improvement. There are tests that call something like ASSERT(optional) EXPECT(optional->foo()) While this isn't an actual violation, clang-tidy doesn't seem to be smart enough to deal with it, so add some explicit checks. [1] https://github.com/llvm/llvm-project/issues/55530 Tested: Redfish service validator passes. Change-Id: Ied579cd0b957efc81aff5d5d1091a740a7a2d7e3 Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'test/http')
-rw-r--r--test/http/verb_test.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/http/verb_test.cpp b/test/http/verb_test.cpp
index aff6ec7405..698e39cbd1 100644
--- a/test/http/verb_test.cpp
+++ b/test/http/verb_test.cpp
@@ -27,8 +27,7 @@ TEST(BoostToHttpVerb, ValidCase)
{
HttpVerb httpVerb = static_cast<HttpVerb>(verbIndex);
std::optional<HttpVerb> verb = httpVerbFromBoost(verbMap[httpVerb]);
- ASSERT_TRUE(verb.has_value());
- EXPECT_EQ(*verb, httpVerb);
+ EXPECT_EQ(verb, httpVerb);
}
}