mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
Update test.
This commit is contained in:
parent
94c855153a
commit
0b3073abb1
@ -1,24 +1,6 @@
|
||||
use super::{Key, StaticKey};
|
||||
use super::StaticKey;
|
||||
use core::ptr;
|
||||
|
||||
fn assert_sync<T: Sync>() {}
|
||||
fn assert_send<T: Send>() {}
|
||||
|
||||
#[test]
|
||||
fn smoke() {
|
||||
assert_sync::<Key>();
|
||||
assert_send::<Key>();
|
||||
|
||||
let k1 = Key::new(None);
|
||||
let k2 = Key::new(None);
|
||||
assert!(k1.get().is_null());
|
||||
assert!(k2.get().is_null());
|
||||
k1.set(ptr::invalid_mut(1));
|
||||
k2.set(ptr::invalid_mut(2));
|
||||
assert_eq!(k1.get() as usize, 1);
|
||||
assert_eq!(k2.get() as usize, 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn statik() {
|
||||
static K1: StaticKey = StaticKey::new(None);
|
||||
|
Loading…
Reference in New Issue
Block a user