From c93ac9f6fc860389c7e1dcfd3c0167e507d3bfd9 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sat, 18 Sep 2010 17:15:22 +0200 Subject: [PATCH] Move qRegisterMetaType calls into initTestCase(). --- tests/TestEntryModel.cpp | 8 +++++--- tests/TestGroup.cpp | 6 ++++++ tests/TestGroupModel.cpp | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/TestEntryModel.cpp b/tests/TestEntryModel.cpp index 7e357c4b..c8d7371e 100644 --- a/tests/TestEntryModel.cpp +++ b/tests/TestEntryModel.cpp @@ -28,13 +28,17 @@ class TestEntryModel : public QObject Q_OBJECT private Q_SLOTS: + void initTestCase(); void test(); }; -void TestEntryModel::test() +void TestEntryModel::initTestCase() { qRegisterMetaType("QModelIndex"); +} +void TestEntryModel::test() +{ Group* group1 = new Group(); Group* group2 = new Group(); @@ -94,6 +98,4 @@ void TestEntryModel::test() QTEST_MAIN(TestEntryModel); -Q_DECLARE_METATYPE(QModelIndex); - #include "TestEntryModel.moc" diff --git a/tests/TestGroup.cpp b/tests/TestGroup.cpp index 17a9722d..262dd73a 100644 --- a/tests/TestGroup.cpp +++ b/tests/TestGroup.cpp @@ -25,11 +25,17 @@ class TestGroup : public QObject Q_OBJECT private Q_SLOTS: + void initTestCase(); void testParenting(); void testSignals(); void testEntries(); }; +void TestGroup::initTestCase() +{ + qRegisterMetaType("Group*"); +} + void TestGroup::testParenting() { Database* db = new Database(); diff --git a/tests/TestGroupModel.cpp b/tests/TestGroupModel.cpp index 7ea32434..2d7a15d5 100644 --- a/tests/TestGroupModel.cpp +++ b/tests/TestGroupModel.cpp @@ -28,9 +28,15 @@ class TestGroupModel : public QObject Q_OBJECT private Q_SLOTS: + void initTestCase(); void test(); }; +void TestGroupModel::initTestCase() +{ + qRegisterMetaType("QModelIndex"); +} + void TestGroupModel::test() { Database* db = new Database();