1
/****************************************************************************
3
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/
6
** This file is part of the test suite of the Qt Toolkit.
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.
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.
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.
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.
40
****************************************************************************/
42
#ifndef TST_QJSVALUE_H
43
#define TST_QJSVALUE_H
45
#include <QtCore/qobject.h>
46
#include <QtCore/qnumeric.h>
47
#include <qjsengine.h>
49
#include <QtTest/QtTest>
51
Q_DECLARE_METATYPE(QVariant)
52
Q_DECLARE_METATYPE(QJSValue)
54
class tst_QJSValue : public QObject
60
virtual ~tst_QJSValue();
64
void ctor_undefinedWithEngine();
65
void ctor_undefined();
66
void ctor_nullWithEngine();
68
void ctor_boolWithEngine();
70
void ctor_intWithEngine();
72
void ctor_uintWithEngine();
74
void ctor_floatWithEngine();
76
void ctor_stringWithEngine();
78
void ctor_copyAndAssignWithEngine();
79
void ctor_copyAndAssign();
88
void toQObject_nonQObject_data();
89
void toQObject_nonQObject();
97
void isError_propertiesOfGlobalObject();
100
void isRegExp_data();
103
#if 0 // FIXME: No QScriptValue::lessThan
107
void strictlyEquals();
109
void hasProperty_basic();
110
void hasProperty_globalObject();
111
void hasProperty_changePrototype();
113
void deleteProperty_basic();
114
void deleteProperty_globalObject();
115
void deleteProperty_inPrototype();
117
void getSetPrototype_cyclicPrototype();
118
void getSetPrototype_evalCyclicPrototype();
119
void getSetPrototype_eval();
120
void getSetPrototype_invalidPrototype();
121
void getSetPrototype_twoEngines();
122
void getSetPrototype_null();
123
void getSetPrototype_notObjectOrNull();
124
void getSetPrototype();
126
void getSetProperty_HooliganTask162051();
127
void getSetProperty_HooliganTask183072();
128
void getSetProperty_propertyRemoval();
129
void getSetProperty_resolveMode();
130
void getSetProperty_twoEngines();
131
void getSetProperty_gettersAndSetters();
132
void getSetProperty_gettersAndSettersThrowErrorNative();
133
void getSetProperty_gettersAndSettersThrowErrorJS();
134
void getSetProperty_gettersAndSettersOnNative();
135
void getSetProperty_gettersAndSettersOnGlobalObject();
136
void getSetProperty_gettersAndSettersChange();
137
void getSetProperty_gettersAndSettersStupid();
138
void getSetProperty_array();
139
void getSetProperty();
140
void arrayElementGetterSetter();
141
void getSetData_objects_data();
142
void getSetData_objects();
143
void getSetData_nonObjects_data();
144
void getSetData_nonObjects();
145
void setData_QTBUG15144();
146
#if 0 // FIXME: no QScriptClass
147
void getSetScriptClass_emptyClass_data();
148
void getSetScriptClass_emptyClass();
149
void getSetScriptClass_JSObjectFromCpp();
150
void getSetScriptClass_JSObjectFromJS();
151
void getSetScriptClass_QVariant();
152
void getSetScriptClass_QObject();
154
void call_function();
156
void call_newObjects();
158
void call_arguments();
160
void call_invalidArguments();
161
void call_invalidReturn();
162
void call_twoEngines();
164
void call_nonFunction_data();
165
void call_nonFunction();
166
void construct_nonFunction_data();
167
void construct_nonFunction();
168
void construct_simple();
169
void construct_newObjectJS();
170
#if 0 // FIXME: no c-style callbacks
171
void construct_undefined();
172
void construct_newObjectCpp();
174
void construct_arg();
175
void construct_proto();
176
void construct_returnInt();
177
void construct_throw();
178
#if 0 // FIXME: The feature of interpreting an array as argument list has been removed from the API
181
void construct_twoEngines();
182
void construct_constructorThrowsPrimitive();
183
void castToPointer();
184
void prettyPrinter_data();
185
void prettyPrinter();
186
void engineDeleted();
187
void valueOfWithClosure();
188
#if 0 // FIXME: no objectId()
191
void nestedObjectToVariant_data();
192
void nestedObjectToVariant();
199
engine = new QJSEngine();