Skip to content

Commit 03b8ae7

Browse files
committed
Move binary view initialization into function body for LLIL test
1 parent f741ac9 commit 03b8ae7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

rust/tests/llil.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use binaryninja::architecture::Register;
2-
use binaryninja::binary_view::{BinaryView, BinaryViewExt};
2+
use binaryninja::binary_view::BinaryViewExt;
33
use binaryninja::headless::Session;
44
use binaryninja::low_level_il::expression::LowLevelExpressionIndex;
55
use binaryninja::low_level_il::instruction::{
66
InstructionHandler, LowLevelILInstructionKind, LowLevelInstructionIndex,
77
};
88
use binaryninja::low_level_il::LowLevelILRegister;
9-
use binaryninja::rc::Ref;
109
use rstest::*;
1110
use std::path::PathBuf;
1211

@@ -16,15 +15,11 @@ fn session() -> Session {
1615
Session::new().expect("Failed to initialize session")
1716
}
1817

19-
#[fixture]
20-
#[once]
21-
fn view() -> Ref<BinaryView> {
18+
#[rstest]
19+
fn test_llil_info(_session: &Session) {
2220
let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap();
23-
binaryninja::load(out_dir.join("atox.obj")).expect("Failed to create view")
24-
}
21+
let view = binaryninja::load(out_dir.join("atox.obj")).expect("Failed to create view");
2522

26-
#[rstest]
27-
fn test_llil_info(_session: &Session, view: &BinaryView) {
2823
let entry_function = view.entry_point_function().unwrap();
2924
let llil_function = entry_function.low_level_il().unwrap();
3025
let llil_basic_blocks = llil_function.basic_blocks();

0 commit comments

Comments
 (0)