Test getrandom 0.3

This commit is contained in:
Eduardo Sánchez Muñoz 2025-02-01 16:26:13 +01:00
parent 13f3132aed
commit eab3528b07
3 changed files with 35 additions and 1 deletions

View file

@ -105,6 +105,18 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "getrandom"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
dependencies = [
"cfg-if",
"libc",
"wasi 0.13.3+wasi-0.2.2",
"windows-targets",
]
[[package]]
name = "gimli"
version = "0.29.0"
@ -178,6 +190,7 @@ dependencies = [
"cfg-if",
"getrandom 0.1.16",
"getrandom 0.2.15",
"getrandom 0.3.1",
"libc",
"num_cpus",
"page_size",
@ -359,6 +372,15 @@ version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasi"
version = "0.13.3+wasi-0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
dependencies = [
"wit-bindgen-rt",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.92"
@ -507,3 +529,12 @@ name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "wit-bindgen-rt"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
dependencies = [
"bitflags",
]

View file

@ -15,6 +15,7 @@ cfg-if = "1"
getrandom_01 = { package = "getrandom", version = "0.1" }
getrandom_02 = { package = "getrandom", version = "0.2", features = ["js"] }
getrandom_03 = { package = "getrandom", version = "0.3" }
[target.'cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))'.dependencies]
tempfile = "3"

View file

@ -3,7 +3,7 @@
//@revisions: isolation no_isolation
//@[no_isolation]compile-flags: -Zmiri-disable-isolation
/// Test direct calls of getrandom 0.1 and 0.2.
/// Test direct calls of getrandom 0.1, 0.2 and 0.3.
fn main() {
let mut data = vec![0; 16];
@ -13,4 +13,6 @@ fn main() {
getrandom_01::getrandom(&mut data).unwrap();
getrandom_02::getrandom(&mut data).unwrap();
getrandom_03::fill(&mut data).unwrap();
}