Start incorporating "event" support into the Fuse tests. Only supported by the Z80 fuse tests at present.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2019-08-14 22:38:47 +01:00
parent 315bef7229
commit d15d1e0d08
5 changed files with 95 additions and 6 deletions
+2
View File
@@ -17,6 +17,8 @@ namespace Fuse
public T RegisterState { get; } = new T();
public TestEvents Events => this.events;
public ReadOnlyCollection<MemoryDatum> MemoryData => this.memoryData.AsReadOnly();
public bool TryParse(Lines lines)
+12
View File
@@ -9,6 +9,18 @@ namespace Fuse
{
private int cycles;
public TestEvent()
{
}
public TestEvent(int cycles, string specifier, ushort address, byte value)
{
this.cycles = cycles;
this.Specifier = specifier;
this.Address = address;
this.Value = value;
}
public int Cycles => this.cycles;
public string Specifier { get; private set; }
+3 -1
View File
@@ -12,6 +12,8 @@ namespace Fuse
public ReadOnlyCollection<TestEvent> Container => this.container.AsReadOnly();
public void Add(TestEvent testEvent) => this.container.Add(testEvent);
public void Parse(Lines lines)
{
bool success;
@@ -21,7 +23,7 @@ namespace Fuse
success = e.TryParse(lines);
if (success)
{
this.container.Add(e);
this.Add(e);
}
}
while (success);