summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-02-24 14:22:06 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-02-24 14:32:40 (GMT)
commit94ba971e824d697277b11c5c766325bce9980bbe (patch)
tree3fef9bcc04cd4791910013832551821126e12a73
parent90e2ad422e55307bbab57dc1f4d627d6ae592489 (diff)
downloadQt-94ba971e824d697277b11c5c766325bce9980bbe.zip
Qt-94ba971e824d697277b11c5c766325bce9980bbe.tar.gz
Qt-94ba971e824d697277b11c5c766325bce9980bbe.tar.bz2
QScriptValue autotest generator templates change.
Each generated test case should check if a result is deterministic. The future generation of QScriptValue will be based on a state machine. The state might be changed after each function call, so it is worth of testing if result is always the same. Reviewed-by: Kent Hansen
-rw-r--r--tests/auto/qscriptvalue/testgen/testgenerator.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalue/testgen/testgenerator.cpp b/tests/auto/qscriptvalue/testgen/testgenerator.cpp
index d852ea5..4376c42 100644
--- a/tests/auto/qscriptvalue/testgen/testgenerator.cpp
+++ b/tests/auto/qscriptvalue/testgen/testgenerator.cpp
@@ -119,6 +119,7 @@ static QString generateIsXXXDef(const QString& name, const QList<QString>& list)
"{\n"\
" QFETCH(bool, expected);\n"\
" QCOMPARE(value.%1(), expected);\n"\
+ " QCOMPARE(value.%1(), expected);\n"\
"}\n"\
"\n"\
"DEFINE_TEST_FUNCTION(%1)\n"\
@@ -166,6 +167,7 @@ static QString generateToXXXDef(const QString& name, const QList<QPair<QString,
"{\n"\
" QFETCH(%2, expected);\n"\
" QCOMPARE(value.%1(), expected);\n"\
+ " QCOMPARE(value.%1(), expected);\n"\
"}\n"\
"\n"\
"DEFINE_TEST_FUNCTION(%1)\n";
@@ -213,9 +215,11 @@ QString generateToXXXDef<qsreal>(const QString& name, const QList<QPair<QString,
"%666"
" if (qIsInf(expected)) {\n"\
" QVERIFY(qIsInf(value.%1()));\n"\
+ " QVERIFY(qIsInf(value.%1()));\n"\
" return;\n"\
" }\n"\
" QCOMPARE(value.%1(), expected);\n"\
+ " QCOMPARE(value.%1(), expected);\n"\
"}\n"\
"\n"\
"DEFINE_TEST_FUNCTION(%1)\n";
@@ -269,6 +273,7 @@ static QString generateCastDef(const QList<QPair<QString, T> >& list)
"{\n"\
" QFETCH(%2, expected);\n"\
" QCOMPARE(qscriptvalue_cast<%2>(value), expected);\n"\
+ " QCOMPARE(qscriptvalue_cast<%2>(value), expected);\n"\
"}\n"\
"\n"\
"DEFINE_TEST_FUNCTION(qscriptvalue_cast%2)\n";
@@ -313,13 +318,16 @@ QString generateCastDef<qsreal>(const QList<QPair<QString, qsreal> >& list)
" QFETCH(%2, expected);\n"\
" if (qIsNaN(expected)) {\n"
" QVERIFY(qIsNaN(qscriptvalue_cast<%2>(value)));\n"
+ " QVERIFY(qIsNaN(qscriptvalue_cast<%2>(value)));\n"
" return;\n"
" }\n"\
" if (qIsInf(expected)) {\n"
" QVERIFY(qIsInf(qscriptvalue_cast<%2>(value)));\n"
+ " QVERIFY(qIsInf(qscriptvalue_cast<%2>(value)));\n"
" return;\n"
" }\n"
" QCOMPARE(qscriptvalue_cast<%2>(value), expected);\n"\
+ " QCOMPARE(qscriptvalue_cast<%2>(value), expected);\n"\
"}\n"\
"\n"\
"DEFINE_TEST_FUNCTION(qscriptvalue_cast%2)\n";