Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions library/alloctests/testing/crash_test.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use std::cmp::Ordering;
use std::fmt::Debug;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::SeqCst;

use crate::fmt::Debug; // the `Debug` trait is the only thing we use from `crate::fmt`

/// A blueprint for crash test dummy instances that monitor particular events.
/// Some instances may be configured to panic at some point.
/// Events are `clone`, `drop` or some anonymous `query`.
Expand Down Expand Up @@ -36,6 +35,7 @@ impl CrashTestDummy {
}

/// Returns how many times instances of the dummy have been cloned.
#[allow(unused)]
pub(crate) fn cloned(&self) -> usize {
self.cloned.load(SeqCst)
}
Expand All @@ -46,6 +46,7 @@ impl CrashTestDummy {
}

/// Returns how many times instances of the dummy have had their `query` member invoked.
#[allow(unused)]
pub(crate) fn queried(&self) -> usize {
self.queried.load(SeqCst)
}
Expand All @@ -71,6 +72,7 @@ impl Instance<'_> {
}

/// Some anonymous query, the result of which is already given.
#[allow(unused)]
pub(crate) fn query<R>(&self, result: R) -> R {
self.origin.queried.fetch_add(1, SeqCst);
if self.panic == Panic::InQuery {
Expand Down
80 changes: 0 additions & 80 deletions library/alloctests/tests/testing/crash_test.rs

This file was deleted.

1 change: 1 addition & 0 deletions library/alloctests/tests/testing/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#[path = "../../testing/crash_test.rs"]
pub mod crash_test;
Loading