unittests: convert util-spm tests to FAIL/PASS API - v3#15368
Closed
0x-0ddc0de wants to merge 1 commit into
Closed
unittests: convert util-spm tests to FAIL/PASS API - v3#153680x-0ddc0de wants to merge 1 commit into
0x-0ddc0de wants to merge 1 commit into
Conversation
Closed
jufajardini
reviewed
May 11, 2026
Comment on lines
2359
to
+2363
| if (found == NULL) { | ||
| if (d->match_offset != SPM_NO_MATCH) { | ||
| printf(" should have matched at %" PRIu32 " but didn't\n", | ||
| d->match_offset); | ||
| ret = 0; | ||
| } | ||
| FAIL_IF(d->match_offset != SPM_NO_MATCH); | ||
| } else { | ||
| uint32_t offset = (uint32_t)(found - (const uint8_t *)d->haystack); | ||
| if (offset != d->match_offset) { | ||
| printf(" should have matched at %" PRIu32 | ||
| " but matched at %" PRIu32 "\n", | ||
| d->match_offset, offset); | ||
| ret = 0; | ||
| } | ||
| FAIL_IF(offset != d->match_offset); |
Contributor
There was a problem hiding this comment.
Could we find a way to also remove this if/ else case, following Victor's comment on the previous PR?
Contributor
|
Thanks for following up on the feedback.
|
|
NOTE: This PR may contain new authors. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #15368 +/- ##
==========================================
- Coverage 82.66% 82.64% -0.02%
==========================================
Files 993 996 +3
Lines 271004 271051 +47
==========================================
- Hits 224022 224008 -14
- Misses 46982 47043 +61
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Member
|
Replaced w #15371 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update to address comments on
Replaces conditionals within the loops with a single FAIL_IF.
Issue: 6334