Skip to content

Commit

Permalink
Add endianness check test
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranshila committed Apr 5, 2024
1 parent 6925917 commit a05cd81
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,18 @@ mod tests {
assert_eq!(b"HEADER_END", e);
}

#[test]
fn test_wrong_endian() {
let hstart = sigproc_string("HEADER_START");
let a = header_start(&hstart, Endianness::Big);
let b = header_start(&hstart, Endianness::Little);
if a.is_err() {
assert!(b.is_ok())
} else {
assert!(b.is_err())
}
}

#[test]
fn test_numeric_headers() {
let mut az = sigproc_string("az_start");
Expand Down

0 comments on commit a05cd81

Please sign in to comment.