Skip to content

Commit 90c0da6

Browse files
committed
Add x86 indirect table test
1 parent 9d95aa1 commit 90c0da6

File tree

5 files changed

+16406
-0
lines changed

5 files changed

+16406
-0
lines changed

objdiff-core/tests/arch_x86.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,21 @@ fn read_x86_local_labels() {
104104
.unwrap();
105105
insta::assert_debug_snapshot!(obj);
106106
}
107+
108+
#[test]
109+
#[cfg(feature = "x86")]
110+
fn read_x86_indirect_table() {
111+
let diff_config = diff::DiffObjConfig::default();
112+
let obj = obj::read::parse(
113+
include_object!("data/x86/indirect_table.obj"),
114+
&diff_config,
115+
diff::DiffSide::Base,
116+
)
117+
.unwrap();
118+
insta::assert_debug_snapshot!(obj);
119+
let symbol_idx = obj.symbols.iter().position(|s| s.name == "?process@@YAHHHH@Z").unwrap();
120+
let diff = diff::code::no_diff_code(&obj, symbol_idx, &diff_config).unwrap();
121+
insta::assert_debug_snapshot!(diff.instruction_rows);
122+
let output = common::display_diff(&obj, &diff, symbol_idx, &diff_config);
123+
insta::assert_snapshot!(output);
124+
}
4.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)