summaryrefslogtreecommitdiff
path: root/test/sys
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-08-12 01:22:12 +0000
committerGitHub <noreply@github.com>2022-08-12 01:22:12 +0000
commita9861d873eaba52c9bf0f5b02552c567cadf6591 (patch)
treef62fe97f0ad2c8fee7d4700dde7991981039984f /test/sys
parent09b4b4904641edf786b7b377b7998fab3df4da29 (diff)
parent217c3b514148ff2c7bcfdfa808df2316d56db281 (diff)
downloadnix-a9861d873eaba52c9bf0f5b02552c567cadf6591.zip
Merge #1785
1785: Remove deprecated items r=asomers a=SteveLauC #### What this pr does 1. Convert `assert!(x == y)` to `assert_eq!(x, y)` 2. Convert `assert!(x != y)` to `assert_ne!(x, y)` 3. Add `.unwrap()` to unused `Result/Option` (in code comments) 4. Convert `std::ixx::MAX` to `ixx::MAX` 5. Convert `Box<Trait>` to `Box<dyn Trait>` Co-authored-by: SteveLauC <stevelauc@outlook.com> Co-authored-by: SteveLau <stevelauc@outlook.com>
Diffstat (limited to 'test/sys')
-rw-r--r--test/sys/test_pthread.rs2
-rw-r--r--test/sys/test_ptrace.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/test/sys/test_pthread.rs b/test/sys/test_pthread.rs
index 42a4aefa..ce048bae 100644
--- a/test/sys/test_pthread.rs
+++ b/test/sys/test_pthread.rs
@@ -11,7 +11,7 @@ fn test_pthread_self() {
#[test]
fn test_pthread_self() {
let tid = pthread_self();
- assert!(tid != 0);
+ assert_ne!(tid, 0);
}
#[test]
diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs
index e514832b..530560fe 100644
--- a/test/sys/test_ptrace.rs
+++ b/test/sys/test_ptrace.rs
@@ -33,7 +33,7 @@ fn test_ptrace_setoptions() {
require_capability!("test_ptrace_setoptions", CAP_SYS_PTRACE);
let err = ptrace::setoptions(getpid(), Options::PTRACE_O_TRACESYSGOOD)
.unwrap_err();
- assert!(err != Errno::EOPNOTSUPP);
+ assert_ne!(err, Errno::EOPNOTSUPP);
}
// Just make sure ptrace_getevent can be called at all, for now.
@@ -42,7 +42,7 @@ fn test_ptrace_setoptions() {
fn test_ptrace_getevent() {
require_capability!("test_ptrace_getevent", CAP_SYS_PTRACE);
let err = ptrace::getevent(getpid()).unwrap_err();
- assert!(err != Errno::EOPNOTSUPP);
+ assert_ne!(err, Errno::EOPNOTSUPP);
}
// Just make sure ptrace_getsiginfo can be called at all, for now.