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

Fix compilation error if expression length != message length #163

Merged
merged 9 commits into from
May 9, 2024
Merged

Conversation

cschreib
Copy link
Member

@cschreib cschreib commented May 2, 2024

Reported in #158. The *REQUIRE_THAT macros were assuming that SNITCH_MAX_MESSAGE_LENGTH and SNITCH_MAX_EXPR_LENGTH were the same. If they weren't, this would cause a compilation error. The tests have now been modified so none of the lengths are identical, to catch future instances of this problem.

Also fixes #164.

@cschreib cschreib mentioned this pull request May 2, 2024
@cschreib
Copy link
Member Author

cschreib commented May 2, 2024

I still need to update the approval test data. But first I need to fix another issue, which was highlighted by these test failures: in the XML or TeamCity reporters, we need to escape some of the strings before reporting them. When the resulting string is too long and truncated, there is a risk of truncating halfway through an escaped sequence, which would render the escaped string invalid. I opened the bug ticket #164 to capture this.

I'm working on a solution.

Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.05%. Comparing base (ccd3afa) to head (65ee518).
Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
+ Coverage   93.87%   94.05%   +0.18%     
==========================================
  Files          27       27              
  Lines        1664     1698      +34     
==========================================
+ Hits         1562     1597      +35     
+ Misses        102      101       -1     
Files Coverage Δ
include/snitch/snitch_registry.hpp 82.85% <ø> (ø)
include/snitch/snitch_string_utility.hpp 100.00% <ø> (ø)
src/snitch_reporter_catch2_xml.cpp 94.59% <100.00%> (+0.07%) ⬆️
src/snitch_reporter_teamcity.cpp 100.00% <100.00%> (ø)
src/snitch_string_utility.cpp 100.00% <100.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 ccd3afa...65ee518. Read the comment docs.

tocic
tocic previously approved these changes May 4, 2024
src/snitch_string_utility.cpp Show resolved Hide resolved
@cschreib cschreib merged commit f7a0ec2 into main May 9, 2024
43 checks passed
@cschreib cschreib deleted the lengths branch May 9, 2024 11:14
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.

Escaped characters in XML or TeamCity reporters can be truncated incorrectly
2 participants