Formatação (cargo fmt) e ajustes do clippy para o CI da 1.0.0
Release / Cria a release (push) Canceled after 0s
Release / CLI (linux-aarch64) (push) Canceled after 0s
Release / CLI (linux-x86_64) (push) Canceled after 0s
Release / CLI (macos-aarch64) (push) Canceled after 0s
Release / CLI (macos-x86_64) (push) Canceled after 0s
Release / CLI (windows-x86_64) (push) Canceled after 0s
Release / App desktop (linux-x86_64) (push) Canceled after 0s
Release / App desktop (macos-aarch64) (push) Canceled after 0s
Release / App desktop (macos-x86_64) (push) Canceled after 0s
Release / App desktop (windows-x86_64) (push) Canceled after 0s
Release / Publica a release (push) Canceled after 0s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Opus 5.5 committed 2026-10-19 11:41:58 -03:00
1 parent 74218e7beb
commit beb83fef92
49 files changed
+3806 -854

No files matched your search

+20 -5
View File
@@ -5,7 +5,8 @@ use common::*;
use guara_core::*;
fn image() -> Option<Vec<u8>> {
let p = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../target/testdata/dfvfs/hfsplus.raw");
let p = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../target/testdata/dfvfs/hfsplus.raw");
p.exists().then(|| std::fs::read(p).unwrap())
}
@@ -14,7 +15,13 @@ fn scan_bytes(bytes: &[u8]) -> Collect {
let dir = tempfile::tempdir().unwrap();
let p = dir.path().join("h.img");
std::fs::write(&p, bytes).unwrap();
scan_path(&p, &ScanOptions { mode: ScanMode::Quick, ..Default::default() })
scan_path(
&p,
&ScanOptions {
mode: ScanMode::Quick,
..Default::default()
},
)
}
#[test]
@@ -25,7 +32,11 @@ fn pristine_volume_has_no_deleted_files_and_is_recognized() {
};
let c = scan_bytes(&img);
assert_eq!(c.layout.as_ref().unwrap().partitions[0].fs, FsKind::HfsPlus);
assert!(c.found.is_empty(), "{:?}", c.found.iter().map(|f| &f.name).collect::<Vec<_>>());
assert!(
c.found.is_empty(),
"{:?}",
c.found.iter().map(|f| &f.name).collect::<Vec<_>>()
);
}
#[test]
@@ -33,13 +44,17 @@ fn record_left_in_leaf_slack_is_recovered() {
let Some(mut img) = image() else { return };
let bs = 4096usize;
let node = 186 * bs + bs; // catálogo começa no bloco 186; nó 1 é a única folha
// Remove os 5 últimos registros como o driver faz ao apagar no fim do nó: só diminui a contagem.
// Remove os 5 últimos registros como o driver faz ao apagar no fim do nó: só diminui a contagem.
img[node + 10..node + 12].copy_from_slice(&21u16.to_be_bytes());
// Libera o bloco de dados (bitmap de alocação no bloco 1).
let blk = 278usize;
img[bs + blk / 8] &= !(0x80 >> (blk % 8));
let c = scan_bytes(&img);
let f = c.found.iter().find(|f| f.name == "fseventsd-uuid").unwrap_or_else(|| panic!("{:?}", c.found.iter().map(|f| &f.name).collect::<Vec<_>>()));
let f = c
.found
.iter()
.find(|f| f.name == "fseventsd-uuid")
.unwrap_or_else(|| panic!("{:?}", c.found.iter().map(|f| &f.name).collect::<Vec<_>>()));
assert_eq!(f.origin, Origin::Hfs);
assert_eq!(f.size, 36);
assert_eq!(f.dir.as_deref(), Some("/.fseventsd"));