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

test(s2n-quic-core): only check IntervalSet integrity in tests #2131

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions quic/s2n-quic-core/src/interval_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,13 @@ impl<T: IntervalBound> IntervalSet<T> {
}
}

/// Internal check for integrity - only used when debug_assertions are enabled
/// Internal check for integrity - only used when `cfg(test)` is enabled
#[inline]
fn check_integrity(&self) {
if cfg!(debug_assertions) {
// When using this data structure outside of this crate, these checks are quite expensive.
// Rather than using `cfg(debug_assertions)`, we limit it to `cfg(test)`, which will just
// turn them on when testing this crate.
if cfg!(test) {
let mut prev_end: Option<T> = None;

for interval in self.intervals.iter() {
Expand Down
Loading