MCPcopy Create free account
hub / github.com/RustCrypto/utils / non_zero

Function non_zero

zeroize/tests/zeroize.rs:31–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30#[test]
31fn non_zero() {
32 macro_rules! non_zero_test {
33 ($($type:ty),+) => {
34 $(let mut value = <$type>::new(42).unwrap();
35 value.zeroize();
36 assert_eq!(value.get(), 1);)+
37 };
38 }
39
40 non_zero_test!(
41 NonZeroI8,
42 NonZeroI16,
43 NonZeroI32,
44 NonZeroI64,
45 NonZeroI128,
46 NonZeroIsize,
47 NonZeroU8,
48 NonZeroU16,
49 NonZeroU32,
50 NonZeroU64,
51 NonZeroU128,
52 NonZeroUsize
53 );
54}
55
56#[test]
57fn zeroize_byte_arrays() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected