diff options
| author | Mason Reed <mason@vector35.com> | 2025-02-26 20:56:18 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-02-26 21:05:34 -0500 |
| commit | dc8015f6695ee069279dfbd681000e8b1fcd30e5 (patch) | |
| tree | c1e387c68a249ff90999bbdcc4fa90372516d88c /rust/tests/platform.rs | |
| parent | 4608523101738492124069765324141966372229 (diff) | |
Remove module level `Session` initialization in Rust unit tests
This was preventing the enterprise license checkout from dropping, also the initialization story is much better than it was when we added the rstest fixtures, we can get away with initialization in parallel more broadly.
Diffstat (limited to 'rust/tests/platform.rs')
| -rw-r--r-- | rust/tests/platform.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/rust/tests/platform.rs b/rust/tests/platform.rs index 530f97b0..36a04d7f 100644 --- a/rust/tests/platform.rs +++ b/rust/tests/platform.rs @@ -1,15 +1,9 @@ use binaryninja::headless::Session; use binaryninja::platform::Platform; -use rstest::*; -#[fixture] -#[once] -fn session() -> Session { - Session::new().expect("Failed to initialize session") -} - -#[rstest] -fn test_platform_lifetime(_session: &Session) { +#[test] +fn test_platform_lifetime() { + let _session = Session::new().expect("Failed to initialize session"); let platform_0 = Platform::by_name("windows-x86_64").expect("windows-x86_64 exists"); let platform_types_0 = platform_0.types(); let platform_1 = Platform::by_name("windows-x86_64").expect("windows-x86_64 exists"); @@ -18,16 +12,18 @@ fn test_platform_lifetime(_session: &Session) { assert_ne!(platform_types_1.len(), 0); } -#[rstest] -fn test_platform_types(_session: &Session) { +#[test] +fn test_platform_types() { + let _session = Session::new().expect("Failed to initialize session"); let platform = Platform::by_name("windows-x86_64").expect("windows-x86_64 exists"); let platform_types = platform.types(); // windows-x86_64 has a few thousand, not zero. assert_ne!(platform_types.len(), 0); } -#[rstest] -fn test_platform_calling_conventions(_session: &Session) { +#[test] +fn test_platform_calling_conventions() { + let _session = Session::new().expect("Failed to initialize session"); let platform = Platform::by_name("windows-x86_64").expect("windows-x86_64 exists"); assert_eq!(platform.calling_conventions().len(), 1); } |
