Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/catalog/src/tests_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ fn dropping_the_lock_frees_the_library_while_another_thread_spawns_processes() {
std::thread::spawn(move || {
let mut spawned = 0usize;
while !stop.load(Ordering::Relaxed) {
if let Ok(mut c) =
std::process::Command::new("/bin/true").stdout(std::process::Stdio::null()).stderr(std::process::Stdio::null()).spawn()
if let Ok(mut c) = std::process::Command::new("true").stdout(std::process::Stdio::null()).stderr(std::process::Stdio::null()).spawn()
{
let _ = c.wait();
spawned += 1;
Expand Down
29 changes: 23 additions & 6 deletions crates/engine/src/tests_lightroom_folder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,32 @@ fn odd_folders_never_fail_the_check() {
#[cfg(unix)]
{
use std::os::unix::ffi::OsStrExt;
// file systems that only store UTF-8 names (APFS, the macOS default) refuse these, so there
// is nothing non-UTF-8 to come across and only the symlink checks below apply
let bad = root.join(std::ffi::OsStr::from_bytes(b"caf\xe9 Previews.lrdata"));
std::fs::create_dir_all(&bad).unwrap();
std::fs::write(root.join("Cat.lrcat"), b"x").unwrap();
assert_eq!(lightroom_catalog_at(&bad), Some(LightroomPlace { catalog: Some(root.join("Cat.lrcat")) }), "non-UTF-8 name");
let lr = root.join(std::ffi::OsStr::from_bytes(b"\xff\xfe"));
let made = match std::fs::create_dir_all(&bad) {
Ok(()) => true,
// (the file system rejects the name: EILSEQ on macOS)
Err(e)
if (cfg!(target_os = "macos") && e.raw_os_error() == Some(92))
|| matches!(e.kind(), std::io::ErrorKind::InvalidFilename | std::io::ErrorKind::InvalidInput) =>
{
false
}
Err(e) => panic!("cannot create {bad:?}: {e}"),
};
if made {
std::fs::write(root.join("Cat.lrcat"), b"x").unwrap();
assert_eq!(lightroom_catalog_at(&bad), Some(LightroomPlace { catalog: Some(root.join("Cat.lrcat")) }), "non-UTF-8 name");
let odd = root.join(std::ffi::OsStr::from_bytes(b"\xff\xfe"));
std::fs::create_dir_all(&odd).unwrap();
std::fs::write(odd.join(std::ffi::OsStr::from_bytes(b"\xff.lrcat")), b"x").unwrap();
std::fs::write(odd.join("b.lrcat"), b"x").unwrap();
assert_eq!(lightroom_catalog_at(&odd), Some(LightroomPlace { catalog: Some(odd.join("b.lrcat")) }), "non-UTF-8 entries skipped");
}
let lr = root.join("catalogs");
std::fs::create_dir_all(&lr).unwrap();
std::fs::write(lr.join(std::ffi::OsStr::from_bytes(b"\xff.lrcat")), b"x").unwrap();
std::fs::write(lr.join("b.lrcat"), b"x").unwrap();
assert_eq!(lightroom_catalog_at(&lr), Some(LightroomPlace { catalog: Some(lr.join("b.lrcat")) }), "non-UTF-8 entries skipped");
// a symlink to a catalog folder is one too; a dangling one is not
std::os::unix::fs::symlink(&lr, root.join("link")).unwrap();
assert!(lightroom_catalog_at(&root.join("link")).is_some());
Expand Down
4 changes: 2 additions & 2 deletions crates/pipeline/src/spots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ fn fill_box(src: &mut [[f32; 3]], tgt: &[[f32; 3]], alpha: &[f32], bw: usize, bh
let flat: Vec<f32> = tgt.iter().flatten().copied().collect();
let out = lightcraft_inpaint::complete(bw, bh, 3, &flat, &hole, &lightcraft_inpaint::CompleteParams::default())
.unwrap_or_else(|| lightcraft_inpaint::membrane_fill(bw, bh, 3, &flat, &hole));
for (d, v) in src.iter_mut().zip(out.chunks_exact(3)) {
*d = [v[0], v[1], v[2]];
for (d, v) in src.iter_mut().zip(out.as_chunks::<3>().0) {
*d = *v;
}
}

Expand Down
5 changes: 3 additions & 2 deletions crates/ui-egui/src/tests_dialog_fit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ fn export_dialog_is_unchanged_in_a_tall_window() {
assert_fits(&h, "Export at 1600×1000");
let dialog = rect(&h, "dialog:window");
// (846 tall as before #781: the whole dialog, nothing scrolled away; 615 wide since the
// format row gained JPEG XL, #780)
assert!((dialog.height() - 846.0).abs() <= 1.0, "{dialog:?}");
// format row gained JPEG XL, #780; the macOS-only "Add to Apple Photos" row adds 30)
let tall = if cfg!(target_os = "macos") { 876.0 } else { 846.0 };
assert!((dialog.height() - tall).abs() <= 1.0, "{dialog:?}");
assert!((dialog.width() - 615.2).abs() <= 1.0, "{dialog:?}");
}

Expand Down