Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Sep 3, 2022
1 parent 01d4d9c commit 33c9c04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
4 changes: 1 addition & 3 deletions libc-test/build.rs
Expand Up @@ -29,9 +29,7 @@ fn do_cc() {
|| target.contains("fuchsia")
|| target.contains("bsd")
{
cc::Build::new()
.file("src/makedev.c")
.compile("makedev");
cc::Build::new().file("src/makedev.c").compile("makedev");
}
}
if target.contains("android") || target.contains("linux") {
Expand Down
28 changes: 12 additions & 16 deletions libc-test/test/makedev.rs
Expand Up @@ -41,7 +41,7 @@ mod t {
fn test_android_like() {
for major in [0, 1, 255, 256, 4095] {
for minor_exp in [1, 8, 16] {
for minor in [(1 << minor_exp) -1, (1 << minor_exp)] {
for minor in [(1 << minor_exp) - 1, (1 << minor_exp)] {
compare(major, minor);
}
}
Expand All @@ -51,15 +51,11 @@ mod t {

// These OSes allow 32 bits for minor, but only 8 for major
#[test]
#[cfg(any(
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
))]
#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd",))]
fn test_fbsd11_like() {
for major in [0, 1, 255] {
for minor_exp in [1, 8, 16, 24, 31] {
for minor in [(1 << minor_exp) -1, (1 << minor_exp)] {
for minor in [(1 << minor_exp) - 1, (1 << minor_exp)] {
compare(major, minor);
}
}
Expand All @@ -73,7 +69,7 @@ mod t {
fn test_openbsd_like() {
for major in [0, 1, 255] {
for minor_exp in [1, 8, 16] {
for minor in [(1 << minor_exp) -1, (1 << minor_exp)] {
for minor in [(1 << minor_exp) - 1, (1 << minor_exp)] {
compare(major, minor);
}
}
Expand All @@ -83,17 +79,19 @@ mod t {

// These OSes allow 32 bits for both minor and major
#[cfg(any(
target_os = "empscripten",
target_os = "fuchsia",
target_os = "linux",
freebsd12, freebsd13, freebsd14
target_os = "empscripten",
target_os = "fuchsia",
target_os = "linux",
freebsd12,
freebsd13,
freebsd14
))]
#[test]
fn test_fbsd12_like() {
for major_exp in [16, 24, 31] {
for major in [(1 << major_exp) -1, (1 << major_exp)] {
for major in [(1 << major_exp) - 1, (1 << major_exp)] {
for minor_exp in [1, 8, 16, 24, 31] {
for minor in [(1 << minor_exp) -1, (1 << minor_exp)] {
for minor in [(1 << minor_exp) - 1, (1 << minor_exp)] {
compare(major, minor);
}
}
Expand All @@ -103,5 +101,3 @@ mod t {
}
}
}


0 comments on commit 33c9c04

Please sign in to comment.