MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / test_getrandom_uninit

Function test_getrandom_uninit

tests/rand/getrandom.rs:12–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11#[test]
12fn test_getrandom_uninit() {
13 let mut buf = unsafe { MaybeUninit::<[MaybeUninit<u8>; 256]>::uninit().assume_init() };
14 let (init, uninit) = getrandom(&mut buf, GetRandomFlags::empty()).unwrap();
15 let combined_len = init.len() + uninit.len();
16 assert_eq!(buf.len(), combined_len);
17}

Callers

nothing calls this directly

Calls 3

assume_initMethod · 0.80
getrandomFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected