TestHarness<TCycle> Class
Definition
Base class for emulator test harnesses.
c#
public abstract class TestHarness<TCycle>Type Parameters
| Name | Description |
|---|---|
TCycle | The type used to represent recorded cycles. |
Constructors
| Name | Description |
|---|---|
TestHarness() |
Properties
| Name | Description |
|---|---|
Cycles | Gets the recorded CPU cycles. Only available when RecordCycles is true. |
MutableCycles | A mutable list of recorded cycles to update when RecordCycles is true, null otherwise. |
RecordCycles | Gets or sets whether CPU cycles should be recorded. |
TStates | Gets or sets the number of cycles executed. |
Methods
| Name | Description |
|---|---|
AssertEqual<T>(T, T, DefaultInterpolatedStringHandler) | Asserts that the actual value is equal to the expected value. If the values are not equal, an error is reported. |
AssertFail(String) | Signals that a test has failed with the provided error message. |
ClearMemory() | Clears memory. |
CopyToMemory(UInt16, ReadOnlySpan<Byte>) | Copies a span of bytes into memory starting at the specified address. |
CopyToMemory(UInt16, IReadOnlyList<Byte>) | Copies a sequence of bytes into memory starting at the specified address. |
CreateAssertionScope(String) | Creates an assertion scope that allows multiple AssertEqual<T>(T, T, DefaultInterpolatedStringHandler) assertions to be made with just one AssertFail(String). |
ReadByteFromMemory(UInt16) | Reads a byte from memory. |
ReadWordFromMemory(UInt16) | Reads a word in little-endian format from memory. |
Reset() | Resets the test harness state. |
WriteByteToMemory(UInt16, Byte) | Writes a byte to memory. |
WriteWordToMemory(UInt16, UInt16) | Writes a word in little-endian format to memory. |