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 /tests/auto/utils/stringutils/tst_stringutils.cpp | |
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>
Diffstat (limited to 'tests/auto/utils/stringutils/tst_stringutils.cpp')
-rw-r--r-- | tests/auto/utils/stringutils/tst_stringutils.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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; |