Improve output on test failures
authorJoão Abecasis <joao.abecasis@nokia.com>
Thu, 22 Mar 2012 00:28:30 +0000 (01:28 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 28 Mar 2012 07:36:52 +0000 (09:36 +0200)
commit7c9e3455514576a48008d5150ffde45871716fe0
treee8bdcc863cf8947270e68b561c3bf424b9ae1a94
parent049157f4f121d91b8702f998511a90a1adf0b71e
Improve output on test failures

This adds checks to ensure Q_ALIGNOF is returning the desired alignment
for explicitly-aligned types.

The alignment check is now inlined in the test inside QCOMPARE so we get
slightly more informative errors:

FAIL!  : tst_Collections::alignment() Compared values are not the same
   Actual   (quintptr(&it.value()) % Value::PreferredAlignment): 64
   Expected (quintptr(0)): 0
   Loc: [tst_collections.cpp(3384)]

In this case, this is enough to notice "non-native" alignments are being
requested. Having test parameters otherwise hidden in template arguments
doesn't help the situation.

Change-Id: I05267fd25b71f183cfb98fb5b0a7dfd6c28da816
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
tests/auto/other/collections/tst_collections.cpp