QTest: allow to mark QFETCH variables const

[ChangeLog][QtTest] QFETCH variables can now be declared const (QFETCH(const T, name)).

Change-Id: I7cc1e4568d7082f27f90d8b5abf53ffafb1c48c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2016-08-28 20:17:24 +02:00
parent 6e64008e69
commit bb7e3e2dd7
1 changed files with 5 additions and 5 deletions

View File

@ -52,11 +52,11 @@
#include <string.h>
#include <type_traits>
#ifndef QT_NO_EXCEPTIONS
# include <exception>
#endif // QT_NO_EXCEPTIONS
QT_BEGIN_NAMESPACE
class QRegularExpression;
@ -204,11 +204,11 @@ do {\
return;\
} while (0)
#define QFETCH(type, name)\
type name = *static_cast<type *>(QTest::qData(#name, ::qMetaTypeId<type >()))
#define QFETCH(Type, name)\
Type name = *static_cast<Type *>(QTest::qData(#name, ::qMetaTypeId<typename std::remove_cv<Type >::type>()))
#define QFETCH_GLOBAL(type, name)\
type name = *static_cast<type *>(QTest::qGlobalData(#name, ::qMetaTypeId<type >()))
#define QFETCH_GLOBAL(Type, name)\
Type name = *static_cast<Type *>(QTest::qGlobalData(#name, ::qMetaTypeId<typename std::remove_cv<Type >::type>()))
#define QTEST(actual, testElement)\
do {\