Skip to content

Commit

Permalink
Add Control Word to Unit Test
Browse files Browse the repository at this point in the history
  • Loading branch information
enusbaum committed Aug 27, 2024
1 parent 178d5ed commit 56339ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MBBSEmu.Tests/CPU/FRNDINT_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ public class FRNDINT_Tests : CpuTestBase
[InlineData(0.1d, 0d)]
[InlineData(1.9d, 2d)]
[InlineData(-1.9d, -2d)]
[InlineData(0.5d, 1d)]
[InlineData(0.5d, 0d)]
[InlineData(0.49999999d, 0d)]
public void FRNDINT_Test(double ST0Value, double expectedValue)
{
Reset();
mbbsEmuCpuCore.FpuStack[mbbsEmuCpuRegisters.Fpu.GetStackTop()] = ST0Value;

//Set FPU Control Word to set rounding to even
mbbsEmuCpuRegisters.Fpu.ControlWord = 0x0000000C;

var instructions = new Assembler(16);
instructions.frndint();
CreateCodeSegment(instructions);
Expand Down

0 comments on commit 56339ec

Please sign in to comment.