Skip to content
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

request.cpp coverage #64

Merged
merged 3 commits into from
Feb 27, 2024
Merged

Conversation

cmazakas
Copy link
Collaborator

No description provided.

src/detail/header.cpp Outdated Show resolved Hide resolved
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.23%. Comparing base (e1b4aa1) to head (e0131a6).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #64      +/-   ##
===========================================
+ Coverage    85.45%   86.23%   +0.77%     
===========================================
  Files           77       77              
  Lines         4269     4271       +2     
===========================================
+ Hits          3648     3683      +35     
+ Misses         621      588      -33     
Files Coverage Δ
src/detail/header.cpp 94.01% <100.00%> (ø)
src/request.cpp 100.00% <100.00%> (+25.00%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1b4aa1...e0131a6. Read the comment docs.

1 similar comment
@cmazakas cmazakas force-pushed the fix/request-coverage branch from 2fdc538 to aae5832 Compare February 15, 2024 23:36
src/detail/header.cpp Outdated Show resolved Hide resolved
src/detail/header.cpp Outdated Show resolved Hide resolved
@cmazakas cmazakas force-pushed the fix/request-coverage branch from aae5832 to 010a28e Compare February 16, 2024 18:23
@vinniefalco
Copy link
Member

"Expectations" is capitalized but isn't a well-known field name

@cmazakas cmazakas force-pushed the fix/request-coverage branch from 010a28e to 3f677e3 Compare February 19, 2024 15:43
src/request.cpp Outdated
h_.md.expect.count - 1);
return;
}

erase(field::expect);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be

raw_erase_n( field::expect, h_.md.expect.count  );

instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This required a little of massaging of the metadata but I made it work and I think it's a bit cleaner than before.

@cmazakas cmazakas force-pushed the fix/request-coverage branch from 3f677e3 to e0131a6 Compare February 23, 2024 18:24
@vinniefalco
Copy link
Member

Pull request looks good to merge.

When writing these tests you might find it helpful to author some utility functions. For example this:

BOOST_TEST( ! req.metadata().expect.ec.failed() );
BOOST_TEST( req.metadata().expect.is_100_continue );
BOOST_TEST_EQ( req.count("Expect"), 1 );

might be expressed as

ok( req, true, 1 );

and

BOOST_TEST( req.metadata().expect.ec.failed() );
BOOST_TEST_EQ( req.count("Expect"), 2 );

might be expressed as

bad( req, 2 );

@cmazakas cmazakas merged commit b911eee into cppalliance:develop Feb 27, 2024
53 checks passed
@cmazakas cmazakas deleted the fix/request-coverage branch February 27, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants