forked from qt-creator/qt-creator
Tests: Fix compile
Broke with 4e96f2ce
.
Change-Id: I7c467cc92cc8444bd3b1ef41eebff089668a0f31
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -34,8 +34,14 @@ using namespace Utils;
|
|||||||
|
|
||||||
class MacroMapExpander : public AbstractMacroExpander {
|
class MacroMapExpander : public AbstractMacroExpander {
|
||||||
public:
|
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);
|
QHash<QString, QString>::const_iterator it = m_map.constFind(name);
|
||||||
if (it != m_map.constEnd()) {
|
if (it != m_map.constEnd()) {
|
||||||
*ret = it.value();
|
*ret = it.value();
|
||||||
|
@@ -32,8 +32,14 @@
|
|||||||
class TestMacroExpander : public Utils::AbstractMacroExpander
|
class TestMacroExpander : public Utils::AbstractMacroExpander
|
||||||
{
|
{
|
||||||
public:
|
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")) {
|
if (name == QLatin1String("foo")) {
|
||||||
*ret = QLatin1String("a");
|
*ret = QLatin1String("a");
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user