-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add response tests #67
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #67 +/- ##
===========================================
+ Coverage 86.23% 87.83% +1.59%
===========================================
Files 77 77
Lines 4271 4306 +35
===========================================
+ Hits 3683 3782 +99
+ Misses 588 524 -64
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
GCOVR code coverage report https://67.http-proto.prtest.cppalliance.org/gcovr/index.html |
/** Constructor | ||
*/ | ||
BOOST_HTTP_PROTO_DECL | ||
response( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be explicit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the http_proto::status
is an enum class
, I don't think it's strictly required here.
I tried to making it file with something like response res({200});
but I couldn't get it to compile in c++11 or c++20.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't hurt though, to communicate this to the reader
@@ -71,6 +73,14 @@ operator=( | |||
return *this; | |||
} | |||
|
|||
response:: | |||
response( | |||
http_proto::status sc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I don't know how I feel about this. Upon construction using this signature, the message will be invalid out of the box, because it is missing the required "Server" field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind, changing this from version::http_1_1
to version::http_1_0
means that this constructor allocates now, and a bunch of the tests seem predicated on this not allocating so these will have to be adjusted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1_0 is not a good default
3c2fdfe
to
726fa0e
Compare
GCOVR code coverage report https://67.http-proto.prtest.cppalliance.org/gcovr/index.html |
src/response.cpp
Outdated
response( | ||
http_proto::status sc) | ||
: response( | ||
sc, http_proto::version::http_1_0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, what? Why would we want to default to 1.0 ?
726fa0e
to
24434dd
Compare
GCOVR code coverage report https://67.http-proto.prtest.cppalliance.org/gcovr/index.html |
24434dd
to
9d95f97
Compare
GCOVR code coverage report https://67.http-proto.prtest.cppalliance.org/gcovr/index.html |
No description provided.