Skip to content

Commit

Permalink
Merge pull request #1038 from xanathar/pr/macos-unit-tests
Browse files Browse the repository at this point in the history
Fixed unit tests under macOS and possibly other *nix flavors
  • Loading branch information
pbor authored Mar 5, 2023
2 parents 7b79419 + c1057ec commit 60946b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions gio/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -925,12 +925,7 @@ mod tests {

let mut fds = [0 as libc::c_int; 2];
let (out_sock, in_sock) = unsafe {
let ret = libc::socketpair(
libc::AF_UNIX,
libc::SOCK_STREAM | libc::SOCK_CLOEXEC,
0,
fds.as_mut_ptr(),
);
let ret = libc::socketpair(libc::AF_UNIX, libc::SOCK_STREAM, 0, fds.as_mut_ptr());
if ret != 0 {
panic!("{}", io::Error::last_os_error());
}
Expand Down
4 changes: 2 additions & 2 deletions glib/src/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2812,10 +2812,10 @@ mod tests {
// gives us useful results
let dir_1 = tmp_dir.join("abcd");
fs::create_dir(&dir_1).unwrap();
assert_eq!(crate::path_get_basename(&dir_1), Path::from("abcd"));
assert_eq!(crate::path_get_basename(&dir_1), Path::new("abcd"));
assert_eq!(
crate::path_get_basename(dir_1.canonicalize().unwrap()),
Path::from("abcd")
Path::new("abcd")
);
assert_eq!(
crate::path_get_dirname(dir_1.canonicalize().unwrap()),
Expand Down

0 comments on commit 60946b7

Please sign in to comment.