30 lines
661 B
Rust
30 lines
661 B
Rust
use maraiah::machdr;
|
|
|
|
include!("data/rand.rs");
|
|
|
|
#[test]
|
|
fn machdr_must_process()
|
|
{
|
|
const INPUT: &[u8] = include_bytes!("data/misc/macbin.in");
|
|
|
|
let mut inp = std::io::Cursor::new(INPUT);
|
|
|
|
assert_eq!(machdr::skip_macbin(&mut inp), true);
|
|
assert_eq!(machdr::skip_mac_header(&mut inp), true);
|
|
|
|
// FIXME: missing test data for applesingle
|
|
}
|
|
|
|
#[test]
|
|
fn machdr_must_not_process()
|
|
{
|
|
for rinp in &RANDOM {
|
|
let mut inp = std::io::Cursor::new(rinp);
|
|
assert_eq!(machdr::skip_macbin(&mut inp), false);
|
|
assert_eq!(machdr::skip_apple_single(&mut inp), false);
|
|
assert_eq!(machdr::skip_mac_header(&mut inp), false);
|
|
}
|
|
}
|
|
|
|
// EOF
|