Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of el17ajf by
UnitTests/UnitTests.h@44:44aa01af687e, 2019-05-09 (annotated)
- Committer:
- el17ajf
- Date:
- Thu May 09 12:37:20 2019 +0000
- Revision:
- 44:44aa01af687e
- Parent:
- 41:91b0c73b9e02
Found the issue, should have fixed API docs now. (Final Submission. I have read and agreed with Statement of Academic Integrity.)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17ajf | 44:44aa01af687e | 1 | /** |
el17ajf | 44:44aa01af687e | 2 | * Unit Tests class |
el17ajf | 44:44aa01af687e | 3 | * @brief Runs a series of unit tests, printing the restults to stdout |
el17ajf | 44:44aa01af687e | 4 | */ |
el17ajf | 41:91b0c73b9e02 | 5 | class UnitTests { |
el17ajf | 41:91b0c73b9e02 | 6 | public: |
el17ajf | 41:91b0c73b9e02 | 7 | /** |
el17ajf | 41:91b0c73b9e02 | 8 | * @brief Runs all unit tests, and prints their name |
el17ajf | 41:91b0c73b9e02 | 9 | */ |
el17ajf | 41:91b0c73b9e02 | 10 | static void runAllTests(); |
el17ajf | 41:91b0c73b9e02 | 11 | private: |
el17ajf | 41:91b0c73b9e02 | 12 | /** |
el17ajf | 41:91b0c73b9e02 | 13 | * @brief |
el17ajf | 41:91b0c73b9e02 | 14 | * @param description A description of the test to print if it fails |
el17ajf | 41:91b0c73b9e02 | 15 | * @param result The result of the test, if it's false the error will print |
el17ajf | 41:91b0c73b9e02 | 16 | */ |
el17ajf | 41:91b0c73b9e02 | 17 | static void assertTrue(const char * description, bool result); |
el17ajf | 41:91b0c73b9e02 | 18 | |
el17ajf | 41:91b0c73b9e02 | 19 | /** |
el17ajf | 41:91b0c73b9e02 | 20 | * @brief Test the tetromino is the same after being rotated 360 degrees |
el17ajf | 41:91b0c73b9e02 | 21 | */ |
el17ajf | 41:91b0c73b9e02 | 22 | static void testTetromino(); |
el17ajf | 41:91b0c73b9e02 | 23 | |
el17ajf | 41:91b0c73b9e02 | 24 | /** |
el17ajf | 41:91b0c73b9e02 | 25 | * @brief Test the blocks are instanciated correctly |
el17ajf | 41:91b0c73b9e02 | 26 | */ |
el17ajf | 41:91b0c73b9e02 | 27 | static void testBlock(); |
el17ajf | 41:91b0c73b9e02 | 28 | |
el17ajf | 41:91b0c73b9e02 | 29 | /** |
el17ajf | 41:91b0c73b9e02 | 30 | * @brief Tests that preferences are saved and retrived correctly |
el17ajf | 41:91b0c73b9e02 | 31 | */ |
el17ajf | 41:91b0c73b9e02 | 32 | static void testPrefs(); |
el17ajf | 41:91b0c73b9e02 | 33 | |
el17ajf | 41:91b0c73b9e02 | 34 | /** |
el17ajf | 41:91b0c73b9e02 | 35 | * @brief Test that the space is taken up when a tetromino |
el17ajf | 41:91b0c73b9e02 | 36 | * is inserted into the grid |
el17ajf | 41:91b0c73b9e02 | 37 | */ |
el17ajf | 41:91b0c73b9e02 | 38 | static void testGrid(); |
el17ajf | 41:91b0c73b9e02 | 39 | }; |