()
| 52 | |
| 53 | #[test] |
| 54 | fn test_debug_info() { |
| 55 | let _session = Session::new().expect("Failed to initialize session"); |
| 56 | let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap(); |
| 57 | |
| 58 | // Register test parser |
| 59 | DebugInfoParser::register("test", TestDebugInfoParser); |
| 60 | |
| 61 | // Make sure it exists. |
| 62 | let _parser = DebugInfoParser::from_name("test").expect("Debug info test parser exists"); |
| 63 | |
| 64 | { |
| 65 | let view = binaryninja::load(out_dir.join("atox.obj")).expect("Failed to create view"); |
| 66 | view.type_by_name("test_dbg") |
| 67 | .expect("Debug info test type exists"); |
| 68 | |
| 69 | let func = view |
| 70 | .function_at(&view.default_platform().unwrap(), 0x3b440) |
| 71 | .expect("Debug info test function exists"); |
| 72 | assert_eq!(func.symbol().raw_name().to_string(), "test_func"); |
| 73 | view.file().close(); |
| 74 | } |
| 75 | |
| 76 | // Disable the parser for other tests, so we don't introduce any unwanted behavior. |
| 77 | TEST_PARSER_ENABLED.store(false, Ordering::SeqCst); |
| 78 | } |
nothing calls this directly
no test coverage detected