()
| 574 | |
| 575 | #[test] |
| 576 | fn test_process_instruction() { |
| 577 | let arch = ArchX86 { arch: Architecture::X86, endianness: object::Endianness::Little }; |
| 578 | let code = [0xc7, 0x85, 0x68, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00]; |
| 579 | let opcode = iced_x86::Mnemonic::Mov as u16; |
| 580 | let mut parts = Vec::new(); |
| 581 | arch.display_instruction( |
| 582 | ResolvedInstructionRef { |
| 583 | ins_ref: InstructionRef { address: 0x1234, size: 10, opcode, branch_dest: None }, |
| 584 | code: &code, |
| 585 | ..Default::default() |
| 586 | }, |
| 587 | &DiffObjConfig::default(), |
| 588 | &mut |part| { |
| 589 | parts.push(part.into_static()); |
| 590 | Ok(()) |
| 591 | }, |
| 592 | ) |
| 593 | .unwrap(); |
| 594 | assert_eq!(parts, &[ |
| 595 | InstructionPart::opcode("mov", opcode), |
| 596 | InstructionPart::opaque("dword"), |
| 597 | InstructionPart::basic(" "), |
| 598 | InstructionPart::opaque("ptr"), |
| 599 | InstructionPart::basic(" "), |
| 600 | InstructionPart::basic("["), |
| 601 | InstructionPart::opaque("ebp"), |
| 602 | InstructionPart::opaque("-"), |
| 603 | InstructionPart::signed(152i64), |
| 604 | InstructionPart::basic("]"), |
| 605 | InstructionPart::basic(","), |
| 606 | InstructionPart::basic(" "), |
| 607 | InstructionPart::unsigned(0u64), |
| 608 | ]); |
| 609 | } |
| 610 | |
| 611 | #[test] |
| 612 | fn test_process_instruction_with_reloc_1() { |
nothing calls this directly
no test coverage detected