diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-11-29 17:05:24 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-05 17:23:00 +0100 |
commit | d242d78339db2f2443c61dc10b55b6c68ab87f18 (patch) | |
tree | a1d45d54a52ac7568052e1dad93a8fbd3124672b /tests | |
parent | 097a3f42310dbef9a4051f83b2d3e8153f87b47b (diff) |
Make tst_QVariant::canConvertMetaTypeToInt more verbose.
Change-Id: If17cbd1154c4fd3c006648b28e91a009de5b373b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index cb4952fd69..a3d841d04d 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -2592,21 +2592,28 @@ template<typename T> void convertMetaType() QCOMPARE(qVariantFromValue<T>(10), qVariantFromValue<T>(10)); } +#define CONVERT_META_TYPE(Type) \ + convertMetaType<Type>(); \ + if (QTest::currentTestFailed()) \ + QFAIL("convertMetaType<" #Type "> failed"); + void tst_QVariant::canConvertMetaTypeToInt() const { - convertMetaType<long>(); - convertMetaType<short>(); - convertMetaType<short>(); - convertMetaType<unsigned short>(); - convertMetaType<ushort>(); - convertMetaType<ulong>(); - convertMetaType<unsigned long>(); - convertMetaType<uchar>(); - convertMetaType<unsigned char>(); - convertMetaType<char>(); - convertMetaType<uint>(); - convertMetaType<unsigned int>(); -} + CONVERT_META_TYPE(long); + CONVERT_META_TYPE(short); + CONVERT_META_TYPE(short); + CONVERT_META_TYPE(unsigned short); + CONVERT_META_TYPE(ushort); + CONVERT_META_TYPE(ulong); + CONVERT_META_TYPE(unsigned long); + CONVERT_META_TYPE(uchar); + CONVERT_META_TYPE(unsigned char); + CONVERT_META_TYPE(char); + CONVERT_META_TYPE(uint); + CONVERT_META_TYPE(unsigned int); +} + +#undef CONVERT_META_TYPE /*! These calls should not produce any warnings. |