Skip to content

Commit

Permalink
Update test.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Apr 27, 2023
1 parent 94c8551 commit 0b3073a
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions library/std/src/sys_common/thread_local_key/tests.rs
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit 0b3073a

Please sign in to comment.