Skip to content

Commit

Permalink
Fixed a bug in the unit test
Browse files Browse the repository at this point in the history
The pre-commit version of the code was using std::istream_iterator
which truncated line termination sequences. The new code uses
std::istreambuf_iterator.
  • Loading branch information
iagaponenko committed Jun 30, 2024
1 parent 27ea6c0 commit b619220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qhttp/testqhttp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ BOOST_FIXTURE_TEST_CASE(body_stream_reader, QhttpFixture) {
response->sendStatus(qhttp::STATUS_INTERNAL_SERVER_ERR);
return;
}
_readContent.append(std::istream_iterator<char>(request->content), std::istream_iterator<char>());
_readContent.append(std::istreambuf_iterator<char>(request->content), {});
++_numReads;
if (request->contentReadBytes() == request->contentLengthBytes()) {
BOOST_CHECK_EQUAL(_expectedNumReads, _numReads);
Expand Down

0 comments on commit b619220

Please sign in to comment.