Ensure that QAtomicPointer of forward-declared classes works

This is working, but let's just be sure by adding a testcase.

Change-Id: I8c6b5ded0c7b6c90645dbf70a7ce6c1ba447a284
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This commit is contained in:
Thiago Macieira 2012-07-27 16:28:36 +02:00 committed by Qt by Nokia
parent 4d38a3b2da
commit 920dcb0158

View File

@ -69,6 +69,7 @@ private slots:
void fetchAndAdd();
void constAndVolatile();
void forwardDeclared();
private:
static void warningFreeHelper();
};
@ -647,5 +648,21 @@ void tst_QAtomicPointer::constAndVolatile()
constAndVolatile_helper<const volatile void>();
}
struct ForwardDeclared;
struct ContainsForwardDeclared
{
QAtomicPointer<ForwardDeclared> ptr;
};
void tst_QAtomicPointer::forwardDeclared()
{
// this is just a compilation test
QAtomicPointer<ForwardDeclared> ptr;
ContainsForwardDeclared cfd;
Q_UNUSED(ptr);
Q_UNUSED(cfd);
QVERIFY(true);
}
QTEST_APPLESS_MAIN(tst_QAtomicPointer)
#include "tst_qatomicpointer.moc"