Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qjsvalue / tst_qjsvalue.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the test suite of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #ifndef TST_QJSVALUE_H
43 #define TST_QJSVALUE_H
44
45 #include <QtCore/qobject.h>
46 #include <QtCore/qnumeric.h>
47 #include <qjsengine.h>
48 #include <qjsvalue.h>
49 #include <QtTest/QtTest>
50
51 Q_DECLARE_METATYPE(QVariant)
52 Q_DECLARE_METATYPE(QJSValue)
53
54 class tst_QJSValue : public QObject
55 {
56     Q_OBJECT
57
58 public:
59     tst_QJSValue();
60     virtual ~tst_QJSValue();
61
62 private slots:
63     void toObject();
64
65     void ctor_invalid();
66     void ctor_undefinedWithEngine();
67     void ctor_undefined();
68     void ctor_nullWithEngine();
69     void ctor_null();
70     void ctor_boolWithEngine();
71     void ctor_bool();
72     void ctor_intWithEngine();
73     void ctor_int();
74     void ctor_uintWithEngine();
75     void ctor_uint();
76     void ctor_floatWithEngine();
77     void ctor_float();
78     void ctor_stringWithEngine();
79     void ctor_string();
80     void ctor_copyAndAssignWithEngine();
81     void ctor_copyAndAssign();
82     void ctor_nullEngine();
83
84     void toString();
85     void toNumber();
86     void toBoolean();
87     void toBool();
88     void toInteger();
89     void toInt();
90     void toUInt();
91     void toUInt16();
92     void toVariant();
93     void toQObject_nonQObject_data();
94     void toQObject_nonQObject();
95     void toQObject();
96     void toDateTime();
97     void toRegExp();
98     void instanceOf_twoEngines();
99     void instanceOf();
100     void isArray_data();
101     void isArray();
102     void isDate();
103     void isDate_data();
104     void isError_propertiesOfGlobalObject();
105     void isError_data();
106     void isError();
107     void isRegExp_data();
108     void isRegExp();
109
110 #if 0 // FIXME: No QScriptValue::lessThan
111     void lessThan();
112 #endif
113     void equals();
114     void strictlyEquals();
115
116     void hasProperty_basic();
117     void hasProperty_globalObject();
118     void hasProperty_changePrototype();
119
120     void deleteProperty_basic();
121     void deleteProperty_globalObject();
122     void deleteProperty_inPrototype();
123
124     void getSetPrototype_cyclicPrototype();
125     void getSetPrototype_evalCyclicPrototype();
126     void getSetPrototype_eval();
127     void getSetPrototype_invalidPrototype();
128     void getSetPrototype_twoEngines();
129     void getSetPrototype_null();
130     void getSetPrototype_notObjectOrNull();
131     void getSetPrototype();
132     void getSetScope();
133     void getSetProperty_HooliganTask162051();
134     void getSetProperty_HooliganTask183072();
135     void getSetProperty_propertyRemoval();
136     void getSetProperty_resolveMode();
137     void getSetProperty_twoEngines();
138     void getSetProperty_gettersAndSetters();
139     void getSetProperty_gettersAndSettersThrowErrorNative();
140     void getSetProperty_gettersAndSettersThrowErrorJS();
141     void getSetProperty_gettersAndSettersOnNative();
142     void getSetProperty_gettersAndSettersOnGlobalObject();
143     void getSetProperty_gettersAndSettersChange();
144     void getSetProperty_gettersAndSettersStupid();
145     void getSetProperty_array();
146     void getSetProperty();
147     void arrayElementGetterSetter();
148     void getSetData_objects_data();
149     void getSetData_objects();
150     void getSetData_nonObjects_data();
151     void getSetData_nonObjects();
152     void setData_QTBUG15144();
153 #if 0 // FIXME: no QScriptClass
154     void getSetScriptClass_emptyClass_data();
155     void getSetScriptClass_emptyClass();
156     void getSetScriptClass_JSObjectFromCpp();
157     void getSetScriptClass_JSObjectFromJS();
158     void getSetScriptClass_QVariant();
159     void getSetScriptClass_QObject();
160 #endif
161     void call_function();
162     void call_object();
163     void call_newObjects();
164     void call_this();
165     void call_arguments();
166     void call();
167     void call_invalidArguments();
168     void call_invalidReturn();
169     void call_twoEngines();
170     void call_array();
171     void call_nonFunction_data();
172     void call_nonFunction();
173     void construct_nonFunction_data();
174     void construct_nonFunction();
175     void construct_simple();
176     void construct_newObjectJS();
177 #if 0 // FIXME: no c-style callbacks
178     void construct_undefined();
179     void construct_newObjectCpp();
180 #endif
181     void construct_arg();
182     void construct_proto();
183     void construct_returnInt();
184     void construct_throw();
185 #if 0 // FIXME: The feature of interpreting an array as argument list has been removed from the API
186     void construct();
187 #endif
188     void construct_twoEngines();
189     void construct_constructorThrowsPrimitive();
190     void castToPointer();
191     void prettyPrinter_data();
192     void prettyPrinter();
193     void engineDeleted();
194     void valueOfWithClosure();
195 #if 0 // FIXME: no objectId()
196     void objectId();
197 #endif
198     void nestedObjectToVariant_data();
199     void nestedObjectToVariant();
200     void propertyFlags_data();
201     void propertyFlags();
202
203 private:
204     void newEngine()
205     {
206         if (engine)
207             delete engine;
208         engine = new QJSEngine();
209     }
210     QJSEngine *engine;
211 };
212
213 #endif