From df030e06a81cf636aa766053af979ae79c2ab69d Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Mon, 9 Jan 2023 11:58:34 +0100 Subject: [PATCH] Adapt the qstringbuilder test for batching There are numerous conflicting symbols in the tst_qstringbuilder\d variants when batching those together. Remove the linkage from symbols by putting the common include stringbuilder.cpp in an unnamed namespace. Task-number: QTBUG-109954 Change-Id: Ic2a745795b57482c90c9def7667a1145cdb19854 Reviewed-by: Thiago Macieira --- .../qstringbuilder1/tst_qstringbuilder1.cpp | 10 +++++----- .../qstringbuilder2/tst_qstringbuilder2.cpp | 10 +++++----- .../qstringbuilder3/tst_qstringbuilder3.cpp | 10 +++++----- .../qstringbuilder4/tst_qstringbuilder4.cpp | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp index 8b45e15d5d..3f850aaa82 100644 --- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp +++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp @@ -17,7 +17,11 @@ #define LITERAL "some literal" -void runScenario(); // Defined in stringbuilder.cpp #included below. +namespace { +#define P % +#include "stringbuilder.cpp" +#undef P +} // namespace class tst_QStringBuilder1 : public QObject { @@ -27,10 +31,6 @@ private slots: void scenario() { runScenario(); } }; -#define P % -#include "stringbuilder.cpp" -#undef P - #include "tst_qstringbuilder1.moc" QTEST_APPLESS_MAIN(tst_QStringBuilder1) diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp index 9a4de80c0f..f833c71c81 100644 --- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp +++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp @@ -18,7 +18,11 @@ #define LITERAL "some literal" -void runScenario(); // Defined in stringbuilder.cpp #included below. +namespace { +#define P + +#include "../qstringbuilder1/stringbuilder.cpp" +#undef P +} // namespace class tst_QStringBuilder2 : public QObject { @@ -28,10 +32,6 @@ private slots: void scenario() { runScenario(); } }; -#define P + -#include "../qstringbuilder1/stringbuilder.cpp" -#undef P - #include "tst_qstringbuilder2.moc" QTEST_APPLESS_MAIN(tst_QStringBuilder2) diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp index 062643e116..787241541f 100644 --- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp +++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp @@ -17,7 +17,11 @@ #define LITERAL "some literal" -void runScenario(); // Defined in stringbuilder.cpp #included below. +namespace { +#define P % +#include "../qstringbuilder1/stringbuilder.cpp" +#undef P +} // namespace class tst_QStringBuilder3 : public QObject { @@ -27,10 +31,6 @@ private slots: void scenario() { runScenario(); } }; -#define P % -#include "../qstringbuilder1/stringbuilder.cpp" -#undef P - #include "tst_qstringbuilder3.moc" QTEST_APPLESS_MAIN(tst_QStringBuilder3) diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp index 56006b7b8f..12b219cf81 100644 --- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp +++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp @@ -18,7 +18,11 @@ #define LITERAL "some literal" -void runScenario(); // Defined in stringbuilder.cpp #included below. +namespace { +#define P + +#include "../qstringbuilder1/stringbuilder.cpp" +#undef P +} // namespace class tst_QStringBuilder4 : public QObject { @@ -28,10 +32,6 @@ private slots: void scenario() { runScenario(); } }; -#define P + -#include "../qstringbuilder1/stringbuilder.cpp" -#undef P - #include "tst_qstringbuilder4.moc" QTEST_APPLESS_MAIN(tst_QStringBuilder4)