PDA

View Full Version : Using QTestEventLoop causes crash in debug mode



wednesday
11th July 2013, 10:45
Hi.I have created a QML application which uses Qt Test Framework to unit test my class APIs.(Have integrated Qt Test Framework in a QML application)
Inside of my test cases i use QTestEventLoop::instance().enterLoop(1) to wait for signal emission.
However ,this thing works fine in Release mode but my application crashes on executing the above statement in debug mode.
Read somewhere that its not advised to use event loop inside another one.In my case my main has its event loop for processing GUI related and other stuff in addition to one am using in my unit test case.
Have tried other alternatives like QTest::qwait() /qSleep() etc ,creating timer etc but in that case though my app doesnt crash but my test case also fails (seems signal not emitted etc).
Any suggestions as to why its crashing only in debug mode or any another way out to achieve functionality for QTestEventLoop.
Am using Qt 5.02 and 5.1.0 versions.Result is same in both.
Thanks