Further code cleanups and documentation.
- Coverity defects. - Documentation.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// \file Test.h
|
||||
/// \file Assert.h
|
||||
/// \author K. Isom <kyle@imap.cc>
|
||||
/// \date 2023-10-09
|
||||
/// \brief Tooling to assist in building test programs..
|
||||
|
||||
@@ -40,10 +40,15 @@ public:
|
||||
/// \return The number of tests that failed.
|
||||
size_t Failing() const;
|
||||
|
||||
/// \brief Returns the number of tests that have passed
|
||||
/// successfully.
|
||||
size_t Passing() const;
|
||||
|
||||
/// \brief Total is the number of tests registered.
|
||||
size_t Total() const;
|
||||
|
||||
void Failed();
|
||||
void Passed();
|
||||
void AddTest(size_t testCount = 0);
|
||||
void Reset(size_t testCount = 0);
|
||||
|
||||
@@ -54,8 +59,9 @@ public:
|
||||
|
||||
Report();
|
||||
private:
|
||||
size_t failing{};
|
||||
size_t total{};
|
||||
size_t failing;
|
||||
size_t passed;
|
||||
size_t total;
|
||||
|
||||
std::chrono::time_point<std::chrono::steady_clock> start;
|
||||
std::chrono::time_point<std::chrono::steady_clock> end;
|
||||
|
||||
@@ -41,6 +41,9 @@ struct UnitTest {
|
||||
|
||||
/// This is the test function to be run.
|
||||
std::function<bool()> test;
|
||||
|
||||
/// This is the value the test returns if it passes.
|
||||
bool expect;
|
||||
};
|
||||
|
||||
/// \brief SimpleSuite is a test-running harness for simple tests.
|
||||
@@ -105,8 +108,8 @@ public:
|
||||
|
||||
private:
|
||||
bool quiet;
|
||||
std::function<bool(void)> fnSetup, fnTeardown;
|
||||
std::vector<UnitTest> tests;
|
||||
std::function<bool(void)> fnSetup, fnTeardown;
|
||||
std::vector<UnitTest> tests;
|
||||
|
||||
// Report functions.
|
||||
Report report;
|
||||
|
||||
Reference in New Issue
Block a user