resonance 1.0.1
Loading...
Searching...
No Matches
testregistry.h
Go to the documentation of this file.
1#pragma once
2
12public:
14 typedef int (*TestFunc)();
15
17 struct Entry {
18 const char *mName;
20 };
21
25 static constexpr int kMaxTests = 64;
26
35 static void Register(const char *pszName, TestFunc pfnTest);
36
45 static TestFunc Find(const char *pszName);
46
56
63 static int sTestCount;
64};
Table of named self-tests that the hx.test script command runs.
Definition testregistry.h:11
static void Register(const char *pszName, TestFunc pfnTest)
Append a test to the table.
static constexpr int kMaxTests
Slots of the table, bounded by the next object at 0x008efb50 rather than measured.
Definition testregistry.h:25
int(* TestFunc)()
A self-test.
Definition testregistry.h:14
static TestFunc Find(const char *pszName)
Look a test up by name.
static int sTestCount
The number of registered tests.
Definition testregistry.h:63
static Entry sTests[kMaxTests]
The registered tests, in registration order.
Definition testregistry.h:55
One registered test.
Definition testregistry.h:17
const char * mName
Definition testregistry.h:18
TestFunc mFunc
Definition testregistry.h:19