diff options
author | Christian Stenger <christian.stenger@qt.io> | 2017-06-21 07:34:46 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2017-06-21 13:34:36 +0000 |
commit | bd259129b5b50d2a816d2d99a1b45bedb57e7563 (patch) | |
tree | df648a398d0cea94953f8ad0707ada46299282f7 | |
parent | 1e68d91cb106d553a188a5b083b30c6d6ded8fea (diff) | |
download | qt-creator-bd259129b5b50d2a816d2d99a1b45bedb57e7563.tar.gz |
Tests: Fix compile
Broke with 4e96f2ce.
Change-Id: I7c467cc92cc8444bd3b1ef41eebff089668a0f31
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r-- | tests/auto/qtcprocess/tst_qtcprocess.cpp | 8 | ||||
-rw-r--r-- | tests/auto/utils/stringutils/tst_stringutils.cpp | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tests/auto/qtcprocess/tst_qtcprocess.cpp b/tests/auto/qtcprocess/tst_qtcprocess.cpp index e789203fbc..b4df669441 100644 --- a/tests/auto/qtcprocess/tst_qtcprocess.cpp +++ b/tests/auto/qtcprocess/tst_qtcprocess.cpp @@ -34,8 +34,14 @@ using namespace Utils; class MacroMapExpander : public AbstractMacroExpander { public: - virtual bool resolveMacro(const QString &name, QString *ret) + virtual bool resolveMacro(const QString &name, QString *ret, QSet<AbstractMacroExpander*> &seen) { + // loop prevention + const int count = seen.count(); + seen.insert(this); + if (seen.count() == count) + return false; + QHash<QString, QString>::const_iterator it = m_map.constFind(name); if (it != m_map.constEnd()) { *ret = it.value(); diff --git a/tests/auto/utils/stringutils/tst_stringutils.cpp b/tests/auto/utils/stringutils/tst_stringutils.cpp index ae137b13e1..d9d47e1845 100644 --- a/tests/auto/utils/stringutils/tst_stringutils.cpp +++ b/tests/auto/utils/stringutils/tst_stringutils.cpp @@ -32,8 +32,14 @@ class TestMacroExpander : public Utils::AbstractMacroExpander { public: - virtual bool resolveMacro(const QString &name, QString *ret) + virtual bool resolveMacro(const QString &name, QString *ret, QSet<AbstractMacroExpander*> &seen) { + // loop prevention + const int count = seen.count(); + seen.insert(this); + if (seen.count() == count) + return false; + if (name == QLatin1String("foo")) { *ret = QLatin1String("a"); return true; |