Implement ::std::error::Error

This commit is contained in:
Sam Wilson
2018-10-10 14:03:28 -04:00
committed by Levente Kurusa
parent 84ae587360
commit 7826b798bd
18 changed files with 392 additions and 293 deletions
+3 -3
View File
@@ -1,7 +1,8 @@
extern crate cgroups;
use cgroups::cpuset::CpuSetController;
use cgroups::{Cgroup, CgroupError};
use cgroups::error::ErrorKind;
use cgroups::Cgroup;
#[test]
fn test_cpuset_memory_pressure_root_cg() {
@@ -12,8 +13,7 @@ fn test_cpuset_memory_pressure_root_cg() {
// This is not a root control group, so it should fail via InvalidOperation.
let res = cpuset.set_enable_memory_pressure(true);
assert!(res.is_err());
assert_eq!(res.unwrap_err(), CgroupError::InvalidOperation);
assert_eq!(res.unwrap_err().kind(), &ErrorKind::InvalidOperation);
}
cg.delete();
}
+1 -1
View File
@@ -2,7 +2,7 @@
extern crate cgroups;
use cgroups::pid::{PidController, PidMax};
use cgroups::Controller;
use cgroups::{Cgroup, CgroupError, CgroupPid, PidResources, Resources};
use cgroups::{Cgroup, CgroupPid, PidResources, Resources};
extern crate nix;
use nix::sys::wait::{waitpid, WaitStatus};