about summary refs log tree commit diff
path: root/src/libcore/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/tests')
-rw-r--r--src/libcore/tests/atomic.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libcore/tests/atomic.rs b/src/libcore/tests/atomic.rs
index b6bb5fddf4a..9babe24a985 100644
--- a/src/libcore/tests/atomic.rs
+++ b/src/libcore/tests/atomic.rs
@@ -24,11 +24,24 @@ fn bool_() {
 #[test]
 fn bool_and() {
     let a = AtomicBool::new(true);
-    assert_eq!(a.fetch_and(false, SeqCst),true);
+    assert_eq!(a.fetch_and(false, SeqCst), true);
     assert_eq!(a.load(SeqCst),false);
 }
 
 #[test]
+fn bool_nand() {
+    let a = AtomicBool::new(false);
+    assert_eq!(a.fetch_nand(false, SeqCst), false);
+    assert_eq!(a.load(SeqCst), true);
+    assert_eq!(a.fetch_nand(false, SeqCst), true);
+    assert_eq!(a.load(SeqCst), true);
+    assert_eq!(a.fetch_nand(true, SeqCst), true);
+    assert_eq!(a.load(SeqCst), false);
+    assert_eq!(a.fetch_nand(true, SeqCst), false);
+    assert_eq!(a.load(SeqCst), true);
+}
+
+#[test]
 fn uint_and() {
     let x = AtomicUsize::new(0xf731);
     assert_eq!(x.fetch_and(0x137f, SeqCst), 0xf731);