2 Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef tst_qscriptvalue_h
21 #define tst_qscriptvalue_h
23 #include "qscriptengine.h"
24 #include "qscriptvalue.h"
25 #include <QtCore/qnumeric.h>
26 #include <QtTest/qtest.h>
28 #define DEFINE_TEST_VALUE(expr) m_values.insert(QString::fromLatin1(#expr), expr)
30 Q_DECLARE_METATYPE(QScriptValue
*);
31 Q_DECLARE_METATYPE(QScriptValue
);
32 typedef QPair
<QString
, QScriptValue
> QPairQStringAndQScriptValue
;
33 Q_DECLARE_METATYPE(QPairQStringAndQScriptValue
);
35 class tst_QScriptValue
: public QObject
{
40 virtual ~tst_QScriptValue();
43 void toStringSimple_data();
44 void toStringSimple();
45 void copyConstructor_data();
46 void copyConstructor();
47 void assignOperator_data();
48 void assignOperator();
50 void constructors_data();
52 void getSetPrototype();
55 void toObjectSimple();
56 void getPropertySimple_data();
57 void getPropertySimple();
58 void setPropertySimple();
59 void setProperty_data();
61 void getSetProperty();
62 void getPropertyResolveFlag();
63 void propertyFlag_data();
65 void globalObjectChanges();
66 void assignAndCopyConstruct_data();
67 void assignAndCopyConstruct();
69 // Generated test functions.
76 void isBoolean_data();
85 void isFunction_data();
97 void isUndefined_data();
103 void toString_data();
106 void toNumber_data();
112 void toBoolean_data();
115 void toInteger_data();
121 void toUInt32_data();
124 void toUInt16_data();
130 void strictlyEquals_data();
131 void strictlyEquals();
133 void instanceOf_data();
137 // Generated function
138 QPair
<QString
, QScriptValue
> initScriptValues(uint idx
);
140 QScriptEngine
* m_engine
;
143 #endif // tst_qscriptvalue_h