Priority: Not Evaluated
Affects Version/s: None
Fix Version/s: None
Component/s: Testing: qtestlib
I'am encountering the following scenario:
- I have various singletons declared through Q_GLOBAL_STATIC,
- An instance of the class A uses several of these singletons,
- I want to test the functionalities of class A by creating test cases under QTest,
- So, when a test case needs an access to one singleton, this one is automatically created.
The problem comes for the following tests. If they need access to this singleton, they will obtain an object that is in unknown state. Because it has been created, and modified, by the previous test(s).
So, is it possible to add in Qtest a function to cleanup all the QGlobalStatic to be sure that each test works in a clean environment?