diff options
| author | Mason Reed <mason@vector35.com> | 2025-06-22 19:06:30 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-07-02 01:56:53 -0400 |
| commit | 15c7af50d7c320ca1f1fede1ccd671e5d8a21fa6 (patch) | |
| tree | b4e329fd0f93e7a6a100a2088e23ab96cfd895b4 /rust | |
| parent | 4c53912ff8027e9a7b276c1a5ccc1e779965dfc6 (diff) | |
[Rust] Misc changes to `test_deterministic_functions`
The function name is redundant, just pull from the symbol
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/tests/binary_view.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rust/tests/binary_view.rs b/rust/tests/binary_view.rs index db094247..1b4f1c40 100644 --- a/rust/tests/binary_view.rs +++ b/rust/tests/binary_view.rs @@ -2,7 +2,10 @@ use binaryninja::binary_view::{AnalysisState, BinaryViewBase, BinaryViewExt}; use binaryninja::function::Function; use binaryninja::headless::Session; use binaryninja::main_thread::execute_on_main_thread_and_wait; -use binaryninja::symbol::{SymbolBuilder, SymbolType}; +use binaryninja::platform::Platform; +use binaryninja::rc::Ref; +use binaryninja::symbol::{Symbol, SymbolBuilder, SymbolType}; +use std::collections::BTreeMap; use std::path::PathBuf; #[test] @@ -100,7 +103,6 @@ fn test_binary_view_strings() { // See `test_deterministic_functions` for details. #[derive(Debug, PartialEq)] pub struct FunctionSnapshot { - name: String, platform: Ref<Platform>, symbol: Ref<Symbol>, } @@ -108,16 +110,15 @@ pub struct FunctionSnapshot { impl From<&Function> for FunctionSnapshot { fn from(func: &Function) -> Self { Self { - name: func.symbol().raw_name().to_string(), platform: func.platform().to_owned(), symbol: func.symbol().to_owned(), } } } -#[rstest] -fn test_deterministic_functions(session: &Session) { - // Test to make sure that analysis always collects the same information on functions. +#[test] +fn test_deterministic_functions() { + let session = Session::new().expect("Failed to initialize session"); let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap(); for entry in std::fs::read_dir(out_dir).expect("Failed to read OUT_DIR") { let entry = entry.expect("Failed to read directory entry"); |
