mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-19 16:08:02 +03:00
Added test for INT3 instruction handler
This commit is contained in:
30
X86DisassemblerTests/Int3InstructionTests.cs
Normal file
30
X86DisassemblerTests/Int3InstructionTests.cs
Normal file
@ -0,0 +1,30 @@
|
||||
namespace X86DisassemblerTests;
|
||||
|
||||
using Xunit;
|
||||
using X86Disassembler.X86;
|
||||
|
||||
/// <summary>
|
||||
/// Tests for INT3 instruction handler
|
||||
/// </summary>
|
||||
public class Int3InstructionTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests the Int3Handler for decoding INT3 instruction
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Int3Handler_DecodesInt3_Correctly()
|
||||
{
|
||||
// Arrange
|
||||
// INT3 (CC)
|
||||
byte[] codeBuffer = new byte[] { 0xCC };
|
||||
var decoder = new InstructionDecoder(codeBuffer, codeBuffer.Length);
|
||||
|
||||
// Act
|
||||
var instruction = decoder.DecodeInstruction();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(instruction);
|
||||
Assert.Equal("int3", instruction.Mnemonic);
|
||||
Assert.Equal("", instruction.Operands);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user