summaryrefslogtreecommitdiff
path: root/tests/auto/qscriptvaluegenerated
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-09 15:13:15 +1000
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-10 12:44:51 +1000
commitfe170938cf963e0a0a20b19f97ee6e18b6808a90 (patch)
treee9ec1599aa35e78dde3014b8f8f6e11c4cc1bdeb /tests/auto/qscriptvaluegenerated
parent74a4aad171b39018d596b99684286b9426a091a5 (diff)
downloadqt4-tools-fe170938cf963e0a0a20b19f97ee6e18b6808a90.tar.gz
Remove Q_ASSERT from qscriptvaluegenerated test
Report a fatal error if an unknown type of comparison is requested rather than failing silently in non-debug builds. Also fixes the misspelled parameter name. Change-Id: I84bd018aa99e99a98d97c43343032b38ca9cbccb Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto/qscriptvaluegenerated')
-rw-r--r--tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp
index df2d38af79..c9eacd4058 100644
--- a/tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp
+++ b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp
@@ -467,7 +467,7 @@ QString generateCastDef<qsreal>(const QList<QPair<QString, qsreal> >& list)
QString::number(list.count()));
}
-static QString generateCompareDef(const QString& comparisionType, const QList<QString> tags)
+static QString generateCompareDef(const QString& comparisonType, const QList<QString> tags)
{
static const QString templ = "\n"\
"void tst_QScriptValueGenerated::%1_initData()\n"\
@@ -501,10 +501,11 @@ static QString generateCompareDef(const QString& comparisionType, const QList<QS
"}\n"\
"\n"\
"DEFINE_TEST_FUNCTION(%1)\n";
- Q_ASSERT(comparisionType == "strictlyEquals"
- || comparisionType == "equals"
- || comparisionType == "lessThan"
- || comparisionType == "instanceOf");
+ if (comparisonType != "strictlyEquals"
+ && comparisonType != "equals"
+ && comparisonType != "lessThan"
+ && comparisonType != "instanceOf")
+ qFatal("%s: Unknown comparisonType: %s", Q_FUNC_INFO, qPrintable(comparisonType));
QString result = templ;
QStringList set;
@@ -516,7 +517,7 @@ static QString generateCompareDef(const QString& comparisionType, const QList<QS
set.append(escape(tmp));
set.append("\"");
}
- return result.arg(comparisionType, set.join(""), QString::number(tags.count()));
+ return result.arg(comparisonType, set.join(""), QString::number(tags.count()));
}
static QString generateInitDef(const QVector<QString>& allDataTags)