summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-09 05:13:15 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-10 02:44:51 (GMT)
commitfe170938cf963e0a0a20b19f97ee6e18b6808a90 (patch)
treee9ec1599aa35e78dde3014b8f8f6e11c4cc1bdeb /tests/auto
parent74a4aad171b39018d596b99684286b9426a091a5 (diff)
downloadQt-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.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 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)