Skip to content

Commit

Permalink
Adjusted estimated max execution time for MAINDEC tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sictransit committed Feb 17, 2020
1 parent bb8ec55 commit b02cb47
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 67 deletions.
2 changes: 1 addition & 1 deletion Core8/CPU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void Run()
{
break;
}
}
}

Interrupts.Interrupt();

Expand Down
65 changes: 0 additions & 65 deletions Tests/Core8Tests/CPUTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,70 +57,5 @@ public void TestHelloWorld()

Log.Information(PDP.CPU.Teletype.Printout);
}

[TestMethod]
public void TestIAC()
{
var length = 10;

PDP.Load8(0200);

for (int i = 0; i < length; i++)
{
PDP.Deposit8(7001);
}

PDP.Deposit8(7402);

PDP.Load8(0200);

PDP.Continue();

Assert.IsTrue(PDP.CPU.Registers.AC.Accumulator == length);
}

[TestMethod]
public void TestPaging()
{
PDP.Load8(0200);

PDP.Deposit8(7300);
PDP.Deposit8(1205);
PDP.Deposit8(1206);
PDP.Deposit8(3207);
PDP.Deposit8(7402);
PDP.Deposit8(0002);
PDP.Deposit8(0003);

PDP.Load8(0200);
PDP.Continue();

PDP.Load8(0207);
PDP.Exam();

Assert.AreEqual(5, PDP.CPU.Registers.AC.Accumulator);
}

[TestMethod]
public void TestAddition()
{
PDP.Load8(0000);

PDP.Deposit8(7300);
PDP.Deposit8(1005);
PDP.Deposit8(1006);
PDP.Deposit8(3007);
PDP.Deposit8(7402);
PDP.Deposit8(0002);
PDP.Deposit8(0003);

PDP.Load8(0000);
PDP.Continue();

PDP.Load8(0007);
PDP.Exam();

Assert.AreEqual(5, PDP.CPU.Registers.AC.Accumulator);
}
}
}
2 changes: 1 addition & 1 deletion Tests/Core8Tests/MAINDEC/Abstract/MAINDECTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public abstract class MAINDECTestsBase : InstructionTestsBase

protected virtual string[] UnexpectedOutput => new string[] { };

protected virtual TimeSpan MaxRunningTime => TimeSpan.FromSeconds(10);
protected virtual TimeSpan MaxRunningTime => TimeSpan.FromSeconds(5);

protected virtual bool ExpectHLT => false;

Expand Down
2 changes: 2 additions & 0 deletions Tests/Core8Tests/MAINDEC/AdderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class AdderTest : MAINDECTestsBase

protected override string[] ExpectedOutput => new[] { "SIMAD", "SIMROT", "FCT", "RANDOM" };

protected override TimeSpan MaxRunningTime => TimeSpan.FromSeconds(600);

[TestMethod]
public override void Start()
{
Expand Down
3 changes: 3 additions & 0 deletions Tests/Core8Tests/MAINDEC/ExtendedMemoryAddressTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Core8.Tests.MAINDEC.Abstract;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Core8.Tests.MAINDEC
{
Expand All @@ -12,6 +13,8 @@ public class ExtendedMemoryAddressTest : MAINDECTestsBase

protected override string[] ExpectedOutput => new[] { "\r\n5" };

protected override TimeSpan MaxRunningTime => TimeSpan.FromSeconds(60);

[TestMethod]
public override void Start()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Core8.Tests.MAINDEC.Abstract;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Core8.Tests.MAINDEC
{
Expand All @@ -10,6 +11,8 @@ public class MemoryExtensionAndTimeShareControlTest : MAINDECTestsBase

protected override string[] ExpectedOutput => new[] { "\u0007" };

protected override TimeSpan MaxRunningTime => TimeSpan.FromSeconds(60);

[TestMethod]
public override void Start()
{
Expand Down

0 comments on commit b02cb47

Please sign in to comment.