Skip to content

Commit a79e605

Browse files
committed
[Rust] Add simple binary view tags test
1 parent 3caff8a commit a79e605

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

rust/tests/binary_view.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ fn test_binary_view_strings() {
9999
assert_eq!(str_15dc.length, 33);
100100
}
101101

102+
#[test]
103+
fn test_binary_tags() {
104+
let _session = Session::new().expect("Failed to initialize session");
105+
let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap();
106+
let view = binaryninja::load(out_dir.join("atox.obj")).expect("Failed to create view");
107+
let tag_ty = view.create_tag_type("Test", "");
108+
view.add_tag(0x0, &tag_ty, "t", false);
109+
view.tag_type_by_name("Test").expect("Failed to get tag type");
110+
}
111+
102112
// These are the target files present in OUT_DIR
103113
// Add the files to fixtures/bin
104114
static TARGET_FILES: [&str; 2] = ["atox.obj", "atof.obj"];

0 commit comments

Comments
 (0)