From c42343ab8bedda2700b16b10ee7a7409130cb500 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 22 Feb 2010 16:25:46 +0100 Subject: 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 --- tests/auto/qstringbuilder1/stringbuilder.cpp | 14 +++++++++++--- 1 file 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); -- cgit v0.12