Table of named self-tests that the hx.test script command runs.
More...
#include <testregistry.h>
|
| static void | Register (const char *pszName, TestFunc pfnTest) |
| | Append a test to the table.
|
| static TestFunc | Find (const char *pszName) |
| | Look a test up by name.
|
|
| static constexpr int | kMaxTests = 64 |
| | Slots of the table, bounded by the next object at 0x008efb50 rather than measured.
|
| static Entry | sTests [kMaxTests] |
| | The registered tests, in registration order.
|
| static int | sTestCount |
| | The number of registered tests.
|
Table of named self-tests that the hx.test script command runs.
The class has no instance and no RTTI, so the title is inferred from the command's messages, requires 1 arg (name of test) and valid tests are:. A unit that carries a self-test registers it from its static initialiser, as the PlayMapLinear and TrackSelector units do. The command expands Find() inline rather than calling it.
◆ TestFunc
| typedef int(* TestRegistry::TestFunc) () |
A self-test.
It takes no arguments, reports through the log, and reports pass or fail.
◆ Register()
| void TestRegistry::Register |
( |
const char * | pszName, |
|
|
TestFunc | pfnTest ) |
|
static |
Append a test to the table.
The count is not checked against the table's size.
- Parameters
-
| pszName | The name the command matches. |
| pfnTest | The test. |
- Ghidra address:
- NTSC-U/C: 0x0015fda8
- Ghidra address:
- PAL: 0x00161cc8
◆ Find()
| TestFunc TestRegistry::Find |
( |
const char * | pszName | ) |
|
|
static |
Look a test up by name.
- Parameters
-
- Returns
- The first test registered under the name, or null.
- Ghidra address:
- NTSC-U/C: 0x0015fdd8
- Ghidra address:
- PAL: 0x00161cf8
◆ kMaxTests
| int TestRegistry::kMaxTests = 64 |
|
staticconstexpr |
Slots of the table, bounded by the next object at 0x008efb50 rather than measured.
◆ sTests
The registered tests, in registration order.
Public because the command walks the table itself to list the valid tests.
- Ghidra address:
- NTSC-U/C: 0x008ef950
- Ghidra address:
- PAL: 0x00934950
◆ sTestCount
| int TestRegistry::sTestCount |
|
static |
The number of registered tests.
- Ghidra address:
- NTSC-U/C: 0x0086f790
- Ghidra address:
- PAL: 0x008b3e70
The documentation for this class was generated from the following file: