27 lines
545 B
Rust
27 lines
545 B
Rust
use maraiah::marathon::machdr;
|
|
|
|
include!("data/rand.rs");
|
|
|
|
#[test]
|
|
fn machdr_must_process()
|
|
{
|
|
const INPUT: &[u8] = include_bytes!("data/macbin.in");
|
|
|
|
assert_eq!(machdr::check_macbin(INPUT), Some(128));
|
|
assert_eq!(machdr::try_mac_header(INPUT), 128);
|
|
|
|
// TODO: missing test data for applesingle
|
|
}
|
|
|
|
#[test]
|
|
fn machdr_must_not_process()
|
|
{
|
|
for inp in &RANDOM {
|
|
assert_eq!(machdr::check_macbin(inp), None);
|
|
assert_eq!(machdr::check_apple_single(inp), None);
|
|
assert_eq!(machdr::try_mac_header(inp), 0);
|
|
}
|
|
}
|
|
|
|
// EOF
|