Skip to content

Commit

Permalink
Test move binary is parsed correctly by the GoblinParser
Browse files Browse the repository at this point in the history
  • Loading branch information
ksolana committed Apr 2, 2024
1 parent 3522812 commit 1df4bfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1973,4 +1973,11 @@ mod test {
SECTION_NAME_LENGTH_MAXIMUM
);
}
#[test]
fn test_move_binary() {
// Binary compiled from move-mv-llvm-compiler/tests/rbpf-tests/eq-u32.move program.
let elf_bytes = std::fs::read("tests/elfs/move_u32_eq_check.so").unwrap();
let p = GoblinParser::parse(&elf_bytes).expect("Failed to parse move binary");
assert!(p.section_headers().count() == 10, "Incorrect section entries");
}
}
Binary file added tests/elfs/move_u32_eq_check.so
Binary file not shown.

0 comments on commit 1df4bfd

Please sign in to comment.