RIOT unit tests for C++. More...
RIOT unit tests for C++.
The C++ unit test framework syntax is loosely based on GoogleTest, but offers far less functionality. For mocking the package Fake Functions Framework can be used.
Files | |
| file | cppunit_base.hpp |
| RIOT unit tests for C++ base classes and macros. | |
| file | cppunit_expect.hpp |
| RIOT unit tests for C++ assertion macros. | |
| file | cppunit_fff.hpp |
| RIOT unit tests for C++ assertion macros for Fake Functions Framework. | |
| file | cppunit.hpp |
| RIOT unit tests for C++. | |
Macros | |
| #define | CPPUNIT_SUITE_CNT (10) |
| Maximum amount of tests in one test suite. | |
| #define | RUN_SUITE(name) |
| Run the test suite name. More... | |
| #define | TEST_SUITE_F(suite, name) |
| Instantiate a test suite with custom test fixture. More... | |
| #define | TEST_SUITE(name) |
| Instantiate a test suite. More... | |
| #define | TEST(suite, name) |
| Begin the definition of a test. More... | |
| #define | EXPECT_EQ(expected, actual, msg) |
| Expect equality of the actual and expected value. More... | |
| #define | EXPECT_STREQ(expected, actual, msg) |
| Expect string equality of the actual and expected value. More... | |
| #define | EXPECT_FFF_CALL_COUNT(name, count) |
| Expect count calls to name mock. More... | |
| #define | EXPECT_FFF_CALL_PARAMS(mock, ...) |
| Expect that the last call to mock was made with the given parameters. More... | |
| #define EXPECT_EQ | ( | expected, | |
| actual, | |||
| msg | |||
| ) |
Expect equality of the actual and expected value.
| [in] | expected | Expected value |
| [in] | actual | Actual value |
| [in] | msg | Message to print in case of failure |
Definition at line 26 of file cppunit_expect.hpp.
| #define EXPECT_FFF_CALL_COUNT | ( | name, | |
| count | |||
| ) |
Expect count calls to name mock.
Needs the Fake Functions Framework for mocks
| [in] | name | Name of the mock |
| [in] | count | Expected calls |
Definition at line 26 of file cppunit_fff.hpp.
| #define EXPECT_FFF_CALL_PARAMS | ( | mock, | |
| ... | |||
| ) |
Expect that the last call to mock was made with the given parameters.
Needs the Fake Functions Framework for mocks
| [in] | mock | Name of the mock |
| [in] | ... | params |
Definition at line 128 of file cppunit_fff.hpp.
| #define EXPECT_STREQ | ( | expected, | |
| actual, | |||
| msg | |||
| ) |
Expect string equality of the actual and expected value.
Interprets both values as const char* string
| [in] | expected | Expected value |
| [in] | actual | Actual value |
| [in] | msg | Message to print in case of failure |
Definition at line 52 of file cppunit_expect.hpp.
| #define RUN_SUITE | ( | name | ) |
Run the test suite name.
| [in] | name | Name of the suite |
Definition at line 136 of file cppunit_base.hpp.
| #define TEST | ( | suite, | |
| name | |||
| ) |
Begin the definition of a test.
Insert the test body after the macro
| [in] | suite | Name of the suite to add the test to |
| [in] | name | Instantiation name of the test |
Definition at line 168 of file cppunit_base.hpp.
| #define TEST_SUITE | ( | name | ) |
Instantiate a test suite.
| [in] | name | Instantiation name of the suite |
Definition at line 159 of file cppunit_base.hpp.
| #define TEST_SUITE_F | ( | suite, | |
| name | |||
| ) |
Instantiate a test suite with custom test fixture.
| [in] | suite | Name of the custom test fixture class |
| [in] | name | Instantiation name of the suite |
Definition at line 144 of file cppunit_base.hpp.