MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / test_component_creation

Function test_component_creation

rust/tests/component.rs:7–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6#[test]
7fn test_component_creation() {
8 let _session = Session::new().expect("Failed to initialize session");
9 let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap();
10 let view = binaryninja::load(out_dir.join("atox.obj")).expect("Failed to create view");
11 let component = ComponentBuilder::new(view.clone()).name("test").finalize();
12 assert_eq!(component.name().as_str(), "test");
13 let root_component = view.root_component().unwrap();
14 // We should only have our component.
15 assert_eq!(root_component.components().len(), 1);
16 assert!(
17 root_component.contains_component(&component),
18 "Component not found in root component"
19 );
20}

Callers

nothing calls this directly

Calls 6

joinMethod · 0.80
loadFunction · 0.50
finalizeMethod · 0.45
nameMethod · 0.45
cloneMethod · 0.45
root_componentMethod · 0.45

Tested by

no test coverage detected