diff options
Diffstat (limited to 'rust/tests')
| -rw-r--r-- | rust/tests/binary_view.rs | 9 | ||||
| -rw-r--r-- | rust/tests/websocket.rs | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/rust/tests/binary_view.rs b/rust/tests/binary_view.rs index e48d5f52..a2407253 100644 --- a/rust/tests/binary_view.rs +++ b/rust/tests/binary_view.rs @@ -29,7 +29,7 @@ fn test_binary_saving() { let modified_contents = view.read_vec(contents_addr, 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. + // 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 @@ -56,7 +56,7 @@ fn test_binary_saving_database() { SymbolBuilder::new(SymbolType::Function, "test", entry_function.start()).create(); view.define_user_symbol(&new_entry_func_symbol); // Verify that we modified the binary - assert_eq!(entry_function.symbol().raw_name().as_str(), "test"); + assert_eq!(entry_function.symbol().raw_name().to_string_lossy(), "test"); // Save the modified database. assert!(view.file().create_database(out_dir.join("atox.obj.bndb"))); // Verify that the file exists and is modified. @@ -65,5 +65,8 @@ fn test_binary_saving_database() { let new_entry_function = new_view .entry_point_function() .expect("Failed to get entry point function"); - assert_eq!(new_entry_function.symbol().raw_name().as_str(), "test"); + assert_eq!( + new_entry_function.symbol().raw_name().to_string_lossy(), + "test" + ); } diff --git a/rust/tests/websocket.rs b/rust/tests/websocket.rs index 97a4ae2b..01d2d791 100644 --- a/rust/tests/websocket.rs +++ b/rust/tests/websocket.rs @@ -1,6 +1,6 @@ use binaryninja::headless::Session; use binaryninja::rc::Ref; -use binaryninja::string::BnStrCompatible; +use binaryninja::string::AsCStr; use binaryninja::websocket::{ register_websocket_provider, CoreWebsocketClient, CoreWebsocketProvider, WebsocketClient, WebsocketClientCallback, WebsocketProvider, @@ -34,8 +34,8 @@ impl WebsocketClient for MyWebsocketClient { fn connect<I, K, V>(&self, host: &str, _headers: I) -> bool where I: IntoIterator<Item = (K, V)>, - K: BnStrCompatible, - V: BnStrCompatible, + K: AsCStr, + V: AsCStr, { assert_eq!(host, "url"); true |
