chore: Fix tests for clang-tidy bugprone-unchecked-optional-access check (#6502)

This commit is contained in:
Alex Kremer
2026-03-16 23:47:40 +00:00
committed by GitHub
parent ffea3977f0
commit 7e7b71d84c
55 changed files with 495 additions and 150 deletions

View File

@@ -152,7 +152,7 @@ public:
std::string const& normal = "")
{
auto const result = Endpoint::from_string_checked(s);
if (!BEAST_EXPECT(result))
if (BEAST_EXPECT(result); !result.has_value())
return;
if (!BEAST_EXPECT(result->address().is_v4()))
return;
@@ -171,7 +171,7 @@ public:
std::string const& normal = "")
{
auto result = Endpoint::from_string_checked(s);
if (!BEAST_EXPECT(result))
if (BEAST_EXPECT(result); !result.has_value())
return;
if (!BEAST_EXPECT(result->address().is_v6()))
return;