From 94ba971e824d697277b11c5c766325bce9980bbe Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 24 Feb 2010 16:22:06 +0200 Subject: 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 --- tests/auto/qscriptvalue/testgen/testgenerator.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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& 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(const QString& name, const QList >& 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(const QList >& 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"; -- cgit v0.12