fgerlits commented on code in PR #2009:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2009#discussion_r2276580457
##########
extensions/expression-language/tests/ProcessContextExprTests.cpp:
##########
@@ -129,3 +129,28 @@ TEST_CASE("ProcessContextExpr can use expression language
in dynamic properties"
}
}
}
+
+TEST_CASE("ProcessContextExpr is mutex guarded properly") {
+ TestController test_controller;
+ const std::shared_ptr<TestPlan> test_plan = test_controller.createPlan();
+ std::ignore = test_plan->addProcessor("DummyProcessor", "dummy_processor");
+ test_plan->runNextProcessor();
+ const auto context = test_plan->getCurrentContext();
+ REQUIRE(dynamic_pointer_cast<core::ProcessContextExpr>(context) != nullptr);
+
+ auto play_with_context = [=]() {
+ for (auto i = 0; i < 100; ++i) {
+ context->setDynamicProperty("foo", fmt::format("${{literal('{}')}}",
std::this_thread::get_id()));
Review Comment:
MSVC wants a `std::ignore` here, too:
```
2025-08-14T12:00:39.3543868Z
C:\a\nifi-minifi-cpp\nifi-minifi-cpp\extensions\expression-language\tests\ProcessContextExprTests.cpp(143,16):
error C2220: the following warning is treated as an error
2025-08-14T12:00:39.3545841Z context->setDynamicProperty("foo",
fmt::format("${{literal('{}')}}", std::this_thread::get_id()));
2025-08-14T12:00:39.3877335Z ^
2025-08-14T12:00:39.4198282Z
C:\a\nifi-minifi-cpp\nifi-minifi-cpp\extensions\expression-language\tests\ProcessContextExprTests.cpp(143,16):
warning C4834: discarding return value of function with [[nodiscard]] attribute
```
or CHECK/REQUIRE would work, too
--
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]