summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstringbuilder1
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-02-22 15:25:46 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-02-22 16:00:31 (GMT)
commitc42343ab8bedda2700b16b10ee7a7409130cb500 (patch)
treeb8787f2b8b79ae10fb313ff548189617c0905740 /tests/auto/qstringbuilder1
parent0bcf45bf9f0adc8cf9e3486845819447d153bd5e (diff)
downloadQt-c42343ab8bedda2700b16b10ee7a7409130cb500.zip
Qt-c42343ab8bedda2700b16b10ee7a7409130cb500.tar.gz
Qt-c42343ab8bedda2700b16b10ee7a7409130cb500.tar.bz2
Fix test with gcc 4.0 where QT_USE_FAST_CONCATENATION cannot be enabled.
On GCC 4.0 we disabled the possibility to use the fast operator plus as a bug in the compiler makes it impossible to add enums. There is no normal operator+ for these case. Always test the operator% instead. Reviewed-by: joao
Diffstat (limited to 'tests/auto/qstringbuilder1')
-rw-r--r--tests/auto/qstringbuilder1/stringbuilder.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/auto/qstringbuilder1/stringbuilder.cpp b/tests/auto/qstringbuilder1/stringbuilder.cpp
index 8e95818..e9ae7a6 100644
--- a/tests/auto/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/qstringbuilder1/stringbuilder.cpp
@@ -44,6 +44,14 @@
// "some literal", but replacing all vocals by their umlauted UTF-8 string :)
#define UTF8_LITERAL "s\xc3\xb6m\xc3\xab l\xc3\xaft\xc3\xabr\xc3\xa4l"
+
+//fix for gcc4.0: if the operator+ does not exist without QT_USE_FAST_OPERATOR_PLUS
+#ifndef QT_USE_FAST_CONCATENATION
+#define Q %
+#else
+#define Q P
+#endif
+
void runScenario()
{
// set codec for C strings to 0, enforcing Latin1
@@ -59,13 +67,13 @@ void runScenario()
QString r;
QByteArray ba(LITERAL);
- r = l1literal P l1literal;
+ r = l1literal Q l1literal;
QCOMPARE(r, r2);
r = string P string;
QCOMPARE(r, r2);
- r = stringref P stringref;
+ r = stringref Q stringref;
QCOMPARE(r, QString(stringref.toString() + stringref.toString()));
- r = string P l1literal;
+ r = string Q l1literal;
QCOMPARE(r, r2);
r = string P l1string;
QCOMPARE(r, r2);