martinzink commented on code in PR #1968:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1968#discussion_r2285041446


##########
libminifi/test/unit/ExpectedTest.cpp:
##########
@@ -473,7 +473,7 @@ TEST_CASE("expected valueOrElse", 
"[expected][valueOrElse]") {
   REQUIRE(gsl::narrow<int>("hello"sv.size()) == (ex | 
utils::valueOrElse([](const std::string& err) { return 
gsl::narrow<int>(err.size()); })));
   REQUIRE_THROWS_AS(ex | utils::valueOrElse([](std::string){ throw 
std::exception(); }), std::exception);  // 
NOLINT(performance-unnecessary-value-param)
   REQUIRE_THROWS_AS(ex | utils::valueOrElse([](const std::string&) -> int { 
throw std::exception(); }), std::exception);
-  REQUIRE_THROWS_WITH(std::move(ex) | utils::valueOrElse([](std::string&& 
error) -> int { throw std::runtime_error(error); }), "hello");
+  REQUIRE_THROWS_WITH([&] { std::move(ex) | utils::valueOrElse([](const 
std::string& error) -> int { throw std::runtime_error(error); }); }(), "hello");

Review Comment:
   now i remember
   
   
`/home/runner/work/nifi-minifi-cpp/nifi-minifi-cpp/libminifi/test/unit/ExpectedTest.cpp:479:78:
 error: rvalue reference parameter 'error' is never moved from inside the 
function body 
[cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]
     479 |   REQUIRE_THROWS_MATCHES(std::move(ex) | 
utils::valueOrElse([](std::string&& error) -> int { throw 
std::runtime_error(error); }),`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to