Hi all,

Is there are any reasons why the tested objects are created in 'heap' instead of 'stack' (in the majority of cases)?

E.g. we can look on \qtbase\tests\auto\network\socket\qtcpsocket\tst_qtcpsocket.cpp as example,
where in each test are used the new/delete:

void tst_QTcpSocket::foo()
{
    QTcpSocket *socket = new QTcpSocket;
    // make tests
    delete socket;
}

instead of

void tst_QTcpSocket::foo()
{
    QTcpSocket socket;
   // make tests
}

BR,
Denis

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to