summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/qstringbuilder1/qstringbuilder1.pro3
-rw-r--r--tests/auto/qstringbuilder1/stringbuilder.cpp56
-rw-r--r--tests/auto/qstringbuilder1/stringbuilder.h55
-rw-r--r--tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp33
-rw-r--r--tests/auto/qstringbuilder2/qstringbuilder2.pro3
-rw-r--r--tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp32
-rw-r--r--tests/auto/qstringbuilder3/qstringbuilder3.pro3
-rw-r--r--tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp31
-rw-r--r--tests/auto/qstringbuilder4/qstringbuilder4.pro3
-rw-r--r--tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp34
10 files changed, 129 insertions, 124 deletions
diff --git a/tests/auto/qstringbuilder1/qstringbuilder1.pro b/tests/auto/qstringbuilder1/qstringbuilder1.pro
index 1ca9d456a8..5bb14d4290 100644
--- a/tests/auto/qstringbuilder1/qstringbuilder1.pro
+++ b/tests/auto/qstringbuilder1/qstringbuilder1.pro
@@ -3,7 +3,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qstringbuilder1.cpp
-HEADERS += ../qstringbuilder1/stringbuilder.h
-
-DEFINES += SCENARIO=1
diff --git a/tests/auto/qstringbuilder1/stringbuilder.cpp b/tests/auto/qstringbuilder1/stringbuilder.cpp
index 9fea137a58..f35d4d20d5 100644
--- a/tests/auto/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/qstringbuilder1/stringbuilder.cpp
@@ -39,61 +39,9 @@
**
****************************************************************************/
-// This is included in various .cpp files as a compile test for various scenarios
-// depending on NO_CAST_* and QT_USE_FAST_OPERATOR_PLUS and QT_USE_FAST_CONCATENATION
-
-#if SCENARIO == 1
-// this is the "no harm done" version. Only operator% is active,
-// with NO_CAST * defined
-#define P %
-#undef QT_USE_FAST_OPERATOR_PLUS
-#undef QT_USE_FAST_CONCATENATION
-#define QT_NO_CAST_FROM_ASCII
-#define QT_NO_CAST_TO_ASCII
-#endif
-
-
-#if SCENARIO == 2
-// this is the "full" version. Operator+ is replaced by a QStringBuilder
-// based version
-// with NO_CAST * defined
-#define P +
-#define QT_USE_FAST_OPERATOR_PLUS
-#define QT_USE_FAST_CONCATENATION
-#define QT_NO_CAST_FROM_ASCII
-#define QT_NO_CAST_TO_ASCII
-#endif
-
-#if SCENARIO == 3
-// this is the "no harm done" version. Only operator% is active,
-// with NO_CAST * _not_ defined
-#define P %
-#undef QT_USE_FAST_OPERATOR_PLUS
-#undef QT_USE_FAST_CONCATENATION
-#undef QT_NO_CAST_FROM_ASCII
-#undef QT_NO_CAST_TO_ASCII
-#endif
-
-#if SCENARIO == 4
-// this is the "full" version. Operator+ is replaced by a QStringBuilder
-// based version
-// with NO_CAST * _not_ defined
-#define P +
-#define QT_USE_FAST_OPERATOR_PLUS
-#define QT_USE_FAST_CONCATENATION
-#undef QT_NO_CAST_FROM_ASCII
-#undef QT_NO_CAST_TO_ASCII
-#endif
-
-#include <QtTest/QtTest>
-#include "stringbuilder.h"
-
-//TESTED_CLASS=QStringBuilder
-//TESTED_FILES=qstringbuilder.cpp
-
#define LITERAL "some literal"
-void tst_QStringBuilder::scenario()
+void runScenario()
{
QLatin1Literal l1literal(LITERAL);
QLatin1String l1string(LITERAL);
@@ -129,5 +77,3 @@ void tst_QStringBuilder::scenario()
QCOMPARE(r, r2);
#endif
}
-
-QTEST_APPLESS_MAIN(tst_QStringBuilder)
diff --git a/tests/auto/qstringbuilder1/stringbuilder.h b/tests/auto/qstringbuilder1/stringbuilder.h
deleted file mode 100644
index 5ac9dbea82..0000000000
--- a/tests/auto/qstringbuilder1/stringbuilder.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TST_QSTRINGBUILDER_H
-#define TST_QSTRINGBUILDER_H
-
-#include <qobject.h>
-
-class tst_QStringBuilder : public QObject
-{
- Q_OBJECT
-
-private slots:
- void scenario();
-};
-
-#endif
diff --git a/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp
index bd2e4b0c65..d0a613c572 100644
--- a/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp
+++ b/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp
@@ -39,4 +39,35 @@
**
****************************************************************************/
-#include "../qstringbuilder1/stringbuilder.cpp"
+
+// SCENARIO 1
+// this is the "no harm done" version. Only operator% is active,
+// with NO_CAST * defined
+#define P %
+#undef QT_USE_FAST_OPERATOR_PLUS
+#undef QT_USE_FAST_CONCATENATION
+#define QT_NO_CAST_FROM_ASCII
+#define QT_NO_CAST_TO_ASCII
+
+
+#include <QtTest/QtTest>
+
+//TESTED_CLASS=QStringBuilder
+//TESTED_FILES=qstringbuilder.cpp
+
+#define LITERAL "some literal"
+
+void runScenario(); // Defined in stringbuilder.cpp #included below.
+
+class tst_QStringBuilder1 : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void scenario() { runScenario(); }
+};
+
+#include "stringbuilder.cpp"
+#include "tst_qstringbuilder1.moc"
+
+QTEST_APPLESS_MAIN(tst_QStringBuilder1)
diff --git a/tests/auto/qstringbuilder2/qstringbuilder2.pro b/tests/auto/qstringbuilder2/qstringbuilder2.pro
index c0b3ebc797..4152dc31e3 100644
--- a/tests/auto/qstringbuilder2/qstringbuilder2.pro
+++ b/tests/auto/qstringbuilder2/qstringbuilder2.pro
@@ -3,6 +3,3 @@ load(qttest_p4)
QT = core
SOURCES += tst_qstringbuilder2.cpp
-HEADERS += ../qstringbuilder1/stringbuilder.h
-
-DEFINES += SCENARIO=2
diff --git a/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp b/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp
index bd2e4b0c65..4470928def 100644
--- a/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp
+++ b/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp
@@ -39,4 +39,36 @@
**
****************************************************************************/
+
+// SCENARIO 2
+// this is the "full" version. Operator+ is replaced by a QStringBuilder
+// based version
+// with NO_CAST * defined
+#define P +
+#define QT_USE_FAST_OPERATOR_PLUS
+#define QT_USE_FAST_CONCATENATION
+#define QT_NO_CAST_FROM_ASCII
+#define QT_NO_CAST_TO_ASCII
+
+
+#include <QtTest/QtTest>
+
+//TESTED_CLASS=QStringBuilder
+//TESTED_FILES=qstringbuilder.cpp
+
+#define LITERAL "some literal"
+
+void runScenario(); // Defined in stringbuilder.cpp #included below.
+
+class tst_QStringBuilder2 : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void scenario() { runScenario(); }
+};
+
#include "../qstringbuilder1/stringbuilder.cpp"
+#include "tst_qstringbuilder2.moc"
+
+QTEST_APPLESS_MAIN(tst_QStringBuilder2)
diff --git a/tests/auto/qstringbuilder3/qstringbuilder3.pro b/tests/auto/qstringbuilder3/qstringbuilder3.pro
index 93d1a39e7e..b4d222591d 100644
--- a/tests/auto/qstringbuilder3/qstringbuilder3.pro
+++ b/tests/auto/qstringbuilder3/qstringbuilder3.pro
@@ -3,6 +3,3 @@ load(qttest_p4)
QT = core
SOURCES += tst_qstringbuilder3.cpp
-HEADERS += ../qstringbuilder1/stringbuilder.h
-
-DEFINES += SCENARIO=3
diff --git a/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp b/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp
index bd2e4b0c65..30f0181056 100644
--- a/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp
+++ b/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp
@@ -39,4 +39,35 @@
**
****************************************************************************/
+
+// SCENARIO 3
+// this is the "no harm done" version. Only operator% is active,
+// with NO_CAST * _not_ defined
+#define P %
+#undef QT_USE_FAST_OPERATOR_PLUS
+#undef QT_USE_FAST_CONCATENATION
+#undef QT_NO_CAST_FROM_ASCII
+#undef QT_NO_CAST_TO_ASCII
+
+
+#include <QtTest/QtTest>
+
+//TESTED_CLASS=QStringBuilder
+//TESTED_FILES=qstringbuilder.cpp
+
+#define LITERAL "some literal"
+
+void runScenario(); // Defined in stringbuilder.cpp #included below.
+
+class tst_QStringBuilder3 : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void scenario() { runScenario(); }
+};
+
#include "../qstringbuilder1/stringbuilder.cpp"
+#include "tst_qstringbuilder3.moc"
+
+QTEST_APPLESS_MAIN(tst_QStringBuilder3)
diff --git a/tests/auto/qstringbuilder4/qstringbuilder4.pro b/tests/auto/qstringbuilder4/qstringbuilder4.pro
index eeec447885..6ec522884b 100644
--- a/tests/auto/qstringbuilder4/qstringbuilder4.pro
+++ b/tests/auto/qstringbuilder4/qstringbuilder4.pro
@@ -3,6 +3,3 @@ load(qttest_p4)
QT = core
SOURCES += tst_qstringbuilder4.cpp
-HEADERS += ../qstringbuilder1/stringbuilder.h
-
-DEFINES += SCENARIO=4
diff --git a/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp
index 2159283bb5..95b4ec3a6e 100644
--- a/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp
+++ b/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns module of the Qt Toolkit.
+** This file is part of the test suite module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -39,4 +39,36 @@
**
****************************************************************************/
+
+// SCENARIO 4
+// this is the "full" version. Operator+ is replaced by a QStringBuilder
+// based version
+// with NO_CAST * _not_ defined
+#define P +
+#define QT_USE_FAST_OPERATOR_PLUS
+#define QT_USE_FAST_CONCATENATION
+#undef QT_NO_CAST_FROM_ASCII
+#undef QT_NO_CAST_TO_ASCII
+
+
+#include <QtTest/QtTest>
+
+//TESTED_CLASS=QStringBuilder
+//TESTED_FILES=qstringbuilder.cpp
+
+#define LITERAL "some literal"
+
+void runScenario(); // Defined in stringbuilder.cpp #included below.
+
+class tst_QStringBuilder4 : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void scenario() { runScenario(); }
+};
+
#include "../qstringbuilder1/stringbuilder.cpp"
+#include "tst_qstringbuilder4.moc"
+
+QTEST_APPLESS_MAIN(tst_QStringBuilder4)