From bd259129b5b50d2a816d2d99a1b45bedb57e7563 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 21 Jun 2017 07:34:46 +0200 Subject: Tests: Fix compile Broke with 4e96f2ce. Change-Id: I7c467cc92cc8444bd3b1ef41eebff089668a0f31 Reviewed-by: Tobias Hunger --- tests/auto/utils/stringutils/tst_stringutils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/auto/utils/stringutils/tst_stringutils.cpp') 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 &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; -- cgit v1.2.1