summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qstringbuilder/qstringbuilder1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/text/qstringbuilder/qstringbuilder1')
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp4
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp10
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp
index ac7f439248..e31708ad72 100644
--- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp
@@ -26,7 +26,8 @@
**
****************************************************************************/
-#include <QtTest/QtTest>
+// Do not include anything in this file. We are being #included with
+// a bunch of defines that may break other legitimate code.
#define LITERAL "some literal"
#define LITERAL_LEN (sizeof(LITERAL)-1)
@@ -46,7 +47,6 @@
#ifndef P
# error You need to define P
-# define P +
#endif
//fix for gcc4.0: if the operator+ does not exist without QT_USE_FAST_OPERATOR_PLUS
diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
index 2d320748f2..fcf004b4fc 100644
--- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
@@ -30,13 +30,14 @@
// SCENARIO 1
// this is the "no harm done" version. Only operator% is active,
// with NO_CAST * defined
-#define P %
#undef QT_USE_QSTRINGBUILDER
#define QT_NO_CAST_FROM_ASCII
#define QT_NO_CAST_TO_ASCII
-
-#include <QtTest/QtTest>
+#include <QtCore/QObject>
+#include <QtCore/QString>
+#include <QtCore/QStringBuilder>
+#include <QtTest/QTest>
#define LITERAL "some literal"
@@ -50,7 +51,10 @@ private slots:
void scenario() { runScenario(); }
};
+#define P %
#include "stringbuilder.cpp"
+#undef P
+
#include "tst_qstringbuilder1.moc"
QTEST_APPLESS_MAIN(tst_QStringBuilder1)