0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-19 07:59:47 +03:00

simplify reading logic

This commit is contained in:
bird_egop
2025-04-13 23:22:30 +03:00
parent 0ea3294c61
commit 00547ed273
13 changed files with 31 additions and 79 deletions

View File

@ -26,24 +26,4 @@ public class AddEaxImmHandlerTests
Assert.Equal("add", instruction.Mnemonic);
Assert.Equal("eax, 0x12345678", instruction.Operands);
}
/// <summary>
/// Tests the AddEaxImmHandler for handling insufficient bytes
/// </summary>
[Fact]
public void AddEaxImmHandler_HandlesInsufficientBytes_Gracefully()
{
// Arrange
// ADD EAX, ?? (05) - missing immediate value
byte[] codeBuffer = new byte[] { 0x05 };
var decoder = new InstructionDecoder(codeBuffer, codeBuffer.Length);
// Act
var instruction = decoder.DecodeInstruction();
// Assert
Assert.NotNull(instruction);
Assert.Equal("add", instruction.Mnemonic);
Assert.Equal("eax, ??", instruction.Operands);
}
}