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

add huffman table constructor from symbol-bitsize range #96

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

oliverlee
Copy link
Collaborator

Add a constructor to huffman::table that takes a range of symbol-bitsize
tuples.

This commit also moves public tag types into a utility header.

Change-Id: Ia125173ce91e2e189c23de0956d9eaa7aa51762c

@oliverlee oliverlee force-pushed the Ia125173ce91e2e189c23de0956d9eaa7aa51762c branch from 96394da to d7a2481 Compare September 27, 2023 01:50
@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2023

Codecov Report

Merging #96 (5360f66) into master (1a1e06e) will increase coverage by 2.75%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
+ Coverage   95.86%   98.62%   +2.75%     
==========================================
  Files          11       11              
  Lines         290      290              
==========================================
+ Hits          278      286       +8     
+ Misses         12        4       -8     
Files Coverage Δ
huffman/src/detail/table_storage.hpp 100.00% <100.00%> (ø)
huffman/src/table.hpp 97.14% <100.00%> (+0.26%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@oliverlee oliverlee force-pushed the Ic42b6b1c03f10077d19d49a9e6544214834ba42f branch from 8b144ef to 5bb362f Compare September 28, 2023 05:05
@oliverlee oliverlee force-pushed the Ia125173ce91e2e189c23de0956d9eaa7aa51762c branch from d7a2481 to 3cb36c5 Compare September 28, 2023 05:05
@oliverlee oliverlee force-pushed the Ia125173ce91e2e189c23de0956d9eaa7aa51762c branch from 3cb36c5 to 8bac466 Compare October 5, 2023 00:54
@oliverlee oliverlee force-pushed the Ic42b6b1c03f10077d19d49a9e6544214834ba42f branch from 0396f5d to bf73c0e Compare October 5, 2023 01:09
@oliverlee oliverlee force-pushed the Ia125173ce91e2e189c23de0956d9eaa7aa51762c branch 3 times, most recently from fb781a1 to 3079c1d Compare October 7, 2023 03:43
namespace huffman = ::starflate::huffman;
using namespace huffman::literals;

test("table with DEFLATE canonical code, example 1") = [] {
Copy link
Owner

Choose a reason for hiding this comment

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

If these examples are from the RFC, please add that in a comment or put that in the test desc string (like RFC example 1 instead of example 1).
Also, do we get any more code coverage from having 2 examples vs just 1? If not then probably just 1 is enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think coverage will be the same with one example vs two. I'll remove the smaller one and update the test description to include "RFC"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated descriptions and added links to RFC examples. Coverage comes from the second test. First test verifies usability in constant expressions. I've replaced expect with static_assert to make that more clear.

@oliverlee oliverlee force-pushed the Ic42b6b1c03f10077d19d49a9e6544214834ba42f branch 2 times, most recently from 6fffff8 to 0d12cbb Compare October 12, 2023 15:18
Base automatically changed from Ic42b6b1c03f10077d19d49a9e6544214834ba42f to master October 12, 2023 15:27
@oliverlee oliverlee force-pushed the Ia125173ce91e2e189c23de0956d9eaa7aa51762c branch from 3079c1d to f596820 Compare October 13, 2023 06:03
@oliverlee oliverlee requested a review from garymm October 13, 2023 06:03
Add a constructor to huffman::table that takes a range of symbol-bitsize
tuples.

This commit also moves public tag types into a utility header.

Change-Id: Ia125173ce91e2e189c23de0956d9eaa7aa51762c
@oliverlee oliverlee force-pushed the Ia125173ce91e2e189c23de0956d9eaa7aa51762c branch from f596820 to 5360f66 Compare October 13, 2023 06:16
@garymm garymm merged commit 48fd171 into master Oct 13, 2023
15 checks passed
@garymm garymm deleted the Ia125173ce91e2e189c23de0956d9eaa7aa51762c branch October 13, 2023 15:47
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