Skip to content

Commit

Permalink
swap test added
Browse files Browse the repository at this point in the history
  • Loading branch information
latonis committed Nov 25, 2023
1 parent 407ab46 commit 251369d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions yara-x/src/modules/macho/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,24 @@ fn test_swap_rpath_command() {
assert_eq!(command.cmdsize, 0x88776655);
}

#[test]
fn test_swap_min_version_command() {
let mut command: MinVersionCommand = MinVersionCommand {
cmd: 0x11223344,
cmdsize: 0x55667788,
version: 0x99AABBCC,
sdk: 0xDDDDFFFF,
..Default::default()
};

swap_min_version_command(&mut command);

assert_eq!(command.cmd, 0x44332211);
assert_eq!(command.cmdsize, 0x88776655);
assert_eq!(command.version, 0xCCBBAA99);
assert_eq!(command.sdk, 0xFFFFDDDD);
}

#[test]
fn test_swap_segment_command() {
let mut segment = SegmentCommand32 {
Expand Down

0 comments on commit 251369d

Please sign in to comment.