Skip to content
Permalink
Browse files

Add a test for size_of Option<ThreadId>

  • Loading branch information...
SimonSapin committed Mar 20, 2019
1 parent 8cf720b commit c1d9191fa576c600775b4fbb90a3d09ca5e0fa0b
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/libstd/thread/mod.rs
@@ -1485,9 +1485,10 @@ fn _assert_sync_and_send() {
mod tests {
use super::Builder;
use crate::any::Any;
use crate::mem;
use crate::sync::mpsc::{channel, Sender};
use crate::result;
use crate::thread;
use crate::thread::{self, ThreadId};
use crate::time::Duration;
use crate::u32;

@@ -1717,6 +1718,11 @@ mod tests {
thread::sleep(Duration::from_millis(2));
}

#[test]
fn test_size_of_option_thread_id() {
assert_eq!(mem::size_of::<Option<ThreadId>>(), mem::size_of::<ThreadId>());
}

#[test]
fn test_thread_id_equal() {
assert!(thread::current().id() == thread::current().id());

0 comments on commit c1d9191

Please sign in to comment.
You can’t perform that action at this time.