diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-09 05:13:15 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-10 02:44:51 (GMT) |
commit | fe170938cf963e0a0a20b19f97ee6e18b6808a90 (patch) | |
tree | e9ec1599aa35e78dde3014b8f8f6e11c4cc1bdeb /tests/auto | |
parent | 74a4aad171b39018d596b99684286b9426a091a5 (diff) | |
download | Qt-fe170938cf963e0a0a20b19f97ee6e18b6808a90.zip Qt-fe170938cf963e0a0a20b19f97ee6e18b6808a90.tar.gz Qt-fe170938cf963e0a0a20b19f97ee6e18b6808a90.tar.bz2 |
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')
-rw-r--r-- | tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp index df2d38a..c9eacd4 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) |