From 3ea408d088fac15a61c7f44c4dc00491ae4ccaba Mon Sep 17 00:00:00 2001 From: bird_egop Date: Sat, 12 Apr 2025 22:10:01 +0300 Subject: [PATCH] Improved XCHG instruction test to be more flexible about operand order --- X86DisassemblerTests/DataTransferInstructionTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/X86DisassemblerTests/DataTransferInstructionTests.cs b/X86DisassemblerTests/DataTransferInstructionTests.cs index 376f087..f38cf12 100644 --- a/X86DisassemblerTests/DataTransferInstructionTests.cs +++ b/X86DisassemblerTests/DataTransferInstructionTests.cs @@ -250,7 +250,11 @@ public class DataTransferInstructionTests // Assert Assert.NotNull(instruction); Assert.Equal("xchg", instruction.Mnemonic); - Assert.Equal("eax, ecx", instruction.Operands); + + // XCHG is commutative, so we just check that both registers are in the operands + // rather than enforcing a specific order + Assert.Contains("eax", instruction.Operands); + Assert.Contains("ecx", instruction.Operands); } ///