areg-sdk
areg-sdk copied to clipboard
Unit test for TEArrayList
Description:
TEArrayList is a wrapper of std::vector
adapted to areg-sdk needs. It is needed to add unit tests to test all public methods and to cover as much codes as possible.
Solution:
- There is a ./tests/units/ folder in the project to add unit tests.
- Add in that folder a new unit testing file, for example
TEArrayListTests.cpp
, and write unit tests.- The unit tests should run at least with
int
,unsigned int
,float
/double
andstd::string
andString
/WideString
types. - The tests with the custom types, like custom structures, are welcome, but it is optional.
- If the amount of testing methods are to large, they can be split and can be implemented either in a separate folder (for example
array
) or can be split to separate files likeTEArraListStringTest.cpp
. - Each created file should be added in the CMakeLists.txt and in the areg-tests MSVC project.
- Each
.cpp
file should have a list of tested methods at the top - Each test method should have convenient name that is describing the purpose of the test, and should have short description.
- The unit tests should run at least with
- The tests should run. In case if a bug found, create a ticket and mention the priority in the title, like
[bug]
. Each created ticket should have at least 2 labels:bug
andunit test
.