diff options
| author | Mason Reed <mason@vector35.com> | 2025-01-27 16:56:15 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-01-27 17:52:29 -0500 |
| commit | 01a224425d2a90e660bbfffe8d1cbc6b93da24bd (patch) | |
| tree | 4be2aa6c3154b4fb34e61815956dcd357c754e2c /rust/tests/binary_view.rs | |
| parent | 9c9f5085e010059c813d2285ddff79b542c76834 (diff) | |
Fix some rust race conditions and comment some likely suspects
FYI The binary view saving stuff can deadlock right now, so we document that now :/
Diffstat (limited to 'rust/tests/binary_view.rs')
| -rw-r--r-- | rust/tests/binary_view.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/tests/binary_view.rs b/rust/tests/binary_view.rs index 65f6b45b..0ee10d87 100644 --- a/rust/tests/binary_view.rs +++ b/rust/tests/binary_view.rs @@ -3,6 +3,7 @@ use binaryninja::headless::Session; use binaryninja::symbol::{SymbolBuilder, SymbolType}; use rstest::*; use std::path::PathBuf; +use binaryninja::main_thread::execute_on_main_thread_and_wait; #[fixture] #[once] @@ -31,6 +32,10 @@ fn test_binary_saving(_session: &Session) { // Verify that we modified the binary let modified_contents = view.read_vec(0x1560, 4); assert_eq!(modified_contents, [0xff, 0xff, 0xff, 0xff]); + + // HACK: To prevent us from deadlocking in save_to_path we wait for all main thread actions to finish. + execute_on_main_thread_and_wait(|| {}); + // Save the modified file assert!(view.save_to_path(out_dir.join("atox.obj.new"))); // Verify that the file exists and is modified. |
