From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/cpufeatures/tests/aarch64.rs | 17 +++++++++++++++++ vendor/cpufeatures/tests/x86.rs | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 vendor/cpufeatures/tests/aarch64.rs create mode 100644 vendor/cpufeatures/tests/x86.rs (limited to 'vendor/cpufeatures/tests') diff --git a/vendor/cpufeatures/tests/aarch64.rs b/vendor/cpufeatures/tests/aarch64.rs new file mode 100644 index 000000000..949669bed --- /dev/null +++ b/vendor/cpufeatures/tests/aarch64.rs @@ -0,0 +1,17 @@ +//! ARM64 tests + +#![cfg(target_arch = "aarch64")] + +cpufeatures::new!(armcaps, "aes", "sha2", "sha3"); + +#[test] +fn init() { + let token: armcaps::InitToken = armcaps::init(); + assert_eq!(token.get(), armcaps::get()); +} + +#[test] +fn init_get() { + let (token, val) = armcaps::init_get(); + assert_eq!(val, token.get()); +} diff --git a/vendor/cpufeatures/tests/x86.rs b/vendor/cpufeatures/tests/x86.rs new file mode 100644 index 000000000..0d8124238 --- /dev/null +++ b/vendor/cpufeatures/tests/x86.rs @@ -0,0 +1,17 @@ +//! x86/x86_64 tests + +#![cfg(any(target_arch = "x86", target_arch = "x86_64"))] + +cpufeatures::new!(cpuid, "aes", "sha"); + +#[test] +fn init() { + let token: cpuid::InitToken = cpuid::init(); + assert_eq!(token.get(), cpuid::get()); +} + +#[test] +fn init_get() { + let (token, val) = cpuid::init_get(); + assert_eq!(val, token.get()); +} -- cgit v1.2.3