fn test_rdseed_retval<T: Into<u64>>(rc: Option<T>) {
assert!(rc.is_some(), "call didn't get any result");
assert!(rc.unwrap().into() != 0u64, "call got unexpected zero seed");
}
#[test]
fn get_one_rdseed64() {
let rc = rdseed::get64();
test_rdseed_retval(rc);
}
#[test]
fn get_one_rdseed32() {
let rc = rdseed::get32();
test_rdseed_retval(rc);
}
#[test]
fn get_one_rdseed16() {
let rc = rdseed::get16();
test_rdseed_retval(rc);
}
#[test]
fn get_one_rdrand64() {
let rc = rdseed::rand::get64();
test_rdseed_retval(rc);
}
#[test]
fn get_one_rdrand32() {
let rc = rdseed::rand::get32();
test_rdseed_retval(rc);
}
#[test]
fn get_one_rdrand16() {
let rc = rdseed::rand::get16();
test_rdseed_retval(rc);
}