OpenCoverage

qv4dataview.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4dataview.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQml module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qv4dataview_p.h"-
41#include "qv4arraybuffer_p.h"-
42#include "qv4string_p.h"-
43#include "qv4symbol_p.h"-
44-
45#include <QtCore/private/qnumeric_p.h>-
46#include "qendian.h"-
47-
48using namespace QV4;-
49-
50DEFINE_OBJECT_VTABLE(DataViewCtor);-
51DEFINE_OBJECT_VTABLE(DataView);-
52-
53void Heap::DataViewCtor::init(QV4::ExecutionContext *scope)-
54{-
55 Heap::FunctionObject::init(scope, QStringLiteral("DataView"));
executed 98102 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98102
56}
executed 99083 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99083
57-
58ReturnedValue DataViewCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *)-
59{-
60 Scope scope(f->engine());-
61 Scoped<ArrayBuffer> buffer(scope, argc ? argv[0] : Primitive::undefinedValue());-
62 if (!buffer)
!bufferDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1415 times by 1 test
Evaluated by:
  • tst_ecmascripttests
52-1415
63 return scope.engine->throwTypeError();
executed 52 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
52
64-
65 double bo = argc > 1 ? argv[1].toNumber() : 0;
argc > 1Description
TRUEevaluated 1407 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-1407
66 uint byteOffset = (uint)bo;-
67 uint bufferLength = buffer->d()->data->size;-
68 double bl = argc < 3 || argv[2].isUndefined() ? (bufferLength - bo) : argv[2].toNumber();
argc < 3Description
TRUEevaluated 1149 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 268 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argv[2].isUndefined()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 248 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-1149
69 uint byteLength = (uint)bl;-
70 if (bo != byteOffset || bl != byteLength || byteOffset + byteLength > bufferLength)
bo != byteOffsetDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1392 times by 1 test
Evaluated by:
  • tst_ecmascripttests
bl != byteLengthDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1355 times by 1 test
Evaluated by:
  • tst_ecmascripttests
byteOffset + b...> bufferLengthDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1337 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-1392
71 return scope.engine->throwRangeError(QStringLiteral("DataView: constructor arguments out of range"));
executed 80 times by 1 test: return scope.engine->throwRangeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "DataView: constructor arguments out of range")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "DataView: constructor arguments out of range" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
Executed by:
  • tst_ecmascripttests
executed 80 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
80
72-
73 Scoped<DataView> a(scope, scope.engine->memoryManager->allocate<DataView>());-
74 a->d()->buffer.set(scope.engine, buffer->d());-
75 a->d()->byteLength = byteLength;-
76 a->d()->byteOffset = byteOffset;-
77 return a.asReturnedValue();
executed 1335 times by 1 test: return a.asReturnedValue();
Executed by:
  • tst_ecmascripttests
1335
78}-
79-
80ReturnedValue DataViewCtor::virtualCall(const FunctionObject *f, const Value *, const Value *argv, int argc)-
81{-
82 return virtualCallAsConstructor(f, argv, argc, f);
executed 4 times by 1 test: return virtualCallAsConstructor(f, argv, argc, f);
Executed by:
  • tst_ecmascripttests
4
83}-
84-
85void DataViewPrototype::init(ExecutionEngine *engine, Object *ctor)-
86{-
87 Scope scope(engine);-
88 ScopedObject o(scope);-
89 ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(3));-
90 ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));-
91 defineDefaultProperty(engine->id_constructor(), (o = ctor));-
92 defineAccessorProperty(QStringLiteral("buffer"), method_get_buffer, nullptr);
executed 98856 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98856
93 defineAccessorProperty(QStringLiteral("byteLength"), method_get_byteLength, nullptr);
executed 98759 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98759
94 defineAccessorProperty(QStringLiteral("byteOffset"), method_get_byteOffset, nullptr);
executed 98413 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98413
95-
96 defineDefaultProperty(QStringLiteral("getInt8"), method_getChar<signed char>, 1);
executed 98555 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98555
97 defineDefaultProperty(QStringLiteral("getUint8"), method_getChar<unsigned char>, 1);
executed 98430 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98430
98 defineDefaultProperty(QStringLiteral("getInt16"), method_get<short>, 1);
executed 98750 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98750
99 defineDefaultProperty(QStringLiteral("getUint16"), method_get<unsigned short>, 1);
executed 98771 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98771
100 defineDefaultProperty(QStringLiteral("getInt32"), method_get<int>, 1);
executed 98898 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98898
101 defineDefaultProperty(QStringLiteral("getUint32"), method_get<unsigned int>, 1);
executed 98555 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98555
102 defineDefaultProperty(QStringLiteral("getFloat32"), method_getFloat<float>, 1);
executed 98823 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98823
103 defineDefaultProperty(QStringLiteral("getFloat64"), method_getFloat<double>, 1);
executed 98762 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98762
104-
105 defineDefaultProperty(QStringLiteral("setInt8"), method_setChar<signed char>, 2);
executed 98889 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98889
106 defineDefaultProperty(QStringLiteral("setUint8"), method_setChar<unsigned char>, 2);
executed 98892 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98892
107 defineDefaultProperty(QStringLiteral("setInt16"), method_set<short>, 2);
executed 98890 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98890
108 defineDefaultProperty(QStringLiteral("setUint16"), method_set<unsigned short>, 2);
executed 98826 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98826
109 defineDefaultProperty(QStringLiteral("setInt32"), method_set<int>, 2);
executed 98426 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98426
110 defineDefaultProperty(QStringLiteral("setUint32"), method_set<unsigned int>, 2);
executed 98589 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98589
111 defineDefaultProperty(QStringLiteral("setFloat32"), method_setFloat<float>, 2);
executed 98790 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98790
112 defineDefaultProperty(QStringLiteral("setFloat64"), method_setFloat<double>, 2);
executed 98798 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98798
113-
114 ScopedString name(scope, engine->newString(QStringLiteral("DataView")));
executed 98922 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98922
115 defineReadonlyConfigurableProperty(scope.engine->symbol_toStringTag(), name);-
116-
117 // For backword compatibility-
118 defineDefaultProperty(QStringLiteral("getUInt8"), method_getChar<unsigned char>, 1);
executed 98920 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98920
119 defineDefaultProperty(QStringLiteral("getUInt16"), method_get<unsigned short>, 1);
executed 98972 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98972
120 defineDefaultProperty(QStringLiteral("getUInt32"), method_get<unsigned int>, 1);
executed 99042 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99042
121 defineDefaultProperty(QStringLiteral("setUInt8"), method_setChar<unsigned char>, 1);
executed 98917 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98917
122 defineDefaultProperty(QStringLiteral("setUInt16"), method_set<unsigned short>, 1);
executed 98629 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98629
123 defineDefaultProperty(QStringLiteral("setUInt32"), method_set<unsigned int>, 1);
executed 98984 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98984
124}
executed 98717 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98717
125-
126ReturnedValue DataViewPrototype::method_get_buffer(const FunctionObject *b, const Value *thisObject, const Value *, int)-
127{-
128 const DataView *v = thisObject->as<DataView>();-
129 if (!v)
!vDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 87 times by 1 test
Evaluated by:
  • tst_ecmascripttests
52-87
130 return b->engine()->throwTypeError();
executed 52 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
52
131-
132 return v->d()->buffer->asReturnedValue();
executed 87 times by 1 test: return v->d()->buffer->asReturnedValue();
Executed by:
  • tst_ecmascripttests
87
133}-
134-
135ReturnedValue DataViewPrototype::method_get_byteLength(const FunctionObject *b, const Value *thisObject, const Value *, int)-
136{-
137 const DataView *v = thisObject->as<DataView>();-
138 if (!v)
!vDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
52-112
139 return b->engine()->throwTypeError();
executed 52 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
52
140-
141 return Encode(v->d()->byteLength);
executed 112 times by 1 test: return Encode(v->d()->byteLength);
Executed by:
  • tst_ecmascripttests
112
142}-
143-
144ReturnedValue DataViewPrototype::method_get_byteOffset(const FunctionObject *b, const Value *thisObject, const Value *, int)-
145{-
146 const DataView *v = thisObject->as<DataView>();-
147 if (!v)
!vDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 115 times by 1 test
Evaluated by:
  • tst_ecmascripttests
52-115
148 return b->engine()->throwTypeError();
executed 52 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
52
149-
150 return Encode(v->d()->byteOffset);
executed 116 times by 1 test: return Encode(v->d()->byteOffset);
Executed by:
  • tst_ecmascripttests
116
151}-
152-
153template <typename T>-
154ReturnedValue DataViewPrototype::method_getChar(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
155{-
156 const DataView *v = thisObject->as<DataView>();-
157 if (!v || argc < 1)
!vDescription
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 444 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argc < 1Description
TRUEnever evaluated
FALSEevaluated 444 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-444
158 return b->engine()->throwTypeError();
executed 88 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
88
159 double l = argv[0].toNumber();-
160 uint idx = (uint)l;-
161 if (l != idx || idx + sizeof(T) > v->d()->byteLength)
l != idxDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 420 times by 1 test
Evaluated by:
  • tst_ecmascripttests
idx + sizeof(T...()->byteLengthDescription
TRUEnever evaluated
FALSEevaluated 420 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-420
162 return b->engine()->throwTypeError();
executed 24 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
24
163 idx += v->d()->byteOffset;-
164-
165 T t = T(v->d()->buffer->data->data()[idx]);-
166-
167 return Encode((int)t);
executed 420 times by 1 test: return Encode((int)t);
Executed by:
  • tst_ecmascripttests
420
168}-
169-
170template <typename T>-
171ReturnedValue DataViewPrototype::method_get(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
172{-
173 const DataView *v = thisObject->as<DataView>();-
174 if (!v || argc < 1)
!vDescription
TRUEevaluated 176 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1936 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argc < 1Description
TRUEnever evaluated
FALSEevaluated 1936 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-1936
175 return b->engine()->throwTypeError();
executed 176 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
176
176 double l = argv[0].toNumber();-
177 uint idx = (uint)l;-
178 if (l != idx || idx + sizeof(T) > v->d()->byteLength)
l != idxDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1888 times by 1 test
Evaluated by:
  • tst_ecmascripttests
idx + sizeof(T...()->byteLengthDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1840 times by 1 test
Evaluated by:
  • tst_ecmascripttests
48-1888
179 return b->engine()->throwTypeError();
executed 96 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
96
180 idx += v->d()->byteOffset;-
181-
182 bool littleEndian = argc < 2 ? false : argv[1].toBoolean();
argc < 2Description
TRUEevaluated 1184 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 656 times by 1 test
Evaluated by:
  • tst_ecmascripttests
656-1184
183-
184 T t = littleEndian
littleEndianDescription
TRUEevaluated 328 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1512 times by 1 test
Evaluated by:
  • tst_ecmascripttests
328-1512
185 ? qFromLittleEndian<T>((uchar *)v->d()->buffer->data->data() + idx)-
186 : qFromBigEndian<T>((uchar *)v->d()->buffer->data->data() + idx);-
187-
188 return Encode(t);
executed 1840 times by 1 test: return Encode(t);
Executed by:
  • tst_ecmascripttests
1840
189}-
190-
191template <typename T>-
192ReturnedValue DataViewPrototype::method_getFloat(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
193{-
194 const DataView *v = thisObject->as<DataView>();-
195 if (!v || argc < 1)
!vDescription
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1032 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argc < 1Description
TRUEnever evaluated
FALSEevaluated 1032 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-1032
196 return b->engine()->throwTypeError();
executed 88 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
88
197 double l = argv[0].toNumber();-
198 uint idx = (uint)l;-
199 if (l != idx || idx + sizeof(T) > v->d()->byteLength)
l != idxDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1008 times by 1 test
Evaluated by:
  • tst_ecmascripttests
idx + sizeof(T...()->byteLengthDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 984 times by 1 test
Evaluated by:
  • tst_ecmascripttests
24-1008
200 return b->engine()->throwTypeError();
executed 48 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
48
201 idx += v->d()->byteOffset;-
202-
203 bool littleEndian = argc < 2 ? false : argv[1].toBoolean();
argc < 2Description
TRUEevaluated 608 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 376 times by 1 test
Evaluated by:
  • tst_ecmascripttests
376-608
204-
205 if (sizeof(T) == 4) {
sizeof(T) == 4Description
TRUEevaluated 492 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 492 times by 1 test
Evaluated by:
  • tst_ecmascripttests
492
206 // float-
207 union {-
208 uint i;-
209 float f;-
210 } u;-
211 u.i = littleEndian
littleEndianDescription
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 396 times by 1 test
Evaluated by:
  • tst_ecmascripttests
96-396
212 ? qFromLittleEndian<uint>((uchar *)v->d()->buffer->data->data() + idx)-
213 : qFromBigEndian<uint>((uchar *)v->d()->buffer->data->data() + idx);-
214 return Encode(u.f);
executed 492 times by 1 test: return Encode(u.f);
Executed by:
  • tst_ecmascripttests
492
215 } else {-
216 Q_ASSERT(sizeof(T) == 8);-
217 union {-
218 quint64 i;-
219 double d;-
220 } u;-
221 u.i = littleEndian
littleEndianDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 400 times by 1 test
Evaluated by:
  • tst_ecmascripttests
92-400
222 ? qFromLittleEndian<quint64>((uchar *)v->d()->buffer->data->data() + idx)-
223 : qFromBigEndian<quint64>((uchar *)v->d()->buffer->data->data() + idx);-
224 return Encode(u.d);
executed 492 times by 1 test: return Encode(u.d);
Executed by:
  • tst_ecmascripttests
492
225 }-
226}-
227-
228template <typename T>-
229ReturnedValue DataViewPrototype::method_setChar(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
230{-
231 const DataView *v = thisObject->as<DataView>();-
232 if (!v || argc < 1)
!vDescription
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1808 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argc < 1Description
TRUEnever evaluated
FALSEevaluated 1808 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-1808
233 return b->engine()->throwTypeError();
executed 88 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
88
234 double l = argv[0].toNumber();-
235 uint idx = (uint)l;-
236 if (l != idx || idx + sizeof(T) > v->d()->byteLength)
l != idxDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1776 times by 1 test
Evaluated by:
  • tst_ecmascripttests
idx + sizeof(T...()->byteLengthDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1768 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-1776
237 return b->engine()->throwTypeError();
executed 40 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
40
238 idx += v->d()->byteOffset;-
239-
240 int val = argc >= 2 ? argv[1].toInt32() : 0;
argc >= 2Description
TRUEevaluated 1760 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-1760
241 v->d()->buffer->data->data()[idx] = (char)val;-
242-
243 RETURN_UNDEFINED();
executed 1768 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
1768
244}-
245-
246template <typename T>-
247ReturnedValue DataViewPrototype::method_set(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
248{-
249 const DataView *v = thisObject->as<DataView>();-
250 if (!v || argc < 1)
!vDescription
TRUEevaluated 176 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1373 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argc < 1Description
TRUEnever evaluated
FALSEevaluated 1374 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-1374
251 return b->engine()->throwTypeError();
executed 176 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
176
252 double l = argv[0].toNumber();-
253 uint idx = (uint)l;-
254 if (l != idx || idx + sizeof(T) > v->d()->byteLength)
l != idxDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1312 times by 1 test
Evaluated by:
  • tst_ecmascripttests
idx + sizeof(T...()->byteLengthDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1248 times by 1 test
Evaluated by:
  • tst_ecmascripttests
64-1312
255 return b->engine()->throwTypeError();
executed 128 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
128
256 idx += v->d()->byteOffset;-
257-
258 int val = argc >= 2 ? argv[1].toInt32() : 0;
argc >= 2Description
TRUEevaluated 1232 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-1232
259-
260 bool littleEndian = argc < 3 ? false : argv[2].toBoolean();
argc < 3Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 880 times by 1 test
Evaluated by:
  • tst_ecmascripttests
368-880
261-
262 if (littleEndian)
littleEndianDescription
TRUEevaluated 160 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1088 times by 1 test
Evaluated by:
  • tst_ecmascripttests
160-1088
263 qToLittleEndian<T>(val, (uchar *)v->d()->buffer->data->data() + idx);
executed 160 times by 1 test: qToLittleEndian<T>(val, (uchar *)v->d()->buffer->data->data() + idx);
Executed by:
  • tst_ecmascripttests
160
264 else-
265 qToBigEndian<T>(val, (uchar *)v->d()->buffer->data->data() + idx);
executed 1088 times by 1 test: qToBigEndian<T>(val, (uchar *)v->d()->buffer->data->data() + idx);
Executed by:
  • tst_ecmascripttests
1088
266-
267 RETURN_UNDEFINED();
executed 1248 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
1248
268}-
269-
270template <typename T>-
271ReturnedValue DataViewPrototype::method_setFloat(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
272{-
273 const DataView *v = thisObject->as<DataView>();-
274 if (!v || argc < 1)
!vDescription
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 648 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argc < 1Description
TRUEnever evaluated
FALSEevaluated 648 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-648
275 return b->engine()->throwTypeError();
executed 88 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
88
276 double l = argv[0].toNumber();-
277 uint idx = (uint)l;-
278 if (l != idx || idx + sizeof(T) > v->d()->byteLength)
l != idxDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 616 times by 1 test
Evaluated by:
  • tst_ecmascripttests
idx + sizeof(T...()->byteLengthDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 584 times by 1 test
Evaluated by:
  • tst_ecmascripttests
32-616
279 return b->engine()->throwTypeError();
executed 64 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
64
280 idx += v->d()->byteOffset;-
281-
282 double val = argc >= 2 ? argv[1].toNumber() : qt_qnan();
argc >= 2Description
TRUEevaluated 576 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-576
283 bool littleEndian = argc < 3 ? false : argv[2].toBoolean();
argc < 3Description
TRUEevaluated 176 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 408 times by 1 test
Evaluated by:
  • tst_ecmascripttests
176-408
284-
285 if (sizeof(T) == 4) {
sizeof(T) == 4Description
TRUEevaluated 292 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 292 times by 1 test
Evaluated by:
  • tst_ecmascripttests
292
286 // float-
287 union {-
288 uint i;-
289 float f;-
290 } u;-
291 u.f = val;-
292 if (littleEndian)
littleEndianDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 268 times by 1 test
Evaluated by:
  • tst_ecmascripttests
24-268
293 qToLittleEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx);
executed 24 times by 1 test: qToLittleEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx);
Executed by:
  • tst_ecmascripttests
24
294 else-
295 qToBigEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx);
executed 268 times by 1 test: qToBigEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx);
Executed by:
  • tst_ecmascripttests
268
296 } else {-
297 Q_ASSERT(sizeof(T) == 8);-
298 union {-
299 quint64 i;-
300 double d;-
301 } u;-
302 u.d = val;-
303 if (littleEndian)
littleEndianDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 268 times by 1 test
Evaluated by:
  • tst_ecmascripttests
24-268
304 qToLittleEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx);
executed 24 times by 1 test: qToLittleEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx);
Executed by:
  • tst_ecmascripttests
24
305 else-
306 qToBigEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx);
executed 268 times by 1 test: qToBigEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx);
Executed by:
  • tst_ecmascripttests
268
307 }-
308 RETURN_UNDEFINED();
executed 584 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
584
309}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0