O'Reilly logo

Computer Vision with OpenCV 3 and Qt5 by Amin Ahmadi Tazehkandi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Unit Test

A unit test can be created by subclassing the QObject class and adding the slots required by the Qt Test Framework into it, along with one or more slots (test functions) for performing various tests. The following slots (private slots) can exist in each test class and are called by Qt Test, in addition to test functions:

  • initTestCase: This is called before the first test function is called. If this function fails, the entire test will fail and no test function will be called.
  • cleanupTestCase: This is called after the last test function is called.
  • init: This is called before each test function is called. If this function fails, the preceding test function will not be executed.
  • cleanup: This is called after each test function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required