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

Reflect enum type #204

Merged
merged 5 commits into from
Jul 28, 2023
Merged

Reflect enum type #204

merged 5 commits into from
Jul 28, 2023

Conversation

bbbgan
Copy link
Collaborator

@bbbgan bbbgan commented Jul 24, 2023

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.58% 🎉

Comparison is base (b262d32) 42.94% compared to head (46a80ec) 43.52%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
+ Coverage   42.94%   43.52%   +0.58%     
==========================================
  Files          44       45       +1     
  Lines        5305     5333      +28     
==========================================
+ Hits         2278     2321      +43     
+ Misses       3027     3012      -15     
Files Changed Coverage Δ
iguana/json_util.hpp 20.00% <ø> (ø)
test/test_util.cpp 100.00% <ø> (ø)
iguana/enum_reflection.hpp 100.00% <100.00%> (ø)
iguana/json_reader.hpp 87.96% <100.00%> (+12.53%) ⬆️
iguana/json_writer.hpp 100.00% <100.00%> (ø)
test/test.cpp 100.00% <100.00%> (ø)
test/unit_test.cpp 99.65% <100.00%> (+<0.01%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qicosmos
Copy link
Owner

你是假定enum 值是连续的吗?enum 的值不一定是连续的,可能是200, 400, 500, 甚至更大,还有可能是负数。

@bbbgan bbbgan force-pushed the master branch 2 times, most recently from 33fe543 to 86fcd97 Compare July 26, 2023 15:21
if (it != str_to_enum.end())
IGUANA_LIKELY { value = it->second; }
else {
throw std::runtime_error(std::string(enum_names) +
Copy link
Owner

Choose a reason for hiding this comment

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

这个分支覆盖到了吗,确保每个分支都覆盖到。

@bbbgan bbbgan merged commit f0d77cf into qicosmos:master Jul 28, 2023
18 checks passed
171930433 pushed a commit to 171930433/iguana that referenced this pull request Jun 25, 2024
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