Skip to content

4. Unit Tests

Jinfeng-Lyu edited this page Apr 13, 2023 · 39 revisions
  1. Unit Tests

In this section, we use googletest as the tool of unit test. The source is from this website: https://github.com/google/googletest. The function of googletest is to use assertions to check whether the output value of a programme is corresponded to the expected value. If does not correspond, the system will report a failure. There are two kinds of assertions, namely ASSERT and EXPECT. The former can produce a serious failure if detects an error in the programme, then stop the running of the programme. The latter can generate a slight failure and do not stop the program even if a mistake detected.

The commands in googletest are as follow:

Clone this wiki locally