Cleanup test predicates on binary strings#5341
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the test framework to use more specific test predicates for binary string comparisons. It replaces generic test_eq and test_ne calls with test_bin_eq and test_bin_ne when comparing binary data (byte vectors, arrays, etc.).
Changes:
- Introduces
test_bin_eqandtest_bin_nemethods for binary data comparisons that acceptstd::span<const uint8_t>and hex strings - Adds static assertions to
test_is_eqto prevent misuse with binary/string/integral types - Refactors implementation to use
std::spaninstead of raw pointers - Updates hundreds of test cases across the codebase to use the new predicates
Reviewed changes
Copilot reviewed 87 out of 87 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tests/tests.h | Added new test_bin_eq/test_bin_ne methods and static assertions to prevent misuse |
| src/tests/tests.cpp | Refactored implementation to use std::span, removed "producer" parameter |
| src/tests/unit_*.cpp | Updated test calls to use test_bin_eq for binary comparisons |
| src/tests/test_*.cpp | Updated test calls across all test files consistently |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bda6612 to
e5a537a
Compare
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.
No description provided.