szaszm commented on code in PR #1999:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1999#discussion_r2319456833


##########
libminifi/test/libtest/unit/RecordSetTesters.h:
##########
@@ -62,15 +62,10 @@ bool testRecordWriter(RecordSetWriter& record_set_writer, 
const RecordSet& recor
 }
 
 inline bool testRecordReader(RecordSetReader& record_set_reader, const 
std::string_view serialized_record_set, const RecordSet& expected_record_set) {
-  const RecordSetFixture fixture;
-  ProcessSession& process_session = fixture.processSession();
-
-  const auto flow_file = process_session.create();
-  process_session.writeBuffer(flow_file, serialized_record_set);
-  process_session.transfer(flow_file, fixture.getRelationship());
-  process_session.commit();
+  io::BufferStream buffer_stream;
+  buffer_stream.write(reinterpret_cast<const 
uint8_t*>(serialized_record_set.data()), serialized_record_set.size());

Review Comment:
   I'd use the `span` overload and remove the cast. You can try `as_bytes`.
   ```suggestion
     io::BufferStream buffer_stream;
     buffer_stream.write(as_bytes(serialized_record_set));
   ```



-- 
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