mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 00:18:02 +03:00
add misc handlers, cleanup and fixes
This commit is contained in:
@ -27,7 +27,7 @@ public class DebugHandlerRegistration
|
||||
// Create a factory
|
||||
byte[] codeBuffer = new byte[1];
|
||||
var decoder = new InstructionDecoder(codeBuffer, codeBuffer.Length);
|
||||
var sut = new InstructionHandlerFactory(codeBuffer, decoder, codeBuffer.Length);
|
||||
var sut = new InstructionHandlerFactory(decoder);
|
||||
|
||||
// Get the handlers registered in the factory
|
||||
var handlers = (List<IInstructionHandler>)sut.GetType()
|
||||
|
@ -18,7 +18,7 @@ public class HandlerSelectionTests
|
||||
// Arrange
|
||||
byte[] codeBuffer = new byte[] {0x83, 0xC1, 0x04}; // ADD ecx, 0x04
|
||||
var decoder = new InstructionDecoder(codeBuffer, codeBuffer.Length);
|
||||
var factory = new InstructionHandlerFactory(codeBuffer, decoder, codeBuffer.Length);
|
||||
var factory = new InstructionHandlerFactory(decoder);
|
||||
|
||||
// Act
|
||||
var handler = factory.GetHandler(0x83);
|
||||
|
@ -10,7 +10,7 @@ public class InstructionHandlerFactoryTests
|
||||
public void Factory_ShouldNotContainDuplicates()
|
||||
{
|
||||
byte[] code = new byte[] {0xCC, 0xCC, 0xCC};
|
||||
var sut = new InstructionHandlerFactory(code, new InstructionDecoder(code, code.Length), code.Length);
|
||||
var sut = new InstructionHandlerFactory(new InstructionDecoder(code, code.Length));
|
||||
|
||||
var handlers = (List<IInstructionHandler>) sut.GetType()
|
||||
.GetField("_handlers", BindingFlags.Instance | BindingFlags.NonPublic)!
|
||||
@ -26,7 +26,7 @@ public class InstructionHandlerFactoryTests
|
||||
public void Factory_ShouldContainAllKnownHandlers()
|
||||
{
|
||||
byte[] code = new byte[] {0xCC, 0xCC, 0xCC};
|
||||
var sut = new InstructionHandlerFactory(code, new InstructionDecoder(code, code.Length), code.Length);
|
||||
var sut = new InstructionHandlerFactory(new InstructionDecoder(code, code.Length));
|
||||
|
||||
var handlers = (List<IInstructionHandler>) sut.GetType()
|
||||
.GetField("_handlers", BindingFlags.Instance | BindingFlags.NonPublic)!
|
||||
|
Reference in New Issue
Block a user