summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp13
-rw-r--r--tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp5
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp15
3 files changed, 13 insertions, 20 deletions
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index 82e59cef76..be13b39e7e 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -931,5 +931,18 @@ void tst_QMetaType::automaticTemplateRegistration()
}
}
+// Compile-time test, it should be possible to register function pointer types
+class Undefined;
+
+typedef Undefined (*UndefinedFunction0)();
+typedef Undefined (*UndefinedFunction1)(Undefined);
+typedef Undefined (*UndefinedFunction2)(Undefined, Undefined);
+typedef Undefined (*UndefinedFunction3)(Undefined, Undefined, Undefined);
+
+Q_DECLARE_METATYPE(UndefinedFunction0);
+Q_DECLARE_METATYPE(UndefinedFunction1);
+Q_DECLARE_METATYPE(UndefinedFunction2);
+Q_DECLARE_METATYPE(UndefinedFunction3);
+
QTEST_MAIN(tst_QMetaType)
#include "tst_qmetatype.moc"
diff --git a/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
index e53582f178..71a70384fc 100644
--- a/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
+++ b/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
@@ -99,11 +99,6 @@ struct AbstractTester
Q_DECLARE_METATYPE(AbstractTester *)
typedef void (*TestFunction)(QObject*);
-QT_BEGIN_NAMESPACE namespace QtPrivate {
-template <> struct IsPointerToTypeDerivedFromQObject<TestFunction> {
- enum { Value = false };
-};
-} QT_END_NAMESPACE
Q_DECLARE_METATYPE(TestFunction)
template <typename T>
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index ca72a9b013..9d5c43c290 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -1298,11 +1298,6 @@ static int ucstrncmp_ssse3_aligning2(const ushort *a, const ushort *b, int len)
#endif
typedef int (* UcstrncmpFunction)(const ushort *, const ushort *, int);
-QT_BEGIN_NAMESPACE namespace QtPrivate {
-template <> struct IsPointerToTypeDerivedFromQObject<UcstrncmpFunction> {
- enum { Value = false };
-};
-} QT_END_NAMESPACE
Q_DECLARE_METATYPE(UcstrncmpFunction)
void tst_QString::ucstrncmp_data() const
@@ -1462,11 +1457,6 @@ void tst_QString::fromLatin1() const
}
typedef void (* FromLatin1Function)(ushort *, const char *, int);
-QT_BEGIN_NAMESPACE namespace QtPrivate {
-template <> struct IsPointerToTypeDerivedFromQObject<FromLatin1Function> {
- enum { Value = false };
-};
-} QT_END_NAMESPACE
Q_DECLARE_METATYPE(FromLatin1Function)
void fromLatin1_regular(ushort *dst, const char *str, int size)
@@ -1917,11 +1907,6 @@ void tst_QString::fromLatin1Alternatives() const
}
typedef int (* FromUtf8Function)(ushort *, const char *, int);
-QT_BEGIN_NAMESPACE namespace QtPrivate {
-template <> struct IsPointerToTypeDerivedFromQObject<FromUtf8Function> {
- enum { Value = false };
-};
-} QT_END_NAMESPACE
Q_DECLARE_METATYPE(FromUtf8Function)
extern QTextCodec::ConverterState *state;