We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f103bd commit 51989f6Copy full SHA for 51989f6
1 file changed
src/tests.rs
@@ -114,3 +114,16 @@ macro_rules! define_tests {
114
pub(crate) use define_tests;
115
116
define_tests!(crate::getrandom);
117
+mod uninit {
118
+ use super::*;
119
+
120
+ fn wrapper(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
121
+ let dest_ptr = dest.as_ptr().cast::<u8>();
122
+ let res = crate::getrandom_uninit(dest)?;
123
+ // Ensure that the output points to the same bytes as the input.
124
+ assert_eq!(res.as_ptr(), dest_ptr);
125
+ assert_eq!(res.len(), dest.len());
126
+ Ok(())
127
+ }
128
+ super::define_tests!(wrapper);
129
+}
0 commit comments