diff options
author | Thiago Macieira <thiago@kde.org> | 2011-07-31 19:41:18 -0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-28 02:16:39 +0200 |
commit | 2cf466312bce5fcb48d620c98ca81b2c1a40f674 (patch) | |
tree | aba78e0b778b7219119ba905ea0a2939606146e3 /tests/auto/corelib/thread/qatomicpointer | |
parent | dc6a1d186eb2060f549ef55b74711b54ed66ade7 (diff) |
Unit-test the additional QBasicAtomicXXX expansions
Test that they do expand properly and don't produce errors. This is
templated code, so it doesn't get tested fully unless we instantiate
them.
Also check that the alignments are correct.
Change-Id: I2a8ee2165167f54b652b4227411e209850974b8e
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'tests/auto/corelib/thread/qatomicpointer')
-rw-r--r-- | tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp index a8f7e037d0..ee6460d35c 100644 --- a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp +++ b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp @@ -49,6 +49,7 @@ class tst_QAtomicPointer : public QObject Q_OBJECT private slots: void warningFree(); + void alignment(); void constructor(); void copy_constructor(); @@ -114,6 +115,15 @@ void tst_QAtomicPointer::warningFree() (void)foo; } +void tst_QAtomicPointer::alignment() +{ +#ifdef Q_ALIGNOF + // this will cause a build error if the alignment isn't the same + char dummy[Q_ALIGNOF(QBasicAtomicPointer<void>) == Q_ALIGNOF(void*) ? 1 : -1]; + (void)dummy; +#endif +} + void tst_QAtomicPointer::constructor() { void *one = this; |