Maraiah/tests/misc.rs

27 lines
541 B
Rust
Raw Normal View History

2019-06-13 18:09:07 -07:00
use maraiah::machdr;
2019-03-04 06:10:38 -08:00
2019-03-04 18:55:49 -08:00
include!("data/rand.rs");
#[test]
fn machdr_must_process()
2019-03-04 06:10:38 -08:00
{
2019-03-12 13:28:08 -07:00
const INPUT: &[u8] = include_bytes!("data/misc/macbin.in");
2019-03-04 06:10:38 -08:00
assert_eq!(machdr::check_macbin(INPUT), Some(128));
assert_eq!(machdr::try_mac_header(INPUT), 128);
2019-03-04 18:55:49 -08:00
2019-04-03 11:16:47 -07:00
// FIXME: missing test data for applesingle
2019-03-04 06:10:38 -08:00
}
2019-03-04 18:55:49 -08:00
#[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);
}
}
2019-03-04 06:10:38 -08:00
// EOF