On 1/18/2017 10:28 AM, Konrad Rosenbaum wrote:
Hi,

On Wednesday, January 18, 2017 10:16:30 Bob Hood wrote:
I'm trying to develop a unit test for an deferred signal; i.e. one that
won't be emitted until the event loop has been allowed to run.  The case
looks like:

    void MyTest::user_info_deferred()
    {
        QVERIFY(qnam_class_ptr != nullptr);

        QSignalSpy spy(qnam_class_ptr, &QNAMClass::signal_userInfoReceived);

        // Retrieve account user information (deferred)
        QCOMPARE(qname_class_ptr->userInfo(), true);
I think you need to insert a spy.wait(...) here. Give the event loop a chance
to run...

Ah, I see. The qWait() approach has probably been folded into QSignalSpy. That makes sense.

Thanks, Konrad.

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to