From 526c6fd4686a8e87e5087ebcac941405f742304a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 15 Feb 2010 13:33:07 +0100 Subject: Prevent stale QWidget pointers in QCocoaView QCocoaView has two "back" pointers ot its owning QWidget and the corresponding QWidgetPrivate. The lifetime of the QCocoaView might be longer and that of the QWidget if Cocoa itself holds references to it. In addition accessing a QWidget that is being destroyed is not safe. Set both pack pointers to NULL in ~QWidget. This prevents following stale pointers in the QCocoaView callbacks. This also means that we'll see the NULL pointers, add gurads for that. --- src/gui/kernel/qcocoaview_mac.mm | 52 ++++++++++++++++++++++++++++++++-- src/gui/kernel/qcocoaview_mac_p.h | 1 + src/gui/kernel/qt_cocoa_helpers_mac.mm | 10 +++++++ src/gui/kernel/qwidget.cpp | 9 ++++++ 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 455176e..4977042 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -419,6 +419,8 @@ extern "C" { - (BOOL)isOpaque; { + if (!qwidgetprivate) + return [super isOpaque]; return qwidgetprivate->isOpaque; } @@ -450,7 +452,7 @@ extern "C" { } // Make sure the opengl context is updated on resize. - if (qwidgetprivate->isGLWidget) { + if (qwidgetprivate && qwidgetprivate->isGLWidget) { qwidgetprivate->needWindowChange = true; QEvent event(QEvent::MacGLWindowChange); qApp->sendEvent(qwidget, &event); @@ -459,6 +461,9 @@ extern "C" { - (void)drawRect:(NSRect)aRect { + if (!qwidget) + return; + if (QApplicationPrivate::graphicsSystem() != 0) { if (QWidgetBackingStore *bs = qwidgetprivate->maybeBackingStore()) { // Drawing is handled on the window level @@ -551,12 +556,18 @@ extern "C" { - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { + if (!qwidget) + return NO; + Q_UNUSED(theEvent); return !qwidget->testAttribute(Qt::WA_MacNoClickThrough); } - (NSView *)hitTest:(NSPoint)aPoint { + if (!qwidget) + return [super hitTest:aPoint]; + if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) return nil; // You cannot hit a transparent for mouse event widget. return [super hitTest:aPoint]; @@ -564,6 +575,9 @@ extern "C" { - (void)updateTrackingAreas { + if (!qwidget) + return; + // [NSView addTrackingArea] is slow, so bail out early if we can: if (NSIsEmptyRect([self visibleRect])) return; @@ -597,6 +611,9 @@ extern "C" { - (void)mouseEntered:(NSEvent *)event { + if (!qwidget) + return; + if (qwidgetprivate->data.in_destructor) return; QEvent enterEvent(QEvent::Enter); @@ -619,6 +636,9 @@ extern "C" { - (void)mouseExited:(NSEvent *)event { + if (!qwidget) + return; + QEvent leaveEvent(QEvent::Leave); NSPoint globalPoint = [[event window] convertBaseToScreen:[event locationInWindow]]; if (!qAppInstance()->activeModalWidget() || QApplicationPrivate::tryModalHelper(qwidget, 0)) { @@ -637,6 +657,9 @@ extern "C" { - (void)flagsChanged:(NSEvent *)theEvent { + if (!qwidget) + return; + QWidget *widgetToGetKey = qwidget; QWidget *popup = qAppInstance()->activePopupWidget(); @@ -648,6 +671,9 @@ extern "C" { - (void)mouseMoved:(NSEvent *)theEvent { + if (!qwidget) + return; + // We always enable mouse tracking for all QCocoaView-s. In cases where we have // child views, we will receive mouseMoved for both parent & the child (if // mouse is over the child). We need to ignore the parent mouseMoved in such @@ -938,6 +964,8 @@ extern "C" { - (void)frameDidChange:(NSNotification *)note { Q_UNUSED(note); + if (!qwidget) + return; if (qwidget->isWindow()) return; NSRect newFrame = [self frame]; @@ -961,7 +989,7 @@ extern "C" { { QMacCocoaAutoReleasePool pool; [super setEnabled:flag]; - if (qwidget->isEnabled() != flag) + if (qwidget && qwidget->isEnabled() != flag) qwidget->setEnabled(flag); } @@ -972,6 +1000,8 @@ extern "C" { - (BOOL)acceptsFirstResponder { + if (!qwidget) + return NO; if (qwidget->isWindow()) return YES; // Always do it, so that windows can accept key press events. return qwidget->focusPolicy() != Qt::NoFocus; @@ -979,6 +1009,8 @@ extern "C" { - (BOOL)resignFirstResponder { + if (!qwidget) + return NO; // Seems like the following test only triggers if this // view is inside a QMacNativeWidget: if (qwidget == QApplication::focusWidget()) @@ -1014,6 +1046,12 @@ extern "C" { return qwidget; } +- (void) qt_clearQWidget +{ + qwidget = 0; + qwidgetprivate = 0; +} + - (BOOL)qt_leftButtonIsRightButton { return leftButtonIsRightButton; @@ -1067,9 +1105,11 @@ extern "C" { - (void)viewWillMoveToWindow:(NSWindow *)window { + if (qwidget == 0) + return; + if (qwidget->windowFlags() & Qt::MSWindowsOwnDC && (window != [self window])) { // OpenGL Widget - // Create a stupid ClearDrawable Event QEvent event(QEvent::MacGLClearDrawable); qApp->sendEvent(qwidget, &event); } @@ -1077,6 +1117,9 @@ extern "C" { - (void)viewDidMoveToWindow { + if (qwidget == 0) + return; + if (qwidget->windowFlags() & Qt::MSWindowsOwnDC && [self window]) { // call update paint event qwidgetprivate->needWindowChange = true; @@ -1272,6 +1315,9 @@ extern "C" { - (NSArray*) validAttributesForMarkedText { + if (qwidget == 0) + return nil; + if (!qwidget->testAttribute(Qt::WA_InputMethodEnabled)) return nil; // Not sure if that's correct, but it's saves a malloc. diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h index 4bb10c5..33aaa24 100644 --- a/src/gui/kernel/qcocoaview_mac_p.h +++ b/src/gui/kernel/qcocoaview_mac_p.h @@ -103,6 +103,7 @@ Q_GUI_EXPORT - (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation; - (BOOL)isComposing; - (QWidget *)qt_qwidget; +- (void) qt_clearQWidget; - (BOOL)qt_leftButtonIsRightButton; - (void)qt_setLeftButtonIsRightButton:(BOOL)isSwapped; + (DnDParams*)currentMouseEvent; diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index e9fdbda..9560952 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -369,6 +369,16 @@ QMacTabletHash *qt_mac_tablet_hash() } #ifdef QT_MAC_USE_COCOA + +// Clears the QWidget pointer that each QCocoaView holds. +void qt_mac_clearCocoaViewQWidgetPointers(QWidget *widget) +{ + QCocoaView *cocoaView = reinterpret_cast(qt_mac_nativeview_for(widget)); + if (cocoaView && [cocoaView respondsToSelector:@selector(qt_qwidget)]) { + [cocoaView qt_clearQWidget]; + } +} + void qt_dispatchTabletProximityEvent(void * /*NSEvent * */ tabletEvent) { NSEvent *proximityEvent = static_cast(tabletEvent); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index d433048..1e9b1d9 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1468,6 +1468,15 @@ QWidget::~QWidget() d->declarativeData = 0; // don't activate again in ~QObject } +#ifdef QT_MAC_USE_COCOA + // QCocoaView holds a pointer back to this widget. Clear it now + // to make sure it's not followed later on. The lifetime of the + // QCocoaView might exceed the lifetime of this widget in cases + // where Cocoa itself holds references to it. + extern void qt_mac_clearCocoaViewQWidgetPointers(QWidget *); + qt_mac_clearCocoaViewQWidgetPointers(this); +#endif + if (!d->children.isEmpty()) d->deleteChildren(); -- cgit v0.12 From 69abc957bca39bce4ed954b0469eb6abce8173fa Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 23 Feb 2010 11:32:43 +0100 Subject: Move the SIMD detection from QtGui to QtCore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SIMD instructions are useful outside painting code, the common functions are moved to QtCore Reviewed-by: Samuel Rødal --- src/corelib/corelib.pro | 22 ++++ src/corelib/tools/qsimd.cpp | 227 +++++++++++++++++++++++++++++++++++++++ src/corelib/tools/qsimd_p.h | 122 +++++++++++++++++++++ src/corelib/tools/tools.pri | 2 + src/gui/painting/qdrawhelper.cpp | 196 +-------------------------------- src/gui/painting/qdrawhelper_p.h | 9 -- 6 files changed, 375 insertions(+), 203 deletions(-) create mode 100644 src/corelib/tools/qsimd.cpp create mode 100644 src/corelib/tools/qsimd_p.h diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 7f33791..4bffd0f 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -38,3 +38,25 @@ symbian: { # Timezone server LIBS += -ltzclient } + +mmx { + DEFINES += QT_HAVE_MMX +} +3dnow { + DEFINES += QT_HAVE_3DNOW +} +sse { + DEFINES += QT_HAVE_SSE + DEFINES += QT_HAVE_MMXEXT +} +sse2 { + DEFINES += QT_HAVE_SSE2 +} +iwmmxt { + DEFINES += QT_HAVE_IWMMXT +} +neon { + DEFINES += QT_HAVE_NEON + QMAKE_CXXFLAGS *= -mfpu=neon +} + diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp new file mode 100644 index 0000000..331a699 --- /dev/null +++ b/src/corelib/tools/qsimd.cpp @@ -0,0 +1,227 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qsimd_p.h" +#include + +QT_BEGIN_NAMESPACE + +uint qDetectCPUFeatures() +{ +#if defined (Q_OS_WINCE) +#if defined (ARM) + if (IsProcessorFeaturePresent(PF_ARM_INTEL_WMMX)) + return IWMMXT; +#elif defined(_X86_) + uint features = 0; +#if defined QT_HAVE_MMX + if (IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE)) + features |= MMX; +#endif +#if defined QT_HAVE_3DNOW + if (IsProcessorFeaturePresent(PF_3DNOW_INSTRUCTIONS_AVAILABLE)) + features |= MMX3DNOW; +#endif + return features; +#endif + return 0; +#elif defined(QT_HAVE_IWMMXT) + // runtime detection only available when running as a previlegied process + static const bool doIWMMXT = !qgetenv("QT_NO_IWMMXT").toInt(); + return doIWMMXT ? IWMMXT : 0; +#elif defined(QT_HAVE_NEON) + static const bool doNEON = !qgetenv("QT_NO_NEON").toInt(); + return doNEON ? NEON : 0; +#else + uint features = 0; +#if defined(__x86_64__) || defined(Q_OS_WIN64) + features = MMX|SSE|SSE2|CMOV; +#elif defined(__ia64__) + features = MMX|SSE|SSE2; +#elif defined(__i386__) || defined(_M_IX86) + unsigned int extended_result = 0; + uint result = 0; + /* see p. 118 of amd64 instruction set manual Vol3 */ +#if defined(Q_CC_GNU) + asm ("push %%ebx\n" + "pushf\n" + "pop %%eax\n" + "mov %%eax, %%ebx\n" + "xor $0x00200000, %%eax\n" + "push %%eax\n" + "popf\n" + "pushf\n" + "pop %%eax\n" + "xor %%edx, %%edx\n" + "xor %%ebx, %%eax\n" + "jz 1f\n" + + "mov $0x00000001, %%eax\n" + "cpuid\n" + "1:\n" + "pop %%ebx\n" + "mov %%edx, %0\n" + : "=r" (result) + : + : "%eax", "%ecx", "%edx" + ); + + asm ("push %%ebx\n" + "pushf\n" + "pop %%eax\n" + "mov %%eax, %%ebx\n" + "xor $0x00200000, %%eax\n" + "push %%eax\n" + "popf\n" + "pushf\n" + "pop %%eax\n" + "xor %%edx, %%edx\n" + "xor %%ebx, %%eax\n" + "jz 2f\n" + + "mov $0x80000000, %%eax\n" + "cpuid\n" + "cmp $0x80000000, %%eax\n" + "jbe 2f\n" + "mov $0x80000001, %%eax\n" + "cpuid\n" + "2:\n" + "pop %%ebx\n" + "mov %%edx, %0\n" + : "=r" (extended_result) + : + : "%eax", "%ecx", "%edx" + ); +#elif defined (Q_OS_WIN) + _asm { + push eax + push ebx + push ecx + push edx + pushfd + pop eax + mov ebx, eax + xor eax, 00200000h + push eax + popfd + pushfd + pop eax + mov edx, 0 + xor eax, ebx + jz skip + + mov eax, 1 + cpuid + mov result, edx + skip: + pop edx + pop ecx + pop ebx + pop eax + } + + _asm { + push eax + push ebx + push ecx + push edx + pushfd + pop eax + mov ebx, eax + xor eax, 00200000h + push eax + popfd + pushfd + pop eax + mov edx, 0 + xor eax, ebx + jz skip2 + + mov eax, 80000000h + cpuid + cmp eax, 80000000h + jbe skip2 + mov eax, 80000001h + cpuid + mov extended_result, edx + skip2: + pop edx + pop ecx + pop ebx + pop eax + } +#endif + + // result now contains the standard feature bits + if (result & (1u << 15)) + features |= CMOV; + if (result & (1u << 23)) + features |= MMX; + if (extended_result & (1u << 22)) + features |= MMXEXT; + if (extended_result & (1u << 31)) + features |= MMX3DNOW; + if (extended_result & (1u << 30)) + features |= MMX3DNOWEXT; + if (result & (1u << 25)) + features |= SSE; + if (result & (1u << 26)) + features |= SSE2; +#endif // i386 + + if (qgetenv("QT_NO_MMX").toInt()) + features ^= MMX; + if (qgetenv("QT_NO_MMXEXT").toInt()) + features ^= MMXEXT; + if (qgetenv("QT_NO_3DNOW").toInt()) + features ^= MMX3DNOW; + if (qgetenv("QT_NO_3DNOWEXT").toInt()) + features ^= MMX3DNOWEXT; + if (qgetenv("QT_NO_SSE").toInt()) + features ^= SSE; + if (qgetenv("QT_NO_SSE2").toInt()) + features ^= SSE2; + + return features; +#endif +} + +QT_END_NAMESPACE diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h new file mode 100644 index 0000000..d535762 --- /dev/null +++ b/src/corelib/tools/qsimd_p.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSIMD_P_H +#define QSIMD_P_H + +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +#if defined(QT_NO_MAC_XARCH) || (defined(Q_OS_DARWIN) && (defined(__ppc__) || defined(__ppc64__))) +// Disable MMX and SSE on Mac/PPC builds, or if the compiler +// does not support -Xarch argument passing +#undef QT_HAVE_SSE2 +#undef QT_HAVE_SSE +#undef QT_HAVE_3DNOW +#undef QT_HAVE_MMX +#endif + +// SSE intrinsics +#if defined(QT_HAVE_SSE2) || defined(QT_HAVE_SSE) || defined(QT_HAVE_MMX) +#if defined(QT_LINUXBASE) +/// this is an evil hack - the posix_memalign declaration in LSB +/// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431 +# define posix_memalign _lsb_hack_posix_memalign +# include +# undef posix_memalign +#else +# include +#endif +#endif + +// NEON intrinsics +#if defined(QT_HAVE_NEON) +#include +#endif + + +// IWMMXT intrinsics +#if defined(QT_HAVE_IWMMXT) +#include +#if defined(Q_OS_WINCE) +# include "qplatformdefs.h" +#endif +#endif + +#if !defined(__IWMMXT__) && !defined(Q_OS_WINCE) +# include +#elif defined(Q_OS_WINCE_STD) && defined(_X86_) +# pragma warning(disable: 4391) +# include +#endif + +// 3D now intrinsics +#if defined(QT_HAVE_3DNOW) +#include +#endif + +enum CPUFeatures { + None = 0, + MMX = 0x1, + MMXEXT = 0x2, + MMX3DNOW = 0x4, + MMX3DNOWEXT = 0x8, + SSE = 0x10, + SSE2 = 0x20, + CMOV = 0x40, + IWMMXT = 0x80, + NEON = 0x100 +}; + + +QT_END_NAMESPACE + +QT_END_HEADER + +Q_CORE_EXPORT uint qDetectCPUFeatures(); + +#endif // QSIMD_P_H diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 3406e41..6d64915 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -33,6 +33,7 @@ HEADERS += \ tools/qsharedpointer.h \ tools/qsharedpointer_impl.h \ tools/qset.h \ + tools/qsimd_p.h \ tools/qsize.h \ tools/qstack.h \ tools/qstring.h \ @@ -68,6 +69,7 @@ SOURCES += \ tools/qregexp.cpp \ tools/qshareddata.cpp \ tools/qsharedpointer.cpp \ + tools/qsimd.cpp \ tools/qsize.cpp \ tools/qstring.cpp \ tools/qstringbuilder.cpp \ diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 194dda3..b9aa9ce 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include QT_BEGIN_NAMESPACE @@ -7720,199 +7721,6 @@ static void qt_memfill16_setup(quint16 *dest, quint16 value, int count); qt_memfill32_func qt_memfill32 = qt_memfill32_setup; qt_memfill16_func qt_memfill16 = qt_memfill16_setup; -enum CPUFeatures { - None = 0, - MMX = 0x1, - MMXEXT = 0x2, - MMX3DNOW = 0x4, - MMX3DNOWEXT = 0x8, - SSE = 0x10, - SSE2 = 0x20, - CMOV = 0x40, - IWMMXT = 0x80, - NEON = 0x100 -}; - -static uint detectCPUFeatures() -{ -#if defined (Q_OS_WINCE) -#if defined (ARM) - if (IsProcessorFeaturePresent(PF_ARM_INTEL_WMMX)) - return IWMMXT; -#elif defined(_X86_) - uint features = 0; -#if defined QT_HAVE_MMX - if (IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE)) - features |= MMX; -#endif -#if defined QT_HAVE_3DNOW - if (IsProcessorFeaturePresent(PF_3DNOW_INSTRUCTIONS_AVAILABLE)) - features |= MMX3DNOW; -#endif - return features; -#endif - return 0; -#elif defined(QT_HAVE_IWMMXT) - // runtime detection only available when running as a previlegied process - static const bool doIWMMXT = !qgetenv("QT_NO_IWMMXT").toInt(); - return doIWMMXT ? IWMMXT : 0; -#elif defined(QT_HAVE_NEON) - static const bool doNEON = !qgetenv("QT_NO_NEON").toInt(); - return doNEON ? NEON : 0; -#else - uint features = 0; -#if defined(__x86_64__) || defined(Q_OS_WIN64) - features = MMX|SSE|SSE2|CMOV; -#elif defined(__ia64__) - features = MMX|SSE|SSE2; -#elif defined(__i386__) || defined(_M_IX86) - unsigned int extended_result = 0; - uint result = 0; - /* see p. 118 of amd64 instruction set manual Vol3 */ -#if defined(Q_CC_GNU) - asm ("push %%ebx\n" - "pushf\n" - "pop %%eax\n" - "mov %%eax, %%ebx\n" - "xor $0x00200000, %%eax\n" - "push %%eax\n" - "popf\n" - "pushf\n" - "pop %%eax\n" - "xor %%edx, %%edx\n" - "xor %%ebx, %%eax\n" - "jz 1f\n" - - "mov $0x00000001, %%eax\n" - "cpuid\n" - "1:\n" - "pop %%ebx\n" - "mov %%edx, %0\n" - : "=r" (result) - : - : "%eax", "%ecx", "%edx" - ); - - asm ("push %%ebx\n" - "pushf\n" - "pop %%eax\n" - "mov %%eax, %%ebx\n" - "xor $0x00200000, %%eax\n" - "push %%eax\n" - "popf\n" - "pushf\n" - "pop %%eax\n" - "xor %%edx, %%edx\n" - "xor %%ebx, %%eax\n" - "jz 2f\n" - - "mov $0x80000000, %%eax\n" - "cpuid\n" - "cmp $0x80000000, %%eax\n" - "jbe 2f\n" - "mov $0x80000001, %%eax\n" - "cpuid\n" - "2:\n" - "pop %%ebx\n" - "mov %%edx, %0\n" - : "=r" (extended_result) - : - : "%eax", "%ecx", "%edx" - ); -#elif defined (Q_OS_WIN) - _asm { - push eax - push ebx - push ecx - push edx - pushfd - pop eax - mov ebx, eax - xor eax, 00200000h - push eax - popfd - pushfd - pop eax - mov edx, 0 - xor eax, ebx - jz skip - - mov eax, 1 - cpuid - mov result, edx - skip: - pop edx - pop ecx - pop ebx - pop eax - } - - _asm { - push eax - push ebx - push ecx - push edx - pushfd - pop eax - mov ebx, eax - xor eax, 00200000h - push eax - popfd - pushfd - pop eax - mov edx, 0 - xor eax, ebx - jz skip2 - - mov eax, 80000000h - cpuid - cmp eax, 80000000h - jbe skip2 - mov eax, 80000001h - cpuid - mov extended_result, edx - skip2: - pop edx - pop ecx - pop ebx - pop eax - } -#endif - - // result now contains the standard feature bits - if (result & (1u << 15)) - features |= CMOV; - if (result & (1u << 23)) - features |= MMX; - if (extended_result & (1u << 22)) - features |= MMXEXT; - if (extended_result & (1u << 31)) - features |= MMX3DNOW; - if (extended_result & (1u << 30)) - features |= MMX3DNOWEXT; - if (result & (1u << 25)) - features |= SSE; - if (result & (1u << 26)) - features |= SSE2; -#endif // i386 - - if (qgetenv("QT_NO_MMX").toInt()) - features ^= MMX; - if (qgetenv("QT_NO_MMXEXT").toInt()) - features ^= MMXEXT; - if (qgetenv("QT_NO_3DNOW").toInt()) - features ^= MMX3DNOW; - if (qgetenv("QT_NO_3DNOWEXT").toInt()) - features ^= MMX3DNOWEXT; - if (qgetenv("QT_NO_SSE").toInt()) - features ^= SSE; - if (qgetenv("QT_NO_SSE2").toInt()) - features ^= SSE2; - - return features; -#endif -} - #if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6) // Move these to qdrawhelper_arm.c when all // functions are implemented using arm assembly. @@ -8008,7 +7816,7 @@ void qInitDrawhelperAsm() static uint features = 0xffffffff; if (features != 0xffffffff) return; - features = detectCPUFeatures(); + features = qDetectCPUFeatures(); qt_memfill32 = qt_memfill_template; qt_memfill16 = qt_memfill_quint16; //qt_memfill_template; diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 6c47aac..474ebcf 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -67,15 +67,6 @@ #include "QtGui/qscreen_qws.h" #endif -// Disable MMX and SSE on Mac/PPC builds, or if the compiler -// does not support -Xarch argument passing -#if defined(QT_NO_MAC_XARCH) || (defined(Q_OS_DARWIN) && (defined(__ppc__) || defined(__ppc64__))) -#undef QT_HAVE_SSE2 -#undef QT_HAVE_SSE -#undef QT_HAVE_3DNOW -#undef QT_HAVE_MMX -#endif - QT_BEGIN_NAMESPACE #if defined(Q_CC_MSVC) && _MSCVER <= 1300 && !defined(Q_CC_INTEL) -- cgit v0.12 From d7181ae996f9add10bf4e956ddbedff99cb19378 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 23 Feb 2010 16:05:38 +0100 Subject: Cache the result of qDetectCPUFeatures() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the caching of the result from drawhelper to qsimd.cpp. Avoid getting the environment variables when not necessary Reviewed-by: Samuel Rødal --- src/corelib/tools/qsimd.cpp | 33 ++++++++++++++++++++++++++------- src/gui/painting/qdrawhelper.cpp | 5 +---- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 331a699..4ba8901 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -46,12 +46,18 @@ QT_BEGIN_NAMESPACE uint qDetectCPUFeatures() { + static uint features = 0xffffffff; + if (features != 0xffffffff) + return features; + #if defined (Q_OS_WINCE) #if defined (ARM) - if (IsProcessorFeaturePresent(PF_ARM_INTEL_WMMX)) - return IWMMXT; + if (IsProcessorFeaturePresent(PF_ARM_INTEL_WMMX)) { + features = IWMMXT; + return features; + } #elif defined(_X86_) - uint features = 0; + features = 0; #if defined QT_HAVE_MMX if (IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE)) features |= MMX; @@ -62,16 +68,19 @@ uint qDetectCPUFeatures() #endif return features; #endif - return 0; + features = 0; + return features; #elif defined(QT_HAVE_IWMMXT) // runtime detection only available when running as a previlegied process static const bool doIWMMXT = !qgetenv("QT_NO_IWMMXT").toInt(); - return doIWMMXT ? IWMMXT : 0; + features = doIWMMXT ? IWMMXT : 0 + return features; #elif defined(QT_HAVE_NEON) static const bool doNEON = !qgetenv("QT_NO_NEON").toInt(); - return doNEON ? NEON : 0; + features = doNEON ? NEON : 0 + return features; #else - uint features = 0; + features = 0; #if defined(__x86_64__) || defined(Q_OS_WIN64) features = MMX|SSE|SSE2|CMOV; #elif defined(__ia64__) @@ -207,18 +216,28 @@ uint qDetectCPUFeatures() features |= SSE2; #endif // i386 +#if defined(QT_HAVE_MMX) if (qgetenv("QT_NO_MMX").toInt()) features ^= MMX; +#endif if (qgetenv("QT_NO_MMXEXT").toInt()) features ^= MMXEXT; + +#if defined(QT_HAVE_3DNOW) if (qgetenv("QT_NO_3DNOW").toInt()) features ^= MMX3DNOW; +#endif if (qgetenv("QT_NO_3DNOWEXT").toInt()) features ^= MMX3DNOWEXT; + +#if defined(QT_HAVE_SSE) if (qgetenv("QT_NO_SSE").toInt()) features ^= SSE; +#endif +#if defined(QT_HAVE_SSE2) if (qgetenv("QT_NO_SSE2").toInt()) features ^= SSE2; +#endif return features; #endif diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index b9aa9ce..40fe499 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -7813,10 +7813,7 @@ static void qt_blend_color_argb_armv6(int count, const QSpan *spans, void *userD void qInitDrawhelperAsm() { - static uint features = 0xffffffff; - if (features != 0xffffffff) - return; - features = qDetectCPUFeatures(); + const uint features = qDetectCPUFeatures(); qt_memfill32 = qt_memfill_template; qt_memfill16 = qt_memfill_quint16; //qt_memfill_template; -- cgit v0.12 From 60fd302e8d88b92ade59d68872c99310128c3a6c Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 23 Feb 2010 17:06:41 +0100 Subject: Implement QString::fromLatin1_helper() with SSE2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When there is at least 16 characters, use SSE2 to convert from 8bits to 16 bits. Reviewed-by: Samuel Rødal Reveiwed-by: Thiago Macieira --- src/corelib/tools/qsimd_p.h | 9 +++++++++ src/corelib/tools/qstring.cpp | 24 ++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index d535762..d0a057e 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -60,6 +60,15 @@ QT_MODULE(Core) #undef QT_HAVE_MMX #endif + +#if defined(__x86_64__) || defined(Q_OS_WIN64) || defined(__ia64__) || defined(__SSE2__) +#if defined(QT_HAVE_SSE2) +// Defined for small fast functions that can take advantages of SSE2 intrinsics +#define QT_ALWAYS_HAVE_SSE2 +#endif +#endif + + // SSE intrinsics #if defined(QT_HAVE_SSE2) || defined(QT_HAVE_SSE) || defined(QT_HAVE_MMX) #if defined(QT_LINUXBASE) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index dec59b7..571a015 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -46,6 +46,7 @@ #include #endif #include +#include "qsimd_p.h" #include #include #include "qlocale.h" @@ -3612,10 +3613,29 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size) d->alloc = d->size = size; d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0; d->data = d->array; - ushort *i = d->data; d->array[size] = '\0'; + ushort *dst = d->data; +#if defined(QT_ALWAYS_HAVE_SSE2) + if (size >= 16) { + int chunkCount = size >> 4; // divided by 16 + const __m128i nullMask = _mm_set1_epi32(0); + for (int i = 0; i < chunkCount; ++i) { + const __m128i chunk = _mm_loadu_si128((__m128i*)str); + str += 16; + + const __m128i firstHalf = _mm_unpacklo_epi8(chunk, nullMask); + _mm_storeu_si128((__m128i*)dst, firstHalf); + dst += 8; + + const __m128i secondHalf = _mm_unpackhi_epi8 (chunk, nullMask); + _mm_storeu_si128((__m128i*)dst, secondHalf); + dst += 8; + } + size = size % 16; + } +#endif while (size--) - *i++ = (uchar)*str++; + *dst++ = (uchar)*str++; } return d; } -- cgit v0.12 From 7fb1434479001890b073405d53c7814143e9929a Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 23 Feb 2010 22:04:09 +0100 Subject: Build fixes for the SIMD functions Two semicolons were missing for arm. The MMX header was included for all non-x86 platforms. --- src/corelib/tools/qsimd.cpp | 4 ++-- src/corelib/tools/qsimd_p.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 4ba8901..52d2cea 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -73,11 +73,11 @@ uint qDetectCPUFeatures() #elif defined(QT_HAVE_IWMMXT) // runtime detection only available when running as a previlegied process static const bool doIWMMXT = !qgetenv("QT_NO_IWMMXT").toInt(); - features = doIWMMXT ? IWMMXT : 0 + features = doIWMMXT ? IWMMXT : 0; return features; #elif defined(QT_HAVE_NEON) static const bool doNEON = !qgetenv("QT_NO_NEON").toInt(); - features = doNEON ? NEON : 0 + features = doNEON ? NEON : 0; return features; #else features = 0; diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index d0a057e..07fae97 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -96,12 +96,14 @@ QT_MODULE(Core) #endif #endif +#if defined(QT_HAVE_IWMMXT) #if !defined(__IWMMXT__) && !defined(Q_OS_WINCE) # include #elif defined(Q_OS_WINCE_STD) && defined(_X86_) # pragma warning(disable: 4391) # include #endif +#endif // 3D now intrinsics #if defined(QT_HAVE_3DNOW) -- cgit v0.12 From 5d6d552c4c01c1e8884d7641c81671e808eed55d Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 24 Feb 2010 11:29:52 +0100 Subject: Comments the SSE implementation of fromLatin1_helper() Add comments to explain the intrinsics. Comment on the general method. Share the information that it is not worth it to do the same on with Neon. --- src/corelib/tools/qstring.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 9431ef4..f8303bd 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3650,20 +3650,26 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size) d->data = d->array; d->array[size] = '\0'; ushort *dst = d->data; + /* SIMD: + * Unpacking with SSE has been shown to improve performance on recent CPUs + * The same method gives no improvement with NEON. + */ #if defined(QT_ALWAYS_HAVE_SSE2) if (size >= 16) { int chunkCount = size >> 4; // divided by 16 const __m128i nullMask = _mm_set1_epi32(0); for (int i = 0; i < chunkCount; ++i) { - const __m128i chunk = _mm_loadu_si128((__m128i*)str); + const __m128i chunk = _mm_loadu_si128((__m128i*)str); // load str += 16; + // unpack the first 8 bytes, padding with zeros const __m128i firstHalf = _mm_unpacklo_epi8(chunk, nullMask); - _mm_storeu_si128((__m128i*)dst, firstHalf); + _mm_storeu_si128((__m128i*)dst, firstHalf); // store dst += 8; + // unpack the last 8 bytes, padding with zeros const __m128i secondHalf = _mm_unpackhi_epi8 (chunk, nullMask); - _mm_storeu_si128((__m128i*)dst, secondHalf); + _mm_storeu_si128((__m128i*)dst, secondHalf); // store dst += 8; } size = size % 16; -- cgit v0.12 From 5a3a5cd17496bc49c005df8f92ec2ffb56187281 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 24 Feb 2010 11:01:32 +0100 Subject: Fix compilation on x86 with gcc if SSE2 is not enabled Reviewed-By: Benjamin Poulain --- src/corelib/tools/qsimd_p.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 07fae97..556db14 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -60,17 +60,8 @@ QT_MODULE(Core) #undef QT_HAVE_MMX #endif - -#if defined(__x86_64__) || defined(Q_OS_WIN64) || defined(__ia64__) || defined(__SSE2__) -#if defined(QT_HAVE_SSE2) -// Defined for small fast functions that can take advantages of SSE2 intrinsics -#define QT_ALWAYS_HAVE_SSE2 -#endif -#endif - - // SSE intrinsics -#if defined(QT_HAVE_SSE2) || defined(QT_HAVE_SSE) || defined(QT_HAVE_MMX) +#if defined(__SSE2__) #if defined(QT_LINUXBASE) /// this is an evil hack - the posix_memalign declaration in LSB /// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431 @@ -80,6 +71,8 @@ QT_MODULE(Core) #else # include #endif + +#define QT_ALWAYS_HAVE_SSE2 #endif // NEON intrinsics -- cgit v0.12 From 5d98d7fb3e961d32819ae9831b715780487612e0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 24 Feb 2010 12:33:04 +0100 Subject: Add an extra operator delete() to QSharedPointer's internals. Maybe this fixes a warning that MSVC produces. But no guarantees. Task-number: QTBUG-8462 Reviewed-by: Trust Me --- src/corelib/tools/qsharedpointer_impl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index d85c248..bfc65bc 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -209,6 +209,7 @@ namespace QtSharedPointer { inline bool destroy() { destroyer(this); return true; } inline void operator delete(void *ptr) { ::operator delete(ptr); } + inline void operator delete(void *, void *) { } }; // sizeof(ExternalRefCountWithDestroyFn) = 16 (32-bit) / 24 (64-bit) -- cgit v0.12 From b35d2d4717f71b4e519d33160dfce8b23607f9c8 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 18 Feb 2010 11:21:48 +0100 Subject: Cache scene coordinates of a hotspot in a QGesture. Reviewed-by: trustme --- src/gui/graphicsview/qgraphicsscene.cpp | 27 ++++++++++++++++++--------- src/gui/graphicsview/qgraphicsscene_p.h | 4 ++-- src/gui/kernel/qgesture_p.h | 2 +- src/gui/kernel/qgesturerecognizer.cpp | 1 + 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index aaae88e..34543e3 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5901,7 +5901,6 @@ void QGraphicsScenePrivate::leaveModal(QGraphicsItem *panel) } void QGraphicsScenePrivate::getGestureTargets(const QSet &gestures, - QWidget *viewport, QMap *conflictedGestures, QList > *conflictedItems, QHash *normalGestures) @@ -5909,8 +5908,7 @@ void QGraphicsScenePrivate::getGestureTargets(const QSet &gestures, foreach (QGesture *gesture, gestures) { Qt::GestureType gestureType = gesture->gestureType(); if (gesture->hasHotSpot()) { - QPoint screenPos = gesture->hotSpot().toPoint(); - QList items = itemsAtPosition(screenPos, QPointF(), viewport); + QList items = itemsAtPosition(QPoint(), gesture->d_func()->sceneHotSpot, 0); QList result; for (int j = 0; j < items.size(); ++j) { QGraphicsItem *item = items.at(j); @@ -5946,6 +5944,10 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) QWidget *viewport = event->widget(); if (!viewport) return; + QGraphicsView *graphicsView = qobject_cast(viewport->parent()); + if (!graphicsView) + return; + QList allGestures = event->gestures(); DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" << "Delivering gestures:" << allGestures; @@ -5958,6 +5960,14 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) QSet startedGestures; foreach (QGesture *gesture, allGestures) { + // cache scene coordinates of the hot spot + if (gesture->hasHotSpot()) { + gesture->d_func()->sceneHotSpot = graphicsView->mapToScene( + graphicsView->mapFromGlobal(gesture->hotSpot().toPoint())); + } else { + gesture->d_func()->sceneHotSpot = QPointF(); + } + QGraphicsObject *target = gestureTargets.value(gesture, 0); if (!target) { // when we are not in started mode but don't have a target @@ -5976,7 +5986,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) QMap conflictedGestures; QList > conflictedItems; QHash normalGestures; - getGestureTargets(startedGestures, viewport, &conflictedGestures, &conflictedItems, + getGestureTargets(startedGestures, &conflictedGestures, &conflictedItems, &normalGestures); DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" << "Conflicting gestures:" << conflictedGestures.values() << conflictedItems; @@ -6186,7 +6196,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) QMap conflictedGestures; QList > itemsForConflictedGestures; QHash normalGestures; - getGestureTargets(ignoredGestures, viewport, + getGestureTargets(ignoredGestures, &conflictedGestures, &itemsForConflictedGestures, &normalGestures); for (int k = 0; k < itemsForConflictedGestures.size(); ++k) @@ -6205,7 +6215,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) if (g->gestureCancelPolicy() == QGesture::CancelAllInContext) { DEBUG() << "lets try to cancel some"; // find gestures in context in Qt::GestureStarted or Qt::GestureUpdated state and cancel them - cancelGesturesForChildren(g, event->widget()); + cancelGesturesForChildren(g); } } @@ -6222,7 +6232,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) } } -void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original, QWidget *viewport) +void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original) { Q_ASSERT(original); QGraphicsItem *originalItem = gestureTargets.value(original); @@ -6278,8 +6288,7 @@ void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original, QWidge if (!g->hasHotSpot()) continue; - QPoint screenPos = g->hotSpot().toPoint(); - QList items = itemsAtPosition(screenPos, QPointF(), viewport); + QList items = itemsAtPosition(QPoint(), g->d_func()->sceneHotSpot, 0); for (int j = 0; j < items.size(); ++j) { QGraphicsObject *item = items.at(j)->toGraphicsObject(); if (!item) diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 04ffe0f..2e19a89 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -296,11 +296,11 @@ public: QHash gestureTargets; void gestureEventHandler(QGestureEvent *event); - void getGestureTargets(const QSet &gestures, QWidget *viewport, + void getGestureTargets(const QSet &gestures, QMap *conflictedGestures, QList > *conflictedItems, QHash *normalGestures); - void cancelGesturesForChildren(QGesture *original, QWidget *viewport); + void cancelGesturesForChildren(QGesture *original); void updateInputMethodSensitivityInViews(); diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h index dee5592..649a310 100644 --- a/src/gui/kernel/qgesture_p.h +++ b/src/gui/kernel/qgesture_p.h @@ -69,13 +69,13 @@ public: QGesturePrivate() : gestureType(Qt::CustomGesture), state(Qt::NoGesture), isHotSpotSet(false), gestureCancelPolicy(0) - { } Qt::GestureType gestureType; Qt::GestureState state; QPointF hotSpot; + QPointF sceneHotSpot; uint isHotSpotSet : 1; uint gestureCancelPolicy : 2; }; diff --git a/src/gui/kernel/qgesturerecognizer.cpp b/src/gui/kernel/qgesturerecognizer.cpp index 8735d27..c88a9a7 100644 --- a/src/gui/kernel/qgesturerecognizer.cpp +++ b/src/gui/kernel/qgesturerecognizer.cpp @@ -181,6 +181,7 @@ void QGestureRecognizer::reset(QGesture *gesture) QGesturePrivate *d = gesture->d_func(); d->state = Qt::NoGesture; d->hotSpot = QPointF(); + d->sceneHotSpot = QPointF(); d->isHotSpotSet = false; } } -- cgit v0.12 From 97b7a880cf97c166600df097ee178b8dec8cf3ce Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 22 Feb 2010 18:39:50 +0100 Subject: Fixed a gesture autotest. Reviewed-by: trustme --- tests/auto/gestures/tst_gestures.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp index 24391c0..1765a30 100644 --- a/tests/auto/gestures/tst_gestures.cpp +++ b/tests/auto/gestures/tst_gestures.cpp @@ -1549,7 +1549,7 @@ void tst_Gestures::graphicsViewParentPropagation() QCOMPARE(item1_c1_c1->gestureEventsReceived, TotalGestureEventsCount); QCOMPARE(item1_c1_c1->gestureOverrideEventsReceived, 1); - QCOMPARE(item1_c1->gestureEventsReceived, 0); + QCOMPARE(item1_c1->gestureEventsReceived, TotalGestureEventsCount-1); QCOMPARE(item1_c1->gestureOverrideEventsReceived, 1); QCOMPARE(item1->gestureEventsReceived, TotalGestureEventsCount-1); QCOMPARE(item1->gestureOverrideEventsReceived, 1); -- cgit v0.12 From 734ba1f540aaedc4a3558268bd7350c0b15325a4 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 23 Feb 2010 13:24:42 +0100 Subject: Improved gesture event delivery in graphicsview. Made it possible to delete a gesture target from a gesture event handler. It is still not possible to delete some items (like an item that originated the gesture, i.e. that that the event that triggered the gesture to start), and in that case deleteLater() should be used. Reviewed-by: Andreas Aardal Hanssen --- src/gui/graphicsview/qgraphicsscene.cpp | 435 +++++++++++++++----------------- src/gui/graphicsview/qgraphicsscene_p.h | 13 +- tests/auto/gestures/tst_gestures.cpp | 139 +++++++++- 3 files changed, 343 insertions(+), 244 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 34543e3..40e1d2c 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -693,6 +693,18 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item) --selectionChanging; if (!selectionChanging && selectedItems.size() != oldSelectedItemsSize) emit q->selectionChanged(); + + QHash::iterator it; + for (it = gestureTargets.begin(); it != gestureTargets.end();) { + if (it.value() == item) + it = gestureTargets.erase(it); + else + ++it; + } + QGraphicsObject *dummy = static_cast(item); + cachedTargetItems.removeOne(dummy); + cachedItemGestures.remove(dummy); + cachedAlreadyDeliveredGestures.remove(dummy); } /*! @@ -5900,43 +5912,51 @@ void QGraphicsScenePrivate::leaveModal(QGraphicsItem *panel) dispatchHoverEvent(&hoverEvent); } -void QGraphicsScenePrivate::getGestureTargets(const QSet &gestures, - QMap *conflictedGestures, - QList > *conflictedItems, - QHash *normalGestures) +void QGraphicsScenePrivate::gestureTargetsAtHotSpots(const QSet &gestures, + Qt::GestureFlag flag, + QHash > *targets, + QSet *itemsSet, + QSet *normal, + QSet *conflicts) { + QSet normalGestures; // that are not in conflicted state. foreach (QGesture *gesture, gestures) { - Qt::GestureType gestureType = gesture->gestureType(); - if (gesture->hasHotSpot()) { - QList items = itemsAtPosition(QPoint(), gesture->d_func()->sceneHotSpot, 0); - QList result; - for (int j = 0; j < items.size(); ++j) { - QGraphicsItem *item = items.at(j); + if (!gesture->hasHotSpot()) + continue; + const Qt::GestureType gestureType = gesture->gestureType(); + QList items = itemsAtPosition(QPoint(), gesture->d_func()->sceneHotSpot, 0); + for (int j = 0; j < items.size(); ++j) { + QGraphicsItem *item = items.at(j); - // Check if the item is blocked by a modal panel and use it as - // a target instead of this item. - (void) item->isBlockedByModalPanel(&item); + // Check if the item is blocked by a modal panel and use it as + // a target instead of this item. + (void) item->isBlockedByModalPanel(&item); - if (QGraphicsObject *itemobj = item->toGraphicsObject()) { - QGraphicsItemPrivate *d = item->d_func(); - if (d->gestureContext.contains(gestureType)) { - result.append(itemobj); + if (QGraphicsObject *itemobj = item->toGraphicsObject()) { + QGraphicsItemPrivate *d = item->QGraphicsItem::d_func(); + QMap::const_iterator it = + d->gestureContext.find(gestureType); + if (it != d->gestureContext.end() && (!flag || (it.value() & flag))) { + if (normalGestures.contains(gesture)) { + normalGestures.remove(gesture); + if (conflicts) + conflicts->insert(gesture); + } else { + normalGestures.insert(gesture); } + if (targets) + (*targets)[itemobj].insert(gesture); + if (itemsSet) + (*itemsSet).insert(itemobj); } - // Don't propagate through panels. - if (item->isPanel()) - break; - } - DEBUG() << "QGraphicsScenePrivate::getGestureTargets:" - << gesture << result; - if (result.size() == 1) { - normalGestures->insert(gesture, result.first()); - } else if (!result.isEmpty()) { - conflictedGestures->insert(gestureType, gesture); - conflictedItems->append(result); } + // Don't propagate through panels. + if (item->isPanel()) + break; } } + if (normal) + *normal = normalGestures; } void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) @@ -5952,18 +5972,14 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" << "Delivering gestures:" << allGestures; - typedef QHash > GesturesPerItem; - GesturesPerItem gesturesPerItem; - - // gestures that are only supposed to propagate to parent items. - QSet parentPropagatedGestures; - QSet startedGestures; + QPoint delta = graphicsView->mapFromGlobal(QPoint()); + QTransform toScene = QTransform::fromTranslate(delta.x(), delta.y()) + * graphicsView->viewportTransform().inverted(); foreach (QGesture *gesture, allGestures) { // cache scene coordinates of the hot spot if (gesture->hasHotSpot()) { - gesture->d_func()->sceneHotSpot = graphicsView->mapToScene( - graphicsView->mapFromGlobal(gesture->hotSpot().toPoint())); + gesture->d_func()->sceneHotSpot = toScene.map(gesture->hotSpot()); } else { gesture->d_func()->sceneHotSpot = QPointF(); } @@ -5974,243 +5990,184 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) // then the only one interested in gesture is the view/scene if (gesture->state() == Qt::GestureStarted) startedGestures.insert(gesture); - } else { - gesturesPerItem[target].append(gesture); - Qt::GestureFlags flags = - target->QGraphicsItem::d_func()->gestureContext.value(gesture->gestureType()); - if (flags & Qt::IgnoredGesturesPropagateToParent) - parentPropagatedGestures.insert(gesture); } } - QMap conflictedGestures; - QList > conflictedItems; - QHash normalGestures; - getGestureTargets(startedGestures, &conflictedGestures, &conflictedItems, - &normalGestures); - DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" - << "Conflicting gestures:" << conflictedGestures.values() << conflictedItems; - Q_ASSERT((conflictedGestures.isEmpty() && conflictedItems.isEmpty()) || - (!conflictedGestures.isEmpty() && !conflictedItems.isEmpty())); - - // gestures that were sent as override events, but no one accepted them - QHash ignoredConflictedGestures; - - // deliver conflicted gestures as override events first - while (!conflictedGestures.isEmpty() && !conflictedItems.isEmpty()) { - // get the topmost item to deliver the override event - Q_ASSERT(!conflictedItems.isEmpty()); - Q_ASSERT(!conflictedItems.first().isEmpty()); - QGraphicsObject *topmost = conflictedItems.first().first(); - for (int i = 1; i < conflictedItems.size(); ++i) { - QGraphicsObject *item = conflictedItems.at(i).first(); - if (qt_closestItemFirst(item, topmost)) { - topmost = item; - } - } - // get a list of gestures to send to the item - QList grabbedGestures = - topmost->QGraphicsItem::d_func()->gestureContext.keys(); - QList gestures; - for (int i = 0; i < grabbedGestures.size(); ++i) { - if (QGesture *g = conflictedGestures.value(grabbedGestures.at(i), 0)) { - gestures.append(g); - if (!ignoredConflictedGestures.contains(g)) - ignoredConflictedGestures.insert(g, topmost); - } - } - - // send gesture override to the topmost item - QGestureEvent ev(gestures); - ev.t = QEvent::GestureOverride; - ev.setWidget(event->widget()); - // mark event and individual gestures as ignored - ev.ignore(); - foreach(QGesture *g, gestures) - ev.setAccepted(g, false); + if (!startedGestures.isEmpty()) { + QSet normalGestures; // that have just one target + QSet conflictedGestures; // that have multiple possible targets + gestureTargetsAtHotSpots(startedGestures, Qt::GestureFlag(0), &cachedItemGestures, 0, + &normalGestures, &conflictedGestures); + cachedTargetItems = cachedItemGestures.keys(); + qSort(cachedTargetItems.begin(), cachedTargetItems.end(), qt_closestItemFirst); DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" - << "delivering override to" - << topmost << gestures; - sendEvent(topmost, &ev); - // mark all accepted gestures to deliver them as normal gesture events - foreach (QGesture *g, gestures) { - if (ev.isAccepted() || ev.isAccepted(g)) { - conflictedGestures.remove(g->gestureType()); - gestureTargets.remove(g); - // add the gesture to the list of normal delivered gestures - normalGestures.insert(g, topmost); + << "Conflicting gestures:" << conflictedGestures; + + // deliver conflicted gestures as override events AND remember + // initial gesture targets + if (!conflictedGestures.isEmpty()) { + for (int i = 0; i < cachedTargetItems.size(); ++i) { + QWeakPointer item = cachedTargetItems.at(i); + + // get gestures to deliver to the current item + QSet gestures = conflictedGestures & cachedItemGestures.value(item.data()); + if (gestures.isEmpty()) + continue; + DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" - << "override was accepted:" - << g << topmost; - ignoredConflictedGestures.remove(g); + << "delivering override to" + << item.data() << gestures; + // send gesture override + QGestureEvent ev(gestures.toList()); + ev.t = QEvent::GestureOverride; + ev.setWidget(event->widget()); + // mark event and individual gestures as ignored + ev.ignore(); + foreach(QGesture *g, gestures) + ev.setAccepted(g, false); + sendEvent(item.data(), &ev); + // mark all accepted gestures to deliver them as normal gesture events + foreach (QGesture *g, gestures) { + if (ev.isAccepted() || ev.isAccepted(g)) { + conflictedGestures.remove(g); + // mark the item as a gesture target + if (item) + gestureTargets.insert(g, item.data()); + DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" + << "override was accepted:" + << g << item.data(); + } + // remember the first item that received the override event + // as it most likely become a target if noone else accepts + // the override event + if (!gestureTargets.contains(g) && item) + gestureTargets.insert(g, item.data()); + + } + if (conflictedGestures.isEmpty()) + break; } } - // remove the item that we've already delivered from the list - for (int i = 0; i < conflictedItems.size(); ) { - QList &items = conflictedItems[i]; - if (items.first() == topmost) { - items.removeFirst(); - if (items.isEmpty()) { - conflictedItems.removeAt(i); - continue; + // remember the initial target item for each gesture that was not in + // the conflicted state. + if (!normalGestures.isEmpty()) { + for (int i = 0; i < cachedTargetItems.size() && !normalGestures.isEmpty(); ++i) { + QGraphicsObject *item = cachedTargetItems.at(i); + + // get gestures to deliver to the current item + foreach (QGesture *g, cachedItemGestures.value(item)) { + if (!gestureTargets.contains(g)) { + gestureTargets.insert(g, item); + normalGestures.remove(g); + } } } - ++i; } } - // put back those started gestures that are not in the conflicted state - // and remember their targets - QHash::const_iterator it = normalGestures.begin(), - e = normalGestures.end(); - for (; it != e; ++it) { - QGesture *g = it.key(); - QGraphicsObject *receiver = it.value(); - Q_ASSERT(!gestureTargets.contains(g)); - gestureTargets.insert(g, receiver); - gesturesPerItem[receiver].append(g); - Qt::GestureFlags flags = - receiver->QGraphicsItem::d_func()->gestureContext.value(g->gestureType()); - if (flags & Qt::IgnoredGesturesPropagateToParent) - parentPropagatedGestures.insert(g); - } - it = ignoredConflictedGestures.begin(); - e = ignoredConflictedGestures.end(); - for (; it != e; ++it) { - QGesture *g = it.key(); - QGraphicsObject *receiver = it.value(); - Q_ASSERT(!gestureTargets.contains(g)); - gestureTargets.insert(g, receiver); - gesturesPerItem[receiver].append(g); - Qt::GestureFlags flags = - receiver->QGraphicsItem::d_func()->gestureContext.value(g->gestureType()); - if (flags & Qt::IgnoredGesturesPropagateToParent) - parentPropagatedGestures.insert(g); - } - - DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" - << "Started gestures:" << normalGestures.keys() - << "All gestures:" << gesturesPerItem.values(); // deliver all gesture events - QList alreadyIgnoredGestures; - QHash > itemIgnoredGestures; - QList targetItems = gesturesPerItem.keys(); - qSort(targetItems.begin(), targetItems.end(), qt_closestItemFirst); - for (int i = 0; i < targetItems.size(); ++i) { - QGraphicsObject *item = targetItems.at(i); - QList gestures = gesturesPerItem.value(item); - // remove gestures that were already delivered once and were ignored - DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" - << "already ignored gestures for item" - << item << ":" << itemIgnoredGestures.value(item); - - if (itemIgnoredGestures.contains(item)) // don't deliver twice to the same item - continue; - - QGraphicsItemPrivate *gid = item->QGraphicsItem::d_func(); - foreach(QGesture *g, alreadyIgnoredGestures) { - QMap::iterator contextit = - gid->gestureContext.find(g->gestureType()); - bool deliver = false; - if (contextit != gid->gestureContext.end()) { - if (g->state() == Qt::GestureStarted) { - deliver = true; - } else { - const Qt::GestureFlags flags = contextit.value(); - if (flags & Qt::ReceivePartialGestures) { - QGraphicsObject *originalTarget = gestureTargets.value(g); - Q_ASSERT(originalTarget); - QGraphicsItemPrivate *otd = originalTarget->QGraphicsItem::d_func(); - const Qt::GestureFlags originalTargetFlags = otd->gestureContext.value(g->gestureType()); - if (originalTargetFlags & Qt::IgnoredGesturesPropagateToParent) { - // only deliver to parents of the original target item - deliver = item->isAncestorOf(originalTarget); - } else { - deliver = true; - } - } - } - } - if (deliver) - gestures += g; + QSet undeliveredGestures; + QSet parentPropagatedGestures; + foreach (QGesture *gesture, allGestures) { + if (QGraphicsObject *target = gestureTargets.value(gesture, 0)) { + cachedItemGestures[target].insert(gesture); + cachedTargetItems.append(target); + undeliveredGestures.insert(gesture); + QGraphicsItemPrivate *d = target->QGraphicsItem::d_func(); + const Qt::GestureFlags flags = d->gestureContext.value(gesture->gestureType()); + if (flags & Qt::IgnoredGesturesPropagateToParent) + parentPropagatedGestures.insert(gesture); } + } + qSort(cachedTargetItems.begin(), cachedTargetItems.end(), qt_closestItemFirst); + for (int i = 0; i < cachedTargetItems.size(); ++i) { + QWeakPointer receiver = cachedTargetItems.at(i); + QSet gestures = + undeliveredGestures & cachedItemGestures.value(receiver.data()); + gestures -= cachedAlreadyDeliveredGestures.value(receiver.data()); + if (gestures.isEmpty()) continue; + + cachedAlreadyDeliveredGestures[receiver.data()] += gestures; + const bool isPanel = receiver.data()->isPanel(); + DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" << "delivering to" - << item << gestures; - QGestureEvent ev(gestures); + << receiver.data() << gestures; + QGestureEvent ev(gestures.toList()); ev.setWidget(event->widget()); - sendEvent(item, &ev); + sendEvent(receiver.data(), &ev); QSet ignoredGestures; foreach (QGesture *g, gestures) { if (!ev.isAccepted() && !ev.isAccepted(g)) { - ignoredGestures.insert(g); + // if the gesture was ignored by its target, we will update the + // targetItems list with a possible target items (items that + // want to receive partial gestures). + // ### wont' work if the target was destroyed in the event + // we will just stop delivering it. + if (receiver && receiver.data() == gestureTargets.value(g, 0)) + ignoredGestures.insert(g); } else { - if (g->state() == Qt::GestureStarted) - gestureTargets[g] = item; - } - } - if (!ignoredGestures.isEmpty()) { - // get a list of items under the (current) hotspot of each ignored - // gesture and start delivery again from the beginning - DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" - << "item has ignored the event, will propagate." - << item << ignoredGestures; - itemIgnoredGestures[item] += ignoredGestures; - alreadyIgnoredGestures = ignoredGestures.toList(); - - // remove gestures that are supposed to be propagated to - // parent items only. - QSet parentGestures; - for (QSet::iterator it = ignoredGestures.begin(); - it != ignoredGestures.end();) { - if (parentPropagatedGestures.contains(*it)) { - parentGestures.insert(*it); - it = ignoredGestures.erase(it); - } else { - ++it; + if (receiver && g->state() == Qt::GestureStarted) { + // someone accepted the propagated initial GestureStarted + // event, let it be the new target for all following events. + gestureTargets[g] = receiver.data(); } + undeliveredGestures.remove(g); } + } + if (undeliveredGestures.isEmpty()) + break; + + // ignoredGestures list is only filled when delivering to the gesture + // target item, so it is safe to assume item == target. + if (!ignoredGestures.isEmpty() && !isPanel) { + // look for new potential targets for gestures that were ignored + // and should be propagated. + + QSet targetsSet = cachedTargetItems.toSet(); + + if (receiver) { + // first if the gesture should be propagated to parents only + for (QSet::iterator it = ignoredGestures.begin(); + it != ignoredGestures.end();) { + if (parentPropagatedGestures.contains(*it)) { + QGesture *gesture = *it; + const Qt::GestureType gestureType = gesture->gestureType(); + QGraphicsItem *item = receiver.data(); + while (item) { + if (QGraphicsObject *obj = item->toGraphicsObject()) { + if (item->d_func()->gestureContext.contains(gestureType)) { + targetsSet.insert(obj); + cachedItemGestures[obj].insert(gesture); + } + } + if (item->isPanel()) + break; + item = item->parentItem(); + } - QSet itemsSet = targetItems.toSet(); - - foreach(QGesture *g, parentGestures) { - // get the original target for the gesture - QGraphicsItem *item = gestureTargets.value(g, 0); - Q_ASSERT(item); - const Qt::GestureType gestureType = g->gestureType(); - // iterate through parent items of the original gesture - // target item and collect potential receivers - do { - if (QGraphicsObject *obj = item->toGraphicsObject()) { - if (item->d_func()->gestureContext.contains(gestureType)) - itemsSet.insert(obj); + it = ignoredGestures.erase(it); + continue; } - if (item->isPanel()) - break; - } while ((item = item->parentItem())); + ++it; + } } - QMap conflictedGestures; - QList > itemsForConflictedGestures; - QHash normalGestures; - getGestureTargets(ignoredGestures, - &conflictedGestures, &itemsForConflictedGestures, - &normalGestures); - for (int k = 0; k < itemsForConflictedGestures.size(); ++k) - itemsSet += itemsForConflictedGestures.at(k).toSet(); - - targetItems = itemsSet.toList(); + gestureTargetsAtHotSpots(ignoredGestures, Qt::ReceivePartialGestures, + &cachedItemGestures, &targetsSet, 0, 0); - qSort(targetItems.begin(), targetItems.end(), qt_closestItemFirst); + cachedTargetItems = targetsSet.toList(); + qSort(cachedTargetItems.begin(), cachedTargetItems.end(), qt_closestItemFirst); DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" - << "new targets:" << targetItems; + << "new targets:" << cachedTargetItems; i = -1; // start delivery again continue; } } + foreach (QGesture *g, startedGestures) { if (g->gestureCancelPolicy() == QGesture::CancelAllInContext) { DEBUG() << "lets try to cancel some"; @@ -6230,6 +6187,10 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) break; } } + + cachedTargetItems.clear(); + cachedItemGestures.clear(); + cachedAlreadyDeliveredGestures.clear(); } void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original) diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 2e19a89..ca8b829 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -294,12 +294,17 @@ public: bool allItemsIgnoreTouchEvents; void enableTouchEventsOnViews(); + QList cachedTargetItems; + QHash > cachedItemGestures; + QHash > cachedAlreadyDeliveredGestures; QHash gestureTargets; void gestureEventHandler(QGestureEvent *event); - void getGestureTargets(const QSet &gestures, - QMap *conflictedGestures, - QList > *conflictedItems, - QHash *normalGestures); + void gestureTargetsAtHotSpots(const QSet &gestures, + Qt::GestureFlag flag, + QHash > *targets, + QSet *itemsSet = 0, + QSet *normal = 0, + QSet *conflicts = 0); void cancelGesturesForChildren(QGesture *original); void updateInputMethodSensitivityInViews(); diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp index 1765a30..a2058cd 100644 --- a/tests/auto/gestures/tst_gestures.cpp +++ b/tests/auto/gestures/tst_gestures.cpp @@ -261,15 +261,19 @@ protected: eventsPtr->all << g->gestureType(); switch(g->state()) { case Qt::GestureStarted: + emit gestureStarted(e->type(), g); eventsPtr->started << g->gestureType(); break; case Qt::GestureUpdated: + emit gestureUpdated(e->type(), g); eventsPtr->updated << g->gestureType(); break; case Qt::GestureFinished: + emit gestureFinished(e->type(), g); eventsPtr->finished << g->gestureType(); break; case Qt::GestureCanceled: + emit gestureCanceled(e->type(), g); eventsPtr->canceled << g->gestureType(); break; default: @@ -283,13 +287,23 @@ protected: } return true; } + +Q_SIGNALS: + void gestureStarted(QEvent::Type, QGesture *); + void gestureUpdated(QEvent::Type, QGesture *); + void gestureFinished(QEvent::Type, QGesture *); + void gestureCanceled(QEvent::Type, QGesture *); + +public Q_SLOTS: + void deleteThis() { delete this; } }; // TODO rename to sendGestureSequence static void sendCustomGesture(CustomEvent *event, QObject *object, QGraphicsScene *scene = 0) { + QWeakPointer receiver(object); for (int i = CustomGesture::SerialMaybeThreshold; - i <= CustomGesture::SerialFinishedThreshold; ++i) { + i <= CustomGesture::SerialFinishedThreshold && receiver; ++i) { event->serial = i; if (scene) scene->sendEvent(qobject_cast(object), event); @@ -336,6 +350,9 @@ private slots: void graphicsViewParentPropagation(); void panelPropagation(); void panelStacksBehindParent(); + void deleteGestureTargetWidget(); + void deleteGestureTargetItem_data(); + void deleteGestureTargetItem(); }; tst_Gestures::tst_Gestures() @@ -657,14 +674,16 @@ static const QColor InstanceColors[] = { class GestureItem : public QGraphicsObject { + Q_OBJECT static int InstanceCount; - public: GestureItem(const char *name = 0) { instanceNumber = InstanceCount++; - if (name) + if (name) { setObjectName(QLatin1String(name)); + setToolTip(name); + } size = QRectF(0, 0, 100, 100); customEventsReceived = 0; gestureEventsReceived = 0; @@ -672,6 +691,8 @@ public: events.clear(); overrideEvents.clear(); acceptGestureOverride = false; + + scene = 0; } ~GestureItem() { @@ -773,15 +794,19 @@ protected: switch(g->state()) { case Qt::GestureStarted: eventsPtr->started << g->gestureType(); + emit gestureStarted(e->type(), g); break; case Qt::GestureUpdated: eventsPtr->updated << g->gestureType(); + emit gestureUpdated(e->type(), g); break; case Qt::GestureFinished: eventsPtr->finished << g->gestureType(); + emit gestureFinished(e->type(), g); break; case Qt::GestureCanceled: eventsPtr->canceled << g->gestureType(); + emit gestureCanceled(e->type(), g); break; default: Q_ASSERT(false); @@ -794,6 +819,26 @@ protected: } return true; } + +Q_SIGNALS: + void gestureStarted(QEvent::Type, QGesture *); + void gestureUpdated(QEvent::Type, QGesture *); + void gestureFinished(QEvent::Type, QGesture *); + void gestureCanceled(QEvent::Type, QGesture *); + +public: + // some arguments for the slots below: + QGraphicsScene *scene; + +public Q_SLOTS: + void deleteThis() { delete this; } + void addSelfToScene(QEvent::Type eventType, QGesture *) + { + if (eventType == QEvent::Gesture) { + disconnect(sender(), 0, this, SLOT(addSelfToScene(QEvent::Type,QGesture*))); + scene->addItem(this); + } + } }; int GestureItem::InstanceCount = 0; @@ -1724,5 +1769,93 @@ void tst_Gestures::panelStacksBehindParent() QCOMPARE(panel->gestureOverrideEventsReceived, 0); } +void tst_Gestures::deleteGestureTargetWidget() +{ + +} + +void tst_Gestures::deleteGestureTargetItem_data() +{ + QTest::addColumn("propagateUpdateGesture"); + QTest::addColumn("emitter"); + QTest::addColumn("receiver"); + QTest::addColumn("signalName"); + QTest::addColumn("slotName"); + + QByteArray gestureUpdated = SIGNAL(gestureUpdated(QEvent::Type,QGesture*)); + QByteArray gestureFinished = SIGNAL(gestureFinished(QEvent::Type,QGesture*)); + QByteArray deleteThis = SLOT(deleteThis()); + QByteArray deleteLater = SLOT(deleteLater()); + + QTest::newRow("delete1") + << false << "item1" << "item1" << gestureUpdated << deleteThis; + QTest::newRow("delete2") + << false << "item2" << "item2" << gestureUpdated << deleteThis; + QTest::newRow("delete3") + << false << "item1" << "item2" << gestureUpdated << deleteThis; + + QTest::newRow("deleteLater1") + << false << "item1" << "item1" << gestureUpdated << deleteLater; + QTest::newRow("deleteLater2") + << false << "item2" << "item2" << gestureUpdated << deleteLater; + QTest::newRow("deleteLater3") + << false << "item1" << "item2" << gestureUpdated << deleteLater; + QTest::newRow("deleteLater4") + << false << "item2" << "item1" << gestureUpdated << deleteLater; + + QTest::newRow("delete-self-and-propagate") + << true << "item2" << "item2" << gestureUpdated << deleteThis; + QTest::newRow("deleteLater-self-and-propagate") + << true << "item2" << "item2" << gestureUpdated << deleteLater; + QTest::newRow("propagate-to-deletedLater") + << true << "item2" << "item1" << gestureUpdated << deleteLater; +} + +void tst_Gestures::deleteGestureTargetItem() +{ + QFETCH(bool, propagateUpdateGesture); + QFETCH(QString, emitter); + QFETCH(QString, receiver); + QFETCH(QByteArray, signalName); + QFETCH(QByteArray, slotName); + + QGraphicsScene scene; + QGraphicsView view(&scene); + view.setWindowFlags(Qt::X11BypassWindowManagerHint); + + GestureItem *item1 = new GestureItem("item1"); + item1->grabGesture(CustomGesture::GestureType); + item1->setZValue(2); + scene.addItem(item1); + + GestureItem *item2 = new GestureItem("item2"); + item2->grabGesture(CustomGesture::GestureType); + item2->setZValue(5); + scene.addItem(item2); + + QMap items; + items.insert(item1->objectName(), item1); + items.insert(item2->objectName(), item2); + + view.show(); + QTest::qWaitForWindowShown(&view); + view.ensureVisible(scene.sceneRect()); + + view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren); + + if (propagateUpdateGesture) + item2->ignoredUpdatedGestures << CustomGesture::GestureType; + connect(items.value(emitter, 0), signalName, items.value(receiver, 0), slotName); + + // some debug output to see the current test data tag, so if we crash + // we know which one caused the crash. + qDebug() << "<-- testing"; + + CustomEvent event; + event.hotSpot = mapToGlobal(QPointF(5, 5), item2, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); +} + QTEST_MAIN(tst_Gestures) #include "tst_gestures.moc" -- cgit v0.12 From 513395fa2e4ee8564a202a38584e1887c08f91db Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 24 Feb 2010 13:18:28 +0100 Subject: Compile on Linux: close(2) is defined in #include Reviewed-by: Trust Me --- src/plugins/bearer/generic/qgenericengine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp index a95b14b..e96b80c 100644 --- a/src/plugins/bearer/generic/qgenericengine.cpp +++ b/src/plugins/bearer/generic/qgenericengine.cpp @@ -60,6 +60,7 @@ #include #include #include +#include #endif -- cgit v0.12 From b960edf4ba6eafb8d3b51aca2d7d11080b7f4213 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 24 Feb 2010 13:21:26 +0100 Subject: Autotest: add a test to ensure that the Qt headers are clean. The test here is to compile all Qt headers with QT_NO_KEYWORDS as well as ensuring that all #includes have the module prefix. QtDeclarative is currently disabled because the headers aren't clean and I can't fix them until the renaming is done. --- tests/auto/headers/headers.pro | 2 +- tests/auto/headers/headersclean.cpp | 86 +++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 tests/auto/headers/headersclean.cpp diff --git a/tests/auto/headers/headers.pro b/tests/auto/headers/headers.pro index 703da7c..74e1a02 100644 --- a/tests/auto/headers/headers.pro +++ b/tests/auto/headers/headers.pro @@ -1,3 +1,3 @@ load(qttest_p4) -SOURCES += tst_headers.cpp +SOURCES += tst_headers.cpp headersclean.cpp QT = core diff --git a/tests/auto/headers/headersclean.cpp b/tests/auto/headers/headersclean.cpp new file mode 100644 index 0000000..b932b9f --- /dev/null +++ b/tests/auto/headers/headersclean.cpp @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#define QT_NO_KEYWORDS +#define signals int +#define slots int +#define emit public:; +#define foreach public:; +#define forever public:; + +// include all of Qt here + +// core Qt +#include +#include +#include + +// extra +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// webkit: +#include + +// designer: +#include +#include + +// feature dependent: +#ifndef QT_NO_OPENVG +#include +#endif + +// removed in 4.7: +//#include + +// can't include this since it causes a linker error +//#include -- cgit v0.12 From 1a0697308313ff13b3b6f4712d540304b6b0e575 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 24 Feb 2010 14:21:31 +0100 Subject: Doc: add \since 4.7 to new QtMultimedia classes --- src/multimedia/base/qgraphicsvideoitem.cpp | 3 ++- src/multimedia/base/qmediacontent.cpp | 1 + src/multimedia/base/qmediacontrol.cpp | 1 + src/multimedia/base/qmediaobject.cpp | 1 + src/multimedia/base/qmediaplaylist.cpp | 1 + src/multimedia/base/qmediaplaylistcontrol.cpp | 1 + src/multimedia/base/qmediaplaylistioplugin.cpp | 3 +++ src/multimedia/base/qmediaplaylistnavigator.cpp | 1 + src/multimedia/base/qmediaplaylistprovider.cpp | 1 + src/multimedia/base/qmediaresource.cpp | 1 + src/multimedia/base/qmediaservice.cpp | 1 + src/multimedia/base/qmediaserviceprovider.cpp | 6 ++++++ src/multimedia/base/qmediatimerange.cpp | 2 ++ src/multimedia/base/qmetadatacontrol.cpp | 2 +- src/multimedia/base/qvideodevicecontrol.cpp | 1 + src/multimedia/base/qvideooutputcontrol.cpp | 2 +- src/multimedia/base/qvideorenderercontrol.cpp | 2 +- src/multimedia/base/qvideowidget.cpp | 2 +- src/multimedia/base/qvideowidgetcontrol.cpp | 2 +- src/multimedia/base/qvideowindowcontrol.cpp | 1 + src/multimedia/playback/qmediaplayer.cpp | 2 +- src/multimedia/playback/qmediaplayercontrol.cpp | 2 +- 22 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/multimedia/base/qgraphicsvideoitem.cpp b/src/multimedia/base/qgraphicsvideoitem.cpp index 21ba8c9..d5ca9e8 100644 --- a/src/multimedia/base/qgraphicsvideoitem.cpp +++ b/src/multimedia/base/qgraphicsvideoitem.cpp @@ -177,9 +177,10 @@ void QGraphicsVideoItemPrivate::_q_mediaObjectDestroyed() /*! \class QGraphicsVideoItem - \brief The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject. + \since 4.7 + \ingroup multimedia Attaching a QGraphicsVideoItem to a QMediaObject allows it to display diff --git a/src/multimedia/base/qmediacontent.cpp b/src/multimedia/base/qmediacontent.cpp index 3e32af0..109a0f0 100644 --- a/src/multimedia/base/qmediacontent.cpp +++ b/src/multimedia/base/qmediacontent.cpp @@ -76,6 +76,7 @@ private: \class QMediaContent \preliminary \brief The QMediaContent class provides access to the resources relating to a media content. + \since 4.7 \ingroup multimedia diff --git a/src/multimedia/base/qmediacontrol.cpp b/src/multimedia/base/qmediacontrol.cpp index c8bbfd4..b84c49e 100644 --- a/src/multimedia/base/qmediacontrol.cpp +++ b/src/multimedia/base/qmediacontrol.cpp @@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE /*! \class QMediaControl \ingroup multimedia-serv + \since 4.7 \preliminary \brief The QMediaControl class provides a base interface for media service controls. diff --git a/src/multimedia/base/qmediaobject.cpp b/src/multimedia/base/qmediaobject.cpp index b2b8c1b..0422718 100644 --- a/src/multimedia/base/qmediaobject.cpp +++ b/src/multimedia/base/qmediaobject.cpp @@ -67,6 +67,7 @@ void QMediaObjectPrivate::_q_notify() \class QMediaObject \preliminary \brief The QMediaObject class provides a common base for multimedia objects. + \since 4.7 \ingroup multimedia diff --git a/src/multimedia/base/qmediaplaylist.cpp b/src/multimedia/base/qmediaplaylist.cpp index ab91fd7..b3f3dd3 100644 --- a/src/multimedia/base/qmediaplaylist.cpp +++ b/src/multimedia/base/qmediaplaylist.cpp @@ -66,6 +66,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, playlistIOLoader, /*! \class QMediaPlaylist \ingroup multimedia + \since 4.7 \preliminary \brief The QMediaPlaylist class provides a list of media content to play. diff --git a/src/multimedia/base/qmediaplaylistcontrol.cpp b/src/multimedia/base/qmediaplaylistcontrol.cpp index 2ae03ad..ba3d224 100644 --- a/src/multimedia/base/qmediaplaylistcontrol.cpp +++ b/src/multimedia/base/qmediaplaylistcontrol.cpp @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE /*! \class QMediaPlaylistControl \ingroup multimedia-serv + \since 4.7 \preliminary \brief The QMediaPlaylistControl class provides access to the playlist functionality of a diff --git a/src/multimedia/base/qmediaplaylistioplugin.cpp b/src/multimedia/base/qmediaplaylistioplugin.cpp index 5f11e38..48fd721 100644 --- a/src/multimedia/base/qmediaplaylistioplugin.cpp +++ b/src/multimedia/base/qmediaplaylistioplugin.cpp @@ -46,6 +46,7 @@ QT_BEGIN_NAMESPACE /*! \class QMediaPlaylistReader \preliminary + \since 4.7 \brief The QMediaPlaylistReader class provides an interface for reading a playlist file. \sa QMediaPlaylistIOPlugin @@ -83,6 +84,7 @@ QMediaPlaylistReader::~QMediaPlaylistReader() /*! \class QMediaPlaylistWriter \preliminary + \since 4.7 \brief The QMediaPlaylistWriter class provides an interface for writing a playlist file. \sa QMediaPlaylistIOPlugin @@ -111,6 +113,7 @@ QMediaPlaylistWriter::~QMediaPlaylistWriter() /*! \class QMediaPlaylistIOPlugin + \since 4.7 \brief The QMediaPlaylistIOPlugin class provides an interface for media playlist I/O plug-ins. */ diff --git a/src/multimedia/base/qmediaplaylistnavigator.cpp b/src/multimedia/base/qmediaplaylistnavigator.cpp index 3c22ea4..0c52c71 100644 --- a/src/multimedia/base/qmediaplaylistnavigator.cpp +++ b/src/multimedia/base/qmediaplaylistnavigator.cpp @@ -193,6 +193,7 @@ int QMediaPlaylistNavigatorPrivate::previousItemPos(int steps) const /*! \class QMediaPlaylistNavigator \preliminary + \since 4.7 \brief The QMediaPlaylistNavigator class provides navigation for a media playlist. \sa QMediaPlaylist, QMediaPlaylistProvider diff --git a/src/multimedia/base/qmediaplaylistprovider.cpp b/src/multimedia/base/qmediaplaylistprovider.cpp index 65105dc..942f155 100644 --- a/src/multimedia/base/qmediaplaylistprovider.cpp +++ b/src/multimedia/base/qmediaplaylistprovider.cpp @@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE /*! \class QMediaPlaylistProvider \preliminary + \since 4.7 \brief The QMediaPlaylistProvider class provides an abstract list of media. \sa QMediaPlaylist diff --git a/src/multimedia/base/qmediaresource.cpp b/src/multimedia/base/qmediaresource.cpp index 515e432..646d9a7 100644 --- a/src/multimedia/base/qmediaresource.cpp +++ b/src/multimedia/base/qmediaresource.cpp @@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE /*! \class QMediaResource \preliminary + \since 4.7 \brief The QMediaResource class provides a description of a media resource. \ingroup multimedia diff --git a/src/multimedia/base/qmediaservice.cpp b/src/multimedia/base/qmediaservice.cpp index e40688e..d9e980b 100644 --- a/src/multimedia/base/qmediaservice.cpp +++ b/src/multimedia/base/qmediaservice.cpp @@ -57,6 +57,7 @@ QT_MODULE(Multimedia) service implementations. \ingroup multimedia-serv \preliminary + \since 4.7 Media services provide implementations of the functionality promised by media objects, and allow multiple providers to implement a QMediaObject. diff --git a/src/multimedia/base/qmediaserviceprovider.cpp b/src/multimedia/base/qmediaserviceprovider.cpp index 76377d9..37f0fce 100644 --- a/src/multimedia/base/qmediaserviceprovider.cpp +++ b/src/multimedia/base/qmediaserviceprovider.cpp @@ -82,6 +82,7 @@ public: /*! \class QMediaServiceProviderHint \preliminary + \since 4.7 \brief The QMediaServiceProviderHint class describes what is required of a QMediaService. \ingroup multimedia-serv @@ -489,6 +490,7 @@ Q_GLOBAL_STATIC(QPluginServiceProvider, pluginProvider); /*! \class QMediaServiceProvider \preliminary + \since 4.7 \brief The QMediaServiceProvider class provides an abstract allocator for media services. */ @@ -599,6 +601,7 @@ QT_END_NAMESPACE /*! \class QMediaServiceProviderPlugin \preliminary + \since 4.7 \brief The QMediaServiceProviderPlugin class interface provides an interface for QMediaService plug-ins. @@ -632,6 +635,7 @@ QT_END_NAMESPACE \class QMediaServiceSupportedFormatsInterface \brief The QMediaServiceSupportedFormatsInterface class interface identifies if a media service plug-in supports a media format. + \since 4.7 A QMediaServiceProviderPlugin may implement this interface. */ @@ -658,6 +662,7 @@ QT_END_NAMESPACE \class QMediaServiceSupportedDevicesInterface \brief The QMediaServiceSupportedDevicesInterface class interface identifies the devices supported by a media service plug-in. + \since 4.7 A QMediaServiceProviderPlugin may implement this interface. */ @@ -684,6 +689,7 @@ QT_END_NAMESPACE \class QMediaServiceFeaturesInterface \brief The QMediaServiceFeaturesInterface class interface identifies features supported by a media service plug-in. + \since 4.7 A QMediaServiceProviderPlugin may implement this interface. */ diff --git a/src/multimedia/base/qmediatimerange.cpp b/src/multimedia/base/qmediatimerange.cpp index 0ca1948..e1cea7e 100644 --- a/src/multimedia/base/qmediatimerange.cpp +++ b/src/multimedia/base/qmediatimerange.cpp @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE \class QMediaTimeInterval \brief The QMediaTimeInterval class represents a time interval with integer precision. \ingroup multimedia + \since 4.7 An interval is specified by an inclusive start() and end() time. These must be set in the constructor, as this is an immutable class. @@ -308,6 +309,7 @@ void QMediaTimeRangePrivate::removeInterval(const QMediaTimeInterval &interval) \brief The QMediaTimeRange class represents a set of zero or more disjoint time intervals. \ingroup multimedia + \since 4.7 \reentrant diff --git a/src/multimedia/base/qmetadatacontrol.cpp b/src/multimedia/base/qmetadatacontrol.cpp index 3ecbe8d..28a82ec 100644 --- a/src/multimedia/base/qmetadatacontrol.cpp +++ b/src/multimedia/base/qmetadatacontrol.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE /*! \class QMetaDataControl \ingroup multimedia-serv - + \since 4.7 \preliminary \brief The QMetaDataControl class provides access to the meta-data of a QMediaService's media. diff --git a/src/multimedia/base/qvideodevicecontrol.cpp b/src/multimedia/base/qvideodevicecontrol.cpp index 21db500..c0fe9a8 100644 --- a/src/multimedia/base/qvideodevicecontrol.cpp +++ b/src/multimedia/base/qvideodevicecontrol.cpp @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE /*! \class QVideoDeviceControl \preliminary + \since 4.7 \brief The QVideoDeviceControl class provides an video device selector media control. \ingroup multimedia-serv diff --git a/src/multimedia/base/qvideooutputcontrol.cpp b/src/multimedia/base/qvideooutputcontrol.cpp index a904385..58f1527 100644 --- a/src/multimedia/base/qvideooutputcontrol.cpp +++ b/src/multimedia/base/qvideooutputcontrol.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE /*! \class QVideoOutputControl \preliminary - + \since 4.7 \brief The QVideoOutputControl class provides a means of selecting the active video output control. diff --git a/src/multimedia/base/qvideorenderercontrol.cpp b/src/multimedia/base/qvideorenderercontrol.cpp index 4e7b3da..a34ef9b 100644 --- a/src/multimedia/base/qvideorenderercontrol.cpp +++ b/src/multimedia/base/qvideorenderercontrol.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE /*! \class QVideoRendererControl \preliminary - + \since 4.7 \brief The QVideoRendererControl class provides a control for rendering to a video surface. diff --git a/src/multimedia/base/qvideowidget.cpp b/src/multimedia/base/qvideowidget.cpp index 5df245e..aabfefc 100644 --- a/src/multimedia/base/qvideowidget.cpp +++ b/src/multimedia/base/qvideowidget.cpp @@ -488,7 +488,7 @@ void QVideoWidgetPrivate::_q_dimensionsChanged() /*! \class QVideoWidget \preliminary - + \since 4.7 \brief The QVideoWidget class provides a widget which presents video produced by a media object. \ingroup multimedia diff --git a/src/multimedia/base/qvideowidgetcontrol.cpp b/src/multimedia/base/qvideowidgetcontrol.cpp index bd7ce4e..c53c77b 100644 --- a/src/multimedia/base/qvideowidgetcontrol.cpp +++ b/src/multimedia/base/qvideowidgetcontrol.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE /*! \class QVideoWidgetControl \preliminary - + \since 4.7 \brief The QVideoWidgetControl class provides a media control which implements a video widget. diff --git a/src/multimedia/base/qvideowindowcontrol.cpp b/src/multimedia/base/qvideowindowcontrol.cpp index a23cb4b..da46823 100644 --- a/src/multimedia/base/qvideowindowcontrol.cpp +++ b/src/multimedia/base/qvideowindowcontrol.cpp @@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE /*! \class QVideoWindowControl \preliminary + \since 4.7 \ingroup multimedia-serv \brief The QVideoWindowControl class provides a media control for rendering video to a window. diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index ca34993..27bff02 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -66,7 +66,7 @@ QT_MODULE(Multimedia) \class QMediaPlayer \brief The QMediaPlayer class allows the playing of a media source. \ingroup multimedia - + \since 4.7 \preliminary The QMediaPlayer class is a high level media playback class. It can be used diff --git a/src/multimedia/playback/qmediaplayercontrol.cpp b/src/multimedia/playback/qmediaplayercontrol.cpp index 95ffade..2129098 100644 --- a/src/multimedia/playback/qmediaplayercontrol.cpp +++ b/src/multimedia/playback/qmediaplayercontrol.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE /*! \class QMediaPlayerControl \ingroup multimedia-serv - + \since 4.7 \preliminary \brief The QMediaPlayerControl class provides access to the media playing functionality of a QMediaService. -- cgit v0.12 From 3d25c963adadc5b0f8ae6282790aef11b5f6a9cc Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 24 Feb 2010 14:22:37 +0100 Subject: Implement toLatin1_helper with SSE2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Encoding to latin1 can be done 8 characters at a time with SSE2. The speed difference on a current CPU : -<16 characters: no change: 100% -16 characters string: 120% -1000 characters: 230% -10000 characters: 322% Reviewed-by: Samuel Rødal --- src/corelib/tools/qstring.cpp | 54 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index f8303bd..995e4cf 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3480,12 +3480,54 @@ static QByteArray toLatin1_helper(const QChar *data, int length) QByteArray ba; if (length) { ba.resize(length); - const ushort *i = reinterpret_cast(data); - const ushort *e = i + length; - uchar *s = (uchar*) ba.data(); - while (i != e) { - *s++ = (*i>0xff) ? '?' : (uchar) *i; - ++i; + const ushort *src = reinterpret_cast(data); + uchar *dst = (uchar*) ba.data(); +#if defined(QT_ALWAYS_HAVE_SSE2) + if (length >= 16) { + const int chunkCount = length >> 4; // divided by 16 + const __m128i questionMark = _mm_set1_epi16('?'); + const __m128i thresholdMask = _mm_set1_epi16(0xff); + for (int i = 0; i < chunkCount; ++i) { + __m128i chunk1 = _mm_loadu_si128((__m128i*)src); // load + src += 8; + { + // each 16 bit is equal to 0xFF if the source is outside latin 1 (>0xff) + const __m128i offLimitMask = _mm_cmpgt_epi16(chunk1, thresholdMask); + + // offLimitQuestionMark contains '?' for each 16 bits that was off-limit + // the 16 bits that were correct contains zeros + const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark); + + // correctBytes contains the bytes that were in limit + // the 16 bits that were off limits contains zeros + const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk1); + + // merge offLimitQuestionMark and correctBytes to have the result + chunk1 = _mm_or_si128(correctBytes, offLimitQuestionMark); + } + + __m128i chunk2 = _mm_loadu_si128((__m128i*)src); // load + src += 8; + { + // exactly the same operations as for the previous chunk of data + const __m128i offLimitMask = _mm_cmpgt_epi16(chunk2, thresholdMask); + const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark); + const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk2); + chunk2 = _mm_or_si128(correctBytes, offLimitQuestionMark); + } + + // pack the two vector to 16 x 8bits elements + const __m128i result = _mm_packs_epi16(chunk1, chunk2); + + _mm_storeu_si128((__m128i*)dst, result); // store + dst += 16; + } + length = length % 16; + } +#endif + while (length--) { + *dst++ = (*src>0xff) ? '?' : (uchar) *src; + ++src; } } return ba; -- cgit v0.12 From 61f81db089f45fe56419bc4b695bdbb475b0684a Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 24 Feb 2010 15:46:10 +0200 Subject: QScriptValue::isQMetaObject crash fix. QScriptValue::isQMetaObject shouldn't crash for a value that internally is represented as a non JSObjects values. Additional check was added to QScriptEnginePrivate::isQMetaObject. Reviewed-by: Kent Hansen --- src/script/api/qscriptengine_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index f69e537..79294fe 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -854,7 +854,7 @@ inline bool QScriptEnginePrivate::isQObject(JSC::JSValue value) inline bool QScriptEnginePrivate::isQMetaObject(JSC::JSValue value) { #ifndef QT_NO_QOBJECT - return JSC::asObject(value)->inherits(&QScript::QMetaObjectWrapperObject::info); + return isObject(value) && JSC::asObject(value)->inherits(&QScript::QMetaObjectWrapperObject::info); #else return false; #endif -- cgit v0.12 From 90e2ad422e55307bbab57dc1f4d627d6ae592489 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 24 Feb 2010 16:03:44 +0200 Subject: Fix license template. Fix license template inside the qscriptvalue autotest generator. Reviewed-by: TrustMe --- tests/auto/qscriptvalue/testgen/gen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/qscriptvalue/testgen/gen.py b/tests/auto/qscriptvalue/testgen/gen.py index b3c81b9..6e48f46 100755 --- a/tests/auto/qscriptvalue/testgen/gen.py +++ b/tests/auto/qscriptvalue/testgen/gen.py @@ -70,8 +70,7 @@ class Options(): return getattr(self._o, attr) -mainTempl = Template("""/* -/**************************************************************************** +mainTempl = Template("""/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -- cgit v0.12 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 From 508d0d0f7089c6b737ee10b1245ef9e1fc4240a6 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 24 Feb 2010 16:35:38 +0200 Subject: New autotests cases for QScriptValue autotests generator. Few test cases were added. They test values returned from QScriptEngine functions; evaluate(), newDate(), newObject() and newArray(). Reviewed-by: Kent Hansen --- tests/auto/qscriptvalue/testgen/data.txt | 37 +++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tests/auto/qscriptvalue/testgen/data.txt b/tests/auto/qscriptvalue/testgen/data.txt index a041c9b..2ab2fc9 100644 --- a/tests/auto/qscriptvalue/testgen/data.txt +++ b/tests/auto/qscriptvalue/testgen/data.txt @@ -34,6 +34,7 @@ QScriptValue(QString()) QScriptValue(QString("0")) QScriptValue(QString("123")) QScriptValue(QString("12.4")) +#QScriptValue(QString::fromUtf8("ąśćżźółńę")) #Unbound values (bound to a null engine) QScriptValue(0, QScriptValue::UndefinedValue) @@ -64,6 +65,7 @@ QScriptValue(0, QString()) QScriptValue(0, QString("0")) QScriptValue(0, QString("123")) QScriptValue(0, QString("12.3")) +#QScriptValue(0, QString::fromUtf8("ąśćżźółńę")) #Bound values QScriptValue(engine, QScriptValue::UndefinedValue) @@ -114,7 +116,40 @@ engine->evaluate("/foo/") engine->evaluate("new Object()") engine->evaluate("new Array()") engine->evaluate("new Error()") +engine->evaluate("a = new Object(); a.foo = 22; a.foo") +engine->evaluate("Undefined") +engine->evaluate("Null") +engine->evaluate("True") +engine->evaluate("False") + +engine->evaluate("undefined") +engine->evaluate("null") +engine->evaluate("true") +engine->evaluate("false") +engine->evaluate("122") +engine->evaluate("124") +engine->evaluate("0") +engine->evaluate("0.0") +engine->evaluate("123.0") +engine->evaluate("6.37e-8") +engine->evaluate("-6.37e-8") +engine->evaluate("0x43211234") +engine->evaluate("0x10000") +engine->evaluate("0x10001") +engine->evaluate("NaN") +engine->evaluate("Infinity") +engine->evaluate("-Infinity") +engine->evaluate("'ciao'") +engine->evaluate("''") +engine->evaluate("'0'") +engine->evaluate("'123'") +engine->evaluate("'12.4'") +#engine->evaluate(QString::fromUtf8("'ąśćżźółńę'")) #other engine->nullValue() -engine->undefinedValue() \ No newline at end of file +engine->undefinedValue() +engine->newObject() +engine->newArray() +engine->newArray(10) +engine->newDate(QDateTime()) -- cgit v0.12 From 2de691f9505cba2fd20b91d7cc7ea7e90bac71a0 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 24 Feb 2010 16:48:03 +0200 Subject: Update of the QScriptValue autotest suite. tst_qscriptvalue_generated.cpp was updated after last few autotest generator modifications. Reviewed-by: Kent Hansen --- .../qscriptvalue/tst_qscriptvalue_generated.cpp | 3114 ++++++++++++++++++++ 1 file changed, 3114 insertions(+) diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp index 4e621b3..1f68cb5 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp @@ -152,8 +152,39 @@ void tst_QScriptValue::initScriptValues() DEFINE_TEST_VALUE(engine->evaluate("new Object()")); DEFINE_TEST_VALUE(engine->evaluate("new Array()")); DEFINE_TEST_VALUE(engine->evaluate("new Error()")); + DEFINE_TEST_VALUE(engine->evaluate("a = new Object(); a.foo = 22; a.foo")); + DEFINE_TEST_VALUE(engine->evaluate("Undefined")); + DEFINE_TEST_VALUE(engine->evaluate("Null")); + DEFINE_TEST_VALUE(engine->evaluate("True")); + DEFINE_TEST_VALUE(engine->evaluate("False")); + DEFINE_TEST_VALUE(engine->evaluate("undefined")); + DEFINE_TEST_VALUE(engine->evaluate("null")); + DEFINE_TEST_VALUE(engine->evaluate("true")); + DEFINE_TEST_VALUE(engine->evaluate("false")); + DEFINE_TEST_VALUE(engine->evaluate("122")); + DEFINE_TEST_VALUE(engine->evaluate("124")); + DEFINE_TEST_VALUE(engine->evaluate("0")); + DEFINE_TEST_VALUE(engine->evaluate("0.0")); + DEFINE_TEST_VALUE(engine->evaluate("123.0")); + DEFINE_TEST_VALUE(engine->evaluate("6.37e-8")); + DEFINE_TEST_VALUE(engine->evaluate("-6.37e-8")); + DEFINE_TEST_VALUE(engine->evaluate("0x43211234")); + DEFINE_TEST_VALUE(engine->evaluate("0x10000")); + DEFINE_TEST_VALUE(engine->evaluate("0x10001")); + DEFINE_TEST_VALUE(engine->evaluate("NaN")); + DEFINE_TEST_VALUE(engine->evaluate("Infinity")); + DEFINE_TEST_VALUE(engine->evaluate("-Infinity")); + DEFINE_TEST_VALUE(engine->evaluate("'ciao'")); + DEFINE_TEST_VALUE(engine->evaluate("''")); + DEFINE_TEST_VALUE(engine->evaluate("'0'")); + DEFINE_TEST_VALUE(engine->evaluate("'123'")); + DEFINE_TEST_VALUE(engine->evaluate("'12.4'")); DEFINE_TEST_VALUE(engine->nullValue()); DEFINE_TEST_VALUE(engine->undefinedValue()); + DEFINE_TEST_VALUE(engine->newObject()); + DEFINE_TEST_VALUE(engine->newArray()); + DEFINE_TEST_VALUE(engine->newArray(10)); + DEFINE_TEST_VALUE(engine->newDate(QDateTime())); } @@ -269,8 +300,39 @@ void tst_QScriptValue::isValid_makeData(const char* expr) << "engine->evaluate(\"new Object()\")" << "engine->evaluate(\"new Array()\")" << "engine->evaluate(\"new Error()\")" + << "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")" + << "engine->evaluate(\"Undefined\")" + << "engine->evaluate(\"Null\")" + << "engine->evaluate(\"True\")" + << "engine->evaluate(\"False\")" + << "engine->evaluate(\"undefined\")" + << "engine->evaluate(\"null\")" + << "engine->evaluate(\"true\")" + << "engine->evaluate(\"false\")" + << "engine->evaluate(\"122\")" + << "engine->evaluate(\"124\")" + << "engine->evaluate(\"0\")" + << "engine->evaluate(\"0.0\")" + << "engine->evaluate(\"123.0\")" + << "engine->evaluate(\"6.37e-8\")" + << "engine->evaluate(\"-6.37e-8\")" + << "engine->evaluate(\"0x43211234\")" + << "engine->evaluate(\"0x10000\")" + << "engine->evaluate(\"0x10001\")" + << "engine->evaluate(\"NaN\")" + << "engine->evaluate(\"Infinity\")" + << "engine->evaluate(\"-Infinity\")" + << "engine->evaluate(\"'ciao'\")" + << "engine->evaluate(\"''\")" + << "engine->evaluate(\"'0'\")" + << "engine->evaluate(\"'123'\")" + << "engine->evaluate(\"'12.4'\")" << "engine->nullValue()" << "engine->undefinedValue()" + << "engine->newObject()" + << "engine->newArray()" + << "engine->newArray(10)" + << "engine->newDate(QDateTime())" ; } newRow(expr) << isValid.contains(expr); @@ -280,6 +342,7 @@ void tst_QScriptValue::isValid_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isValid(), expected); + QCOMPARE(value.isValid(), expected); } DEFINE_TEST_FUNCTION(isValid) @@ -301,6 +364,8 @@ void tst_QScriptValue::isBool_makeData(const char* expr) << "QScriptValue(0, false)" << "QScriptValue(engine, true)" << "QScriptValue(engine, false)" + << "engine->evaluate(\"true\")" + << "engine->evaluate(\"false\")" ; } newRow(expr) << isBool.contains(expr); @@ -310,6 +375,7 @@ void tst_QScriptValue::isBool_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isBool(), expected); + QCOMPARE(value.isBool(), expected); } DEFINE_TEST_FUNCTION(isBool) @@ -331,6 +397,8 @@ void tst_QScriptValue::isBoolean_makeData(const char* expr) << "QScriptValue(0, false)" << "QScriptValue(engine, true)" << "QScriptValue(engine, false)" + << "engine->evaluate(\"true\")" + << "engine->evaluate(\"false\")" ; } newRow(expr) << isBoolean.contains(expr); @@ -340,6 +408,7 @@ void tst_QScriptValue::isBoolean_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isBoolean(), expected); + QCOMPARE(value.isBoolean(), expected); } DEFINE_TEST_FUNCTION(isBoolean) @@ -397,6 +466,20 @@ void tst_QScriptValue::isNumber_makeData(const char* expr) << "QScriptValue(engine, qQNaN())" << "QScriptValue(engine, qInf())" << "QScriptValue(engine, -qInf())" + << "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")" + << "engine->evaluate(\"122\")" + << "engine->evaluate(\"124\")" + << "engine->evaluate(\"0\")" + << "engine->evaluate(\"0.0\")" + << "engine->evaluate(\"123.0\")" + << "engine->evaluate(\"6.37e-8\")" + << "engine->evaluate(\"-6.37e-8\")" + << "engine->evaluate(\"0x43211234\")" + << "engine->evaluate(\"0x10000\")" + << "engine->evaluate(\"0x10001\")" + << "engine->evaluate(\"NaN\")" + << "engine->evaluate(\"Infinity\")" + << "engine->evaluate(\"-Infinity\")" ; } newRow(expr) << isNumber.contains(expr); @@ -406,6 +489,7 @@ void tst_QScriptValue::isNumber_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isNumber(), expected); + QCOMPARE(value.isNumber(), expected); } DEFINE_TEST_FUNCTION(isNumber) @@ -439,6 +523,7 @@ void tst_QScriptValue::isFunction_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isFunction(), expected); + QCOMPARE(value.isFunction(), expected); } DEFINE_TEST_FUNCTION(isFunction) @@ -457,6 +542,7 @@ void tst_QScriptValue::isNull_makeData(const char* expr) isNull << "QScriptValue(QScriptValue::NullValue)" << "QScriptValue(0, QScriptValue::NullValue)" << "QScriptValue(engine, QScriptValue::NullValue)" + << "engine->evaluate(\"null\")" << "engine->nullValue()" ; } @@ -467,6 +553,7 @@ void tst_QScriptValue::isNull_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isNull(), expected); + QCOMPARE(value.isNull(), expected); } DEFINE_TEST_FUNCTION(isNull) @@ -512,6 +599,11 @@ void tst_QScriptValue::isString_makeData(const char* expr) << "QScriptValue(engine, QString(\"0\"))" << "QScriptValue(engine, QString(\"123\"))" << "QScriptValue(engine, QString(\"1.23\"))" + << "engine->evaluate(\"'ciao'\")" + << "engine->evaluate(\"''\")" + << "engine->evaluate(\"'0'\")" + << "engine->evaluate(\"'123'\")" + << "engine->evaluate(\"'12.4'\")" ; } newRow(expr) << isString.contains(expr); @@ -521,6 +613,7 @@ void tst_QScriptValue::isString_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isString(), expected); + QCOMPARE(value.isString(), expected); } DEFINE_TEST_FUNCTION(isString) @@ -540,6 +633,7 @@ void tst_QScriptValue::isUndefined_makeData(const char* expr) << "QScriptValue(0, QScriptValue::UndefinedValue)" << "QScriptValue(engine, QScriptValue::UndefinedValue)" << "engine->evaluate(\"{}\")" + << "engine->evaluate(\"undefined\")" << "engine->undefinedValue()" ; } @@ -550,6 +644,7 @@ void tst_QScriptValue::isUndefined_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isUndefined(), expected); + QCOMPARE(value.isUndefined(), expected); } DEFINE_TEST_FUNCTION(isUndefined) @@ -585,6 +680,14 @@ void tst_QScriptValue::isObject_makeData(const char* expr) << "engine->evaluate(\"new Object()\")" << "engine->evaluate(\"new Array()\")" << "engine->evaluate(\"new Error()\")" + << "engine->evaluate(\"Undefined\")" + << "engine->evaluate(\"Null\")" + << "engine->evaluate(\"True\")" + << "engine->evaluate(\"False\")" + << "engine->newObject()" + << "engine->newArray()" + << "engine->newArray(10)" + << "engine->newDate(QDateTime())" ; } newRow(expr) << isObject.contains(expr); @@ -594,6 +697,7 @@ void tst_QScriptValue::isObject_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isObject(), expected); + QCOMPARE(value.isObject(), expected); } DEFINE_TEST_FUNCTION(isObject) @@ -610,6 +714,7 @@ void tst_QScriptValue::isDate_makeData(const char* expr) static QSet isDate; if (isDate.isEmpty()) { isDate << "engine->evaluate(\"Date.prototype\")" + << "engine->newDate(QDateTime())" ; } newRow(expr) << isDate.contains(expr); @@ -619,6 +724,7 @@ void tst_QScriptValue::isDate_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isDate(), expected); + QCOMPARE(value.isDate(), expected); } DEFINE_TEST_FUNCTION(isDate) @@ -644,6 +750,7 @@ void tst_QScriptValue::isRegExp_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isRegExp(), expected); + QCOMPARE(value.isRegExp(), expected); } DEFINE_TEST_FUNCTION(isRegExp) @@ -662,6 +769,8 @@ void tst_QScriptValue::isArray_makeData(const char* expr) isArray << "engine->evaluate(\"[]\")" << "engine->evaluate(\"Array.prototype\")" << "engine->evaluate(\"new Array()\")" + << "engine->newArray()" + << "engine->newArray(10)" ; } newRow(expr) << isArray.contains(expr); @@ -671,6 +780,7 @@ void tst_QScriptValue::isArray_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isArray(), expected); + QCOMPARE(value.isArray(), expected); } DEFINE_TEST_FUNCTION(isArray) @@ -688,6 +798,10 @@ void tst_QScriptValue::isError_makeData(const char* expr) if (isError.isEmpty()) { isError << "engine->evaluate(\"Error.prototype\")" << "engine->evaluate(\"new Error()\")" + << "engine->evaluate(\"Undefined\")" + << "engine->evaluate(\"Null\")" + << "engine->evaluate(\"True\")" + << "engine->evaluate(\"False\")" ; } newRow(expr) << isError.contains(expr); @@ -697,6 +811,7 @@ void tst_QScriptValue::isError_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.isError(), expected); + QCOMPARE(value.isError(), expected); } DEFINE_TEST_FUNCTION(isError) @@ -816,8 +931,39 @@ void tst_QScriptValue::toString_makeData(const char* expr) toString.insert("engine->evaluate(\"new Object()\")", "[object Object]"); toString.insert("engine->evaluate(\"new Array()\")", ""); toString.insert("engine->evaluate(\"new Error()\")", "Error: Unknown error"); + toString.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", "22"); + toString.insert("engine->evaluate(\"Undefined\")", "ReferenceError: Can't find variable: Undefined"); + toString.insert("engine->evaluate(\"Null\")", "ReferenceError: Can't find variable: Null"); + toString.insert("engine->evaluate(\"True\")", "ReferenceError: Can't find variable: True"); + toString.insert("engine->evaluate(\"False\")", "ReferenceError: Can't find variable: False"); + toString.insert("engine->evaluate(\"undefined\")", "undefined"); + toString.insert("engine->evaluate(\"null\")", "null"); + toString.insert("engine->evaluate(\"true\")", "true"); + toString.insert("engine->evaluate(\"false\")", "false"); + toString.insert("engine->evaluate(\"122\")", "122"); + toString.insert("engine->evaluate(\"124\")", "124"); + toString.insert("engine->evaluate(\"0\")", "0"); + toString.insert("engine->evaluate(\"0.0\")", "0"); + toString.insert("engine->evaluate(\"123.0\")", "123"); + toString.insert("engine->evaluate(\"6.37e-8\")", "6.37e-8"); + toString.insert("engine->evaluate(\"-6.37e-8\")", "-6.37e-8"); + toString.insert("engine->evaluate(\"0x43211234\")", "1126240820"); + toString.insert("engine->evaluate(\"0x10000\")", "65536"); + toString.insert("engine->evaluate(\"0x10001\")", "65537"); + toString.insert("engine->evaluate(\"NaN\")", "NaN"); + toString.insert("engine->evaluate(\"Infinity\")", "Infinity"); + toString.insert("engine->evaluate(\"-Infinity\")", "-Infinity"); + toString.insert("engine->evaluate(\"'ciao'\")", "ciao"); + toString.insert("engine->evaluate(\"''\")", ""); + toString.insert("engine->evaluate(\"'0'\")", "0"); + toString.insert("engine->evaluate(\"'123'\")", "123"); + toString.insert("engine->evaluate(\"'12.4'\")", "12.4"); toString.insert("engine->nullValue()", "null"); toString.insert("engine->undefinedValue()", "undefined"); + toString.insert("engine->newObject()", "[object Object]"); + toString.insert("engine->newArray()", ""); + toString.insert("engine->newArray(10)", ",,,,,,,,,"); + toString.insert("engine->newDate(QDateTime())", "Invalid Date"); } newRow(expr) << toString.value(expr); } @@ -826,6 +972,7 @@ void tst_QScriptValue::toString_test(const char*, const QScriptValue& value) { QFETCH(QString, expected); QCOMPARE(value.toString(), expected); + QCOMPARE(value.toString(), expected); } DEFINE_TEST_FUNCTION(toString) @@ -944,8 +1091,39 @@ void tst_QScriptValue::toNumber_makeData(const char* expr) toNumber.insert("engine->evaluate(\"new Object()\")", qQNaN()); toNumber.insert("engine->evaluate(\"new Array()\")", 0); toNumber.insert("engine->evaluate(\"new Error()\")", qQNaN()); + toNumber.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + toNumber.insert("engine->evaluate(\"Undefined\")", qQNaN()); + toNumber.insert("engine->evaluate(\"Null\")", qQNaN()); + toNumber.insert("engine->evaluate(\"True\")", qQNaN()); + toNumber.insert("engine->evaluate(\"False\")", qQNaN()); + toNumber.insert("engine->evaluate(\"undefined\")", qQNaN()); + toNumber.insert("engine->evaluate(\"null\")", 0); + toNumber.insert("engine->evaluate(\"true\")", 1); + toNumber.insert("engine->evaluate(\"false\")", 0); + toNumber.insert("engine->evaluate(\"122\")", 122); + toNumber.insert("engine->evaluate(\"124\")", 124); + toNumber.insert("engine->evaluate(\"0\")", 0); + toNumber.insert("engine->evaluate(\"0.0\")", 0); + toNumber.insert("engine->evaluate(\"123.0\")", 123); + toNumber.insert("engine->evaluate(\"6.37e-8\")", 6.369999999999999e-08); + toNumber.insert("engine->evaluate(\"-6.37e-8\")", -6.369999999999999e-08); + toNumber.insert("engine->evaluate(\"0x43211234\")", 1126240820); + toNumber.insert("engine->evaluate(\"0x10000\")", 65536); + toNumber.insert("engine->evaluate(\"0x10001\")", 65537); + toNumber.insert("engine->evaluate(\"NaN\")", qQNaN()); + toNumber.insert("engine->evaluate(\"Infinity\")", qInf()); + toNumber.insert("engine->evaluate(\"-Infinity\")", qInf()); + toNumber.insert("engine->evaluate(\"'ciao'\")", qQNaN()); + toNumber.insert("engine->evaluate(\"''\")", 0); + toNumber.insert("engine->evaluate(\"'0'\")", 0); + toNumber.insert("engine->evaluate(\"'123'\")", 123); + toNumber.insert("engine->evaluate(\"'12.4'\")", 12.4); toNumber.insert("engine->nullValue()", 0); toNumber.insert("engine->undefinedValue()", qQNaN()); + toNumber.insert("engine->newObject()", qQNaN()); + toNumber.insert("engine->newArray()", 0); + toNumber.insert("engine->newArray(10)", qQNaN()); + toNumber.insert("engine->newDate(QDateTime())", qQNaN()); } newRow(expr) << toNumber.value(expr); } @@ -959,9 +1137,11 @@ void tst_QScriptValue::toNumber_test(const char*, const QScriptValue& value) } if (qIsInf(expected)) { QVERIFY(qIsInf(value.toNumber())); + QVERIFY(qIsInf(value.toNumber())); return; } QCOMPARE(value.toNumber(), expected); + QCOMPARE(value.toNumber(), expected); } DEFINE_TEST_FUNCTION(toNumber) @@ -1080,8 +1260,39 @@ void tst_QScriptValue::toBool_makeData(const char* expr) toBool.insert("engine->evaluate(\"new Object()\")", true); toBool.insert("engine->evaluate(\"new Array()\")", true); toBool.insert("engine->evaluate(\"new Error()\")", true); + toBool.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", true); + toBool.insert("engine->evaluate(\"Undefined\")", true); + toBool.insert("engine->evaluate(\"Null\")", true); + toBool.insert("engine->evaluate(\"True\")", true); + toBool.insert("engine->evaluate(\"False\")", true); + toBool.insert("engine->evaluate(\"undefined\")", false); + toBool.insert("engine->evaluate(\"null\")", false); + toBool.insert("engine->evaluate(\"true\")", true); + toBool.insert("engine->evaluate(\"false\")", false); + toBool.insert("engine->evaluate(\"122\")", true); + toBool.insert("engine->evaluate(\"124\")", true); + toBool.insert("engine->evaluate(\"0\")", false); + toBool.insert("engine->evaluate(\"0.0\")", false); + toBool.insert("engine->evaluate(\"123.0\")", true); + toBool.insert("engine->evaluate(\"6.37e-8\")", true); + toBool.insert("engine->evaluate(\"-6.37e-8\")", true); + toBool.insert("engine->evaluate(\"0x43211234\")", true); + toBool.insert("engine->evaluate(\"0x10000\")", true); + toBool.insert("engine->evaluate(\"0x10001\")", true); + toBool.insert("engine->evaluate(\"NaN\")", false); + toBool.insert("engine->evaluate(\"Infinity\")", true); + toBool.insert("engine->evaluate(\"-Infinity\")", true); + toBool.insert("engine->evaluate(\"'ciao'\")", true); + toBool.insert("engine->evaluate(\"''\")", false); + toBool.insert("engine->evaluate(\"'0'\")", true); + toBool.insert("engine->evaluate(\"'123'\")", true); + toBool.insert("engine->evaluate(\"'12.4'\")", true); toBool.insert("engine->nullValue()", false); toBool.insert("engine->undefinedValue()", false); + toBool.insert("engine->newObject()", true); + toBool.insert("engine->newArray()", true); + toBool.insert("engine->newArray(10)", true); + toBool.insert("engine->newDate(QDateTime())", true); } newRow(expr) << toBool.value(expr); } @@ -1090,6 +1301,7 @@ void tst_QScriptValue::toBool_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.toBool(), expected); + QCOMPARE(value.toBool(), expected); } DEFINE_TEST_FUNCTION(toBool) @@ -1208,8 +1420,39 @@ void tst_QScriptValue::toBoolean_makeData(const char* expr) toBoolean.insert("engine->evaluate(\"new Object()\")", true); toBoolean.insert("engine->evaluate(\"new Array()\")", true); toBoolean.insert("engine->evaluate(\"new Error()\")", true); + toBoolean.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", true); + toBoolean.insert("engine->evaluate(\"Undefined\")", true); + toBoolean.insert("engine->evaluate(\"Null\")", true); + toBoolean.insert("engine->evaluate(\"True\")", true); + toBoolean.insert("engine->evaluate(\"False\")", true); + toBoolean.insert("engine->evaluate(\"undefined\")", false); + toBoolean.insert("engine->evaluate(\"null\")", false); + toBoolean.insert("engine->evaluate(\"true\")", true); + toBoolean.insert("engine->evaluate(\"false\")", false); + toBoolean.insert("engine->evaluate(\"122\")", true); + toBoolean.insert("engine->evaluate(\"124\")", true); + toBoolean.insert("engine->evaluate(\"0\")", false); + toBoolean.insert("engine->evaluate(\"0.0\")", false); + toBoolean.insert("engine->evaluate(\"123.0\")", true); + toBoolean.insert("engine->evaluate(\"6.37e-8\")", true); + toBoolean.insert("engine->evaluate(\"-6.37e-8\")", true); + toBoolean.insert("engine->evaluate(\"0x43211234\")", true); + toBoolean.insert("engine->evaluate(\"0x10000\")", true); + toBoolean.insert("engine->evaluate(\"0x10001\")", true); + toBoolean.insert("engine->evaluate(\"NaN\")", false); + toBoolean.insert("engine->evaluate(\"Infinity\")", true); + toBoolean.insert("engine->evaluate(\"-Infinity\")", true); + toBoolean.insert("engine->evaluate(\"'ciao'\")", true); + toBoolean.insert("engine->evaluate(\"''\")", false); + toBoolean.insert("engine->evaluate(\"'0'\")", true); + toBoolean.insert("engine->evaluate(\"'123'\")", true); + toBoolean.insert("engine->evaluate(\"'12.4'\")", true); toBoolean.insert("engine->nullValue()", false); toBoolean.insert("engine->undefinedValue()", false); + toBoolean.insert("engine->newObject()", true); + toBoolean.insert("engine->newArray()", true); + toBoolean.insert("engine->newArray(10)", true); + toBoolean.insert("engine->newDate(QDateTime())", true); } newRow(expr) << toBoolean.value(expr); } @@ -1218,6 +1461,7 @@ void tst_QScriptValue::toBoolean_test(const char*, const QScriptValue& value) { QFETCH(bool, expected); QCOMPARE(value.toBoolean(), expected); + QCOMPARE(value.toBoolean(), expected); } DEFINE_TEST_FUNCTION(toBoolean) @@ -1336,8 +1580,39 @@ void tst_QScriptValue::toInteger_makeData(const char* expr) toInteger.insert("engine->evaluate(\"new Object()\")", 0); toInteger.insert("engine->evaluate(\"new Array()\")", 0); toInteger.insert("engine->evaluate(\"new Error()\")", 0); + toInteger.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + toInteger.insert("engine->evaluate(\"Undefined\")", 0); + toInteger.insert("engine->evaluate(\"Null\")", 0); + toInteger.insert("engine->evaluate(\"True\")", 0); + toInteger.insert("engine->evaluate(\"False\")", 0); + toInteger.insert("engine->evaluate(\"undefined\")", 0); + toInteger.insert("engine->evaluate(\"null\")", 0); + toInteger.insert("engine->evaluate(\"true\")", 1); + toInteger.insert("engine->evaluate(\"false\")", 0); + toInteger.insert("engine->evaluate(\"122\")", 122); + toInteger.insert("engine->evaluate(\"124\")", 124); + toInteger.insert("engine->evaluate(\"0\")", 0); + toInteger.insert("engine->evaluate(\"0.0\")", 0); + toInteger.insert("engine->evaluate(\"123.0\")", 123); + toInteger.insert("engine->evaluate(\"6.37e-8\")", 0); + toInteger.insert("engine->evaluate(\"-6.37e-8\")", 0); + toInteger.insert("engine->evaluate(\"0x43211234\")", 1126240820); + toInteger.insert("engine->evaluate(\"0x10000\")", 65536); + toInteger.insert("engine->evaluate(\"0x10001\")", 65537); + toInteger.insert("engine->evaluate(\"NaN\")", 0); + toInteger.insert("engine->evaluate(\"Infinity\")", qInf()); + toInteger.insert("engine->evaluate(\"-Infinity\")", qInf()); + toInteger.insert("engine->evaluate(\"'ciao'\")", 0); + toInteger.insert("engine->evaluate(\"''\")", 0); + toInteger.insert("engine->evaluate(\"'0'\")", 0); + toInteger.insert("engine->evaluate(\"'123'\")", 123); + toInteger.insert("engine->evaluate(\"'12.4'\")", 12); toInteger.insert("engine->nullValue()", 0); toInteger.insert("engine->undefinedValue()", 0); + toInteger.insert("engine->newObject()", 0); + toInteger.insert("engine->newArray()", 0); + toInteger.insert("engine->newArray(10)", 0); + toInteger.insert("engine->newDate(QDateTime())", 0); } newRow(expr) << toInteger.value(expr); } @@ -1347,9 +1622,11 @@ void tst_QScriptValue::toInteger_test(const char*, const QScriptValue& value) QFETCH(qsreal, expected); if (qIsInf(expected)) { QVERIFY(qIsInf(value.toInteger())); + QVERIFY(qIsInf(value.toInteger())); return; } QCOMPARE(value.toInteger(), expected); + QCOMPARE(value.toInteger(), expected); } DEFINE_TEST_FUNCTION(toInteger) @@ -1468,8 +1745,39 @@ void tst_QScriptValue::toInt32_makeData(const char* expr) toInt32.insert("engine->evaluate(\"new Object()\")", 0); toInt32.insert("engine->evaluate(\"new Array()\")", 0); toInt32.insert("engine->evaluate(\"new Error()\")", 0); + toInt32.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + toInt32.insert("engine->evaluate(\"Undefined\")", 0); + toInt32.insert("engine->evaluate(\"Null\")", 0); + toInt32.insert("engine->evaluate(\"True\")", 0); + toInt32.insert("engine->evaluate(\"False\")", 0); + toInt32.insert("engine->evaluate(\"undefined\")", 0); + toInt32.insert("engine->evaluate(\"null\")", 0); + toInt32.insert("engine->evaluate(\"true\")", 1); + toInt32.insert("engine->evaluate(\"false\")", 0); + toInt32.insert("engine->evaluate(\"122\")", 122); + toInt32.insert("engine->evaluate(\"124\")", 124); + toInt32.insert("engine->evaluate(\"0\")", 0); + toInt32.insert("engine->evaluate(\"0.0\")", 0); + toInt32.insert("engine->evaluate(\"123.0\")", 123); + toInt32.insert("engine->evaluate(\"6.37e-8\")", 0); + toInt32.insert("engine->evaluate(\"-6.37e-8\")", 0); + toInt32.insert("engine->evaluate(\"0x43211234\")", 1126240820); + toInt32.insert("engine->evaluate(\"0x10000\")", 65536); + toInt32.insert("engine->evaluate(\"0x10001\")", 65537); + toInt32.insert("engine->evaluate(\"NaN\")", 0); + toInt32.insert("engine->evaluate(\"Infinity\")", 0); + toInt32.insert("engine->evaluate(\"-Infinity\")", 0); + toInt32.insert("engine->evaluate(\"'ciao'\")", 0); + toInt32.insert("engine->evaluate(\"''\")", 0); + toInt32.insert("engine->evaluate(\"'0'\")", 0); + toInt32.insert("engine->evaluate(\"'123'\")", 123); + toInt32.insert("engine->evaluate(\"'12.4'\")", 12); toInt32.insert("engine->nullValue()", 0); toInt32.insert("engine->undefinedValue()", 0); + toInt32.insert("engine->newObject()", 0); + toInt32.insert("engine->newArray()", 0); + toInt32.insert("engine->newArray(10)", 0); + toInt32.insert("engine->newDate(QDateTime())", 0); } newRow(expr) << toInt32.value(expr); } @@ -1478,6 +1786,7 @@ void tst_QScriptValue::toInt32_test(const char*, const QScriptValue& value) { QFETCH(qint32, expected); QCOMPARE(value.toInt32(), expected); + QCOMPARE(value.toInt32(), expected); } DEFINE_TEST_FUNCTION(toInt32) @@ -1596,8 +1905,39 @@ void tst_QScriptValue::toUInt32_makeData(const char* expr) toUInt32.insert("engine->evaluate(\"new Object()\")", 0); toUInt32.insert("engine->evaluate(\"new Array()\")", 0); toUInt32.insert("engine->evaluate(\"new Error()\")", 0); + toUInt32.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + toUInt32.insert("engine->evaluate(\"Undefined\")", 0); + toUInt32.insert("engine->evaluate(\"Null\")", 0); + toUInt32.insert("engine->evaluate(\"True\")", 0); + toUInt32.insert("engine->evaluate(\"False\")", 0); + toUInt32.insert("engine->evaluate(\"undefined\")", 0); + toUInt32.insert("engine->evaluate(\"null\")", 0); + toUInt32.insert("engine->evaluate(\"true\")", 1); + toUInt32.insert("engine->evaluate(\"false\")", 0); + toUInt32.insert("engine->evaluate(\"122\")", 122); + toUInt32.insert("engine->evaluate(\"124\")", 124); + toUInt32.insert("engine->evaluate(\"0\")", 0); + toUInt32.insert("engine->evaluate(\"0.0\")", 0); + toUInt32.insert("engine->evaluate(\"123.0\")", 123); + toUInt32.insert("engine->evaluate(\"6.37e-8\")", 0); + toUInt32.insert("engine->evaluate(\"-6.37e-8\")", 0); + toUInt32.insert("engine->evaluate(\"0x43211234\")", 1126240820); + toUInt32.insert("engine->evaluate(\"0x10000\")", 65536); + toUInt32.insert("engine->evaluate(\"0x10001\")", 65537); + toUInt32.insert("engine->evaluate(\"NaN\")", 0); + toUInt32.insert("engine->evaluate(\"Infinity\")", 0); + toUInt32.insert("engine->evaluate(\"-Infinity\")", 0); + toUInt32.insert("engine->evaluate(\"'ciao'\")", 0); + toUInt32.insert("engine->evaluate(\"''\")", 0); + toUInt32.insert("engine->evaluate(\"'0'\")", 0); + toUInt32.insert("engine->evaluate(\"'123'\")", 123); + toUInt32.insert("engine->evaluate(\"'12.4'\")", 12); toUInt32.insert("engine->nullValue()", 0); toUInt32.insert("engine->undefinedValue()", 0); + toUInt32.insert("engine->newObject()", 0); + toUInt32.insert("engine->newArray()", 0); + toUInt32.insert("engine->newArray(10)", 0); + toUInt32.insert("engine->newDate(QDateTime())", 0); } newRow(expr) << toUInt32.value(expr); } @@ -1606,6 +1946,7 @@ void tst_QScriptValue::toUInt32_test(const char*, const QScriptValue& value) { QFETCH(quint32, expected); QCOMPARE(value.toUInt32(), expected); + QCOMPARE(value.toUInt32(), expected); } DEFINE_TEST_FUNCTION(toUInt32) @@ -1724,8 +2065,39 @@ void tst_QScriptValue::toUInt16_makeData(const char* expr) toUInt16.insert("engine->evaluate(\"new Object()\")", 0); toUInt16.insert("engine->evaluate(\"new Array()\")", 0); toUInt16.insert("engine->evaluate(\"new Error()\")", 0); + toUInt16.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + toUInt16.insert("engine->evaluate(\"Undefined\")", 0); + toUInt16.insert("engine->evaluate(\"Null\")", 0); + toUInt16.insert("engine->evaluate(\"True\")", 0); + toUInt16.insert("engine->evaluate(\"False\")", 0); + toUInt16.insert("engine->evaluate(\"undefined\")", 0); + toUInt16.insert("engine->evaluate(\"null\")", 0); + toUInt16.insert("engine->evaluate(\"true\")", 1); + toUInt16.insert("engine->evaluate(\"false\")", 0); + toUInt16.insert("engine->evaluate(\"122\")", 122); + toUInt16.insert("engine->evaluate(\"124\")", 124); + toUInt16.insert("engine->evaluate(\"0\")", 0); + toUInt16.insert("engine->evaluate(\"0.0\")", 0); + toUInt16.insert("engine->evaluate(\"123.0\")", 123); + toUInt16.insert("engine->evaluate(\"6.37e-8\")", 0); + toUInt16.insert("engine->evaluate(\"-6.37e-8\")", 0); + toUInt16.insert("engine->evaluate(\"0x43211234\")", 4660); + toUInt16.insert("engine->evaluate(\"0x10000\")", 0); + toUInt16.insert("engine->evaluate(\"0x10001\")", 1); + toUInt16.insert("engine->evaluate(\"NaN\")", 0); + toUInt16.insert("engine->evaluate(\"Infinity\")", 0); + toUInt16.insert("engine->evaluate(\"-Infinity\")", 0); + toUInt16.insert("engine->evaluate(\"'ciao'\")", 0); + toUInt16.insert("engine->evaluate(\"''\")", 0); + toUInt16.insert("engine->evaluate(\"'0'\")", 0); + toUInt16.insert("engine->evaluate(\"'123'\")", 123); + toUInt16.insert("engine->evaluate(\"'12.4'\")", 12); toUInt16.insert("engine->nullValue()", 0); toUInt16.insert("engine->undefinedValue()", 0); + toUInt16.insert("engine->newObject()", 0); + toUInt16.insert("engine->newArray()", 0); + toUInt16.insert("engine->newArray(10)", 0); + toUInt16.insert("engine->newDate(QDateTime())", 0); } newRow(expr) << toUInt16.value(expr); } @@ -1734,6 +2106,7 @@ void tst_QScriptValue::toUInt16_test(const char*, const QScriptValue& value) { QFETCH(quint16, expected); QCOMPARE(value.toUInt16(), expected); + QCOMPARE(value.toUInt16(), expected); } DEFINE_TEST_FUNCTION(toUInt16) @@ -1758,6 +2131,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"undefined\")"); + equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->nullValue()"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); @@ -1767,11 +2142,14 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"undefined\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(true) <=> QScriptValue(true)"); equals.insert("QScriptValue(true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(true) <=> QScriptValue(engine, true)"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"true\")"); equals.insert("QScriptValue(false) <=> QScriptValue(false)"); equals.insert("QScriptValue(false) <=> QScriptValue(0)"); equals.insert("QScriptValue(false) <=> QScriptValue(0.0)"); @@ -1793,12 +2171,20 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(false) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(false) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(false) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(false) <=> engine->newArray()"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(0, int(122))"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(engine, int(122))"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"122\")"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(0, uint(124))"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(engine, uint(124))"); + equals.insert("QScriptValue(uint(124)) <=> engine->evaluate(\"124\")"); equals.insert("QScriptValue(0) <=> QScriptValue(false)"); equals.insert("QScriptValue(0) <=> QScriptValue(0)"); equals.insert("QScriptValue(0) <=> QScriptValue(0.0)"); @@ -1820,6 +2206,12 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0) <=> engine->newArray()"); equals.insert("QScriptValue(0.0) <=> QScriptValue(false)"); equals.insert("QScriptValue(0.0) <=> QScriptValue(0)"); equals.insert("QScriptValue(0.0) <=> QScriptValue(0.0)"); @@ -1841,39 +2233,54 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0.0) <=> engine->newArray()"); equals.insert("QScriptValue(123.0) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(123.0) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(123.0) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(123.0) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(123.0) <=> QScriptValue(engine, 123.0)"); equals.insert("QScriptValue(123.0) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(123.0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(123.0) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(6.37e-8)"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(0, 6.37e-8)"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(-6.37e-8)"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(0, -6.37e-8)"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"-6.37e-8\")"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(0, 0x43211234)"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(engine, 0x43211234)"); + equals.insert("QScriptValue(0x43211234) <=> engine->evaluate(\"0x43211234\")"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(0, 0x10000)"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(engine, 0x10000)"); + equals.insert("QScriptValue(0x10000) <=> engine->evaluate(\"0x10000\")"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(0, 0x10001)"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(engine, 0x10001)"); + equals.insert("QScriptValue(0x10001) <=> engine->evaluate(\"0x10001\")"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(qInf()) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(\"-Infinity\")"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(0, \"-Infinity\")"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(engine, -qInf())"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(0, \"NaN\")"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(engine, \"NaN\")"); @@ -1883,24 +2290,28 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(\"Infinity\") <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(\"Infinity\") <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(\"Infinity\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(\"-Infinity\")"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(0, \"-Infinity\")"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(engine, -qInf())"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(\"ciao\") <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(false)"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(0)"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(0.0)"); @@ -1919,6 +2330,11 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->newArray()"); equals.insert("QScriptValue(QString()) <=> QScriptValue(false)"); equals.insert("QScriptValue(QString()) <=> QScriptValue(0)"); equals.insert("QScriptValue(QString()) <=> QScriptValue(0.0)"); @@ -1937,6 +2353,11 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(QString()) <=> engine->newArray()"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(false)"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(0)"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(0.0)"); @@ -1949,13 +2370,20 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(engine, 0.0)"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"'0'\")"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(engine, 123.0)"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(QString(\"12.4\")) <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); @@ -1963,6 +2391,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"undefined\")"); + equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->nullValue()"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); @@ -1972,11 +2402,14 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"undefined\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(0, true) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(0, true) <=> QScriptValue(engine, true)"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"true\")"); equals.insert("QScriptValue(0, false) <=> QScriptValue(false)"); equals.insert("QScriptValue(0, false) <=> QScriptValue(0)"); equals.insert("QScriptValue(0, false) <=> QScriptValue(0.0)"); @@ -1998,12 +2431,20 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0, false) <=> engine->newArray()"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(0, int(122))"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(engine, int(122))"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"122\")"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(0, uint(124))"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(engine, uint(124))"); + equals.insert("QScriptValue(0, uint(124)) <=> engine->evaluate(\"124\")"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(false)"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(0)"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(0.0)"); @@ -2025,6 +2466,12 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0, 0) <=> engine->newArray()"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(false)"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(0)"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(0.0)"); @@ -2046,39 +2493,54 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->newArray()"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(engine, 123.0)"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(0, 123.0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, 123.0) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(6.37e-8)"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(0, 6.37e-8)"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(-6.37e-8)"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(0, -6.37e-8)"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"-6.37e-8\")"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(0, 0x43211234)"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(engine, 0x43211234)"); + equals.insert("QScriptValue(0, 0x43211234) <=> engine->evaluate(\"0x43211234\")"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(0, 0x10000)"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(engine, 0x10000)"); + equals.insert("QScriptValue(0, 0x10000) <=> engine->evaluate(\"0x10000\")"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(0, 0x10001)"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(engine, 0x10001)"); + equals.insert("QScriptValue(0, 0x10001) <=> engine->evaluate(\"0x10001\")"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0, qInf()) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(\"-Infinity\")"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(0, \"-Infinity\")"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(engine, -qInf())"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(0, \"NaN\")"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(engine, \"NaN\")"); @@ -2088,24 +2550,28 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, \"Infinity\") <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(0, \"Infinity\") <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0, \"Infinity\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(\"-Infinity\")"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(0, \"-Infinity\")"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(engine, -qInf())"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(0, \"ciao\") <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(false)"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(0)"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(0.0)"); @@ -2124,6 +2590,11 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->newArray()"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(false)"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(0)"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(0.0)"); @@ -2142,6 +2613,11 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->newArray()"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(false)"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(0)"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(0.0)"); @@ -2154,12 +2630,18 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(engine, 0.0)"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"'0'\")"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(engine, 123.0)"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(0, QString(\"12.3\")) <=> QScriptValue(0, QString(\"12.3\"))"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::NullValue)"); @@ -2168,6 +2650,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->evaluate(\"undefined\")"); + equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->nullValue()"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); @@ -2177,11 +2661,14 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"undefined\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(engine, true)"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"true\")"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(false)"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(0)"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(0.0)"); @@ -2203,12 +2690,20 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(engine, false) <=> engine->newArray()"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(0, int(122))"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(engine, int(122))"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"122\")"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(0, uint(124))"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(engine, uint(124))"); + equals.insert("QScriptValue(engine, uint(124)) <=> engine->evaluate(\"124\")"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(false)"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(0)"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(0.0)"); @@ -2230,6 +2725,12 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->newArray()"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(false)"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(0)"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(0.0)"); @@ -2251,39 +2752,54 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->newArray()"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(engine, 123.0)"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(engine, 123.0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, 123.0) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(6.37e-8)"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(0, 6.37e-8)"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(-6.37e-8)"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(0, -6.37e-8)"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"-6.37e-8\")"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(0, 0x43211234)"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(engine, 0x43211234)"); + equals.insert("QScriptValue(engine, 0x43211234) <=> engine->evaluate(\"0x43211234\")"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(0, 0x10000)"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(engine, 0x10000)"); + equals.insert("QScriptValue(engine, 0x10000) <=> engine->evaluate(\"0x10000\")"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(0, 0x10001)"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(engine, 0x10001)"); + equals.insert("QScriptValue(engine, 0x10001) <=> engine->evaluate(\"0x10001\")"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(engine, qInf()) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(\"-Infinity\")"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(0, \"-Infinity\")"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(engine, -qInf())"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(0, \"NaN\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(engine, \"NaN\")"); @@ -2293,24 +2809,28 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, \"Infinity\") <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(engine, \"Infinity\") <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(engine, \"Infinity\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(\"-Infinity\")"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(0, \"-Infinity\")"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(engine, -qInf())"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(false)"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(0)"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(0.0)"); @@ -2329,6 +2849,11 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->newArray()"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(false)"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(0)"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(0.0)"); @@ -2347,6 +2872,11 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->newArray()"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(false)"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(0)"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(0.0)"); @@ -2359,12 +2889,18 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(engine, 0.0)"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"'0'\")"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(engine, 123.0)"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> QScriptValue(engine, QString(\"1.23\"))"); equals.insert("engine->evaluate(\"[]\") <=> QScriptValue(false)"); equals.insert("engine->evaluate(\"[]\") <=> QScriptValue(0)"); @@ -2382,6 +2918,10 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("engine->evaluate(\"[]\") <=> QScriptValue(engine, QString(\"\"))"); equals.insert("engine->evaluate(\"[]\") <=> QScriptValue(engine, QString())"); equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"[]\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"''\")"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(0, QScriptValue::UndefinedValue)"); @@ -2389,6 +2929,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("engine->evaluate(\"{}\") <=> engine->evaluate(\"{}\")"); + equals.insert("engine->evaluate(\"{}\") <=> engine->evaluate(\"undefined\")"); + equals.insert("engine->evaluate(\"{}\") <=> engine->evaluate(\"null\")"); equals.insert("engine->evaluate(\"{}\") <=> engine->nullValue()"); equals.insert("engine->evaluate(\"{}\") <=> engine->undefinedValue()"); equals.insert("engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"Object.prototype\")"); @@ -2409,6 +2951,10 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("engine->evaluate(\"Array.prototype\") <=> QScriptValue(engine, QString(\"\"))"); equals.insert("engine->evaluate(\"Array.prototype\") <=> QScriptValue(engine, QString())"); equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"Array.prototype\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"''\")"); equals.insert("engine->evaluate(\"Function.prototype\") <=> engine->evaluate(\"Function.prototype\")"); equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"Error.prototype\")"); equals.insert("engine->evaluate(\"Object\") <=> engine->evaluate(\"Object\")"); @@ -2436,7 +2982,229 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("engine->evaluate(\"new Array()\") <=> QScriptValue(engine, QString(\"\"))"); equals.insert("engine->evaluate(\"new Array()\") <=> QScriptValue(engine, QString())"); equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Array()\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"''\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(0, QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(0, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> engine->evaluate(\"{}\")"); + equals.insert("engine->evaluate(\"undefined\") <=> engine->evaluate(\"undefined\")"); + equals.insert("engine->evaluate(\"undefined\") <=> engine->evaluate(\"null\")"); + equals.insert("engine->evaluate(\"undefined\") <=> engine->nullValue()"); + equals.insert("engine->evaluate(\"undefined\") <=> engine->undefinedValue()"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"{}\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"undefined\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"null\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->nullValue()"); + equals.insert("engine->evaluate(\"null\") <=> engine->undefinedValue()"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(false)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(QString(\"\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(QString())"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, false)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, QString(\"\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, QString())"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, false)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, QString(\"\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, QString())"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"[]\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"Array.prototype\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"new Array()\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"''\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->newArray()"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"124\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(false)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(QString(\"\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(QString())"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, false)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, QString(\"\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, QString())"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, false)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, QString(\"\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, QString())"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"[]\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"Array.prototype\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"new Array()\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"''\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->newArray()"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(false)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(QString(\"\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(QString())"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, false)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, QString(\"\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, QString())"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, false)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, QString(\"\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, QString())"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"[]\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"Array.prototype\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"new Array()\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"''\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->newArray()"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"123.0\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"123.0\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(-6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, -6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"0x43211234\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"0x10000\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"0x10001\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"Infinity\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(-qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(\"-Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, -qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, \"-Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, -qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"-Infinity\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(false)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(QString(\"\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(QString())"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, false)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, QString(\"\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, QString())"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, false)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, QString(\"\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, QString())"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"[]\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Array.prototype\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"new Array()\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"''\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->newArray()"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(false)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, false)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, false)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"'12.4'\")"); equals.insert("engine->nullValue() <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("engine->nullValue() <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("engine->nullValue() <=> QScriptValue(0, QScriptValue::UndefinedValue)"); @@ -2444,6 +3212,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("engine->nullValue() <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("engine->nullValue() <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("engine->nullValue() <=> engine->evaluate(\"{}\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"undefined\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"null\")"); equals.insert("engine->nullValue() <=> engine->nullValue()"); equals.insert("engine->nullValue() <=> engine->undefinedValue()"); equals.insert("engine->undefinedValue() <=> QScriptValue(QScriptValue::UndefinedValue)"); @@ -2453,8 +3223,33 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("engine->undefinedValue() <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("engine->undefinedValue() <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("engine->undefinedValue() <=> engine->evaluate(\"{}\")"); + equals.insert("engine->undefinedValue() <=> engine->evaluate(\"undefined\")"); + equals.insert("engine->undefinedValue() <=> engine->evaluate(\"null\")"); equals.insert("engine->undefinedValue() <=> engine->nullValue()"); equals.insert("engine->undefinedValue() <=> engine->undefinedValue()"); + equals.insert("engine->newObject() <=> engine->newObject()"); + equals.insert("engine->newArray() <=> QScriptValue(false)"); + equals.insert("engine->newArray() <=> QScriptValue(0)"); + equals.insert("engine->newArray() <=> QScriptValue(0.0)"); + equals.insert("engine->newArray() <=> QScriptValue(QString(\"\"))"); + equals.insert("engine->newArray() <=> QScriptValue(QString())"); + equals.insert("engine->newArray() <=> QScriptValue(0, false)"); + equals.insert("engine->newArray() <=> QScriptValue(0, 0)"); + equals.insert("engine->newArray() <=> QScriptValue(0, 0.0)"); + equals.insert("engine->newArray() <=> QScriptValue(0, QString(\"\"))"); + equals.insert("engine->newArray() <=> QScriptValue(0, QString())"); + equals.insert("engine->newArray() <=> QScriptValue(engine, false)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, 0)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, QString(\"\"))"); + equals.insert("engine->newArray() <=> QScriptValue(engine, QString())"); + equals.insert("engine->newArray() <=> engine->evaluate(\"false\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"0\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"''\")"); + equals.insert("engine->newArray() <=> engine->newArray()"); + equals.insert("engine->newArray(10) <=> engine->newArray(10)"); + equals.insert("engine->newDate(QDateTime()) <=> engine->newDate(QDateTime())"); } QHash::const_iterator it; for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) { @@ -2489,59 +3284,77 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"undefined\")"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(true) <=> QScriptValue(true)"); equals.insert("QScriptValue(true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(true) <=> QScriptValue(engine, true)"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"true\")"); equals.insert("QScriptValue(false) <=> QScriptValue(false)"); equals.insert("QScriptValue(false) <=> QScriptValue(0, false)"); equals.insert("QScriptValue(false) <=> QScriptValue(engine, false)"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"false\")"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(0, int(122))"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(engine, int(122))"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"122\")"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(0, uint(124))"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(engine, uint(124))"); + equals.insert("QScriptValue(uint(124)) <=> engine->evaluate(\"124\")"); equals.insert("QScriptValue(0) <=> QScriptValue(0)"); equals.insert("QScriptValue(0) <=> QScriptValue(0.0)"); equals.insert("QScriptValue(0) <=> QScriptValue(0, 0)"); equals.insert("QScriptValue(0) <=> QScriptValue(0, 0.0)"); equals.insert("QScriptValue(0) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(0) <=> QScriptValue(engine, 0.0)"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"0.0\")"); equals.insert("QScriptValue(0.0) <=> QScriptValue(0)"); equals.insert("QScriptValue(0.0) <=> QScriptValue(0.0)"); equals.insert("QScriptValue(0.0) <=> QScriptValue(0, 0)"); equals.insert("QScriptValue(0.0) <=> QScriptValue(0, 0.0)"); equals.insert("QScriptValue(0.0) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(0.0) <=> QScriptValue(engine, 0.0)"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"0.0\")"); equals.insert("QScriptValue(123.0) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(123.0) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(123.0) <=> QScriptValue(engine, 123.0)"); + equals.insert("QScriptValue(123.0) <=> engine->evaluate(\"123.0\")"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(6.37e-8)"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(0, 6.37e-8)"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(-6.37e-8)"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(0, -6.37e-8)"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"-6.37e-8\")"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(0, 0x43211234)"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(engine, 0x43211234)"); + equals.insert("QScriptValue(0x43211234) <=> engine->evaluate(\"0x43211234\")"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(0, 0x10000)"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(engine, 0x10000)"); + equals.insert("QScriptValue(0x10000) <=> engine->evaluate(\"0x10000\")"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(0, 0x10001)"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(engine, 0x10001)"); + equals.insert("QScriptValue(0x10001) <=> engine->evaluate(\"0x10001\")"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(qInf()) <=> QScriptValue(engine, qInf())"); + equals.insert("QScriptValue(qInf()) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(engine, -qInf())"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(0, \"NaN\")"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(engine, \"NaN\")"); @@ -2557,88 +3370,113 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(\"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(\"ciao\") <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(QString(\"\"))"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(QString())"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(0, QString(\"\"))"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(0, QString())"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(engine, QString(\"\"))"); equals.insert("QScriptValue(QString(\"\")) <=> QScriptValue(engine, QString())"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"''\")"); equals.insert("QScriptValue(QString()) <=> QScriptValue(QString(\"\"))"); equals.insert("QScriptValue(QString()) <=> QScriptValue(QString())"); equals.insert("QScriptValue(QString()) <=> QScriptValue(0, QString(\"\"))"); equals.insert("QScriptValue(QString()) <=> QScriptValue(0, QString())"); equals.insert("QScriptValue(QString()) <=> QScriptValue(engine, QString(\"\"))"); equals.insert("QScriptValue(QString()) <=> QScriptValue(engine, QString())"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"''\")"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(QString(\"0\"))"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(0, QString(\"0\"))"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"'0'\")"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(QString(\"12.4\")) <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"undefined\")"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(0, true) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(0, true) <=> QScriptValue(engine, true)"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"true\")"); equals.insert("QScriptValue(0, false) <=> QScriptValue(false)"); equals.insert("QScriptValue(0, false) <=> QScriptValue(0, false)"); equals.insert("QScriptValue(0, false) <=> QScriptValue(engine, false)"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"false\")"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(0, int(122))"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(engine, int(122))"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"122\")"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(0, uint(124))"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(engine, uint(124))"); + equals.insert("QScriptValue(0, uint(124)) <=> engine->evaluate(\"124\")"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(0)"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(0.0)"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(0, 0)"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(0, 0.0)"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(engine, 0.0)"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"0.0\")"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(0)"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(0.0)"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(0, 0)"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(0, 0.0)"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(engine, 0.0)"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"0.0\")"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(engine, 123.0)"); + equals.insert("QScriptValue(0, 123.0) <=> engine->evaluate(\"123.0\")"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(6.37e-8)"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(0, 6.37e-8)"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(-6.37e-8)"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(0, -6.37e-8)"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"-6.37e-8\")"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(0, 0x43211234)"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(engine, 0x43211234)"); + equals.insert("QScriptValue(0, 0x43211234) <=> engine->evaluate(\"0x43211234\")"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(0, 0x10000)"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(engine, 0x10000)"); + equals.insert("QScriptValue(0, 0x10000) <=> engine->evaluate(\"0x10000\")"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(0, 0x10001)"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(engine, 0x10001)"); + equals.insert("QScriptValue(0, 0x10001) <=> engine->evaluate(\"0x10001\")"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(0, qInf()) <=> QScriptValue(engine, qInf())"); + equals.insert("QScriptValue(0, qInf()) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(engine, -qInf())"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(0, \"NaN\")"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(engine, \"NaN\")"); @@ -2654,88 +3492,112 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(0, \"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(0, \"ciao\") <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(QString(\"\"))"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(QString())"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(0, QString(\"\"))"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(0, QString())"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(engine, QString(\"\"))"); equals.insert("QScriptValue(0, QString(\"\")) <=> QScriptValue(engine, QString())"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"''\")"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(QString(\"\"))"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(QString())"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(0, QString(\"\"))"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(0, QString())"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(engine, QString(\"\"))"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(engine, QString())"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"''\")"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(QString(\"0\"))"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(0, QString(\"0\"))"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"'0'\")"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(0, QString(\"12.3\")) <=> QScriptValue(0, QString(\"12.3\"))"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->evaluate(\"undefined\")"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"null\")"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(engine, true)"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"true\")"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(false)"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(0, false)"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(engine, false)"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"false\")"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(0, int(122))"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(engine, int(122))"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"122\")"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(0, uint(124))"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(engine, uint(124))"); + equals.insert("QScriptValue(engine, uint(124)) <=> engine->evaluate(\"124\")"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(0)"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(0.0)"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(0, 0)"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(0, 0.0)"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(engine, 0.0)"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"0.0\")"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(0)"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(0.0)"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(0, 0)"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(0, 0.0)"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(engine, 0)"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(engine, 0.0)"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"0.0\")"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(0, 123.0)"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(engine, 123.0)"); + equals.insert("QScriptValue(engine, 123.0) <=> engine->evaluate(\"123.0\")"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(6.37e-8)"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(0, 6.37e-8)"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(-6.37e-8)"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(0, -6.37e-8)"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"-6.37e-8\")"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(0, 0x43211234)"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(engine, 0x43211234)"); + equals.insert("QScriptValue(engine, 0x43211234) <=> engine->evaluate(\"0x43211234\")"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(0, 0x10000)"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(engine, 0x10000)"); + equals.insert("QScriptValue(engine, 0x10000) <=> engine->evaluate(\"0x10000\")"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(0, 0x10001)"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(engine, 0x10001)"); + equals.insert("QScriptValue(engine, 0x10001) <=> engine->evaluate(\"0x10001\")"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(engine, qInf()) <=> QScriptValue(engine, qInf())"); + equals.insert("QScriptValue(engine, qInf()) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(-qInf())"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(0, -qInf())"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(engine, -qInf())"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"-Infinity\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(0, \"NaN\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(engine, \"NaN\")"); @@ -2751,36 +3613,43 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, \"ciao\")"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")"); equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(QString(\"\"))"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(QString())"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(0, QString(\"\"))"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(0, QString())"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(engine, QString(\"\"))"); equals.insert("QScriptValue(engine, QString(\"\")) <=> QScriptValue(engine, QString())"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"''\")"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(QString(\"\"))"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(QString())"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(0, QString(\"\"))"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(0, QString())"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(engine, QString(\"\"))"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(engine, QString())"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"''\")"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(QString(\"0\"))"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(0, QString(\"0\"))"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"'0'\")"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(QString(\"123\"))"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> QScriptValue(engine, QString(\"1.23\"))"); equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"[]\")"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("engine->evaluate(\"{}\") <=> engine->evaluate(\"{}\")"); + equals.insert("engine->evaluate(\"{}\") <=> engine->evaluate(\"undefined\")"); equals.insert("engine->evaluate(\"{}\") <=> engine->undefinedValue()"); equals.insert("engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"Object.prototype\")"); equals.insert("engine->evaluate(\"Date.prototype\") <=> engine->evaluate(\"Date.prototype\")"); @@ -2798,15 +3667,125 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("engine->evaluate(\"new Object()\") <=> engine->evaluate(\"new Object()\")"); equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Array()\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(0, QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); + equals.insert("engine->evaluate(\"undefined\") <=> engine->evaluate(\"{}\")"); + equals.insert("engine->evaluate(\"undefined\") <=> engine->evaluate(\"undefined\")"); + equals.insert("engine->evaluate(\"undefined\") <=> engine->undefinedValue()"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"null\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->nullValue()"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(false)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, false)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, false)"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"124\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"123.0\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(-6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, -6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"0x43211234\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"0x10000\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"0x10001\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"Infinity\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"Infinity\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(-qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, -qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, -qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"-Infinity\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(QString(\"\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(QString())"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, QString(\"\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, QString())"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, QString(\"\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, QString())"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"''\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"'12.4'\")"); equals.insert("engine->nullValue() <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("engine->nullValue() <=> QScriptValue(0, QScriptValue::NullValue)"); equals.insert("engine->nullValue() <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"null\")"); equals.insert("engine->nullValue() <=> engine->nullValue()"); equals.insert("engine->undefinedValue() <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("engine->undefinedValue() <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("engine->undefinedValue() <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("engine->undefinedValue() <=> engine->evaluate(\"{}\")"); + equals.insert("engine->undefinedValue() <=> engine->evaluate(\"undefined\")"); equals.insert("engine->undefinedValue() <=> engine->undefinedValue()"); + equals.insert("engine->newObject() <=> engine->newObject()"); + equals.insert("engine->newArray() <=> engine->newArray()"); + equals.insert("engine->newArray(10) <=> engine->newArray(10)"); + equals.insert("engine->newDate(QDateTime()) <=> engine->newDate(QDateTime())"); } QHash::const_iterator it; for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) { @@ -2872,6 +3851,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(true) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(true) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(true) <=> QScriptValue(123.0)"); @@ -2902,6 +3893,16 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(true) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(true) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(true) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(true) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(false) <=> QScriptValue(true)"); equals.insert("QScriptValue(false) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(false) <=> QScriptValue(uint(124))"); @@ -2938,6 +3939,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(false) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(false) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(false) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(false) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(0x43211234)"); @@ -2962,6 +3975,13 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(int(122)) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(int(122)) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(int(122)) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(0x10001)"); @@ -2977,6 +3997,10 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(uint(124)) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(uint(124)) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(uint(124)) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(uint(124)) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(uint(124)) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(uint(124)) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0) <=> QScriptValue(true)"); equals.insert("QScriptValue(0) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0) <=> QScriptValue(uint(124))"); @@ -3013,6 +4037,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(0) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0.0) <=> QScriptValue(true)"); equals.insert("QScriptValue(0.0) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0.0) <=> QScriptValue(uint(124))"); @@ -3049,6 +4085,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0.0) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0.0) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(0.0) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0.0) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(123.0) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(123.0) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(123.0) <=> QScriptValue(0x10000)"); @@ -3067,6 +4115,11 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(123.0) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(123.0) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(123.0) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(123.0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(123.0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(123.0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(123.0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(123.0) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(true)"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(uint(124))"); @@ -3100,6 +4153,17 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(6.37e-8) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(6.37e-8) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(true)"); equals.insert("QScriptValue(-6.37e-8) <=> QScriptValue(false)"); @@ -3160,13 +4224,33 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(-6.37e-8) <=> engine->nullValue()"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->newArray()"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0x43211234) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(qInf())"); @@ -3179,6 +4263,9 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0x10000) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0x10000) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0x10000) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0x10000) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0x10000) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(\"Infinity\")"); @@ -3188,6 +4275,8 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0x10001) <=> QScriptValue(engine, 0x43211234)"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0x10001) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0x10001) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0x10001) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(true)"); equals.insert("QScriptValue(-qInf()) <=> QScriptValue(false)"); @@ -3251,7 +4340,27 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(-qInf()) <=> engine->nullValue()"); + equals.insert("QScriptValue(-qInf()) <=> engine->newArray()"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(0, \"ciao\")"); @@ -3268,6 +4377,12 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(\"NaN\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("QScriptValue(\"NaN\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(\"NaN\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("QScriptValue(\"NaN\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(\"NaN\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(\"NaN\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(\"NaN\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(\"NaN\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(\"NaN\") <=> engine->newObject()"); equals.insert("QScriptValue(\"Infinity\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(\"Infinity\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(\"Infinity\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); @@ -3287,6 +4402,12 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(\"Infinity\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(\"Infinity\") <=> engine->newObject()"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(true)"); equals.insert("QScriptValue(\"-Infinity\") <=> QScriptValue(false)"); @@ -3363,7 +4484,31 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(\"-Infinity\") <=> engine->nullValue()"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->newObject()"); equals.insert("QScriptValue(\"ciao\") <=> engine->evaluate(\"Function.prototype\")"); equals.insert("QScriptValue(\"ciao\") <=> engine->evaluate(\"Object\")"); equals.insert("QScriptValue(\"ciao\") <=> engine->evaluate(\"Array\")"); @@ -3444,6 +4589,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->newObject()"); + equals.insert("QScriptValue(QString(\"\")) <=> engine->newArray(10)"); equals.insert("QScriptValue(QString()) <=> QScriptValue(true)"); equals.insert("QScriptValue(QString()) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(QString()) <=> QScriptValue(uint(124))"); @@ -3508,6 +4673,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(QString()) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(QString()) <=> engine->newObject()"); + equals.insert("QScriptValue(QString()) <=> engine->newArray(10)"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(true)"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(QString(\"0\")) <=> QScriptValue(uint(124))"); @@ -3565,6 +4750,24 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(QString(\"0\")) <=> engine->newObject()"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(QString(\"123\")) <=> QScriptValue(0x10000)"); @@ -3604,6 +4807,17 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(QString(\"123\")) <=> engine->newObject()"); equals.insert("QScriptValue(QString(\"12.4\")) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(QString(\"12.4\")) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(QString(\"12.4\")) <=> QScriptValue(123.0)"); @@ -3652,6 +4866,21 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(QString(\"12.4\")) <=> engine->newObject()"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(uint(124))"); @@ -3688,6 +4917,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, true) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, true) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(0, true) <=> QScriptValue(123.0)"); @@ -3718,6 +4959,16 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, true) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0, true) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(0, true) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, true) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, false) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, false) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, false) <=> QScriptValue(uint(124))"); @@ -3754,6 +5005,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, false) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0, false) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(0, false) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, false) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(0x43211234)"); @@ -3778,6 +5041,13 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0, int(122)) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, int(122)) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(0x10001)"); @@ -3793,6 +5063,10 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0, uint(124)) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0, uint(124)) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, uint(124)) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, uint(124)) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, uint(124)) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(uint(124))"); @@ -3829,6 +5103,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, 0) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(0, 0) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, 0) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(uint(124))"); @@ -3865,6 +5151,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(0, 0.0) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, 0.0) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(0x10000)"); @@ -3883,6 +5181,11 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0, 123.0) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0, 123.0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, 123.0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, 123.0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, 123.0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, 123.0) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(uint(124))"); @@ -3916,6 +5219,17 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(0, 6.37e-8) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, -6.37e-8) <=> QScriptValue(false)"); @@ -3976,13 +5290,33 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, -6.37e-8) <=> engine->nullValue()"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->newArray()"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0, 0x43211234) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(qInf())"); @@ -3995,6 +5329,9 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0, 0x10000) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0, 0x10000) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, 0x10000) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, 0x10000) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(\"Infinity\")"); @@ -4004,6 +5341,8 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(engine, 0x43211234)"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(0, 0x10001) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(0, 0x10001) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, 0x10001) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, -qInf()) <=> QScriptValue(false)"); @@ -4067,7 +5406,27 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, -qInf()) <=> engine->nullValue()"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->newArray()"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(0, \"ciao\")"); @@ -4084,6 +5443,12 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, \"NaN\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("QScriptValue(0, \"NaN\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(0, \"NaN\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("QScriptValue(0, \"NaN\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(0, \"NaN\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(0, \"NaN\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(0, \"NaN\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(0, \"NaN\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(0, \"NaN\") <=> engine->newObject()"); equals.insert("QScriptValue(0, \"Infinity\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(0, \"Infinity\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(0, \"Infinity\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); @@ -4103,6 +5468,12 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(0, \"Infinity\") <=> engine->newObject()"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(true)"); equals.insert("QScriptValue(0, \"-Infinity\") <=> QScriptValue(false)"); @@ -4179,7 +5550,31 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->nullValue()"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->newObject()"); equals.insert("QScriptValue(0, \"ciao\") <=> engine->evaluate(\"Function.prototype\")"); equals.insert("QScriptValue(0, \"ciao\") <=> engine->evaluate(\"Object\")"); equals.insert("QScriptValue(0, \"ciao\") <=> engine->evaluate(\"Array\")"); @@ -4260,6 +5655,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->newObject()"); + equals.insert("QScriptValue(0, QString(\"\")) <=> engine->newArray(10)"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, QString()) <=> QScriptValue(uint(124))"); @@ -4324,6 +5739,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(0, QString()) <=> engine->newObject()"); + equals.insert("QScriptValue(0, QString()) <=> engine->newArray(10)"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, QString(\"0\")) <=> QScriptValue(uint(124))"); @@ -4381,6 +5816,24 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(0, QString(\"0\")) <=> engine->newObject()"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(0, QString(\"123\")) <=> QScriptValue(0x10000)"); @@ -4420,6 +5873,17 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(0, QString(\"123\")) <=> engine->newObject()"); equals.insert("QScriptValue(0, QString(\"12.3\")) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(0, QString(\"12.3\")) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(0, QString(\"12.3\")) <=> QScriptValue(123.0)"); @@ -4469,6 +5933,22 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(0, QString(\"12.3\")) <=> engine->newObject()"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(uint(124))"); @@ -4505,6 +5985,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(123.0)"); @@ -4535,6 +6027,16 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, true) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, true) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(uint(124))"); @@ -4571,6 +6073,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, false) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(engine, false) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, false) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(123.0)"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(0x43211234)"); @@ -4595,6 +6109,13 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(engine, int(122)) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, int(122)) <=> engine->evaluate(\"'123'\")"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(0x10000)"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(0x10001)"); @@ -4610,6 +6131,10 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(engine, uint(124)) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(engine, uint(124)) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, uint(124)) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, uint(124)) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, uint(124)) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(uint(124))"); @@ -4646,6 +6171,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, 0) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(engine, 0) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, 0) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(uint(124))"); @@ -4682,6 +6219,18 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(engine, 0.0) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, 0.0) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(0x10000)"); @@ -4700,6 +6249,11 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(engine, 123.0) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(engine, 123.0) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, 123.0) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, 123.0) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, 123.0) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, 123.0) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(uint(124))"); @@ -4733,6 +6287,17 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(engine, \"Infinity\")"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("QScriptValue(engine, 6.37e-8) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, -6.37e-8) <=> QScriptValue(false)"); @@ -4793,13 +6358,33 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->nullValue()"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->newArray()"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(0, qInf())"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(0, \"Infinity\")"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(engine, 0x43211234) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(0x10001)"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(qInf())"); @@ -4812,6 +6397,9 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(engine, 0x10001)"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(engine, 0x10000) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(engine, 0x10000) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, 0x10000) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, 0x10000) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(\"Infinity\")"); @@ -4821,6 +6409,8 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(engine, 0x43211234)"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(engine, qInf())"); equals.insert("QScriptValue(engine, 0x10001) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("QScriptValue(engine, 0x10001) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, 0x10001) <=> engine->evaluate(\"Infinity\")"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, -qInf()) <=> QScriptValue(false)"); @@ -4884,7 +6474,27 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"''\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, -qInf()) <=> engine->nullValue()"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->newArray()"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(0, \"ciao\")"); @@ -4901,6 +6511,12 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(engine, \"NaN\") <=> engine->newObject()"); equals.insert("QScriptValue(engine, \"Infinity\") <=> QScriptValue(\"NaN\")"); equals.insert("QScriptValue(engine, \"Infinity\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(engine, \"Infinity\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); @@ -4920,6 +6536,12 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(engine, \"Infinity\") <=> engine->newObject()"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> QScriptValue(false)"); @@ -4996,7 +6618,31 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"null\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"false\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"0\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"0.0\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"'12.4'\")"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->nullValue()"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->newObject()"); equals.insert("QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"Function.prototype\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"Object\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"Array\")"); @@ -5077,6 +6723,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->newObject()"); + equals.insert("QScriptValue(engine, QString(\"\")) <=> engine->newArray(10)"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, QString()) <=> QScriptValue(uint(124))"); @@ -5141,6 +6807,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"'0'\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(engine, QString()) <=> engine->newObject()"); + equals.insert("QScriptValue(engine, QString()) <=> engine->newArray(10)"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> QScriptValue(uint(124))"); @@ -5198,6 +6884,24 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"true\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(engine, QString(\"0\")) <=> engine->newObject()"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(0x43211234)"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> QScriptValue(0x10000)"); @@ -5237,6 +6941,17 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(engine, QString(\"123\")) <=> engine->newObject()"); equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> QScriptValue(int(122))"); equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> QScriptValue(uint(124))"); equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> QScriptValue(123.0)"); @@ -5287,6 +7002,22 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"Undefined\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"Null\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"True\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"False\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"122\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"124\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"123.0\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"0x43211234\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"0x10000\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"0x10001\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"Infinity\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"'123'\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("QScriptValue(engine, QString(\"1.23\")) <=> engine->newObject()"); equals.insert("engine->evaluate(\"[]\") <=> QScriptValue(true)"); equals.insert("engine->evaluate(\"[]\") <=> QScriptValue(int(122))"); equals.insert("engine->evaluate(\"[]\") <=> QScriptValue(uint(124))"); @@ -5351,6 +7082,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"/foo/\")"); equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"new Object()\")"); equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"[]\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"[]\") <=> engine->newArray(10)"); equals.insert("engine->evaluate(\"Object.prototype\") <=> QScriptValue(\"ciao\")"); equals.insert("engine->evaluate(\"Object.prototype\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("engine->evaluate(\"Object.prototype\") <=> QScriptValue(0, \"ciao\")"); @@ -5365,6 +7116,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"(function() { return 1; })\")"); equals.insert("engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"'ciao'\")"); equals.insert("engine->evaluate(\"Array.prototype\") <=> QScriptValue(true)"); equals.insert("engine->evaluate(\"Array.prototype\") <=> QScriptValue(int(122))"); equals.insert("engine->evaluate(\"Array.prototype\") <=> QScriptValue(uint(124))"); @@ -5429,6 +7181,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"/foo/\")"); equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"new Object()\")"); equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->newArray(10)"); equals.insert("engine->evaluate(\"Function.prototype\") <=> engine->evaluate(\"Object\")"); equals.insert("engine->evaluate(\"Function.prototype\") <=> engine->evaluate(\"Array\")"); equals.insert("engine->evaluate(\"Function.prototype\") <=> engine->evaluate(\"Number\")"); @@ -5458,6 +7230,12 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"Error.prototype\") <=> engine->newObject()"); equals.insert("engine->evaluate(\"Array\") <=> engine->evaluate(\"Object\")"); equals.insert("engine->evaluate(\"Array\") <=> engine->evaluate(\"Number\")"); equals.insert("engine->evaluate(\"Array\") <=> engine->evaluate(\"Function\")"); @@ -5512,6 +7290,15 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"new Object()\")"); equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"/foo/\") <=> engine->newObject()"); equals.insert("engine->evaluate(\"new Object()\") <=> QScriptValue(\"ciao\")"); equals.insert("engine->evaluate(\"new Object()\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("engine->evaluate(\"new Object()\") <=> QScriptValue(0, \"ciao\")"); @@ -5526,6 +7313,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"new Object()\") <=> engine->evaluate(\"(function() { return 1; })\")"); equals.insert("engine->evaluate(\"new Object()\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("engine->evaluate(\"new Object()\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"new Object()\") <=> engine->evaluate(\"'ciao'\")"); equals.insert("engine->evaluate(\"new Array()\") <=> QScriptValue(true)"); equals.insert("engine->evaluate(\"new Array()\") <=> QScriptValue(int(122))"); equals.insert("engine->evaluate(\"new Array()\") <=> QScriptValue(uint(124))"); @@ -5590,6 +7378,26 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"/foo/\")"); equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Object()\")"); equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"new Array()\") <=> engine->newArray(10)"); equals.insert("engine->evaluate(\"new Error()\") <=> QScriptValue(\"NaN\")"); equals.insert("engine->evaluate(\"new Error()\") <=> QScriptValue(\"Infinity\")"); equals.insert("engine->evaluate(\"new Error()\") <=> QScriptValue(\"ciao\")"); @@ -5612,6 +7420,951 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"new Error()\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"Undefined\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"Undefined\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"Null\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"Null\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"Null\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"Null\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"Null\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"Null\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"True\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"True\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"True\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"True\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"True\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"True\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"False\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"False\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"False\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"False\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"False\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"False\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"null\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"null\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"true\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"true\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"false\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"false\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"122\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"122\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"124\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"124\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"124\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"124\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"124\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"0\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"0\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"0.0\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"123.0\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"123.0\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"123.0\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"123.0\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"123.0\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"123.0\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(false)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(QString(\"\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(QString())"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, false)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, QString(\"\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, QString())"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, false)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, QString(\"\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, QString())"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"[]\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"Array.prototype\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"new Array()\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"null\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"''\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->nullValue()"); + equals.insert("engine->evaluate(\"-6.37e-8\") <=> engine->newArray()"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"0x43211234\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"0x43211234\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"0x10000\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"0x10000\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"0x10000\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"0x10000\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"0x10001\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"0x10001\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"0x10001\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(false)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0.0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(-6.37e-8)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(QString(\"\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(QString())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, false)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, 0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, 0.0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, -6.37e-8)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, QString(\"\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, QString())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, false)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, 0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, 0.0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, -6.37e-8)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, QString(\"\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, QString())"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"[]\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"Array.prototype\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"new Array()\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"null\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"false\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"0\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"0.0\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"-6.37e-8\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"''\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->nullValue()"); + equals.insert("engine->evaluate(\"-Infinity\") <=> engine->newArray()"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(\"NaN\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(\"-Infinity\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, \"NaN\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, \"-Infinity\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, \"NaN\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"''\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Error.prototype\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"/foo/\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"''\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"''\") <=> engine->newArray(10)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(true)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(6.37e-8)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(\"NaN\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, true)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, \"NaN\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, true)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, \"NaN\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Error.prototype\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"true\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->evaluate(\"'0'\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(\"NaN\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, \"NaN\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, \"NaN\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"'123'\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Error.prototype\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"'123'\") <=> engine->newObject()"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(int(122))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(uint(124))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(123.0)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0x43211234)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0x10000)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0x10001)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(qInf())"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(\"NaN\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(\"ciao\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, int(122))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, uint(124))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, 123.0)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, qInf())"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, \"NaN\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, int(122))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, qInf())"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, \"NaN\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Error.prototype\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Array\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Number\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Function\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Null\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"True\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"False\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"122\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"124\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->evaluate(\"'12.4'\") <=> engine->newObject()"); equals.insert("engine->nullValue() <=> QScriptValue(true)"); equals.insert("engine->nullValue() <=> QScriptValue(int(122))"); equals.insert("engine->nullValue() <=> QScriptValue(uint(124))"); @@ -5648,6 +8401,163 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->nullValue() <=> QScriptValue(engine, \"Infinity\")"); equals.insert("engine->nullValue() <=> QScriptValue(engine, QString(\"123\"))"); equals.insert("engine->nullValue() <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"true\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"122\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"124\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->newObject() <=> QScriptValue(\"ciao\")"); + equals.insert("engine->newObject() <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newObject() <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->newObject() <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newObject() <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->newObject() <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newObject() <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"Object\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"Array\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"Number\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"Function\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->newArray() <=> QScriptValue(true)"); + equals.insert("engine->newArray() <=> QScriptValue(int(122))"); + equals.insert("engine->newArray() <=> QScriptValue(uint(124))"); + equals.insert("engine->newArray() <=> QScriptValue(123.0)"); + equals.insert("engine->newArray() <=> QScriptValue(6.37e-8)"); + equals.insert("engine->newArray() <=> QScriptValue(0x43211234)"); + equals.insert("engine->newArray() <=> QScriptValue(0x10000)"); + equals.insert("engine->newArray() <=> QScriptValue(0x10001)"); + equals.insert("engine->newArray() <=> QScriptValue(qInf())"); + equals.insert("engine->newArray() <=> QScriptValue(\"NaN\")"); + equals.insert("engine->newArray() <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->newArray() <=> QScriptValue(\"-Infinity\")"); + equals.insert("engine->newArray() <=> QScriptValue(\"ciao\")"); + equals.insert("engine->newArray() <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newArray() <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->newArray() <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->newArray() <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->newArray() <=> QScriptValue(0, true)"); + equals.insert("engine->newArray() <=> QScriptValue(0, int(122))"); + equals.insert("engine->newArray() <=> QScriptValue(0, uint(124))"); + equals.insert("engine->newArray() <=> QScriptValue(0, 123.0)"); + equals.insert("engine->newArray() <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->newArray() <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->newArray() <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->newArray() <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->newArray() <=> QScriptValue(0, qInf())"); + equals.insert("engine->newArray() <=> QScriptValue(0, \"NaN\")"); + equals.insert("engine->newArray() <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->newArray() <=> QScriptValue(0, \"-Infinity\")"); + equals.insert("engine->newArray() <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->newArray() <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newArray() <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->newArray() <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->newArray() <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->newArray() <=> QScriptValue(engine, true)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, int(122))"); + equals.insert("engine->newArray() <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->newArray() <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->newArray() <=> QScriptValue(engine, qInf())"); + equals.insert("engine->newArray() <=> QScriptValue(engine, \"NaN\")"); + equals.insert("engine->newArray() <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->newArray() <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("engine->newArray() <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->newArray() <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newArray() <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->newArray() <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->newArray() <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Error.prototype\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Object\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Array\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Number\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Function\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"/foo/\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Null\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"True\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"False\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"true\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"122\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"124\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"123.0\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"6.37e-8\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"0x43211234\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"0x10000\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"0x10001\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Infinity\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->newArray() <=> engine->newObject()"); + equals.insert("engine->newArray() <=> engine->newArray(10)"); + equals.insert("engine->newArray(10) <=> QScriptValue(\"NaN\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(\"-Infinity\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(\"ciao\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(QString(\"0\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(0, \"NaN\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(0, \"-Infinity\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(0, \"ciao\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(0, QString(\"0\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(engine, \"NaN\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(engine, \"-Infinity\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(engine, \"ciao\")"); + equals.insert("engine->newArray(10) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(engine, QString(\"0\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->newArray(10) <=> QScriptValue(engine, QString(\"1.23\"))"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Object.prototype\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Function.prototype\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Error.prototype\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Object\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Array\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Number\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Function\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"(function() { return 1; })\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"/foo/\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Undefined\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Null\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"True\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"False\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"'ciao'\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"'0'\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"'123'\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"'12.4'\")"); + equals.insert("engine->newArray(10) <=> engine->newObject()"); } QHash::const_iterator it; for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) { @@ -5702,6 +8612,16 @@ void tst_QScriptValue::instanceOf_makeData(const char *expr) equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Object\")"); equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Array\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"Null\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"True\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->evaluate(\"False\") <=> engine->evaluate(\"Object\")"); + equals.insert("engine->newObject() <=> engine->evaluate(\"Object\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Object\")"); + equals.insert("engine->newArray() <=> engine->evaluate(\"Array\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Object\")"); + equals.insert("engine->newArray(10) <=> engine->evaluate(\"Array\")"); + equals.insert("engine->newDate(QDateTime()) <=> engine->evaluate(\"Object\")"); } QHash::const_iterator it; for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) { @@ -5833,8 +8753,39 @@ void tst_QScriptValue::qscriptvalue_castQString_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", "[object Object]"); value.insert("engine->evaluate(\"new Array()\")", ""); value.insert("engine->evaluate(\"new Error()\")", "Error: Unknown error"); + value.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", "22"); + value.insert("engine->evaluate(\"Undefined\")", "ReferenceError: Can't find variable: Undefined"); + value.insert("engine->evaluate(\"Null\")", "ReferenceError: Can't find variable: Null"); + value.insert("engine->evaluate(\"True\")", "ReferenceError: Can't find variable: True"); + value.insert("engine->evaluate(\"False\")", "ReferenceError: Can't find variable: False"); + value.insert("engine->evaluate(\"undefined\")", ""); + value.insert("engine->evaluate(\"null\")", ""); + value.insert("engine->evaluate(\"true\")", "true"); + value.insert("engine->evaluate(\"false\")", "false"); + value.insert("engine->evaluate(\"122\")", "122"); + value.insert("engine->evaluate(\"124\")", "124"); + value.insert("engine->evaluate(\"0\")", "0"); + value.insert("engine->evaluate(\"0.0\")", "0"); + value.insert("engine->evaluate(\"123.0\")", "123"); + value.insert("engine->evaluate(\"6.37e-8\")", "6.37e-8"); + value.insert("engine->evaluate(\"-6.37e-8\")", "-6.37e-8"); + value.insert("engine->evaluate(\"0x43211234\")", "1126240820"); + value.insert("engine->evaluate(\"0x10000\")", "65536"); + value.insert("engine->evaluate(\"0x10001\")", "65537"); + value.insert("engine->evaluate(\"NaN\")", "NaN"); + value.insert("engine->evaluate(\"Infinity\")", "Infinity"); + value.insert("engine->evaluate(\"-Infinity\")", "-Infinity"); + value.insert("engine->evaluate(\"'ciao'\")", "ciao"); + value.insert("engine->evaluate(\"''\")", ""); + value.insert("engine->evaluate(\"'0'\")", "0"); + value.insert("engine->evaluate(\"'123'\")", "123"); + value.insert("engine->evaluate(\"'12.4'\")", "12.4"); value.insert("engine->nullValue()", ""); value.insert("engine->undefinedValue()", ""); + value.insert("engine->newObject()", "[object Object]"); + value.insert("engine->newArray()", ""); + value.insert("engine->newArray(10)", ",,,,,,,,,"); + value.insert("engine->newDate(QDateTime())", "Invalid Date"); } newRow(expr) << value.value(expr); } @@ -5843,6 +8794,7 @@ void tst_QScriptValue::qscriptvalue_castQString_test(const char*, const QScriptV { QFETCH(QString, expected); QCOMPARE(qscriptvalue_cast(value), expected); + QCOMPARE(qscriptvalue_cast(value), expected); } DEFINE_TEST_FUNCTION(qscriptvalue_castQString) @@ -5961,8 +8913,39 @@ void tst_QScriptValue::qscriptvalue_castqsreal_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", qQNaN()); value.insert("engine->evaluate(\"new Array()\")", 0); value.insert("engine->evaluate(\"new Error()\")", qQNaN()); + value.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + value.insert("engine->evaluate(\"Undefined\")", qQNaN()); + value.insert("engine->evaluate(\"Null\")", qQNaN()); + value.insert("engine->evaluate(\"True\")", qQNaN()); + value.insert("engine->evaluate(\"False\")", qQNaN()); + value.insert("engine->evaluate(\"undefined\")", qQNaN()); + value.insert("engine->evaluate(\"null\")", 0); + value.insert("engine->evaluate(\"true\")", 1); + value.insert("engine->evaluate(\"false\")", 0); + value.insert("engine->evaluate(\"122\")", 122); + value.insert("engine->evaluate(\"124\")", 124); + value.insert("engine->evaluate(\"0\")", 0); + value.insert("engine->evaluate(\"0.0\")", 0); + value.insert("engine->evaluate(\"123.0\")", 123); + value.insert("engine->evaluate(\"6.37e-8\")", 6.369999999999999e-08); + value.insert("engine->evaluate(\"-6.37e-8\")", -6.369999999999999e-08); + value.insert("engine->evaluate(\"0x43211234\")", 1126240820); + value.insert("engine->evaluate(\"0x10000\")", 65536); + value.insert("engine->evaluate(\"0x10001\")", 65537); + value.insert("engine->evaluate(\"NaN\")", qQNaN()); + value.insert("engine->evaluate(\"Infinity\")", qInf()); + value.insert("engine->evaluate(\"-Infinity\")", qInf()); + value.insert("engine->evaluate(\"'ciao'\")", qQNaN()); + value.insert("engine->evaluate(\"''\")", 0); + value.insert("engine->evaluate(\"'0'\")", 0); + value.insert("engine->evaluate(\"'123'\")", 123); + value.insert("engine->evaluate(\"'12.4'\")", 12.4); value.insert("engine->nullValue()", 0); value.insert("engine->undefinedValue()", qQNaN()); + value.insert("engine->newObject()", qQNaN()); + value.insert("engine->newArray()", 0); + value.insert("engine->newArray(10)", qQNaN()); + value.insert("engine->newDate(QDateTime())", qQNaN()); } newRow(expr) << value.value(expr); } @@ -5972,13 +8955,16 @@ void tst_QScriptValue::qscriptvalue_castqsreal_test(const char*, const QScriptVa QFETCH(qsreal, expected); if (qIsNaN(expected)) { QVERIFY(qIsNaN(qscriptvalue_cast(value))); + QVERIFY(qIsNaN(qscriptvalue_cast(value))); return; } if (qIsInf(expected)) { QVERIFY(qIsInf(qscriptvalue_cast(value))); + QVERIFY(qIsInf(qscriptvalue_cast(value))); return; } QCOMPARE(qscriptvalue_cast(value), expected); + QCOMPARE(qscriptvalue_cast(value), expected); } DEFINE_TEST_FUNCTION(qscriptvalue_castqsreal) @@ -6097,8 +9083,39 @@ void tst_QScriptValue::qscriptvalue_castbool_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", true); value.insert("engine->evaluate(\"new Array()\")", true); value.insert("engine->evaluate(\"new Error()\")", true); + value.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", true); + value.insert("engine->evaluate(\"Undefined\")", true); + value.insert("engine->evaluate(\"Null\")", true); + value.insert("engine->evaluate(\"True\")", true); + value.insert("engine->evaluate(\"False\")", true); + value.insert("engine->evaluate(\"undefined\")", false); + value.insert("engine->evaluate(\"null\")", false); + value.insert("engine->evaluate(\"true\")", true); + value.insert("engine->evaluate(\"false\")", false); + value.insert("engine->evaluate(\"122\")", true); + value.insert("engine->evaluate(\"124\")", true); + value.insert("engine->evaluate(\"0\")", false); + value.insert("engine->evaluate(\"0.0\")", false); + value.insert("engine->evaluate(\"123.0\")", true); + value.insert("engine->evaluate(\"6.37e-8\")", true); + value.insert("engine->evaluate(\"-6.37e-8\")", true); + value.insert("engine->evaluate(\"0x43211234\")", true); + value.insert("engine->evaluate(\"0x10000\")", true); + value.insert("engine->evaluate(\"0x10001\")", true); + value.insert("engine->evaluate(\"NaN\")", false); + value.insert("engine->evaluate(\"Infinity\")", true); + value.insert("engine->evaluate(\"-Infinity\")", true); + value.insert("engine->evaluate(\"'ciao'\")", true); + value.insert("engine->evaluate(\"''\")", false); + value.insert("engine->evaluate(\"'0'\")", true); + value.insert("engine->evaluate(\"'123'\")", true); + value.insert("engine->evaluate(\"'12.4'\")", true); value.insert("engine->nullValue()", false); value.insert("engine->undefinedValue()", false); + value.insert("engine->newObject()", true); + value.insert("engine->newArray()", true); + value.insert("engine->newArray(10)", true); + value.insert("engine->newDate(QDateTime())", true); } newRow(expr) << value.value(expr); } @@ -6107,6 +9124,7 @@ void tst_QScriptValue::qscriptvalue_castbool_test(const char*, const QScriptValu { QFETCH(bool, expected); QCOMPARE(qscriptvalue_cast(value), expected); + QCOMPARE(qscriptvalue_cast(value), expected); } DEFINE_TEST_FUNCTION(qscriptvalue_castbool) @@ -6225,8 +9243,39 @@ void tst_QScriptValue::qscriptvalue_castqint32_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", 0); value.insert("engine->evaluate(\"new Array()\")", 0); value.insert("engine->evaluate(\"new Error()\")", 0); + value.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + value.insert("engine->evaluate(\"Undefined\")", 0); + value.insert("engine->evaluate(\"Null\")", 0); + value.insert("engine->evaluate(\"True\")", 0); + value.insert("engine->evaluate(\"False\")", 0); + value.insert("engine->evaluate(\"undefined\")", 0); + value.insert("engine->evaluate(\"null\")", 0); + value.insert("engine->evaluate(\"true\")", 1); + value.insert("engine->evaluate(\"false\")", 0); + value.insert("engine->evaluate(\"122\")", 122); + value.insert("engine->evaluate(\"124\")", 124); + value.insert("engine->evaluate(\"0\")", 0); + value.insert("engine->evaluate(\"0.0\")", 0); + value.insert("engine->evaluate(\"123.0\")", 123); + value.insert("engine->evaluate(\"6.37e-8\")", 0); + value.insert("engine->evaluate(\"-6.37e-8\")", 0); + value.insert("engine->evaluate(\"0x43211234\")", 1126240820); + value.insert("engine->evaluate(\"0x10000\")", 65536); + value.insert("engine->evaluate(\"0x10001\")", 65537); + value.insert("engine->evaluate(\"NaN\")", 0); + value.insert("engine->evaluate(\"Infinity\")", 0); + value.insert("engine->evaluate(\"-Infinity\")", 0); + value.insert("engine->evaluate(\"'ciao'\")", 0); + value.insert("engine->evaluate(\"''\")", 0); + value.insert("engine->evaluate(\"'0'\")", 0); + value.insert("engine->evaluate(\"'123'\")", 123); + value.insert("engine->evaluate(\"'12.4'\")", 12); value.insert("engine->nullValue()", 0); value.insert("engine->undefinedValue()", 0); + value.insert("engine->newObject()", 0); + value.insert("engine->newArray()", 0); + value.insert("engine->newArray(10)", 0); + value.insert("engine->newDate(QDateTime())", 0); } newRow(expr) << value.value(expr); } @@ -6235,6 +9284,7 @@ void tst_QScriptValue::qscriptvalue_castqint32_test(const char*, const QScriptVa { QFETCH(qint32, expected); QCOMPARE(qscriptvalue_cast(value), expected); + QCOMPARE(qscriptvalue_cast(value), expected); } DEFINE_TEST_FUNCTION(qscriptvalue_castqint32) @@ -6353,8 +9403,39 @@ void tst_QScriptValue::qscriptvalue_castquint32_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", 0); value.insert("engine->evaluate(\"new Array()\")", 0); value.insert("engine->evaluate(\"new Error()\")", 0); + value.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + value.insert("engine->evaluate(\"Undefined\")", 0); + value.insert("engine->evaluate(\"Null\")", 0); + value.insert("engine->evaluate(\"True\")", 0); + value.insert("engine->evaluate(\"False\")", 0); + value.insert("engine->evaluate(\"undefined\")", 0); + value.insert("engine->evaluate(\"null\")", 0); + value.insert("engine->evaluate(\"true\")", 1); + value.insert("engine->evaluate(\"false\")", 0); + value.insert("engine->evaluate(\"122\")", 122); + value.insert("engine->evaluate(\"124\")", 124); + value.insert("engine->evaluate(\"0\")", 0); + value.insert("engine->evaluate(\"0.0\")", 0); + value.insert("engine->evaluate(\"123.0\")", 123); + value.insert("engine->evaluate(\"6.37e-8\")", 0); + value.insert("engine->evaluate(\"-6.37e-8\")", 0); + value.insert("engine->evaluate(\"0x43211234\")", 1126240820); + value.insert("engine->evaluate(\"0x10000\")", 65536); + value.insert("engine->evaluate(\"0x10001\")", 65537); + value.insert("engine->evaluate(\"NaN\")", 0); + value.insert("engine->evaluate(\"Infinity\")", 0); + value.insert("engine->evaluate(\"-Infinity\")", 0); + value.insert("engine->evaluate(\"'ciao'\")", 0); + value.insert("engine->evaluate(\"''\")", 0); + value.insert("engine->evaluate(\"'0'\")", 0); + value.insert("engine->evaluate(\"'123'\")", 123); + value.insert("engine->evaluate(\"'12.4'\")", 12); value.insert("engine->nullValue()", 0); value.insert("engine->undefinedValue()", 0); + value.insert("engine->newObject()", 0); + value.insert("engine->newArray()", 0); + value.insert("engine->newArray(10)", 0); + value.insert("engine->newDate(QDateTime())", 0); } newRow(expr) << value.value(expr); } @@ -6363,6 +9444,7 @@ void tst_QScriptValue::qscriptvalue_castquint32_test(const char*, const QScriptV { QFETCH(quint32, expected); QCOMPARE(qscriptvalue_cast(value), expected); + QCOMPARE(qscriptvalue_cast(value), expected); } DEFINE_TEST_FUNCTION(qscriptvalue_castquint32) @@ -6481,8 +9563,39 @@ void tst_QScriptValue::qscriptvalue_castquint16_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", 0); value.insert("engine->evaluate(\"new Array()\")", 0); value.insert("engine->evaluate(\"new Error()\")", 0); + value.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22); + value.insert("engine->evaluate(\"Undefined\")", 0); + value.insert("engine->evaluate(\"Null\")", 0); + value.insert("engine->evaluate(\"True\")", 0); + value.insert("engine->evaluate(\"False\")", 0); + value.insert("engine->evaluate(\"undefined\")", 0); + value.insert("engine->evaluate(\"null\")", 0); + value.insert("engine->evaluate(\"true\")", 1); + value.insert("engine->evaluate(\"false\")", 0); + value.insert("engine->evaluate(\"122\")", 122); + value.insert("engine->evaluate(\"124\")", 124); + value.insert("engine->evaluate(\"0\")", 0); + value.insert("engine->evaluate(\"0.0\")", 0); + value.insert("engine->evaluate(\"123.0\")", 123); + value.insert("engine->evaluate(\"6.37e-8\")", 0); + value.insert("engine->evaluate(\"-6.37e-8\")", 0); + value.insert("engine->evaluate(\"0x43211234\")", 4660); + value.insert("engine->evaluate(\"0x10000\")", 0); + value.insert("engine->evaluate(\"0x10001\")", 1); + value.insert("engine->evaluate(\"NaN\")", 0); + value.insert("engine->evaluate(\"Infinity\")", 0); + value.insert("engine->evaluate(\"-Infinity\")", 0); + value.insert("engine->evaluate(\"'ciao'\")", 0); + value.insert("engine->evaluate(\"''\")", 0); + value.insert("engine->evaluate(\"'0'\")", 0); + value.insert("engine->evaluate(\"'123'\")", 123); + value.insert("engine->evaluate(\"'12.4'\")", 12); value.insert("engine->nullValue()", 0); value.insert("engine->undefinedValue()", 0); + value.insert("engine->newObject()", 0); + value.insert("engine->newArray()", 0); + value.insert("engine->newArray(10)", 0); + value.insert("engine->newDate(QDateTime())", 0); } newRow(expr) << value.value(expr); } @@ -6491,6 +9604,7 @@ void tst_QScriptValue::qscriptvalue_castquint16_test(const char*, const QScriptV { QFETCH(quint16, expected); QCOMPARE(qscriptvalue_cast(value), expected); + QCOMPARE(qscriptvalue_cast(value), expected); } DEFINE_TEST_FUNCTION(qscriptvalue_castquint16) -- cgit v0.12