Skip to content

Commit

Permalink
Remove test ctl_iter_below_compare_outputs since its not reliable.
Browse files Browse the repository at this point in the history
  • Loading branch information
johalun committed Aug 3, 2021
1 parent fdb90c1 commit 38e62b4
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions src/unix/ctl_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,58 +88,4 @@ mod tests {
println!("{:?}", ctl.name());
}
}

#[test]
fn ctl_iter_below_compare_outputs() {
let output = std::process::Command::new("sysctl")
.arg("security")
.output()
.expect("failed to execute process");
let expected = String::from_utf8_lossy(&output.stdout);

let security = super::Ctl::new("security").expect("could not get security node");

let ctls = super::CtlIter::below(security);
let mut actual: Vec<String> = vec!["".to_string()];

for ctl in ctls {
let ctl = match ctl {
Err(_) => {
continue;
}
Ok(s) => s,
};

let name = match ctl.name() {
Ok(s) => s,
Err(_) => {
continue;
}
};

match ctl.value_type().expect("could not get value type") {
crate::CtlType::None => {
continue;
}
crate::CtlType::Struct => {
continue;
}
crate::CtlType::Node => {
continue;
}
#[cfg(not(target_os = "macos"))]
crate::CtlType::Temperature => {
continue;
}
_ => {}
};

actual.push(format!(
"{}: {}",
name,
ctl.value_string().expect("could not get value as string")
));
}
assert_eq!(actual.join("\n").trim(), expected.trim());
}
}

0 comments on commit 38e62b4

Please sign in to comment.