adamdebreceni commented on code in PR #1457:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1457#discussion_r1048458529
##########
extensions/standard-processors/tests/unit/ListenUDPTests.cpp:
##########
@@ -29,49 +29,67 @@ using namespace std::literals::chrono_literals;
namespace org::apache::nifi::minifi::test {
-constexpr uint64_t PORT = 10256;
+void check_no_error(std::error_code error_code) {
+ CHECK_FALSE(error_code);
+}
-void check_for_attributes(core::FlowFile& flow_file) {
+void check_for_attributes(core::FlowFile& flow_file, uint16_t port) {
const auto local_addresses = {"127.0.0.1", "::ffff:127.0.0.1", "::1"};
- CHECK(std::to_string(PORT) == flow_file.getAttribute("udp.port"));
+ CHECK(std::to_string(port) == flow_file.getAttribute("udp.port"));
CHECK(ranges::contains(local_addresses,
flow_file.getAttribute("udp.sender")));
}
+uint16_t scheduleProcessorOnRandomPort(SingleProcessorTestController&
controller, const std::shared_ptr<ListenUDP>& listen_udp) {
Review Comment:
there seem to be three implementations of this functions, differing in which
kind or processor they schedule, could a single template function achieve the
same?
--
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]