Skip to content

Cleanup test predicates on binary strings#5341

Merged
randombit merged 5 commits intomasterfrom
jack/test-h-bin
Feb 15, 2026
Merged

Cleanup test predicates on binary strings#5341
randombit merged 5 commits intomasterfrom
jack/test-h-bin

Conversation

@randombit
Copy link
Owner

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_eq and test_bin_ne methods for binary data comparisons that accept std::span<const uint8_t> and hex strings
  • Adds static assertions to test_is_eq to prevent misuse with binary/string/integral types
  • Refactors implementation to use std::span instead 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.

@randombit randombit merged commit 6d81b0c into master Feb 15, 2026
44 checks passed
@randombit randombit deleted the jack/test-h-bin branch February 15, 2026 16:24
@coveralls
Copy link

Coverage Status

coverage: 90.056% (-0.003%) from 90.059%
when pulling e5a537a on jack/test-h-bin
into 76dfe61 on master.

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.

2 participants