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 <thiago.macieira@intel.com>
This commit is contained in:
Mikolaj Boc 2023-01-09 11:58:34 +01:00
parent 042c7e58e2
commit df030e06a8
4 changed files with 20 additions and 20 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)