summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/.gitignore6
-rw-r--r--tests/arthur/.gitignore2
-rw-r--r--tests/arthur/baselineserver/.gitignore2
-rwxr-xr-xtests/arthur/baselineserver/bin/runserver13
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.cpp511
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.h130
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.pro30
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.qrc5
-rw-r--r--tests/arthur/baselineserver/src/main.cpp70
-rw-r--r--tests/arthur/baselineserver/src/report.cpp296
-rw-r--r--tests/arthur/baselineserver/src/report.h90
-rw-r--r--tests/arthur/baselineserver/src/templates/view.html79
-rw-r--r--tests/arthur/common/baselineprotocol.cpp455
-rw-r--r--tests/arthur/common/baselineprotocol.h172
-rw-r--r--tests/arthur/common/baselineprotocol.pri11
-rw-r--r--tests/arthur/common/lookup3.cpp786
-rw-r--r--tests/arthur/common/paintcommands.cpp29
-rw-r--r--tests/arthur/common/paintcommands.h5
-rw-r--r--tests/arthur/common/qbaselinetest.cpp193
-rw-r--r--tests/arthur/common/qbaselinetest.h77
-rw-r--r--tests/arthur/common/qbaselinetest.pri13
-rw-r--r--tests/arthur/lance/lance.pro2
-rw-r--r--tests/auto/baselineexample/baselineexample.pro18
-rw-r--r--tests/auto/baselineexample/tst_baselineexample.cpp146
-rw-r--r--tests/auto/checkxmlfiles/checkxmlfiles.pro2
-rw-r--r--tests/auto/collections/collections.pro1
-rw-r--r--tests/auto/collections/tst_collections.cpp225
-rw-r--r--tests/auto/corelib.pro3
-rw-r--r--tests/auto/declarative/declarative.pro44
-rw-r--r--tests/auto/declarative/examples/examples.pro6
-rw-r--r--tests/auto/declarative/moduleqt47/moduleqt47.pro4
-rw-r--r--tests/auto/declarative/parserstress/parserstress.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro4
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro4
-rw-r--r--tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro4
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp73
-rw-r--r--tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro4
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro4
-rw-r--r--tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro4
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro4
-rw-r--r--tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro4
-rw-r--r--tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro4
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro4
-rw-r--r--tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro4
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro4
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro4
-rw-r--r--tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro4
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro4
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro4
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro4
-rw-r--r--tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro4
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro4
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro4
-rw-r--r--tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro4
-rw-r--r--tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro4
-rw-r--r--tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro4
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro4
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro4
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro6
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro4
-rw-r--r--tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro4
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro4
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro4
-rw-r--r--tests/auto/declarative/qmlvisual/qmlvisual.pro5
-rw-r--r--tests/auto/declarative/symbianlibs.pri9
-rw-r--r--tests/auto/exceptionsafety/exceptionsafety.pro1
-rw-r--r--tests/auto/gui.pro2
-rw-r--r--tests/auto/guiapplauncher/guiapplauncher.pro1
-rw-r--r--tests/auto/guiapplauncher/tst_guiapplauncher.cpp2
-rw-r--r--tests/auto/lancelot/.gitignore1
-rw-r--r--tests/auto/lancelot/lancelot.pro13
-rw-r--r--tests/auto/lancelot/scripts/aliasing.qps156
-rw-r--r--tests/auto/lancelot/scripts/arcs.qps68
-rw-r--r--tests/auto/lancelot/scripts/arcs2.qps47
-rw-r--r--tests/auto/lancelot/scripts/background.qps136
-rw-r--r--tests/auto/lancelot/scripts/background_brush.qps5
-rw-r--r--tests/auto/lancelot/scripts/beziers.qps147
-rw-r--r--tests/auto/lancelot/scripts/bitmaps.qps166
-rw-r--r--tests/auto/lancelot/scripts/borderimage.qps120
-rw-r--r--tests/auto/lancelot/scripts/brush_pens.qps104
-rw-r--r--tests/auto/lancelot/scripts/brushes.qps79
-rw-r--r--tests/auto/lancelot/scripts/clippaths.qps60
-rw-r--r--tests/auto/lancelot/scripts/clipping.qps182
-rw-r--r--tests/auto/lancelot/scripts/clipping_state.qps47
-rw-r--r--tests/auto/lancelot/scripts/cliprects.qps59
-rw-r--r--tests/auto/lancelot/scripts/conical_gradients.qps85
-rw-r--r--tests/auto/lancelot/scripts/conical_gradients_perspectives.qps64
-rw-r--r--tests/auto/lancelot/scripts/dashes.qps268
-rw-r--r--tests/auto/lancelot/scripts/degeneratebeziers.qps10
-rw-r--r--tests/auto/lancelot/scripts/deviceclipping.qps48
-rw-r--r--tests/auto/lancelot/scripts/drawpoints.qps101
-rw-r--r--tests/auto/lancelot/scripts/ellipses.qps86
-rw-r--r--tests/auto/lancelot/scripts/filltest.qps413
-rw-r--r--tests/auto/lancelot/scripts/gradients.qps44
-rw-r--r--tests/auto/lancelot/scripts/image_formats.qps81
-rw-r--r--tests/auto/lancelot/scripts/images.qps106
-rw-r--r--tests/auto/lancelot/scripts/images2.qps145
-rw-r--r--tests/auto/lancelot/scripts/join_cap_styles.qps63
-rw-r--r--tests/auto/lancelot/scripts/join_cap_styles_duplicate_control_points.qps68
-rw-r--r--tests/auto/lancelot/scripts/linear_gradients.qps144
-rw-r--r--tests/auto/lancelot/scripts/linear_gradients_perspectives.qps62
-rw-r--r--tests/auto/lancelot/scripts/linear_resolving_gradients.qps66
-rw-r--r--tests/auto/lancelot/scripts/lineconsistency.qps72
-rw-r--r--tests/auto/lancelot/scripts/linedashes.qps94
-rw-r--r--tests/auto/lancelot/scripts/linedashes2.qps154
-rw-r--r--tests/auto/lancelot/scripts/linedashes2_aa.qps5
-rw-r--r--tests/auto/lancelot/scripts/lines.qps558
-rw-r--r--tests/auto/lancelot/scripts/lines2.qps179
-rw-r--r--tests/auto/lancelot/scripts/pathfill.qps38
-rw-r--r--tests/auto/lancelot/scripts/paths.qps34
-rw-r--r--tests/auto/lancelot/scripts/paths_aa.qps4
-rw-r--r--tests/auto/lancelot/scripts/pens.qps133
-rw-r--r--tests/auto/lancelot/scripts/pens_aa.qps6
-rw-r--r--tests/auto/lancelot/scripts/pens_cosmetic.qps110
-rw-r--r--tests/auto/lancelot/scripts/perspectives.qps72
-rw-r--r--tests/auto/lancelot/scripts/perspectives2.qps309
-rw-r--r--tests/auto/lancelot/scripts/pixmap_rotation.qps30
-rw-r--r--tests/auto/lancelot/scripts/pixmap_scaling.qps224
-rw-r--r--tests/auto/lancelot/scripts/pixmap_subpixel.qps117
-rw-r--r--tests/auto/lancelot/scripts/pixmaps.qps106
-rw-r--r--tests/auto/lancelot/scripts/porter_duff.qps251
-rw-r--r--tests/auto/lancelot/scripts/porter_duff2.qps261
-rw-r--r--tests/auto/lancelot/scripts/primitives.qps184
-rw-r--r--tests/auto/lancelot/scripts/radial_gradients.qps99
-rw-r--r--tests/auto/lancelot/scripts/radial_gradients_perspectives.qps62
-rw-r--r--tests/auto/lancelot/scripts/rasterops.qps87
-rw-r--r--tests/auto/lancelot/scripts/sizes.qps150
-rw-r--r--tests/auto/lancelot/scripts/text.qps124
-rw-r--r--tests/auto/lancelot/scripts/text_perspectives.qps102
-rw-r--r--tests/auto/lancelot/scripts/tiled_pixmap.qps84
-rw-r--r--tests/auto/lancelot/tst_lancelot.cpp334
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsejscontexts/main.js29
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsejscontexts/project.pro3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsejscontexts/project.ts.result81
-rw-r--r--tests/auto/macnativeevents/expectedeventlist.cpp29
-rw-r--r--tests/auto/macnativeevents/expectedeventlist.h2
-rw-r--r--tests/auto/macnativeevents/nativeeventlist.cpp8
-rw-r--r--tests/auto/macnativeevents/nativeeventlist.h1
-rw-r--r--tests/auto/macnativeevents/qnativeevents_mac.cpp8
-rw-r--r--tests/auto/macnativeevents/tst_macnativeevents.cpp107
-rwxr-xr-xtests/auto/mediaobject/mediaobject.pro2
-rw-r--r--tests/auto/moc/moc.pro2
-rw-r--r--tests/auto/networkselftest/networkselftest.pro8
-rw-r--r--tests/auto/networkselftest/tst_networkselftest.cpp290
-rw-r--r--tests/auto/opengl.pro1
-rw-r--r--tests/auto/other.pro2
-rw-r--r--tests/auto/patternistexamples/patternistexamples.pro12
-rw-r--r--tests/auto/q_func_info/q_func_info.pro1
-rw-r--r--tests/auto/qabstractfileengine/qabstractfileengine.pro6
-rw-r--r--tests/auto/qabstractfileengine/qabstractfileengine.qrc5
-rw-r--r--tests/auto/qabstractfileengine/resources/file.txt1
-rw-r--r--tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp765
-rw-r--r--tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro2
-rw-r--r--tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro2
-rw-r--r--tests/auto/qaccessibility/qaccessibility.pro2
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp7
-rw-r--r--tests/auto/qaction/tst_qaction.cpp2
-rw-r--r--tests/auto/qalgorithms/tst_qalgorithms.cpp23
-rw-r--r--tests/auto/qanimationgroup/qanimationgroup.pro1
-rw-r--r--tests/auto/qapplication/test/test.pro12
-rw-r--r--tests/auto/qatomicint/qatomicint.pro1
-rw-r--r--tests/auto/qatomicpointer/qatomicpointer.pro1
-rw-r--r--tests/auto/qaudioinput/qaudioinput.pro4
-rw-r--r--tests/auto/qaudiooutput/qaudiooutput.pro4
-rw-r--r--tests/auto/qbitarray/qbitarray.pro1
-rw-r--r--tests/auto/qbitarray/tst_qbitarray.cpp9
-rw-r--r--tests/auto/qbrush/tst_qbrush.cpp9
-rw-r--r--tests/auto/qbuffer/qbuffer.pro1
-rw-r--r--tests/auto/qbytearray/qbytearray.pro3
-rw-r--r--tests/auto/qbytearray/tst_qbytearray.cpp63
-rw-r--r--tests/auto/qbytearraymatcher/qbytearraymatcher.pro1
-rw-r--r--tests/auto/qcache/qcache.pro1
-rw-r--r--tests/auto/qchar/qchar.pro5
-rw-r--r--tests/auto/qcheckbox/tst_qcheckbox.cpp7
-rw-r--r--tests/auto/qclipboard/test/test.pro14
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp39
-rw-r--r--tests/auto/qcompleter/tst_qcompleter.cpp27
-rw-r--r--tests/auto/qcomplextext/tst_qcomplextext.cpp39
-rw-r--r--tests/auto/qcontiguouscache/qcontiguouscache.pro1
-rw-r--r--tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp13
-rw-r--r--tests/auto/qcoreapplication/qcoreapplication.pro1
-rw-r--r--tests/auto/qcryptographichash/qcryptographichash.pro1
-rw-r--r--tests/auto/qcssparser/qcssparser.pro4
-rw-r--r--tests/auto/qdatastream/qdatastream.pro4
-rw-r--r--tests/auto/qdatastream/tst_qdatastream.cpp51
-rw-r--r--tests/auto/qdate/qdate.pro1
-rw-r--r--tests/auto/qdatetime/qdatetime.pro1
-rw-r--r--tests/auto/qdatetime/tst_qdatetime.cpp8
-rw-r--r--tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp16
-rw-r--r--tests/auto/qdebug/qdebug.pro1
-rw-r--r--tests/auto/qdesktopservices/qdesktopservices.pro12
-rw-r--r--tests/auto/qdial/tst_qdial.cpp64
-rw-r--r--tests/auto/qdir/qdir.pro5
-rw-r--r--tests/auto/qdir/tst_qdir.cpp389
-rw-r--r--tests/auto/qdiriterator/qdiriterator.pro6
-rw-r--r--tests/auto/qdiriterator/tst_qdiriterator.cpp48
-rw-r--r--tests/auto/qdirmodel/qdirmodel.pro6
-rw-r--r--tests/auto/qdirmodel/tst_qdirmodel.cpp22
-rw-r--r--tests/auto/qdom/qdom.pro2
-rw-r--r--tests/auto/qeasingcurve/qeasingcurve.pro1
-rw-r--r--tests/auto/qelapsedtimer/qelapsedtimer.pro1
-rw-r--r--tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp7
-rw-r--r--tests/auto/qevent/qevent.pro1
-rw-r--r--tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro1
-rw-r--r--tests/auto/qfile/largefile/largefile.pro2
-rw-r--r--tests/auto/qfile/qfile.pro1
-rw-r--r--tests/auto/qfile/test/test.pro10
-rw-r--r--tests/auto/qfile/tst_qfile.cpp392
-rw-r--r--tests/auto/qfiledialog/qfiledialog.pro4
-rw-r--r--tests/auto/qfiledialog/resources/file.txt1
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp18
-rw-r--r--tests/auto/qfiledialog2/qfiledialog2.pro4
-rw-r--r--tests/auto/qfiledialog2/tst_qfiledialog2.cpp4
-rw-r--r--tests/auto/qfileinfo/qfileinfo.pro11
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp401
-rw-r--r--tests/auto/qfilesystementry/qfilesystementry.pro8
-rw-r--r--tests/auto/qfilesystementry/tst_qfilesystementry.cpp387
-rw-r--r--tests/auto/qfilesystemmodel/qfilesystemmodel.pro2
-rw-r--r--tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp9
-rw-r--r--tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro2
-rw-r--r--tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp20
-rw-r--r--tests/auto/qflags/qflags.pro1
-rw-r--r--tests/auto/qfontdatabase/qfontdatabase.pro2
-rw-r--r--tests/auto/qfontdatabase/tst_qfontdatabase.cpp35
-rw-r--r--tests/auto/qfontmetrics/qfontmetrics.pro2
-rw-r--r--tests/auto/qfontmetrics/testfont.qrc5
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp22
-rw-r--r--tests/auto/qfontmetrics/ucs4font.ttfbin0 -> 3076 bytes
-rw-r--r--tests/auto/qftp/qftp.pro4
-rw-r--r--tests/auto/qfuture/qfuture.pro1
-rw-r--r--tests/auto/qfuturewatcher/qfuturewatcher.pro1
-rw-r--r--tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp35
-rw-r--r--tests/auto/qgetputenv/qgetputenv.pro1
-rw-r--r--tests/auto/qgl/tst_qgl.cpp26
-rw-r--r--tests/auto/qglfunctions/qglfunctions.pro7
-rw-r--r--tests/auto/qglfunctions/tst_qglfunctions.cpp244
-rw-r--r--tests/auto/qglobal/qglobal.pro1
-rw-r--r--tests/auto/qglthreads/tst_qglthreads.cpp299
-rw-r--r--tests/auto/qglthreads/tst_qglthreads.h4
-rw-r--r--tests/auto/qglyphs/qglyphs.pro11
-rw-r--r--tests/auto/qglyphs/test.ttfbin0 -> 3712 bytes
-rw-r--r--tests/auto/qglyphs/tst_qglyphs.cpp573
-rw-r--r--tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro2
-rw-r--r--tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro2
-rw-r--r--tests/auto/qgraphicseffect/qgraphicseffect.pro2
-rw-r--r--tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro2
-rw-r--r--tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro2
-rw-r--r--tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp488
-rw-r--r--tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro2
-rw-r--r--tests/auto/qgraphicslayout/qgraphicslayout.pro2
-rw-r--r--tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro2
-rw-r--r--tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro2
-rw-r--r--tests/auto/qgraphicsobject/qgraphicsobject.pro1
-rw-r--r--tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro2
-rw-r--r--tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro2
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp65
-rw-r--r--tests/auto/qgraphicsscene/qgraphicsscene.pro4
-rw-r--r--tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro2
-rw-r--r--tests/auto/qgraphicstransform/qgraphicstransform.pro1
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp55
-rw-r--r--tests/auto/qhash/qhash.pro1
-rw-r--r--tests/auto/qhash/tst_qhash.cpp11
-rw-r--r--tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro4
-rw-r--r--tests/auto/qhelpenginecore/qhelpenginecore.pro4
-rw-r--r--tests/auto/qhttp/qhttp.pro16
-rw-r--r--tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp48
-rw-r--r--tests/auto/qicoimageformat/qicoimageformat.pro10
-rw-r--r--tests/auto/qicon/qicon.pro12
-rw-r--r--tests/auto/qicon/tst_qicon.cpp16
-rw-r--r--tests/auto/qimage/qimage.pro6
-rw-r--r--tests/auto/qimage/tst_qimage.cpp127
-rw-r--r--tests/auto/qimagereader/qimagereader.pro8
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp72
-rw-r--r--tests/auto/qimagewriter/qimagewriter.pro6
-rw-r--r--tests/auto/qiodevice/qiodevice.pro4
-rw-r--r--tests/auto/qiodevice/tst_qiodevice.cpp59
-rw-r--r--tests/auto/qitemdelegate/tst_qitemdelegate.cpp26
-rw-r--r--tests/auto/qitemmodel/qitemmodel.pro4
-rw-r--r--tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp237
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp10
-rw-r--r--tests/auto/qlabel/qlabel.pro2
-rw-r--r--tests/auto/qlayout/qlayout.pro2
-rw-r--r--tests/auto/qlibrary/qlibrary.pro1
-rw-r--r--tests/auto/qlibrary/tst/tst.pro6
-rw-r--r--tests/auto/qlibrary/tst_qlibrary.cpp74
-rw-r--r--tests/auto/qline/qline.pro1
-rw-r--r--tests/auto/qlist/tst_qlist.cpp23
-rw-r--r--tests/auto/qlistwidget/tst_qlistwidget.cpp40
-rw-r--r--tests/auto/qlocale/test/test.pro2
-rw-r--r--tests/auto/qlocalsocket/test/test.pro8
-rw-r--r--tests/auto/qmap/qmap.pro1
-rw-r--r--tests/auto/qmap/tst_qmap.cpp12
-rw-r--r--tests/auto/qmargins/qmargins.pro1
-rw-r--r--tests/auto/qmath/qmath.pro1
-rw-r--r--tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp6
-rw-r--r--tests/auto/qmessagebox/tst_qmessagebox.cpp138
-rw-r--r--tests/auto/qmetaobject/tst_qmetaobject.cpp136
-rw-r--r--tests/auto/qmetatype/qmetatype.pro1
-rw-r--r--tests/auto/qmetatype/tst_qmetatype.cpp5
-rw-r--r--tests/auto/qmovie/animations/corrupt.gifbin0 -> 847 bytes
-rw-r--r--tests/auto/qmovie/qmovie.pro7
-rw-r--r--tests/auto/qmovie/resources.qrc5
-rw-r--r--tests/auto/qmovie/tst_qmovie.cpp13
-rw-r--r--tests/auto/qmutex/qmutex.pro1
-rw-r--r--tests/auto/qmutexlocker/qmutexlocker.pro1
-rw-r--r--tests/auto/qnetworkreply/test/test.pro6
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp273
-rw-r--r--tests/auto/qnumeric/qnumeric.pro1
-rw-r--r--tests/auto/qobject/qobject.pro1
-rw-r--r--tests/auto/qobject/tst_qobject.cpp323
-rw-r--r--tests/auto/qobject/tst_qobject.pro4
-rw-r--r--tests/auto/qobjectrace/qobjectrace.pro1
-rw-r--r--tests/auto/qpainter/qpainter.pro2
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp89
-rw-r--r--tests/auto/qpainterpath/tst_qpainterpath.cpp13
-rw-r--r--tests/auto/qpauseanimation/tst_qpauseanimation.cpp5
-rw-r--r--tests/auto/qpen/tst_qpen.cpp9
-rw-r--r--tests/auto/qpicture/tst_qpicture.cpp13
-rw-r--r--tests/auto/qpixmap/qpixmap.pro8
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp16
-rw-r--r--tests/auto/qpixmapfilter/qpixmapfilter.pro2
-rw-r--r--tests/auto/qplugin/qplugin.pro1
-rw-r--r--tests/auto/qplugin/tst_qplugin.pro4
-rw-r--r--tests/auto/qpluginloader/elftest/.gitattributes10
-rwxr-xr-xtests/auto/qpluginloader/elftest/corrupt1.elf64.sobin0 -> 239745 bytes
-rwxr-xr-xtests/auto/qpluginloader/elftest/corrupt2.elf64.sobin0 -> 240097 bytes
-rwxr-xr-xtests/auto/qpluginloader/elftest/corrupt3.elf64.sobin0 -> 240097 bytes
-rw-r--r--tests/auto/qpluginloader/elftest/debugobj.sobin0 -> 507232 bytes
-rw-r--r--tests/auto/qpluginloader/elftest/garbage1.so4
-rw-r--r--tests/auto/qpluginloader/elftest/garbage2.so1
-rw-r--r--tests/auto/qpluginloader/elftest/garbage3.so1
-rw-r--r--tests/auto/qpluginloader/elftest/garbage4.so1
-rw-r--r--tests/auto/qpluginloader/elftest/garbage5.so2
-rw-r--r--tests/auto/qpluginloader/qpluginloader.pro1
-rw-r--r--tests/auto/qpluginloader/tst/tst.pro8
-rw-r--r--tests/auto/qpluginloader/tst_qpluginloader.cpp62
-rw-r--r--tests/auto/qpoint/qpoint.pro1
-rw-r--r--tests/auto/qpointer/tst_qpointer.cpp32
-rw-r--r--tests/auto/qpolygon/tst_qpolygon.cpp10
-rw-r--r--tests/auto/qprinterinfo/tst_qprinterinfo.cpp2
-rw-r--r--tests/auto/qprocess/test/test.pro40
-rw-r--r--tests/auto/qprocess/tst_qprocess.cpp8
-rw-r--r--tests/auto/qprocessenvironment/qprocessenvironment.pro1
-rw-r--r--tests/auto/qprogressbar/tst_qprogressbar.cpp7
-rw-r--r--tests/auto/qqueue/qqueue.pro1
-rw-r--r--tests/auto/qradiobutton/tst_qradiobutton.cpp6
-rw-r--r--tests/auto/qrand/qrand.pro1
-rw-r--r--tests/auto/qreadlocker/qreadlocker.pro1
-rw-r--r--tests/auto/qreadwritelock/qreadwritelock.pro1
-rw-r--r--tests/auto/qrect/qrect.pro1
-rw-r--r--tests/auto/qregexp/qregexp.pro1
-rw-r--r--tests/auto/qregexp/tst_qregexp.cpp9
-rw-r--r--tests/auto/qregion/tst_qregion.cpp10
-rw-r--r--tests/auto/qresourceengine/qresourceengine.pro21
-rw-r--r--tests/auto/qringbuffer/qringbuffer.pro1
-rw-r--r--tests/auto/qscopedpointer/qscopedpointer.pro1
-rw-r--r--tests/auto/qscriptable/tst_qscriptable.cpp4
-rw-r--r--tests/auto/qscriptclass/tst_qscriptclass.cpp286
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp207
-rw-r--r--tests/auto/qscriptengine/idtranslatable-unicode.js5
-rw-r--r--tests/auto/qscriptengine/qscriptengine.pro2
-rw-r--r--tests/auto/qscriptengine/qscriptengine.qrc2
-rw-r--r--tests/auto/qscriptengine/translatable-unicode.js9
-rw-r--r--tests/auto/qscriptengine/translatable.js3
-rw-r--r--tests/auto/qscriptengine/translations/idtranslatable-unicode.qmbin0 -> 209 bytes
-rw-r--r--tests/auto/qscriptengine/translations/idtranslatable-unicode.ts26
-rw-r--r--tests/auto/qscriptengine/translations/translatable-unicode.qmbin0 -> 322 bytes
-rw-r--r--tests/auto/qscriptengine/translations/translatable-unicode.ts37
-rw-r--r--tests/auto/qscriptengine/translations/translatable_la.qmbin678 -> 975 bytes
-rw-r--r--tests/auto/qscriptengine/translations/translatable_la.ts16
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp604
-rw-r--r--tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp94
-rw-r--r--tests/auto/qscriptextensionplugin/qscriptextensionplugin.pro3
-rw-r--r--tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp79
-rw-r--r--tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.pro10
-rw-r--r--tests/auto/qscriptextensionplugin/staticplugin/__init__.js6
-rw-r--r--tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp75
-rw-r--r--tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro7
-rw-r--r--tests/auto/qscriptextensionplugin/staticplugin/staticplugin.qrc6
-rw-r--r--tests/auto/qscriptextensionplugin/test/test.pro18
-rw-r--r--tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp167
-rw-r--r--tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp179
-rw-r--r--tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro2
-rw-r--r--tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro8
-rw-r--r--tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc5
-rw-r--r--tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp12
-rw-r--r--tests/auto/qscriptvalue/qscriptvalue.pro8
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp1928
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.h418
-rw-r--r--tests/auto/qscriptvaluegenerated/.gitignore1
-rw-r--r--tests/auto/qscriptvaluegenerated/qscriptvaluegenerated.pro18
-rw-r--r--tests/auto/qscriptvaluegenerated/testgen/data.txt (renamed from tests/auto/qscriptvalue/testgen/data.txt)8
-rwxr-xr-xtests/auto/qscriptvaluegenerated/testgen/gen.py (renamed from tests/auto/qscriptvalue/testgen/gen.py)0
-rw-r--r--tests/auto/qscriptvaluegenerated/testgen/main.cpp (renamed from tests/auto/qscriptvalue/testgen/main.cpp)0
-rw-r--r--tests/auto/qscriptvaluegenerated/testgen/testgen.pro (renamed from tests/auto/qscriptvalue/testgen/testgen.pro)0
-rw-r--r--tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp (renamed from tests/auto/qscriptvalue/testgen/testgenerator.cpp)146
-rw-r--r--tests/auto/qscriptvaluegenerated/testgen/testgenerator.h (renamed from tests/auto/qscriptvalue/testgen/testgenerator.h)2
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp116
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h370
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_cast.cpp (renamed from tests/auto/qscriptvalue/tst_qscriptvalue_generated_cast.cpp)887
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_comparison.cpp (renamed from tests/auto/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp)572
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_init.cpp (renamed from tests/auto/qscriptvalue/tst_qscriptvalue_generated_init.cpp)10
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_isXXX.cpp (renamed from tests/auto/qscriptvalue/tst_qscriptvalue_generated_isXXX.cpp)208
-rw-r--r--tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_toXXX.cpp (renamed from tests/auto/qscriptvalue/tst_qscriptvalue_generated_toXXX.cpp)1106
-rw-r--r--tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp21
-rw-r--r--tests/auto/qscroller/qscroller.pro3
-rw-r--r--tests/auto/qscroller/tst_qscroller.cpp537
-rw-r--r--tests/auto/qsemaphore/qsemaphore.pro1
-rw-r--r--tests/auto/qsequentialanimationgroup/qsequentialanimationgroup.pro1
-rw-r--r--tests/auto/qset/qset.pro1
-rw-r--r--tests/auto/qset/tst_qset.cpp11
-rw-r--r--tests/auto/qsettings/qsettings.pro2
-rw-r--r--tests/auto/qsharedpointer/qsharedpointer.pro1
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp8
-rw-r--r--tests/auto/qsignalspy/qsignalspy.pro1
-rw-r--r--tests/auto/qsize/qsize.pro1
-rw-r--r--tests/auto/qsizef/qsizef.pro1
-rw-r--r--tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp140
-rw-r--r--tests/auto/qsound/qsound.pro4
-rw-r--r--tests/auto/qsound/tst_qsound.cpp7
-rw-r--r--tests/auto/qsplitter/qsplitter.pro2
-rw-r--r--tests/auto/qsql/qsql.pro2
-rw-r--r--tests/auto/qsqldatabase/qsqldatabase.pro4
-rw-r--r--tests/auto/qsqldriver/qsqldriver.pro4
-rw-r--r--tests/auto/qsqlerror/qsqlerror.pro2
-rw-r--r--tests/auto/qsqlfield/qsqlfield.pro2
-rw-r--r--tests/auto/qsqlquery/qsqlquery.pro4
-rw-r--r--tests/auto/qsqlquerymodel/qsqlquerymodel.pro2
-rw-r--r--tests/auto/qsqlrecord/qsqlrecord.pro2
-rw-r--r--tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro4
-rw-r--r--tests/auto/qsqltablemodel/qsqltablemodel.pro4
-rw-r--r--tests/auto/qsqlthread/qsqlthread.pro4
-rw-r--r--tests/auto/qsslcertificate/qsslcertificate.pro2
-rw-r--r--tests/auto/qsslkey/qsslkey.pro4
-rw-r--r--tests/auto/qsslsocket/qsslsocket.pro4
-rw-r--r--tests/auto/qstate/qstate.pro1
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp23
-rw-r--r--tests/auto/qstl/qstl.pro1
-rw-r--r--tests/auto/qstring/qstring.pro1
-rw-r--r--tests/auto/qstring/tst_qstring.cpp151
-rw-r--r--tests/auto/qstringbuilder1/qstringbuilder1.pro1
-rw-r--r--tests/auto/qstringbuilder2/qstringbuilder2.pro1
-rw-r--r--tests/auto/qstringbuilder3/qstringbuilder3.pro1
-rw-r--r--tests/auto/qstringbuilder4/qstringbuilder4.pro1
-rw-r--r--tests/auto/qstringlist/qstringlist.pro1
-rw-r--r--tests/auto/qstringmatcher/qstringmatcher.pro1
-rw-r--r--tests/auto/qstringref/qstringref.pro5
-rw-r--r--tests/auto/qstringref/tst_qstringref.cpp881
-rw-r--r--tests/auto/qstyle/qstyle.pro2
-rw-r--r--tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp32
-rw-r--r--tests/auto/qsvggenerator/qsvggenerator.pro2
-rw-r--r--tests/auto/qsvgrenderer/qsvgrenderer.pro2
-rw-r--r--tests/auto/qtabbar/tst_qtabbar.cpp41
-rw-r--r--tests/auto/qtabwidget/tst_qtabwidget.cpp72
-rw-r--r--tests/auto/qtconcurrentfilter/qtconcurrentfilter.pro2
-rw-r--r--tests/auto/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro2
-rw-r--r--tests/auto/qtconcurrentmap/qtconcurrentmap.pro2
-rw-r--r--tests/auto/qtconcurrentrun/qtconcurrentrun.pro2
-rw-r--r--tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp38
-rw-r--r--tests/auto/qtconcurrentthreadengine/qtconcurrentthreadengine.pro2
-rw-r--r--tests/auto/qtcpserver/test/test.pro4
-rw-r--r--tests/auto/qtemporaryfile/qtemporaryfile.pro4
-rw-r--r--tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro3
-rw-r--r--tests/auto/qtextbrowser/qtextbrowser.pro4
-rw-r--r--tests/auto/qtextcodec/test/test.pro2
-rw-r--r--tests/auto/qtextedit/qtextedit.pro2
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp43
-rw-r--r--tests/auto/qtextlist/tst_qtextlist.cpp73
-rw-r--r--tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp21
-rw-r--r--tests/auto/qtextstream/test/test.pro6
-rw-r--r--tests/auto/qtextstream/tst_qtextstream.cpp37
-rw-r--r--tests/auto/qthread/qthread.pro1
-rw-r--r--tests/auto/qthread/tst_qthread.cpp137
-rw-r--r--tests/auto/qthreadonce/qthreadonce.pro1
-rw-r--r--tests/auto/qthreadpool/qthreadpool.pro1
-rw-r--r--tests/auto/qthreadpool/tst_qthreadpool.cpp27
-rw-r--r--tests/auto/qthreadstorage/qthreadstorage.pro1
-rw-r--r--tests/auto/qthreadstorage/tst_qthreadstorage.cpp190
-rw-r--r--tests/auto/qtime/qtime.pro1
-rw-r--r--tests/auto/qtimeline/qtimeline.pro1
-rw-r--r--tests/auto/qtimer/qtimer.pro1
-rw-r--r--tests/auto/qtipc/qsharedmemory/test/test.pro6
-rw-r--r--tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp59
-rw-r--r--tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro4
-rw-r--r--tests/auto/qtmd5/qtmd5.pro1
-rw-r--r--tests/auto/qtokenautomaton/qtokenautomaton.pro1
-rw-r--r--tests/auto/qtranslator/qtranslator.pro2
-rw-r--r--tests/auto/qudpsocket/test/test.pro2
-rw-r--r--tests/auto/qudpsocket/tst_qudpsocket.cpp251
-rw-r--r--tests/auto/qurl/qurl.pro1
-rw-r--r--tests/auto/qurl/tst_qurl.cpp82
-rw-r--r--tests/auto/quuid/quuid.pro1
-rw-r--r--tests/auto/quuid/test/test.pro4
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp11
-rw-r--r--tests/auto/qvarlengtharray/qvarlengtharray.pro1
-rw-r--r--tests/auto/qvector/qvector.pro1
-rw-r--r--tests/auto/qvector/tst_qvector.cpp27
-rw-r--r--tests/auto/qwaitcondition/qwaitcondition.pro1
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp66
-rw-r--r--tests/auto/qwineventnotifier/qwineventnotifier.pro1
-rw-r--r--tests/auto/qwritelocker/qwritelocker.pro1
-rw-r--r--tests/auto/qxml/qxml.pro2
-rw-r--r--tests/auto/qxmlformatter/qxmlformatter.pro2
-rw-r--r--tests/auto/qxmlquery/qxmlquery.pro4
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp2
-rw-r--r--tests/auto/qxmlsimplereader/qxmlsimplereader.pro2
-rw-r--r--tests/auto/qxmlstream/qxmlstream.pro4
-rw-r--r--tests/auto/qxmlstream/tst_qxmlstream.cpp86
-rw-r--r--tests/auto/qzip/qzip.pro2
-rw-r--r--tests/auto/script.pro2
-rw-r--r--tests/auto/selftests/expected_cmptest.txt2
-rw-r--r--tests/auto/selftests/expected_crashes_3.txt2
-rw-r--r--tests/auto/selftests/expected_longstring.txt2
-rw-r--r--tests/auto/selftests/expected_maxwarnings.txt2
-rw-r--r--tests/auto/selftests/expected_skip.txt2
-rw-r--r--tests/auto/selftests/selftests.pro1
-rw-r--r--tests/auto/uic/baseline/gridalignment.ui49
-rw-r--r--tests/auto/uic/baseline/gridalignment.ui.h83
-rw-r--r--tests/auto/uic/baseline/icontheme.ui55
-rw-r--r--tests/auto/uic/baseline/icontheme.ui.h95
-rw-r--r--tests/auto/uiloader/uiloader/uiloader.pro4
-rw-r--r--tests/auto/utf8/tst_utf8.cpp4
-rw-r--r--tests/auto/utf8/utf8.pro1
-rw-r--r--tests/auto/windowsmobile/test/test.pro2
-rw-r--r--tests/auto/xmlpatterns.pri4
-rw-r--r--tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro2
-rw-r--r--tests/auto/xmlpatternsview/xmlpatternsview.pro2
-rw-r--r--tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro2
-rw-r--r--tests/benchmarks/benchmarks.pro3
-rw-r--r--tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro2
-rw-r--r--tests/benchmarks/corelib/corelib.pro10
-rw-r--r--tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp69
-rwxr-xr-xtests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/main.cpp44
-rw-r--r--tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp52
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp47
-rw-r--r--tests/benchmarks/corelib/thread/qmutex/qmutex.pro6
-rw-r--r--tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp433
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qstring/qstring.pro2
-rw-r--r--tests/benchmarks/declarative/binding/binding.pro4
-rw-r--r--tests/benchmarks/declarative/compilation/compilation.pro2
-rw-r--r--tests/benchmarks/declarative/creation/creation.pro2
-rw-r--r--tests/benchmarks/declarative/declarative.pro2
-rw-r--r--tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro2
-rw-r--r--tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro4
-rw-r--r--tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro2
-rw-r--r--tests/benchmarks/declarative/qmltime/qmltime.pro2
-rw-r--r--tests/benchmarks/declarative/script/script.pro4
-rw-r--r--tests/benchmarks/declarative/typeimports/typeimports.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro2
-rw-r--r--tests/benchmarks/gui/gui.pro7
-rw-r--r--tests/benchmarks/gui/image/qimagereader/qimagereader.pro6
-rw-r--r--tests/benchmarks/gui/kernel/qguimetatype/qguimetatype.pro6
-rw-r--r--tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp113
-rw-r--r--tests/benchmarks/gui/kernel/qguivariant/qguivariant.pro6
-rw-r--r--tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp111
-rw-r--r--tests/benchmarks/gui/text/qtext/qtext.pro2
-rw-r--r--tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp90
-rw-r--r--tests/benchmarks/network/network.pro7
-rw-r--r--tests/benchmarks/opengl/opengl.pro2
-rw-r--r--tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp314
-rw-r--r--tests/benchmarks/script/qscriptqobject/qscriptqobject.pro7
-rw-r--r--tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp1265
-rw-r--r--tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp862
-rw-r--r--tests/benchmarks/script/script.pro11
-rw-r--r--tests/benchmarks/script/sunspider/sunspider.pro12
-rw-r--r--tests/benchmarks/script/sunspider/sunspider.qrc5
-rw-r--r--tests/benchmarks/script/sunspider/tests/3d-cube.js337
-rw-r--r--tests/benchmarks/script/sunspider/tests/3d-morph.js54
-rw-r--r--tests/benchmarks/script/sunspider/tests/3d-raytrace.js441
-rw-r--r--tests/benchmarks/script/sunspider/tests/VERSION1
-rw-r--r--tests/benchmarks/script/sunspider/tests/access-binary-trees.js50
-rw-r--r--tests/benchmarks/script/sunspider/tests/access-fannkuch.js66
-rw-r--r--tests/benchmarks/script/sunspider/tests/access-nbody.js169
-rw-r--r--tests/benchmarks/script/sunspider/tests/access-nsieve.js38
-rw-r--r--tests/benchmarks/script/sunspider/tests/bitops-3bit-bits-in-byte.js32
-rw-r--r--tests/benchmarks/script/sunspider/tests/bitops-bits-in-byte.js21
-rw-r--r--tests/benchmarks/script/sunspider/tests/bitops-bitwise-and.js28
-rw-r--r--tests/benchmarks/script/sunspider/tests/bitops-nsieve-bits.js32
-rw-r--r--tests/benchmarks/script/sunspider/tests/controlflow-recursive.js25
-rw-r--r--tests/benchmarks/script/sunspider/tests/crypto-aes.js422
-rw-r--r--tests/benchmarks/script/sunspider/tests/crypto-md5.js286
-rw-r--r--tests/benchmarks/script/sunspider/tests/crypto-sha1.js224
-rw-r--r--tests/benchmarks/script/sunspider/tests/date-format-tofte.js299
-rw-r--r--tests/benchmarks/script/sunspider/tests/date-format-xparb.js417
-rw-r--r--tests/benchmarks/script/sunspider/tests/math-cordic.js95
-rw-r--r--tests/benchmarks/script/sunspider/tests/math-partial-sums.js33
-rw-r--r--tests/benchmarks/script/sunspider/tests/math-spectral-norm.js51
-rw-r--r--tests/benchmarks/script/sunspider/tests/regexp-dna.js1712
-rw-r--r--tests/benchmarks/script/sunspider/tests/string-base64.js135
-rw-r--r--tests/benchmarks/script/sunspider/tests/string-fasta.js85
-rw-r--r--tests/benchmarks/script/sunspider/tests/string-tagcloud.js265
-rw-r--r--tests/benchmarks/script/sunspider/tests/string-unpack-code.js68
-rw-r--r--tests/benchmarks/script/sunspider/tests/string-validate-input.js89
-rw-r--r--tests/benchmarks/script/sunspider/tst_sunspider.cpp124
-rw-r--r--tests/benchmarks/script/v8/tests/README.txt79
-rw-r--r--tests/benchmarks/script/v8/tests/base.js284
-rw-r--r--tests/benchmarks/script/v8/tests/crypto.js1698
-rw-r--r--tests/benchmarks/script/v8/tests/deltablue.js880
-rw-r--r--tests/benchmarks/script/v8/tests/earley-boyer.js4684
-rw-r--r--tests/benchmarks/script/v8/tests/raytrace.js904
-rw-r--r--tests/benchmarks/script/v8/tests/regexp.js1764
-rw-r--r--tests/benchmarks/script/v8/tests/richards.js539
-rw-r--r--tests/benchmarks/script/v8/tests/splay.js394
-rw-r--r--tests/benchmarks/script/v8/tst_v8.cpp137
-rw-r--r--tests/benchmarks/script/v8/v8.pro12
-rw-r--r--tests/benchmarks/script/v8/v8.qrc5
-rw-r--r--tests/benchmarks/svg/svg.pro2
-rw-r--r--tests/benchmarks/trusted-benchmarks.pri11
-rw-r--r--tests/manual/mkspecs/.gitignore2
-rwxr-xr-xtests/manual/mkspecs/test.sh105
-rw-r--r--tests/manual/textrendering/glyphshaping/glyphshaping.pro2
-rw-r--r--tests/shared/filesystem.h75
633 files changed, 47288 insertions, 3271 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
deleted file mode 100644
index b20347367b..0000000000
--- a/tests/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-QObject.log
-tst_*
-!tst_*.*
-tst_*.log
-tst_*.debug
-tst_*~
diff --git a/tests/arthur/.gitignore b/tests/arthur/.gitignore
new file mode 100644
index 0000000000..7f0c1fa2cd
--- /dev/null
+++ b/tests/arthur/.gitignore
@@ -0,0 +1,2 @@
+bin/shower
+lance/lance
diff --git a/tests/arthur/baselineserver/.gitignore b/tests/arthur/baselineserver/.gitignore
new file mode 100644
index 0000000000..cc513e0df2
--- /dev/null
+++ b/tests/arthur/baselineserver/.gitignore
@@ -0,0 +1,2 @@
+storage
+bin/baselineserver
diff --git a/tests/arthur/baselineserver/bin/runserver b/tests/arthur/baselineserver/bin/runserver
new file mode 100755
index 0000000000..48c5c1d086
--- /dev/null
+++ b/tests/arthur/baselineserver/bin/runserver
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+logfile=baselineserver.log
+
+while true; do
+ echo >> $logfile
+ echo -n "***RESTARTING*** " >> $logfile
+ date >> $logfile
+
+ ./baselineserver 2>&1 | tee -a $logfile
+
+ sleep 2
+done
diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp
new file mode 100644
index 0000000000..f59600f879
--- /dev/null
+++ b/tests/arthur/baselineserver/src/baselineserver.cpp
@@ -0,0 +1,511 @@
+/****************************************************************************
+**
+** 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_USE_FAST_CONCATENATION
+#define QT_USE_FAST_OPERATOR_PLUS
+
+#include "baselineserver.h"
+#include <QBuffer>
+#include <QFile>
+#include <QDir>
+#include <QCoreApplication>
+#include <QFileInfo>
+#include <QHostInfo>
+#include <QTextStream>
+#include <QProcess>
+#include <QDirIterator>
+
+QString BaselineServer::storage;
+
+
+BaselineServer::BaselineServer(QObject *parent)
+ : QTcpServer(parent)
+{
+ QFileInfo me(QCoreApplication::applicationFilePath());
+ meLastMod = me.lastModified();
+ heartbeatTimer = new QTimer(this);
+ connect(heartbeatTimer, SIGNAL(timeout()), this, SLOT(heartbeat()));
+ heartbeatTimer->start(HEARTBEAT*1000);
+}
+
+QString BaselineServer::storagePath()
+{
+ if (storage.isEmpty()) {
+ storage = QLS(qgetenv("QT_LANCELOT_DIR"));
+ if (storage.isEmpty())
+ storage = QLS("/var/www");
+ }
+ return storage;
+}
+
+QString BaselineServer::baseUrl()
+{
+ return QLS("http://")
+ + QHostInfo::localHostName().toLatin1() + '.'
+ + QHostInfo::localDomainName().toLatin1() + '/';
+}
+
+void BaselineServer::incomingConnection(int socketDescriptor)
+{
+ qDebug() << "Server: New connection!";
+ BaselineThread *thread = new BaselineThread(socketDescriptor, this);
+ connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
+ thread->start();
+}
+
+void BaselineServer::heartbeat()
+{
+ // The idea is to exit to be restarted when modified, as soon as not actually serving
+ QFileInfo me(QCoreApplication::applicationFilePath());
+ if (me.lastModified() == meLastMod)
+ return;
+ if (!me.exists() || !me.isExecutable())
+ return;
+
+ //# (could close() here to avoid accepting new connections, to avoid livelock)
+ //# also, could check for a timeout to force exit, to avoid hung threads blocking
+ bool isServing = false;
+ foreach(BaselineThread *thread, findChildren<BaselineThread *>()) {
+ if (thread->isRunning()) {
+ isServing = true;
+ break;
+ }
+ }
+
+ if (!isServing)
+ QCoreApplication::exit();
+}
+
+BaselineThread::BaselineThread(int socketDescriptor, QObject *parent)
+ : QThread(parent), socketDescriptor(socketDescriptor)
+{
+}
+
+void BaselineThread::run()
+{
+ BaselineHandler handler(socketDescriptor);
+ exec();
+}
+
+
+BaselineHandler::BaselineHandler(int socketDescriptor)
+ : QObject(), connectionEstablished(false)
+{
+ runId = QDateTime::currentDateTime().toString(QLS("MMMdd-hhmmss"));
+
+ if (socketDescriptor == -1)
+ return;
+
+ connect(&proto.socket, SIGNAL(readyRead()), this, SLOT(receiveRequest()));
+ connect(&proto.socket, SIGNAL(disconnected()), this, SLOT(receiveDisconnect()));
+ proto.socket.setSocketDescriptor(socketDescriptor);
+}
+
+const char *BaselineHandler::logtime()
+{
+ return 0;
+ //return QTime::currentTime().toString(QLS("mm:ss.zzz"));
+}
+
+bool BaselineHandler::establishConnection()
+{
+ if (!proto.acceptConnection(&plat)) {
+ qWarning() << runId << logtime() << "Accepting new connection from" << proto.socket.peerAddress().toString() << "failed." << proto.errorMessage();
+ proto.socket.disconnectFromHost();
+ return false;
+ }
+ QString logMsg;
+ foreach (QString key, plat.keys()) {
+ if (key != PI_HostName && key != PI_HostAddress)
+ logMsg += key + QLS(": '") + plat.value(key) + QLS("', ");
+ }
+ qDebug() << runId << logtime() << "Connection established with" << plat.value(PI_HostName)
+ << "[" << qPrintable(plat.value(PI_HostAddress)) << "]" << logMsg;
+
+ // Filter on branch
+ QString branch = plat.value(PI_PulseGitBranch);
+ if (branch.isEmpty()) {
+ // Not run by Pulse, i.e. ad hoc run: Ok.
+ }
+ else if (branch != QLS("master-integration") || !plat.value(PI_GitCommit).contains(QLS("Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration"))) {
+ qDebug() << runId << logtime() << "Did not pass branch/staging repo filter, disconnecting.";
+ proto.sendBlock(BaselineProtocol::Abort, QByteArray("This branch/staging repo is not assigned to be tested."));
+ proto.socket.disconnectFromHost();
+ return false;
+ }
+
+ proto.sendBlock(BaselineProtocol::Ack, QByteArray());
+
+ report.init(this, runId, plat);
+ return true;
+}
+
+void BaselineHandler::receiveRequest()
+{
+ if (!connectionEstablished) {
+ connectionEstablished = establishConnection();
+ return;
+ }
+
+ QByteArray block;
+ BaselineProtocol::Command cmd;
+ if (!proto.receiveBlock(&cmd, &block)) {
+ qWarning() << runId << logtime() << "Command reception failed. "<< proto.errorMessage();
+ QThread::currentThread()->exit(1);
+ return;
+ }
+
+ switch(cmd) {
+ case BaselineProtocol::RequestBaselineChecksums:
+ provideBaselineChecksums(block);
+ break;
+ case BaselineProtocol::AcceptNewBaseline:
+ storeImage(block, true);
+ break;
+ case BaselineProtocol::AcceptMismatch:
+ storeImage(block, false);
+ break;
+ default:
+ qWarning() << runId << logtime() << "Unknown command received. " << proto.errorMessage();
+ proto.sendBlock(BaselineProtocol::UnknownError, QByteArray());
+ }
+}
+
+
+void BaselineHandler::provideBaselineChecksums(const QByteArray &itemListBlock)
+{
+ ImageItemList itemList;
+ QDataStream ds(itemListBlock);
+ ds >> itemList;
+ qDebug() << runId << logtime() << "Received request for checksums for" << itemList.count()
+ << "items in test function" << itemList.at(0).testFunction;
+
+ for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) {
+ i->imageChecksums.clear();
+ QString prefix = pathForItem(*i, true);
+ QFile file(prefix + QLS("metadata"));
+ if (file.open(QIODevice::ReadOnly)) {
+ QDataStream checkSums(&file);
+ checkSums >> i->imageChecksums;
+ file.close();
+ i->status = ImageItem::Ok;
+ }
+ if (!i->imageChecksums.count())
+ i->status = ImageItem::BaselineNotFound;
+ }
+
+ // Find and mark blacklisted items
+ QString context = pathForItem(itemList.at(0), true, false).section(QLC('/'), 0, -2);
+ if (itemList.count() > 0) {
+ QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST"));
+ if (file.open(QIODevice::ReadOnly)) {
+ QTextStream in(&file);
+ do {
+ QString itemName = in.readLine();
+ if (!itemName.isNull()) {
+ for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) {
+ if (i->itemName == itemName)
+ i->status = ImageItem::IgnoreItem;
+ }
+ }
+ } while (!in.atEnd());
+ }
+ }
+
+ QByteArray block;
+ QDataStream ods(&block, QIODevice::WriteOnly);
+ ods << itemList;
+ proto.sendBlock(BaselineProtocol::Ack, block);
+ report.addItems(itemList);
+}
+
+
+void BaselineHandler::storeImage(const QByteArray &itemBlock, bool isBaseline)
+{
+ QDataStream ds(itemBlock);
+ ImageItem item;
+ ds >> item;
+
+ QString prefix = pathForItem(item, isBaseline);
+ qDebug() << runId << logtime() << "Received" << (isBaseline ? "baseline" : "mismatched") << "image for:" << item.itemName << "Storing in" << prefix;
+
+ QString msg;
+ if (isBaseline)
+ msg = QLS("New baseline image stored: ") + pathForItem(item, true, true) + QLS(FileFormat);
+ else
+ msg = BaselineServer::baseUrl() + report.filePath();
+ proto.sendBlock(BaselineProtocol::Ack, msg.toLatin1());
+
+ QString dir = prefix.section(QLC('/'), 0, -2);
+ QDir cwd;
+ if (!cwd.exists(dir))
+ cwd.mkpath(dir);
+ item.image.save(prefix + QLS(FileFormat), FileFormat);
+
+ //# Could use QSettings or XML or even DB, could use common file for whole dir or even whole storage - but for now, keep it simple
+ QFile file(prefix + QLS("metadata"));
+ file.open(QIODevice::WriteOnly | QIODevice::Truncate);
+ QDataStream checkSums(&file);
+ checkSums << item.imageChecksums;
+ file.close();
+
+ if (!isBaseline)
+ report.addMismatch(item);
+}
+
+
+void BaselineHandler::receiveDisconnect()
+{
+ qDebug() << runId << logtime() << "Client disconnected.";
+ report.end();
+ QThread::currentThread()->exit(0);
+}
+
+
+void BaselineHandler::mapPlatformInfo() const
+{
+ mapped = plat;
+
+ // Map hostname
+ QString host = plat.value(PI_HostName).section(QLC('.'), 0, 0); // Filter away domain, if any
+ if (host.isEmpty() || host == QLS("localhost")) {
+ host = plat.value(PI_HostAddress);
+ } else {
+ //# Site specific, should be in a config file
+ if (!host.startsWith(QLS("oldhcp"))) {
+ // remove index postfix typical of vm hostnames
+ host.remove(QRegExp(QLS("\\d+$")));
+ if (host.endsWith(QLC('-')))
+ host.chop(1);
+ }
+ }
+ if (host.isEmpty())
+ host = QLS("unknownhost");
+ mapped.insert(PI_HostName, host);
+
+ // Map qmakespec
+ QString mkspec = plat.value(PI_QMakeSpec);
+ mapped.insert(PI_QMakeSpec, mkspec.replace(QLC('/'), QLC('_')));
+
+ // Map Qt version
+ QString ver = plat.value(PI_QtVersion);
+ mapped.insert(PI_QtVersion, ver.prepend(QLS("Qt-"))); //### TBD: remove patch version
+}
+
+QString BaselineHandler::pathForItem(const ImageItem &item, bool isBaseline, bool absolute) const
+{
+ if (mapped.isEmpty())
+ mapPlatformInfo();
+
+ QString itemName = item.itemName.simplified();
+ itemName.replace(QLC(' '), QLC('_'));
+ itemName.replace(QLC('.'), QLC('_'));
+ itemName.append(QLC('_'));
+ itemName.append(QString::number(item.itemChecksum, 16).rightJustified(4, QLC('0')));
+
+ QStringList path;
+ if (absolute)
+ path += BaselineServer::storagePath();
+ path += mapped.value(PI_TestCase);
+ path += QLS(isBaseline ? "baselines" : "mismatches");
+ path += item.testFunction;
+ path += mapped.value(PI_QtVersion);
+ path += mapped.value(PI_QMakeSpec);
+ path += mapped.value(PI_HostName);
+ if (!isBaseline)
+ path += runId;
+ path += itemName + QLC('.');
+
+ return path.join(QLS("/"));
+}
+
+
+QString BaselineHandler::view(const QString &baseline, const QString &rendered, const QString &compared)
+{
+ QFile f(":/templates/view.html");
+ f.open(QIODevice::ReadOnly);
+ return QString::fromLatin1(f.readAll()).arg('/'+baseline, '/'+rendered, '/'+compared);
+}
+
+
+QString BaselineHandler::clearAllBaselines(const QString &context)
+{
+ int tot = 0;
+ int failed = 0;
+ QDirIterator it(BaselineServer::storagePath() + QLC('/') + context,
+ QStringList() << QLS("*.png") << QLS("*.metadata"));
+ while (it.hasNext()) {
+ tot++;
+ if (!QFile::remove(it.next()))
+ failed++;
+ }
+ return QString(QLS("%1 of %2 baselines cleared from context ")).arg((tot-failed)/2).arg(tot/2) + context;
+}
+
+QString BaselineHandler::updateSingleBaseline(const QString &oldBaseline, const QString &newBaseline)
+{
+ QString res;
+ QString basePath(BaselineServer::storagePath() + QLC('/'));
+ QString srcBase(basePath + newBaseline.left(newBaseline.length() - 3));
+ QString dstDir(basePath + oldBaseline.left(oldBaseline.lastIndexOf(QLC('/'))));
+
+ QProcess proc;
+ proc.setProcessChannelMode(QProcess::MergedChannels);
+ proc.start(QLS("cp"), QStringList() << QLS("-f") << srcBase + QLS("png") << srcBase + QLS("metadata") << dstDir);
+ proc.waitForFinished();
+ if (proc.exitCode() == 0)
+ res = QString("Successfully updated '%1'").arg(oldBaseline + QLS("/metadata"));
+ else
+ res = QString("Error updating baseline: %1<br>"
+ "Command output: <pre>%2</pre>").arg(proc.errorString(), proc.readAll().constData());
+
+ return res;
+}
+
+
+QString BaselineHandler::blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist)
+{
+ QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST"));
+ QStringList blackList;
+ if (file.open(QIODevice::ReadWrite)) {
+ while (!file.atEnd())
+ blackList.append(file.readLine().trimmed());
+
+ if (removeFromBlacklist)
+ blackList.removeAll(itemId);
+ else if (!blackList.contains(itemId))
+ blackList.append(itemId);
+
+ file.resize(0);
+ foreach (QString id, blackList)
+ file.write(id.toLatin1() + '\n');
+ file.close();
+ return QLS(removeFromBlacklist ? "Whitelisted " : "Blacklisted ") + itemId + QLS(" in context ") + context;
+ } else {
+ return QLS("Unable to update blacklisted tests, failed to open ") + file.fileName();
+ }
+}
+
+
+void BaselineHandler::testPathMapping()
+{
+ qDebug() << "Storage prefix:" << BaselineServer::storagePath();
+
+ QStringList hosts;
+ hosts << QLS("bq-ubuntu910-x86-01")
+ << QLS("bq-ubuntu910-x86-15")
+ << QLS("osl-mac-master-5.test.qt.nokia.com")
+ << QLS("osl-mac-master-6.test.qt.nokia.com")
+ << QLS("sv-xp-vs-010")
+ << QLS("sv-xp-vs-011")
+ << QLS("sv-solaris-sparc-008")
+ << QLS("macbuilder-02.test.troll.no")
+ << QLS("bqvm1164")
+ << QLS("chimera")
+ << QLS("localhost");
+
+ ImageItem item;
+ item.testFunction = QLS("testPathMapping");
+ item.itemName = QLS("arcs.qps");
+ item.imageChecksums << 0x0123456789abcdefULL;
+ item.itemChecksum = 0x0123;
+
+ plat.insert(PI_QtVersion, QLS("4.8.0"));
+ plat.insert(PI_BuildKey, QLS("(nobuildkey)"));
+ plat.insert(PI_QMakeSpec, "linux-g++");
+ foreach(const QString& host, hosts) {
+ mapped.clear();
+ plat.insert(PI_HostName, host);
+ qDebug() << "Baseline from" << host << "->" << pathForItem(item, true);
+ qDebug() << "Mismatch from" << host << "->" << pathForItem(item, false);
+ }
+}
+
+
+QString BaselineHandler::computeMismatchScore(const QImage &baseline, const QImage &rendered)
+{
+ if (baseline.size() != rendered.size() || baseline.format() != rendered.format())
+ return QLS("[No score, incomparable images.]");
+ if (baseline.depth() != 32)
+ return QLS("[Score computation not implemented for format.]");
+
+ int w = baseline.width();
+ int h = baseline.height();
+
+ uint ncd = 0; // number of differing color pixels
+ uint nad = 0; // number of differing alpha pixels
+ uint scd = 0; // sum of color pixel difference
+ uint sad = 0; // sum of alpha pixel difference
+
+ for (int y=0; y<h; ++y) {
+ const QRgb *bl = (const QRgb *) baseline.constScanLine(y);
+ const QRgb *rl = (const QRgb *) rendered.constScanLine(y);
+ for (int x=0; x<w; ++x) {
+ QRgb b = bl[x];
+ QRgb r = rl[x];
+ if (r != b) {
+ int dr = qAbs(qRed(b) - qRed(r));
+ int dg = qAbs(qGreen(b) - qGreen(r));
+ int db = qAbs(qBlue(b) - qBlue(r));
+ int ds = dr + dg + db;
+ int da = qAbs(qAlpha(b) - qAlpha(r));
+ if (ds) {
+ ncd++;
+ scd += ds;
+ }
+ if (da) {
+ nad++;
+ sad += da;
+ }
+ }
+ }
+ }
+
+ double pcd = 100.0 * ncd / (w*h); // percent of pixels that differ
+ double acd = ncd ? double(scd) / (3*ncd) : 0; // avg. difference
+ QString res = QString(QLS("Diffscore: %1% (Num:%2 Avg:%3)")).arg(pcd, 0, 'g', 2).arg(ncd).arg(acd, 0, 'g', 2);
+ if (baseline.hasAlphaChannel()) {
+ double pad = 100.0 * nad / (w*h); // percent of pixels that differ
+ double aad = nad ? double(sad) / (3*nad) : 0; // avg. difference
+ res += QString(QLS(" Alpha-diffscore: %1% (Num:%2 Avg:%3)")).arg(pad, 0, 'g', 2).arg(nad).arg(aad, 0, 'g', 2);
+ }
+ return res;
+}
diff --git a/tests/arthur/baselineserver/src/baselineserver.h b/tests/arthur/baselineserver/src/baselineserver.h
new file mode 100644
index 0000000000..e09a9d0ca5
--- /dev/null
+++ b/tests/arthur/baselineserver/src/baselineserver.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+#ifndef BASELINESERVER_H
+#define BASELINESERVER_H
+
+#include <QStringList>
+#include <QTcpServer>
+#include <QThread>
+#include <QTcpSocket>
+#include <QScopedPointer>
+#include <QTimer>
+#include <QDateTime>
+
+#include "baselineprotocol.h"
+#include "report.h"
+
+// #seconds between update checks
+#define HEARTBEAT 10
+
+class BaselineServer : public QTcpServer
+{
+ Q_OBJECT
+
+public:
+ BaselineServer(QObject *parent = 0);
+
+ static QString storagePath();
+ static QString baseUrl();
+
+protected:
+ void incomingConnection(int socketDescriptor);
+
+private slots:
+ void heartbeat();
+
+private:
+ QTimer *heartbeatTimer;
+ QDateTime meLastMod;
+ static QString storage;
+};
+
+
+
+class BaselineThread : public QThread
+{
+ Q_OBJECT
+
+public:
+ BaselineThread(int socketDescriptor, QObject *parent);
+ void run();
+
+private:
+ int socketDescriptor;
+};
+
+
+class BaselineHandler : public QObject
+{
+ Q_OBJECT
+
+public:
+ BaselineHandler(int socketDescriptor = -1);
+ void testPathMapping();
+ QString pathForItem(const ImageItem &item, bool isBaseline = true, bool absolute = true) const;
+
+ // CGI callbacks:
+ static QString view(const QString &baseline, const QString &rendered, const QString &compared);
+ static QString clearAllBaselines(const QString &context);
+ static QString updateSingleBaseline(const QString &oldBaseline, const QString &newBaseline);
+ static QString blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist = false);
+
+private slots:
+ void receiveRequest();
+ void receiveDisconnect();
+
+private:
+ bool establishConnection();
+ void provideBaselineChecksums(const QByteArray &itemListBlock);
+ void storeImage(const QByteArray &itemBlock, bool isBaseline);
+ void mapPlatformInfo() const;
+ const char *logtime();
+ QString computeMismatchScore(const QImage& baseline, const QImage& rendered);
+
+ BaselineProtocol proto;
+ PlatformInfo plat;
+ mutable PlatformInfo mapped;
+ bool connectionEstablished;
+ QString runId;
+ Report report;
+};
+
+#endif // BASELINESERVER_H
diff --git a/tests/arthur/baselineserver/src/baselineserver.pro b/tests/arthur/baselineserver/src/baselineserver.pro
new file mode 100644
index 0000000000..770662b5fd
--- /dev/null
+++ b/tests/arthur/baselineserver/src/baselineserver.pro
@@ -0,0 +1,30 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-08-11T11:51:09
+#
+#-------------------------------------------------
+
+QT += core network
+
+# gui needed for QImage
+# QT -= gui
+
+TARGET = baselineserver
+DESTDIR = ../bin
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+include(../../common/baselineprotocol.pri)
+
+SOURCES += main.cpp \
+ baselineserver.cpp \
+ report.cpp
+
+HEADERS += \
+ baselineserver.h \
+ report.h
+
+RESOURCES += \
+ baselineserver.qrc
diff --git a/tests/arthur/baselineserver/src/baselineserver.qrc b/tests/arthur/baselineserver/src/baselineserver.qrc
new file mode 100644
index 0000000000..b5cd6afadb
--- /dev/null
+++ b/tests/arthur/baselineserver/src/baselineserver.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>templates/view.html</file>
+ </qresource>
+</RCC>
diff --git a/tests/arthur/baselineserver/src/main.cpp b/tests/arthur/baselineserver/src/main.cpp
new file mode 100644
index 0000000000..bf41f41c60
--- /dev/null
+++ b/tests/arthur/baselineserver/src/main.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+#include <QtCore/QCoreApplication>
+#include "baselineserver.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ QString queryString(qgetenv("QUERY_STRING"));
+ if (!queryString.isEmpty()) {
+ // run as CGI script
+ Report::handleCGIQuery(queryString);
+ return 0;
+ }
+
+ if (a.arguments().contains(QLatin1String("-testmapping"))) {
+ BaselineHandler h;
+ h.testPathMapping();
+ return 0;
+ }
+
+ BaselineServer server;
+ if (!server.listen(QHostAddress::Any, BaselineProtocol::ServerPort)) {
+ qWarning("Failed to listen!");
+ return 1;
+ }
+
+ qDebug() << "\n*****" << argv[0] << "started, ready to serve on port" << BaselineProtocol::ServerPort
+ << "with baseline protocol version" << BaselineProtocol::ProtocolVersion << "*****\n";
+ return a.exec();
+}
diff --git a/tests/arthur/baselineserver/src/report.cpp b/tests/arthur/baselineserver/src/report.cpp
new file mode 100644
index 0000000000..f5bb418f2c
--- /dev/null
+++ b/tests/arthur/baselineserver/src/report.cpp
@@ -0,0 +1,296 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+#include "report.h"
+#include "baselineprotocol.h"
+#include "baselineserver.h"
+#include <QDir>
+#include <QProcess>
+#include <QUrl>
+
+Report::Report()
+ : written(false), numItems(0), numMismatches(0)
+{
+}
+
+Report::~Report()
+{
+ end();
+}
+
+QString Report::filePath()
+{
+ return path;
+}
+
+void Report::init(const BaselineHandler *h, const QString &r, const PlatformInfo &p)
+{
+ handler = h;
+ runId = r;
+ plat = p;
+ rootDir = BaselineServer::storagePath() + QLC('/');
+ reportDir = plat.value(PI_TestCase) + QLC('/') + (plat.value(PI_PulseGitBranch).isEmpty() ? QLS("reports/adhoc/") : QLS("reports/pulse/"));
+ QString dir = rootDir + reportDir;
+ QDir cwd;
+ if (!cwd.exists(dir))
+ cwd.mkpath(dir);
+ path = reportDir + QLS("Report_") + runId + QLS(".html");
+}
+
+void Report::addItems(const ImageItemList &items)
+{
+ if (items.isEmpty())
+ return;
+ numItems += items.size();
+ QString func = items.at(0).testFunction;
+ if (!testFunctions.contains(func))
+ testFunctions.append(func);
+ itemLists[func] += items;
+}
+
+void Report::addMismatch(const ImageItem &item)
+{
+ if (!testFunctions.contains(item.testFunction)) {
+ qWarning() << "Report::addMismatch: unknown testfunction" << item.testFunction;
+ return;
+ }
+ bool found = false;
+ ImageItemList &list = itemLists[item.testFunction];
+ for (ImageItemList::iterator it = list.begin(); it != list.end(); ++it) {
+ if (it->itemName == item.itemName && it->itemChecksum == item.itemChecksum) {
+ it->status = ImageItem::Mismatch;
+ found = true;
+ break;
+ }
+ }
+ if (found)
+ numMismatches++;
+ else
+ qWarning() << "Report::addMismatch: unknown item" << item.itemName << "in testfunction" << item.testFunction;
+}
+
+void Report::end()
+{
+ if (written || !numMismatches)
+ return;
+ write();
+ written = true;
+}
+
+
+void Report::write()
+{
+ QFile file(rootDir + path);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+ qWarning() << "Failed to open report file" << file.fileName();
+ return;
+ }
+ out.setDevice(&file);
+
+ writeHeader();
+ foreach(const QString &func, testFunctions) {
+ writeFunctionResults(itemLists.value(func));
+ }
+ writeFooter();
+ file.close();
+}
+
+
+void Report::writeHeader()
+{
+ QString title = plat.value(PI_TestCase) + QLS(" Qt Baseline Test Report");
+ out << "<head><title>" << title << "</title></head>\n"
+ << "<html><body><h1>" << title << "</h1>\n"
+ << "<p>Run Id: <b>" << runId << "</b></p>\n"
+ << "<p>Summary: <b>" << numMismatches << " of " << numItems << "</b> items reported mismatching</p>\n\n";
+ out << "<h3>Platform Info:</h3>\n"
+ << "<table>\n";
+ foreach (QString key, plat.keys())
+ out << "<tr><td>" << key << "</td><td>" << plat.value(key) << "</td></tr>\n";
+ out << "</table>\n\n";
+}
+
+
+void Report::writeFunctionResults(const ImageItemList &list)
+{
+ QString testFunction = list.at(0).testFunction;
+ QString pageUrl = BaselineServer::baseUrl() + path;
+ QString ctx = handler->pathForItem(list.at(0), true, false).section(QLC('/'), 0, -2);
+
+ out << "\n<p>&nbsp;</p><h3>Test function: " << testFunction << "</h3>\n";
+ out << "<p><a href=\"/cgi-bin/server.cgi?cmd=clearAllBaselines&context=" << ctx << "&url=" << pageUrl
+ << "\"><b><big>Clear all baselines</big></b></a></h3> (They will be recreated by the next run)</p>\n\n";
+
+ out << "<table border=\"2\">\n"
+ "<tr>\n"
+ "<th width=123>Item</th>\n"
+ "<th width=246>Baseline</th>\n"
+ "<th width=246>Rendered</th>\n"
+ "<th width=246>Comparison (diffs are <span style=\"color:red\">RED</span>)</th>\n"
+ "<th width=246>Info/Action</th>\n"
+ "</tr>\n\n";
+
+ foreach (const ImageItem &item, list) {
+ out << "<tr>\n";
+ out << "<td>" << item.itemName << "</td>\n";
+ QString baseline = handler->pathForItem(item, true, false) + QLS(FileFormat);
+ if (item.status == ImageItem::Mismatch) {
+ QString rendered = handler->pathForItem(item, false, false) + QLS(FileFormat);
+ writeItem(baseline, rendered, item, ctx);
+ }
+ else {
+ out << "<td align=center><a href=\"/" << baseline << "\">view</a></td>\n"
+ << "<td align=center colspan=2><small>n/a</small></td>\n"
+ << "<td align=center>";
+ switch (item.status) {
+ case ImageItem::BaselineNotFound:
+ out << "Baseline not found/regenerated";
+ break;
+ case ImageItem::IgnoreItem:
+ out << "<span style=\"background-color:yellow\">Blacklisted</span> "
+ << "<a href=\"/cgi-bin/server.cgi?cmd=whitelist&context=" << ctx
+ << "&itemId=" << item.itemName << "&url=" << pageUrl
+ << "\">Whitelist this item</a>";
+ break;
+ case ImageItem::Ok:
+ out << "<span style=\"color:green\"><small>No mismatch reported</small></span>";
+ break;
+ default:
+ out << "?";
+ break;
+ }
+ out << "</td>\n";
+ }
+ out << "</tr>\n\n";
+ }
+
+ out << "</table>\n";
+}
+
+void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, const QString &ctx)
+{
+ QString compared = generateCompared(baseline, rendered);
+ QString pageUrl = BaselineServer::baseUrl() + path;
+
+ QStringList images = QStringList() << baseline << rendered << compared;
+ foreach (const QString& img, images)
+ out << "<td height=246 align=center><a href=\"/" << img << "\"><img src=\"/" << generateThumbnail(img) << "\"></a></td>\n";
+
+ out << "<td align=center>\n"
+ << "<p><span style=\"color:red\">Mismatch reported</span></p>\n"
+ << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateSingleBaseline&oldBaseline=" << baseline
+ << "&newBaseline=" << rendered << "&url=" << pageUrl << "\">Replace baseline with rendered</a></p>\n"
+ << "<p><a href=\"/cgi-bin/server.cgi?cmd=blacklist&context=" << ctx
+ << "&itemId=" << item.itemName << "&url=" << pageUrl << "\">Blacklist this item</a></p>\n"
+ << "<p><a href=\"/cgi-bin/server.cgi?cmd=view&baseline=" << baseline << "&rendered=" << rendered
+ << "&compared=" << compared << "&url=" << pageUrl << "\">Inspect</a></p>\n"
+ << "</td>\n";
+}
+
+void Report::writeFooter()
+{
+ out << "\n</body></html>\n";
+}
+
+
+QString Report::generateCompared(const QString &baseline, const QString &rendered, bool fuzzy)
+{
+ QString res = rendered;
+ QFileInfo fi(res);
+ res.chop(fi.suffix().length() + 1);
+ res += QLS(fuzzy ? "_fuzzycompared.png" : "_compared.png");
+ QStringList args;
+ if (fuzzy)
+ args << QLS("-fuzz") << QLS("5%");
+ args << rootDir+baseline << rootDir+rendered << rootDir+res;
+ QProcess::execute(QLS("compare"), args);
+ return res;
+}
+
+
+QString Report::generateThumbnail(const QString &image)
+{
+ QString res = image;
+ QFileInfo imgFI(rootDir+image);
+ res.chop(imgFI.suffix().length() + 1);
+ res += QLS("_thumbnail.jpg");
+ QFileInfo resFI(rootDir+res);
+ if (resFI.exists() && resFI.lastModified() > imgFI.lastModified())
+ return res;
+ QStringList args;
+ args << rootDir+image << QLS("-resize") << QLS("240x240>") << QLS("-quality") << QLS("50") << rootDir+res;
+ QProcess::execute(QLS("convert"), args);
+ return res;
+}
+
+
+void Report::handleCGIQuery(const QString &query)
+{
+ QUrl cgiUrl(QLS("http://dummy/cgi-bin/dummy.cgi?") + query);
+ QTextStream s(stdout);
+ s << "Content-Type: text/html\r\n\r\n"
+ << "<HTML>";
+
+ QString command(cgiUrl.queryItemValue("cmd"));
+
+ if (command == QLS("view")) {
+ s << BaselineHandler::view(cgiUrl.queryItemValue(QLS("baseline")),
+ cgiUrl.queryItemValue(QLS("rendered")),
+ cgiUrl.queryItemValue(QLS("compared")));
+ }
+ else if (command == QLS("updateSingleBaseline")) {
+ s << BaselineHandler::updateSingleBaseline(cgiUrl.queryItemValue(QLS("oldBaseline")),
+ cgiUrl.queryItemValue(QLS("newBaseline")));
+ } else if (command == QLS("clearAllBaselines")) {
+ s << BaselineHandler::clearAllBaselines(cgiUrl.queryItemValue(QLS("context")));
+ } else if (command == QLS("blacklist")) {
+ // blacklist a test
+ s << BaselineHandler::blacklistTest(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("itemId")));
+ } else if (command == QLS("whitelist")) {
+ // whitelist a test
+ s << BaselineHandler::blacklistTest(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("itemId")), true);
+ } else {
+ s << "Unknown query:<br>" << query << "<br>";
+ }
+ s << "<p><a href=\"" << cgiUrl.queryItemValue(QLS("url")) << "\">Back to report</a>";
+ s << "</HTML>";
+}
diff --git a/tests/arthur/baselineserver/src/report.h b/tests/arthur/baselineserver/src/report.h
new file mode 100644
index 0000000000..0df613a7ca
--- /dev/null
+++ b/tests/arthur/baselineserver/src/report.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+#ifndef REPORT_H
+#define REPORT_H
+
+#include "baselineprotocol.h"
+#include <QFile>
+#include <QTextStream>
+#include <QMap>
+#include <QStringList>
+
+class BaselineHandler;
+
+class Report
+{
+public:
+ Report();
+ ~Report();
+
+ void init(const BaselineHandler *h, const QString &r, const PlatformInfo &p);
+ void addItems(const ImageItemList& items);
+ void addMismatch(const ImageItem& item);
+ void end();
+
+ QString filePath();
+
+ static void handleCGIQuery(const QString &query);
+
+private:
+ void write();
+ void writeFunctionResults(const ImageItemList &list);
+ void writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, const QString &ctx);
+ void writeHeader();
+ void writeFooter();
+ QString generateCompared(const QString &baseline, const QString &rendered, bool fuzzy = false);
+ QString generateThumbnail(const QString &image);
+
+ const BaselineHandler *handler;
+ QString runId;
+ PlatformInfo plat;
+ QString rootDir;
+ QString reportDir;
+ QString path;
+ QStringList testFunctions;
+ QMap<QString, ImageItemList> itemLists;
+ bool written;
+ int numItems;
+ int numMismatches;
+ QTextStream out;
+};
+
+#endif // REPORT_H
diff --git a/tests/arthur/baselineserver/src/templates/view.html b/tests/arthur/baselineserver/src/templates/view.html
new file mode 100644
index 0000000000..c048f4781c
--- /dev/null
+++ b/tests/arthur/baselineserver/src/templates/view.html
@@ -0,0 +1,79 @@
+<h3>Lancelot Viewer</h3>
+
+<p>
+Zoom:
+<input name="zoom" id="z1" type="radio" checked="Checked">1x</input>
+<input name="zoom" id="z2" type="radio">2x</input>
+<input name="zoom" id="z4" type="radio">4x</input>
+</p>
+
+<p><table>
+<tr>
+<td><input name="imgselect" id="baseline" type="radio" checked="Checked">Baseline</input></td>
+<td>%1</td>
+</tr>
+<tr>
+<td><input name="imgselect" id="rendered" type="radio">Rendered</input></td>
+<td>%2</td>
+</tr>
+<tr>
+<td><input name="imgselect" id="compared" type="radio">Differences</input></td>
+<td></td>
+</tr>
+</table></p>
+
+
+<p>
+<canvas id="c" width="800" height="800"></canvas>
+</p>
+
+<script>
+ var canvas = document.getElementById("c");
+ var context = canvas.getContext("2d");
+ var cat = new Image();
+ cat.src = "%1";
+ var z = 1;
+ cat.onload = function() {
+ context.mozImageSmoothingEnabled = false;
+ context.drawImage(cat, 0, 0, z*cat.width, z*cat.height);
+ };
+
+ var bbut = document.getElementById("baseline");
+ bbut.onclick = function() {
+ cat.src = "%1";
+ };
+
+ var rbut = document.getElementById("rendered");
+ rbut.onclick = function() {
+ cat.src = "%2";
+ };
+
+ var cbut = document.getElementById("compared");
+ cbut.onclick = function() {
+ cat.src = "%3";
+ };
+
+ function setZoom(zoom)
+ {
+ z = zoom;
+ canvas.width = z*800;
+ canvas.height = z*800;
+ context.mozImageSmoothingEnabled = false;
+ context.drawImage(cat, 0, 0, z*cat.width, z*cat.height);
+ }
+
+ var z1but = document.getElementById("z1");
+ z1but.onclick = function() {
+ setZoom(1);
+ };
+
+ var z2but = document.getElementById("z2");
+ z2but.onclick = function() {
+ setZoom(2);
+ };
+
+ var z4but = document.getElementById("z4");
+ z4but.onclick = function() {
+ setZoom(4);
+ };
+</script>
diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp
new file mode 100644
index 0000000000..e4445bde69
--- /dev/null
+++ b/tests/arthur/common/baselineprotocol.cpp
@@ -0,0 +1,455 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+#include "baselineprotocol.h"
+#include <QLibraryInfo>
+#include <QImage>
+#include <QBuffer>
+#include <QHostInfo>
+#include <QSysInfo>
+#include <QProcess>
+#include <QFileInfo>
+#include <QDir>
+#include <QTime>
+#include <QPointer>
+
+#ifndef QMAKESPEC
+#define QMAKESPEC "Unknown"
+#endif
+
+#if defined(Q_OS_WIN)
+#include <QtCore/qt_windows.h>
+#endif
+#if defined(Q_OS_UNIX)
+#include <time.h>
+#endif
+void BaselineProtocol::sysSleep(int ms)
+{
+#if defined(Q_OS_WIN)
+ Sleep(DWORD(ms));
+#else
+ struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
+ nanosleep(&ts, NULL);
+#endif
+}
+
+PlatformInfo::PlatformInfo(bool useLocal)
+ : QMap<QString, QString>()
+{
+ if (useLocal) {
+ insert(PI_HostName, QHostInfo::localHostName());
+ insert(PI_QtVersion, QLS(qVersion()));
+ insert(PI_QMakeSpec, QString(QLS(QMAKESPEC)).remove(QRegExp(QLS("^.*mkspecs/"))));
+ insert(PI_BuildKey, QLibraryInfo::buildKey());
+#if defined(Q_OS_LINUX)
+ insert(PI_OSName, QLS("Linux"));
+ QProcess uname;
+ uname.start(QLS("uname"), QStringList() << QLS("-r"));
+ if (uname.waitForFinished(3000))
+ insert(PI_OSVersion, QString::fromLocal8Bit(uname.readAllStandardOutput().constData()).simplified());
+#elif defined(Q_OS_WINCE)
+ insert(PI_OSName, QLS("WinCE"));
+ insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion()));
+#elif defined(Q_OS_WIN)
+ insert(PI_OSName, QLS("Windows"));
+ insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion()));
+#elif defined(Q_OS_MAC)
+ insert(PI_OSName, QLS("MacOS"));
+ insert(PI_OSVersion, QString::number(qMacVersion()));
+#elif defined(Q_OS_SYMBIAN)
+ insert(PI_OSName, QLS("Symbian"));
+ insert(PI_OSVersion, QString::number(QSysInfo::symbianVersion());
+#else
+ insert(PI_OSName, QLS("Other"));
+#endif
+
+ QProcess git;
+ QString cmd;
+ QStringList args;
+#if defined(Q_OS_WIN)
+ cmd = QLS("cmd.exe");
+ args << QLS("/c") << QLS("git");
+#else
+ cmd = QLS("git");
+#endif
+ args << QLS("log") << QLS("--max-count=1") << QLS("--pretty=%H [%an] [%ad] %s");
+ git.start(cmd, args);
+ git.waitForFinished(3000);
+ if (!git.exitCode())
+ insert(PI_GitCommit, QString::fromLocal8Bit(git.readAllStandardOutput().constData()).simplified());
+ else
+ insert(PI_GitCommit, QLS("Unknown"));
+ }
+
+ QByteArray gb = qgetenv("PULSE_GIT_BRANCH");
+ if (!gb.isEmpty())
+ insert(PI_PulseGitBranch, QString::fromLatin1(gb));
+ QByteArray tb = qgetenv("PULSE_TESTR_BRANCH");
+ if (!tb.isEmpty())
+ insert(PI_PulseTestrBranch, QString::fromLatin1(tb));
+}
+
+
+ImageItem &ImageItem::operator=(const ImageItem &other)
+{
+ testFunction = other.testFunction;
+ itemName = other.itemName;
+ itemChecksum = other.itemChecksum;
+ status = other.status;
+ image = other.image;
+ imageChecksums = other.imageChecksums;
+ return *this;
+}
+
+// Defined in lookup3.c:
+void hashword2 (
+const quint32 *k, /* the key, an array of quint32 values */
+size_t length, /* the length of the key, in quint32s */
+quint32 *pc, /* IN: seed OUT: primary hash value */
+quint32 *pb); /* IN: more seed OUT: secondary hash value */
+
+quint64 ImageItem::computeChecksum(const QImage &image)
+{
+ QImage img(image);
+ const int bpl = img.bytesPerLine();
+ const int padBytes = bpl - (img.width() * img.depth() / 8);
+ if (padBytes) {
+ uchar *p = img.bits() + bpl - padBytes;
+ const int h = img.height();
+ for (int y = 0; y < h; ++y) {
+ qMemSet(p, 0, padBytes);
+ p += bpl;
+ }
+ }
+
+ quint32 h1 = 0xfeedbacc;
+ quint32 h2 = 0x21604894;
+ hashword2((const quint32 *)img.constBits(), img.byteCount()/4, &h1, &h2);
+ return (quint64(h1) << 32) | h2;
+}
+
+#if 0
+QString ImageItem::engineAsString() const
+{
+ switch (engine) {
+ case Raster:
+ return QLS("Raster");
+ break;
+ case OpenGL:
+ return QLS("OpenGL");
+ break;
+ default:
+ break;
+ }
+ return QLS("Unknown");
+}
+
+QString ImageItem::formatAsString() const
+{
+ static const int numFormats = 16;
+ static const char *formatNames[numFormats] = {
+ "Invalid",
+ "Mono",
+ "MonoLSB",
+ "Indexed8",
+ "RGB32",
+ "ARGB32",
+ "ARGB32-Premult",
+ "RGB16",
+ "ARGB8565-Premult",
+ "RGB666",
+ "ARGB6666-Premult",
+ "RGB555",
+ "ARGB8555-Premult",
+ "RGB888",
+ "RGB444",
+ "ARGB4444-Premult"
+ };
+ if (renderFormat < 0 || renderFormat >= numFormats)
+ return QLS("UnknownFormat");
+ return QLS(formatNames[renderFormat]);
+}
+#endif
+
+void ImageItem::writeImageToStream(QDataStream &out) const
+{
+ if (image.isNull() || image.format() == QImage::Format_Invalid) {
+ out << quint8(0);
+ return;
+ }
+ out << quint8('Q') << quint8(image.format());
+ out << quint8(QSysInfo::ByteOrder) << quint8(0); // pad to multiple of 4 bytes
+ out << quint32(image.width()) << quint32(image.height()) << quint32(image.bytesPerLine());
+ out << qCompress((const uchar *)image.constBits(), image.byteCount());
+ //# can be followed by colormap for formats that use it
+}
+
+void ImageItem::readImageFromStream(QDataStream &in)
+{
+ quint8 hdr, fmt, endian, pad;
+ quint32 width, height, bpl;
+ QByteArray data;
+
+ in >> hdr;
+ if (hdr != 'Q') {
+ image = QImage();
+ return;
+ }
+ in >> fmt >> endian >> pad;
+ if (!fmt || fmt >= QImage::NImageFormats) {
+ image = QImage();
+ return;
+ }
+ if (endian != QSysInfo::ByteOrder) {
+ qWarning("ImageItem cannot read streamed image with different endianness");
+ image = QImage();
+ return;
+ }
+ in >> width >> height >> bpl;
+ in >> data;
+ data = qUncompress(data);
+ QImage res((const uchar *)data.constData(), width, height, bpl, QImage::Format(fmt));
+ image = res.copy(); //# yuck, seems there is currently no way to avoid data copy
+}
+
+QDataStream & operator<< (QDataStream &stream, const ImageItem &ii)
+{
+ stream << ii.testFunction << ii.itemName << ii.itemChecksum << quint8(ii.status) << ii.imageChecksums;
+ ii.writeImageToStream(stream);
+ return stream;
+}
+
+QDataStream & operator>> (QDataStream &stream, ImageItem &ii)
+{
+ quint8 encStatus;
+ stream >> ii.testFunction >> ii.itemName >> ii.itemChecksum >> encStatus >> ii.imageChecksums;
+ ii.status = ImageItem::ItemStatus(encStatus);
+ ii.readImageFromStream(stream);
+ return stream;
+}
+
+BaselineProtocol::BaselineProtocol()
+{
+}
+
+BaselineProtocol::~BaselineProtocol()
+{
+ socket.close();
+ if (socket.state() != QTcpSocket::UnconnectedState)
+ socket.waitForDisconnected(Timeout);
+}
+
+
+bool BaselineProtocol::connect(const QString &testCase, bool *dryrun)
+{
+ errMsg.clear();
+ QByteArray serverName(qgetenv("QT_LANCELOT_SERVER"));
+ if (serverName.isNull())
+ serverName = "lancelot.test.qt.nokia.com";
+
+ socket.connectToHost(serverName, ServerPort);
+ if (!socket.waitForConnected(Timeout)) {
+ sysSleep(Timeout); // Wait a bit and try again, the server might just be restarting
+ if (!socket.waitForConnected(Timeout)) {
+ errMsg += QLS("TCP connectToHost failed. Host:") + serverName + QLS(" port:") + QString::number(ServerPort);
+ return false;
+ }
+ }
+
+ PlatformInfo pi(true);
+ pi.insert(PI_TestCase, testCase);
+ QByteArray block;
+ QDataStream ds(&block, QIODevice::ReadWrite);
+ ds << pi;
+ if (!sendBlock(AcceptPlatformInfo, block)) {
+ errMsg += QLS("Failed to send data to server.");
+ return false;
+ }
+
+ Command cmd = UnknownError;
+ if (!receiveBlock(&cmd, &block)) {
+ errMsg += QLS("Failed to get response from server.");
+ return false;
+ }
+
+ if (cmd == Abort) {
+ errMsg += QLS("Server aborted connection. Reason: ") + QString::fromLatin1(block);
+ return false;
+ }
+
+ if (dryrun)
+ *dryrun = (cmd == DoDryRun);
+
+ if (cmd != Ack && cmd != DoDryRun) {
+ errMsg += QLS("Unexpected response from server.");
+ return false;
+ }
+
+ return true;
+}
+
+
+bool BaselineProtocol::acceptConnection(PlatformInfo *pi)
+{
+ errMsg.clear();
+
+ QByteArray block;
+ Command cmd = AcceptPlatformInfo;
+ if (!receiveBlock(&cmd, &block) || cmd != AcceptPlatformInfo)
+ return false;
+
+ if (pi) {
+ QDataStream ds(block);
+ ds >> *pi;
+ pi->insert(PI_HostAddress, socket.peerAddress().toString());
+ }
+
+ return true;
+}
+
+
+bool BaselineProtocol::requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList)
+{
+ errMsg.clear();
+ if (!itemList)
+ return false;
+
+ for(ImageItemList::iterator it = itemList->begin(); it != itemList->end(); it++)
+ it->testFunction = testFunction;
+
+ QByteArray block;
+ QDataStream ds(&block, QIODevice::ReadWrite);
+ ds << *itemList;
+ if (!sendBlock(RequestBaselineChecksums, block))
+ return false;
+ Command cmd;
+ if (!receiveBlock(&cmd, &block))
+ return false;
+ ds.device()->seek(0);
+ ds >> *itemList;
+ return true;
+}
+
+
+bool BaselineProtocol::submitNewBaseline(const ImageItem &item, QByteArray *serverMsg)
+{
+ Command cmd;
+ return (sendItem(AcceptNewBaseline, item) && receiveBlock(&cmd, serverMsg) && cmd == Ack);
+}
+
+
+bool BaselineProtocol::submitMismatch(const ImageItem &item, QByteArray *serverMsg)
+{
+ Command cmd;
+ return (sendItem(AcceptMismatch, item) && receiveBlock(&cmd, serverMsg) && cmd == Ack);
+}
+
+
+bool BaselineProtocol::sendItem(Command cmd, const ImageItem &item)
+{
+ errMsg.clear();
+ QBuffer buf;
+ buf.open(QIODevice::WriteOnly);
+ QDataStream ds(&buf);
+ ds << item;
+ if (!sendBlock(cmd, buf.data())) {
+ errMsg.prepend(QLS("Failed to submit image to server. "));
+ return false;
+ }
+ return true;
+}
+
+
+bool BaselineProtocol::sendBlock(Command cmd, const QByteArray &block)
+{
+ QDataStream s(&socket);
+ // TBD: set qds version as a constant
+ s << quint16(ProtocolVersion) << quint16(cmd);
+ s.writeBytes(block.constData(), block.size());
+ return true;
+}
+
+
+bool BaselineProtocol::receiveBlock(Command *cmd, QByteArray *block)
+{
+ while (socket.bytesAvailable() < int(2*sizeof(quint16) + sizeof(quint32))) {
+ if (!socket.waitForReadyRead(Timeout))
+ return false;
+ }
+ QDataStream ds(&socket);
+ quint16 rcvProtocolVersion, rcvCmd;
+ ds >> rcvProtocolVersion >> rcvCmd;
+ if (rcvProtocolVersion != ProtocolVersion) {
+ errMsg = QLS("Baseline protocol version mismatch, received:") + QString::number(rcvProtocolVersion)
+ + QLS(" expected:") + QString::number(ProtocolVersion);
+ return false;
+ }
+ if (cmd)
+ *cmd = Command(rcvCmd);
+
+ QByteArray uMsg;
+ quint32 remaining;
+ ds >> remaining;
+ uMsg.resize(remaining);
+ int got = 0;
+ char* uMsgBuf = uMsg.data();
+ do {
+ got = ds.readRawData(uMsgBuf, remaining);
+ remaining -= got;
+ uMsgBuf += got;
+ } while (remaining && got >= 0 && socket.waitForReadyRead(Timeout));
+
+ if (got < 0)
+ return false;
+
+ if (block)
+ *block = uMsg;
+
+ return true;
+}
+
+
+QString BaselineProtocol::errorMessage()
+{
+ QString ret = errMsg;
+ if (socket.error() >= 0)
+ ret += QLS(" Socket state: ") + socket.errorString();
+ return ret;
+}
diff --git a/tests/arthur/common/baselineprotocol.h b/tests/arthur/common/baselineprotocol.h
new file mode 100644
index 0000000000..2315bc3db8
--- /dev/null
+++ b/tests/arthur/common/baselineprotocol.h
@@ -0,0 +1,172 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#ifndef BASELINEPROTOCOL_H
+#define BASELINEPROTOCOL_H
+
+#include <QDataStream>
+#include <QTcpSocket>
+#include <QImage>
+#include <QVector>
+#include <QMap>
+#include <QPointer>
+
+#define QLS QLatin1String
+#define QLC QLatin1Char
+
+#define FileFormat "png"
+
+const QString PI_TestCase(QLS("TestCase"));
+const QString PI_HostName(QLS("HostName"));
+const QString PI_HostAddress(QLS("HostAddress"));
+const QString PI_OSName(QLS("OSName"));
+const QString PI_OSVersion(QLS("OSVersion"));
+const QString PI_QtVersion(QLS("QtVersion"));
+const QString PI_BuildKey(QLS("BuildKey"));
+const QString PI_GitCommit(QLS("GitCommit"));
+const QString PI_QMakeSpec(QLS("QMakeSpec"));
+const QString PI_PulseGitBranch(QLS("PulseGitBranch"));
+const QString PI_PulseTestrBranch(QLS("PulseTestrBranch"));
+
+class PlatformInfo : public QMap<QString, QString>
+{
+public:
+ PlatformInfo(bool useLocal = false);
+};
+
+struct ImageItem
+{
+public:
+ ImageItem()
+ : status(Ok), itemChecksum(0)
+ {}
+ ImageItem(const ImageItem &other)
+ { *this = other; }
+ ~ImageItem()
+ {}
+ ImageItem &operator=(const ImageItem &other);
+
+ static quint64 computeChecksum(const QImage& image);
+
+ enum ItemStatus {
+ Ok = 0,
+ BaselineNotFound = 1,
+ IgnoreItem = 2,
+ Mismatch = 3
+ };
+
+ QString testFunction;
+ QString itemName;
+ ItemStatus status;
+ QImage image;
+ QList<quint64> imageChecksums;
+ quint16 itemChecksum;
+
+ void writeImageToStream(QDataStream &stream) const;
+ void readImageFromStream(QDataStream &stream);
+};
+QDataStream & operator<< (QDataStream &stream, const ImageItem &ii);
+QDataStream & operator>> (QDataStream &stream, ImageItem& ii);
+
+Q_DECLARE_METATYPE(ImageItem);
+
+typedef QVector<ImageItem> ImageItemList;
+
+
+class BaselineProtocol
+{
+public:
+ BaselineProtocol();
+ ~BaselineProtocol();
+
+ static BaselineProtocol *instance(QObject *parent = 0);
+
+ // ****************************************************
+ // Important constants here
+ // ****************************************************
+ enum Constant {
+ ProtocolVersion = 4,
+ ServerPort = 54129,
+ Timeout = 5000
+ };
+
+ enum Command {
+ UnknownError = 0,
+ // Queries
+ AcceptPlatformInfo = 1,
+ RequestBaselineChecksums = 2,
+ AcceptNewBaseline = 4,
+ AcceptMismatch = 5,
+ // Responses
+ Ack = 128,
+ Abort = 129,
+ DoDryRun = 130
+ };
+
+ // For client:
+
+ // For advanced client:
+ bool connect(const QString &testCase, bool *dryrun = 0);
+ bool requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList);
+ bool submitNewBaseline(const ImageItem &item, QByteArray *serverMsg);
+ bool submitMismatch(const ImageItem &item, QByteArray *serverMsg);
+
+ // For server:
+ bool acceptConnection(PlatformInfo *pi);
+
+ QString errorMessage();
+
+private:
+ bool sendItem(Command cmd, const ImageItem &item);
+
+ bool sendBlock(Command cmd, const QByteArray &block);
+ bool receiveBlock(Command *cmd, QByteArray *block);
+ void sysSleep(int ms);
+
+ QString errMsg;
+ QTcpSocket socket;
+
+ friend class BaselineThread;
+ friend class BaselineHandler;
+};
+
+
+#endif // BASELINEPROTOCOL_H
diff --git a/tests/arthur/common/baselineprotocol.pri b/tests/arthur/common/baselineprotocol.pri
new file mode 100644
index 0000000000..62e38a6ab5
--- /dev/null
+++ b/tests/arthur/common/baselineprotocol.pri
@@ -0,0 +1,11 @@
+INCLUDEPATH += $$PWD
+DEPENDPATH += $$PWD
+
+QT *= network
+
+SOURCES += \
+ $$PWD/baselineprotocol.cpp \
+ $$PWD/lookup3.cpp
+
+HEADERS += \
+ $$PWD/baselineprotocol.h
diff --git a/tests/arthur/common/lookup3.cpp b/tests/arthur/common/lookup3.cpp
new file mode 100644
index 0000000000..8cdc64b500
--- /dev/null
+++ b/tests/arthur/common/lookup3.cpp
@@ -0,0 +1,786 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+
+/*
+These functions are based on:
+
+-------------------------------------------------------------------------------
+lookup3.c, by Bob Jenkins, May 2006, Public Domain.
+
+These are functions for producing 32-bit hashes for hash table lookup.
+hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
+are externally useful functions. Routines to test the hash are included
+if SELF_TEST is defined. You can use this free for any purpose. It's in
+the public domain. It has no warranty.
+
+You probably want to use hashlittle(). hashlittle() and hashbig()
+hash byte arrays. hashlittle() is is faster than hashbig() on
+little-endian machines. Intel and AMD are little-endian machines.
+On second thought, you probably want hashlittle2(), which is identical to
+hashlittle() except it returns two 32-bit hashes for the price of one.
+You could implement hashbig2() if you wanted but I haven't bothered here.
+
+If you want to find a hash of, say, exactly 7 integers, do
+ a = i1; b = i2; c = i3;
+ mix(a,b,c);
+ a += i4; b += i5; c += i6;
+ mix(a,b,c);
+ a += i7;
+ final(a,b,c);
+then use c as the hash value. If you have a variable length array of
+4-byte integers to hash, use hashword(). If you have a byte array (like
+a character string), use hashlittle(). If you have several byte arrays, or
+a mix of things, see the comments above hashlittle().
+
+Why is this so big? I read 12 bytes at a time into 3 4-byte integers,
+then mix those integers. This is fast (you can do a lot more thorough
+mixing with 12*3 instructions on 3 integers than you can with 3 instructions
+on 1 byte), but shoehorning those bytes into integers efficiently is messy.
+-------------------------------------------------------------------------------
+*/
+
+#include <QtGlobal>
+
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+# define HASH_LITTLE_ENDIAN 0
+# define HASH_BIG_ENDIAN 1
+#else
+# define HASH_LITTLE_ENDIAN 1
+# define HASH_BIG_ENDIAN 0
+#endif
+
+#define hashsize(n) ((quint32)1<<(n))
+#define hashmask(n) (hashsize(n)-1)
+#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
+
+/*
+-------------------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly.
+
+This is reversible, so any information in (a,b,c) before mix() is
+still in (a,b,c) after mix().
+
+If four pairs of (a,b,c) inputs are run through mix(), or through
+mix() in reverse, there are at least 32 bits of the output that
+are sometimes the same for one pair and different for another pair.
+This was tested for:
+* pairs that differed by one bit, by two bits, in any combination
+ of top bits of (a,b,c), or in any combination of bottom bits of
+ (a,b,c).
+* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
+ the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
+ is commonly produced by subtraction) look like a single 1-bit
+ difference.
+* the base values were pseudorandom, all zero but one bit set, or
+ all zero plus a counter that starts at zero.
+
+Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
+satisfy this are
+ 4 6 8 16 19 4
+ 9 15 3 18 27 15
+ 14 9 3 7 17 3
+Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
+for "differ" defined as + with a one-bit base and a two-bit delta. I
+used http://burtleburtle.net/bob/hash/avalanche.html to choose
+the operations, constants, and arrangements of the variables.
+
+This does not achieve avalanche. There are input bits of (a,b,c)
+that fail to affect some output bits of (a,b,c), especially of a. The
+most thoroughly mixed value is c, but it doesn't really even achieve
+avalanche in c.
+
+This allows some parallelism. Read-after-writes are good at doubling
+the number of bits affected, so the goal of mixing pulls in the opposite
+direction as the goal of parallelism. I did what I could. Rotates
+seem to cost as much as shifts on every machine I could lay my hands
+on, and rotates are much kinder to the top and bottom bits, so I used
+rotates.
+-------------------------------------------------------------------------------
+*/
+#define mix(a,b,c) \
+{ \
+ a -= c; a ^= rot(c, 4); c += b; \
+ b -= a; b ^= rot(a, 6); a += c; \
+ c -= b; c ^= rot(b, 8); b += a; \
+ a -= c; a ^= rot(c,16); c += b; \
+ b -= a; b ^= rot(a,19); a += c; \
+ c -= b; c ^= rot(b, 4); b += a; \
+}
+
+/*
+-------------------------------------------------------------------------------
+final -- final mixing of 3 32-bit values (a,b,c) into c
+
+Pairs of (a,b,c) values differing in only a few bits will usually
+produce values of c that look totally different. This was tested for
+* pairs that differed by one bit, by two bits, in any combination
+ of top bits of (a,b,c), or in any combination of bottom bits of
+ (a,b,c).
+* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
+ the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
+ is commonly produced by subtraction) look like a single 1-bit
+ difference.
+* the base values were pseudorandom, all zero but one bit set, or
+ all zero plus a counter that starts at zero.
+
+These constants passed:
+ 14 11 25 16 4 14 24
+ 12 14 25 16 4 14 24
+and these came close:
+ 4 8 15 26 3 22 24
+ 10 8 15 26 3 22 24
+ 11 8 15 26 3 22 24
+-------------------------------------------------------------------------------
+*/
+#define final(a,b,c) \
+{ \
+ c ^= b; c -= rot(b,14); \
+ a ^= c; a -= rot(c,11); \
+ b ^= a; b -= rot(a,25); \
+ c ^= b; c -= rot(b,16); \
+ a ^= c; a -= rot(c,4); \
+ b ^= a; b -= rot(a,14); \
+ c ^= b; c -= rot(b,24); \
+}
+
+/*
+--------------------------------------------------------------------
+ This works on all machines. To be useful, it requires
+ -- that the key be an array of quint32's, and
+ -- that the length be the number of quint32's in the key
+
+ The function hashword() is identical to hashlittle() on little-endian
+ machines, and identical to hashbig() on big-endian machines,
+ except that the length has to be measured in quint32s rather than in
+ bytes. hashlittle() is more complicated than hashword() only because
+ hashlittle() has to dance around fitting the key bytes into registers.
+--------------------------------------------------------------------
+*/
+quint32 hashword(
+const quint32 *k, /* the key, an array of quint32 values */
+size_t length, /* the length of the key, in quint32s */
+quint32 initval) /* the previous hash, or an arbitrary value */
+{
+ quint32 a,b,c;
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + (((quint32)length)<<2) + initval;
+
+ /*------------------------------------------------- handle most of the key */
+ while (length > 3)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 3;
+ k += 3;
+ }
+
+ /*------------------------------------------- handle the last 3 quint32's */
+ switch(length) /* all the case statements fall through */
+ {
+ case 3 : c+=k[2];
+ case 2 : b+=k[1];
+ case 1 : a+=k[0];
+ final(a,b,c);
+ case 0: /* case 0: nothing left to add */
+ break;
+ }
+ /*------------------------------------------------------ report the result */
+ return c;
+}
+
+
+/*
+--------------------------------------------------------------------
+hashword2() -- same as hashword(), but take two seeds and return two
+32-bit values. pc and pb must both be nonnull, and *pc and *pb must
+both be initialized with seeds. If you pass in (*pb)==0, the output
+(*pc) will be the same as the return value from hashword().
+--------------------------------------------------------------------
+*/
+void hashword2 (
+const quint32 *k, /* the key, an array of quint32 values */
+size_t length, /* the length of the key, in quint32s */
+quint32 *pc, /* IN: seed OUT: primary hash value */
+quint32 *pb) /* IN: more seed OUT: secondary hash value */
+{
+ quint32 a,b,c;
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + ((quint32)(length<<2)) + *pc;
+ c += *pb;
+
+ /*------------------------------------------------- handle most of the key */
+ while (length > 3)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 3;
+ k += 3;
+ }
+
+ /*------------------------------------------- handle the last 3 quint32's */
+ switch(length) /* all the case statements fall through */
+ {
+ case 3 : c+=k[2];
+ case 2 : b+=k[1];
+ case 1 : a+=k[0];
+ final(a,b,c);
+ case 0: /* case 0: nothing left to add */
+ break;
+ }
+ /*------------------------------------------------------ report the result */
+ *pc=c; *pb=b;
+}
+
+
+/*
+-------------------------------------------------------------------------------
+hashlittle() -- hash a variable-length key into a 32-bit value
+ k : the key (the unaligned variable-length array of bytes)
+ length : the length of the key, counting by bytes
+ initval : can be any 4-byte value
+Returns a 32-bit value. Every bit of the key affects every bit of
+the return value. Two keys differing by one or two bits will have
+totally different hash values.
+
+The best hash table sizes are powers of 2. There is no need to do
+mod a prime (mod is sooo slow!). If you need less than 32 bits,
+use a bitmask. For example, if you need only 10 bits, do
+ h = (h & hashmask(10));
+In which case, the hash table should have hashsize(10) elements.
+
+If you are hashing n strings (quint8 **)k, do it like this:
+ for (i=0, h=0; i<n; ++i) h = hashlittle( k[i], len[i], h);
+
+By Bob Jenkins, 2006. bob_jenkins@burtleburtle.net. You may use this
+code any way you wish, private, educational, or commercial. It's free.
+
+Use for hash table lookup, or anything where one collision in 2^^32 is
+acceptable. Do NOT use for cryptographic purposes.
+-------------------------------------------------------------------------------
+*/
+
+quint32 hashlittle( const void *key, size_t length, quint32 initval)
+{
+ quint32 a,b,c; /* internal state */
+ union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + ((quint32)length) + initval;
+
+ u.ptr = key;
+ if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
+ const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */
+
+ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 12;
+ k += 3;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ /*
+ * "k[2]&0xffffff" actually reads beyond the end of the string, but
+ * then masks off the part it's not allowed to read. Because the
+ * string is aligned, the masked-off tail is in the same word as the
+ * rest of the string. Every machine with memory protection I've seen
+ * does it on word boundaries, so is OK with this. But VALGRIND will
+ * still catch it and complain. The masking trick does make the hash
+ * noticably faster for short strings (like English words).
+ */
+#ifndef VALGRIND
+
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
+ case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
+ case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
+ case 6 : b+=k[1]&0xffff; a+=k[0]; break;
+ case 5 : b+=k[1]&0xff; a+=k[0]; break;
+ case 4 : a+=k[0]; break;
+ case 3 : a+=k[0]&0xffffff; break;
+ case 2 : a+=k[0]&0xffff; break;
+ case 1 : a+=k[0]&0xff; break;
+ case 0 : return c; /* zero length strings require no mixing */
+ }
+
+#else /* make valgrind happy */
+
+ const quint8 *k8 = (const quint8 *)k;
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=((quint32)k8[10])<<16; /* fall through */
+ case 10: c+=((quint32)k8[9])<<8; /* fall through */
+ case 9 : c+=k8[8]; /* fall through */
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=((quint32)k8[6])<<16; /* fall through */
+ case 6 : b+=((quint32)k8[5])<<8; /* fall through */
+ case 5 : b+=k8[4]; /* fall through */
+ case 4 : a+=k[0]; break;
+ case 3 : a+=((quint32)k8[2])<<16; /* fall through */
+ case 2 : a+=((quint32)k8[1])<<8; /* fall through */
+ case 1 : a+=k8[0]; break;
+ case 0 : return c;
+ }
+
+#endif /* !valgrind */
+
+ } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
+ const quint16 *k = (const quint16 *)key; /* read 16-bit chunks */
+ const quint8 *k8;
+
+ /*--------------- all but last block: aligned reads and different mixing */
+ while (length > 12)
+ {
+ a += k[0] + (((quint32)k[1])<<16);
+ b += k[2] + (((quint32)k[3])<<16);
+ c += k[4] + (((quint32)k[5])<<16);
+ mix(a,b,c);
+ length -= 12;
+ k += 6;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ k8 = (const quint8 *)k;
+ switch(length)
+ {
+ case 12: c+=k[4]+(((quint32)k[5])<<16);
+ b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 11: c+=((quint32)k8[10])<<16; /* fall through */
+ case 10: c+=k[4];
+ b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 9 : c+=k8[8]; /* fall through */
+ case 8 : b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 7 : b+=((quint32)k8[6])<<16; /* fall through */
+ case 6 : b+=k[2];
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 5 : b+=k8[4]; /* fall through */
+ case 4 : a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 3 : a+=((quint32)k8[2])<<16; /* fall through */
+ case 2 : a+=k[0];
+ break;
+ case 1 : a+=k8[0];
+ break;
+ case 0 : return c; /* zero length requires no mixing */
+ }
+
+ } else { /* need to read the key one byte at a time */
+ const quint8 *k = (const quint8 *)key;
+
+ /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ a += ((quint32)k[1])<<8;
+ a += ((quint32)k[2])<<16;
+ a += ((quint32)k[3])<<24;
+ b += k[4];
+ b += ((quint32)k[5])<<8;
+ b += ((quint32)k[6])<<16;
+ b += ((quint32)k[7])<<24;
+ c += k[8];
+ c += ((quint32)k[9])<<8;
+ c += ((quint32)k[10])<<16;
+ c += ((quint32)k[11])<<24;
+ mix(a,b,c);
+ length -= 12;
+ k += 12;
+ }
+
+ /*-------------------------------- last block: affect all 32 bits of (c) */
+ switch(length) /* all the case statements fall through */
+ {
+ case 12: c+=((quint32)k[11])<<24;
+ case 11: c+=((quint32)k[10])<<16;
+ case 10: c+=((quint32)k[9])<<8;
+ case 9 : c+=k[8];
+ case 8 : b+=((quint32)k[7])<<24;
+ case 7 : b+=((quint32)k[6])<<16;
+ case 6 : b+=((quint32)k[5])<<8;
+ case 5 : b+=k[4];
+ case 4 : a+=((quint32)k[3])<<24;
+ case 3 : a+=((quint32)k[2])<<16;
+ case 2 : a+=((quint32)k[1])<<8;
+ case 1 : a+=k[0];
+ break;
+ case 0 : return c;
+ }
+ }
+
+ final(a,b,c);
+ return c;
+}
+
+
+/*
+ * hashlittle2: return 2 32-bit hash values
+ *
+ * This is identical to hashlittle(), except it returns two 32-bit hash
+ * values instead of just one. This is good enough for hash table
+ * lookup with 2^^64 buckets, or if you want a second hash if you're not
+ * happy with the first, or if you want a probably-unique 64-bit ID for
+ * the key. *pc is better mixed than *pb, so use *pc first. If you want
+ * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)".
+ */
+void hashlittle2(
+ const void *key, /* the key to hash */
+ size_t length, /* length of the key */
+ quint32 *pc, /* IN: primary initval, OUT: primary hash */
+ quint32 *pb) /* IN: secondary initval, OUT: secondary hash */
+{
+ quint32 a,b,c; /* internal state */
+ union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + ((quint32)length) + *pc;
+ c += *pb;
+
+ u.ptr = key;
+ if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
+ const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */
+
+ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 12;
+ k += 3;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ /*
+ * "k[2]&0xffffff" actually reads beyond the end of the string, but
+ * then masks off the part it's not allowed to read. Because the
+ * string is aligned, the masked-off tail is in the same word as the
+ * rest of the string. Every machine with memory protection I've seen
+ * does it on word boundaries, so is OK with this. But VALGRIND will
+ * still catch it and complain. The masking trick does make the hash
+ * noticably faster for short strings (like English words).
+ */
+#ifndef VALGRIND
+
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
+ case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
+ case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
+ case 6 : b+=k[1]&0xffff; a+=k[0]; break;
+ case 5 : b+=k[1]&0xff; a+=k[0]; break;
+ case 4 : a+=k[0]; break;
+ case 3 : a+=k[0]&0xffffff; break;
+ case 2 : a+=k[0]&0xffff; break;
+ case 1 : a+=k[0]&0xff; break;
+ case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
+ }
+
+#else /* make valgrind happy */
+
+ const quint8 *k8 = (const quint8 *)k;
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=((quint32)k8[10])<<16; /* fall through */
+ case 10: c+=((quint32)k8[9])<<8; /* fall through */
+ case 9 : c+=k8[8]; /* fall through */
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=((quint32)k8[6])<<16; /* fall through */
+ case 6 : b+=((quint32)k8[5])<<8; /* fall through */
+ case 5 : b+=k8[4]; /* fall through */
+ case 4 : a+=k[0]; break;
+ case 3 : a+=((quint32)k8[2])<<16; /* fall through */
+ case 2 : a+=((quint32)k8[1])<<8; /* fall through */
+ case 1 : a+=k8[0]; break;
+ case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
+ }
+
+#endif /* !valgrind */
+
+ } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
+ const quint16 *k = (const quint16 *)key; /* read 16-bit chunks */
+ const quint8 *k8;
+
+ /*--------------- all but last block: aligned reads and different mixing */
+ while (length > 12)
+ {
+ a += k[0] + (((quint32)k[1])<<16);
+ b += k[2] + (((quint32)k[3])<<16);
+ c += k[4] + (((quint32)k[5])<<16);
+ mix(a,b,c);
+ length -= 12;
+ k += 6;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ k8 = (const quint8 *)k;
+ switch(length)
+ {
+ case 12: c+=k[4]+(((quint32)k[5])<<16);
+ b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 11: c+=((quint32)k8[10])<<16; /* fall through */
+ case 10: c+=k[4];
+ b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 9 : c+=k8[8]; /* fall through */
+ case 8 : b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 7 : b+=((quint32)k8[6])<<16; /* fall through */
+ case 6 : b+=k[2];
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 5 : b+=k8[4]; /* fall through */
+ case 4 : a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 3 : a+=((quint32)k8[2])<<16; /* fall through */
+ case 2 : a+=k[0];
+ break;
+ case 1 : a+=k8[0];
+ break;
+ case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
+ }
+
+ } else { /* need to read the key one byte at a time */
+ const quint8 *k = (const quint8 *)key;
+
+ /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ a += ((quint32)k[1])<<8;
+ a += ((quint32)k[2])<<16;
+ a += ((quint32)k[3])<<24;
+ b += k[4];
+ b += ((quint32)k[5])<<8;
+ b += ((quint32)k[6])<<16;
+ b += ((quint32)k[7])<<24;
+ c += k[8];
+ c += ((quint32)k[9])<<8;
+ c += ((quint32)k[10])<<16;
+ c += ((quint32)k[11])<<24;
+ mix(a,b,c);
+ length -= 12;
+ k += 12;
+ }
+
+ /*-------------------------------- last block: affect all 32 bits of (c) */
+ switch(length) /* all the case statements fall through */
+ {
+ case 12: c+=((quint32)k[11])<<24;
+ case 11: c+=((quint32)k[10])<<16;
+ case 10: c+=((quint32)k[9])<<8;
+ case 9 : c+=k[8];
+ case 8 : b+=((quint32)k[7])<<24;
+ case 7 : b+=((quint32)k[6])<<16;
+ case 6 : b+=((quint32)k[5])<<8;
+ case 5 : b+=k[4];
+ case 4 : a+=((quint32)k[3])<<24;
+ case 3 : a+=((quint32)k[2])<<16;
+ case 2 : a+=((quint32)k[1])<<8;
+ case 1 : a+=k[0];
+ break;
+ case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
+ }
+ }
+
+ final(a,b,c);
+ *pc=c; *pb=b;
+}
+
+
+
+/*
+ * hashbig():
+ * This is the same as hashword() on big-endian machines. It is different
+ * from hashlittle() on all machines. hashbig() takes advantage of
+ * big-endian byte ordering.
+ */
+quint32 hashbig( const void *key, size_t length, quint32 initval)
+{
+ quint32 a,b,c;
+ union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + ((quint32)length) + initval;
+
+ u.ptr = key;
+ if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) {
+ const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */
+
+ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 12;
+ k += 3;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ /*
+ * "k[2]<<8" actually reads beyond the end of the string, but
+ * then shifts out the part it's not allowed to read. Because the
+ * string is aligned, the illegal read is in the same word as the
+ * rest of the string. Every machine with memory protection I've seen
+ * does it on word boundaries, so is OK with this. But VALGRIND will
+ * still catch it and complain. The masking trick does make the hash
+ * noticably faster for short strings (like English words).
+ */
+#ifndef VALGRIND
+
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break;
+ case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break;
+ case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break;
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=k[1]&0xffffff00; a+=k[0]; break;
+ case 6 : b+=k[1]&0xffff0000; a+=k[0]; break;
+ case 5 : b+=k[1]&0xff000000; a+=k[0]; break;
+ case 4 : a+=k[0]; break;
+ case 3 : a+=k[0]&0xffffff00; break;
+ case 2 : a+=k[0]&0xffff0000; break;
+ case 1 : a+=k[0]&0xff000000; break;
+ case 0 : return c; /* zero length strings require no mixing */
+ }
+
+#else /* make valgrind happy */
+
+ const quint8 *k8 = (const quint8 *)k;
+ switch(length) /* all the case statements fall through */
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=((quint32)k8[10])<<8; /* fall through */
+ case 10: c+=((quint32)k8[9])<<16; /* fall through */
+ case 9 : c+=((quint32)k8[8])<<24; /* fall through */
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=((quint32)k8[6])<<8; /* fall through */
+ case 6 : b+=((quint32)k8[5])<<16; /* fall through */
+ case 5 : b+=((quint32)k8[4])<<24; /* fall through */
+ case 4 : a+=k[0]; break;
+ case 3 : a+=((quint32)k8[2])<<8; /* fall through */
+ case 2 : a+=((quint32)k8[1])<<16; /* fall through */
+ case 1 : a+=((quint32)k8[0])<<24; break;
+ case 0 : return c;
+ }
+
+#endif /* !VALGRIND */
+
+ } else { /* need to read the key one byte at a time */
+ const quint8 *k = (const quint8 *)key;
+
+ /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += ((quint32)k[0])<<24;
+ a += ((quint32)k[1])<<16;
+ a += ((quint32)k[2])<<8;
+ a += ((quint32)k[3]);
+ b += ((quint32)k[4])<<24;
+ b += ((quint32)k[5])<<16;
+ b += ((quint32)k[6])<<8;
+ b += ((quint32)k[7]);
+ c += ((quint32)k[8])<<24;
+ c += ((quint32)k[9])<<16;
+ c += ((quint32)k[10])<<8;
+ c += ((quint32)k[11]);
+ mix(a,b,c);
+ length -= 12;
+ k += 12;
+ }
+
+ /*-------------------------------- last block: affect all 32 bits of (c) */
+ switch(length) /* all the case statements fall through */
+ {
+ case 12: c+=k[11];
+ case 11: c+=((quint32)k[10])<<8;
+ case 10: c+=((quint32)k[9])<<16;
+ case 9 : c+=((quint32)k[8])<<24;
+ case 8 : b+=k[7];
+ case 7 : b+=((quint32)k[6])<<8;
+ case 6 : b+=((quint32)k[5])<<16;
+ case 5 : b+=((quint32)k[4])<<24;
+ case 4 : a+=k[3];
+ case 3 : a+=((quint32)k[2])<<8;
+ case 2 : a+=((quint32)k[1])<<16;
+ case 1 : a+=((quint32)k[0])<<24;
+ break;
+ case 0 : return c;
+ }
+ }
+
+ final(a,b,c);
+ return c;
+}
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp
index 74ca3c4f5d..b00ce81948 100644
--- a/tests/arthur/common/paintcommands.cpp
+++ b/tests/arthur/common/paintcommands.cpp
@@ -185,6 +185,7 @@ int PaintCommands::translateEnum(const char *table[], const QString &pattern, in
QList<PaintCommands::PaintCommandInfos> PaintCommands::s_commandInfoTable = QList<PaintCommands::PaintCommandInfos>();
QList<QPair<QString,QStringList> > PaintCommands::s_enumsTable = QList<QPair<QString,QStringList> >();
+QMultiHash<QString, int> PaintCommands::s_commandHash;
#define DECL_PAINTCOMMAND(identifier, method, regexp, syntax, sample) \
s_commandInfoTable << PaintCommandInfos(QLatin1String(identifier), &PaintCommands::method, QRegExp(regexp), \
@@ -627,6 +628,15 @@ void PaintCommands::staticInit()
"\n - where vertices 1 to 4 defines the source quad and 5 to 8 the destination quad",
"mapQuadToQuad 0.0 0.0 1.0 1.0 0.0 0.0 -1.0 -1.0");
+ // populate the command lookup hash
+ for (int i=0; i<s_commandInfoTable.size(); i++) {
+ if (s_commandInfoTable.at(i).isSectionHeader() ||
+ s_commandInfoTable.at(i).identifier == QLatin1String("comment") ||
+ s_commandInfoTable.at(i).identifier == QLatin1String("noop"))
+ continue;
+ s_commandHash.insert(s_commandInfoTable.at(i).identifier, i);
+ }
+
// populate the enums list
ADD_ENUMLIST("brush styles", brushStyleTable);
ADD_ENUMLIST("pen styles", penStyleTable);
@@ -686,12 +696,23 @@ void PaintCommands::insertAt(int commandIndex, const QStringList &newCommands)
**********************************************************************************/
void PaintCommands::runCommand(const QString &scriptLine)
{
- staticInit();
- foreach (PaintCommandInfos command, s_commandInfoTable)
- if (!command.isSectionHeader() && command.regExp.indexIn(scriptLine) >= 0) {
+ if (scriptLine.isEmpty()) {
+ command_noop(QRegExp());
+ return;
+ }
+ if (scriptLine.startsWith('#')) {
+ command_comment(QRegExp());
+ return;
+ }
+ QString firstWord = scriptLine.section(QRegExp("\\s"), 0, 0);
+ QList<int> indices = s_commandHash.values(firstWord);
+ foreach(int idx, indices) {
+ const PaintCommandInfos &command = s_commandInfoTable.at(idx);
+ if (command.regExp.indexIn(scriptLine) >= 0) {
(this->*(command.paintMethod))(command.regExp);
return;
}
+ }
qWarning("ERROR: unknown command or argument syntax error in \"%s\"", qPrintable(scriptLine));
}
@@ -1357,6 +1378,8 @@ void PaintCommands::command_qt3_drawArc(QRegExp re)
/***************************************************************************************************/
void PaintCommands::command_drawText(QRegExp re)
{
+ if (!m_shouldDrawText)
+ return;
QStringList caps = re.capturedTexts();
int x = convertToInt(caps.at(1));
int y = convertToInt(caps.at(2));
diff --git a/tests/arthur/common/paintcommands.h b/tests/arthur/common/paintcommands.h
index eea732d3d4..b2516e1f58 100644
--- a/tests/arthur/common/paintcommands.h
+++ b/tests/arthur/common/paintcommands.h
@@ -48,6 +48,7 @@
#include <qstringlist.h>
#include <qpixmap.h>
#include <qbrush.h>
+#include <qhash.h>
QT_FORWARD_DECLARE_CLASS(QPainter)
QT_FORWARD_DECLARE_CLASS(QRegExp)
@@ -89,6 +90,7 @@ public:
, m_verboseMode(false)
, m_type(WidgetType)
, m_checkers_background(true)
+ , m_shouldDrawText(true)
{ staticInit(); }
public:
@@ -114,6 +116,7 @@ public:
void setControlPoints(const QVector<QPointF> &points) { staticInit(); m_controlPoints = points; }
void setVerboseMode(bool v) { staticInit(); m_verboseMode = v; }
void insertAt(int commandIndex, const QStringList &newCommands);
+ void setShouldDrawText(bool drawText) { m_shouldDrawText = drawText; }
// run
void runCommands();
@@ -279,6 +282,7 @@ private:
bool m_verboseMode;
DeviceType m_type;
bool m_checkers_background;
+ bool m_shouldDrawText;
QVector<QPointF> m_controlPoints;
@@ -329,6 +333,7 @@ public:
static QList<PaintCommandInfos> s_commandInfoTable;
static QList<QPair<QString,QStringList> > s_enumsTable;
+ static QMultiHash<QString, int> s_commandHash;
};
#endif // PAINTCOMMANDS_H
diff --git a/tests/arthur/common/qbaselinetest.cpp b/tests/arthur/common/qbaselinetest.cpp
new file mode 100644
index 0000000000..79241d5611
--- /dev/null
+++ b/tests/arthur/common/qbaselinetest.cpp
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include "qbaselinetest.h"
+#include "baselineprotocol.h"
+
+namespace QBaselineTest {
+
+BaselineProtocol proto;
+bool connected = false;
+bool triedConnecting = false;
+
+QByteArray curFunction;
+ImageItemList itemList;
+bool gotBaselines;
+
+
+bool connect(QByteArray *msg, bool *error)
+{
+ if (!triedConnecting) {
+ triedConnecting = true;
+ if (!proto.connect(QTest::testObject()->metaObject()->className())) {
+ *msg += "Failed to connect to baseline server: " + proto.errorMessage().toLatin1();
+ *error = true;
+ return false;
+ }
+ connected = true;
+ }
+ if (!connected) {
+ *msg = "Not connected to baseline server.";
+ *error = true;
+ return false;
+ }
+ return true;
+}
+
+
+bool compareItem(const ImageItem &baseline, const QImage &img, QByteArray *msg, bool *error)
+{
+ ImageItem item = baseline;
+ item.image = img;
+ item.imageChecksums.clear();
+ item.imageChecksums.prepend(ImageItem::computeChecksum(img));
+ QByteArray srvMsg;
+ switch (baseline.status) {
+ case ImageItem::Ok:
+ break;
+ case ImageItem::IgnoreItem :
+ qDebug() << msg->constData() << "Ignored, blacklisted on server.";
+ return true;
+ break;
+ case ImageItem::BaselineNotFound:
+ if (proto.submitNewBaseline(item, &srvMsg))
+ qDebug() << msg->constData() << "Baseline not found on server. New baseline uploaded.";
+ else
+ qDebug() << msg->constData() << "Baseline not found on server. Uploading of new baseline failed:" << srvMsg;
+ return true;
+ break;
+ default:
+ qWarning() << "Unexpected reply from baseline server.";
+ return true;
+ break;
+ }
+ *error = false;
+ // The actual comparison of the given image with the baseline:
+ if (baseline.imageChecksums.contains(item.imageChecksums.at(0)))
+ return true;
+ proto.submitMismatch(item, &srvMsg);
+ *msg += "Mismatch. See report:\n " + srvMsg;
+ return false;
+}
+
+bool checkImage(const QImage &img, const char *name, quint16 checksum, QByteArray *msg, bool *error)
+{
+ if (!connected && !connect(msg, error))
+ return true;
+
+ QByteArray itemName;
+ bool hasName = qstrlen(name);
+ const char *tag = QTest::currentDataTag();
+ if (qstrlen(tag)) {
+ itemName = tag;
+ if (hasName)
+ itemName.append('_').append(name);
+ } else {
+ itemName = hasName ? name : "default_name";
+ }
+
+ *msg = "Baseline check of image '" + itemName + "': ";
+
+
+ ImageItem item;
+ item.itemName = QString::fromLatin1(itemName);
+ item.itemChecksum = checksum;
+ item.testFunction = QString::fromLatin1(QTest::currentTestFunction());
+ ImageItemList list;
+ list.append(item);
+ if (!proto.requestBaselineChecksums(QLatin1String(QTest::currentTestFunction()), &list) || list.isEmpty()) {
+ *msg = "Communication with baseline server failed: " + proto.errorMessage().toLatin1();
+ *error = true;
+ return true;
+ }
+
+ return compareItem(list.at(0), img, msg, error);
+}
+
+
+QTestData &newRow(const char *dataTag, quint16 checksum)
+{
+ if (QTest::currentTestFunction() != curFunction) {
+ curFunction = QTest::currentTestFunction();
+ itemList.clear();
+ gotBaselines = false;
+ }
+ ImageItem item;
+ item.itemName = QString::fromLatin1(dataTag);
+ item.itemChecksum = checksum;
+ item.testFunction = QString::fromLatin1(QTest::currentTestFunction());
+ itemList.append(item);
+
+ return QTest::newRow(dataTag);
+}
+
+
+bool testImage(const QImage& img, QByteArray *msg, bool *error)
+{
+ if (!connected && !connect(msg, error))
+ return true;
+
+ if (QTest::currentTestFunction() != curFunction || itemList.isEmpty()) {
+ qWarning() << "Usage error: QBASELINE_TEST used without corresponding QBaselineTest::newRow()";
+ return true;
+ }
+
+ if (!gotBaselines) {
+ if (!proto.requestBaselineChecksums(QString::fromLatin1(QTest::currentTestFunction()), &itemList) || itemList.isEmpty()) {
+ *msg = "Communication with baseline server failed: " + proto.errorMessage().toLatin1();
+ *error = true;
+ return true;
+ }
+ gotBaselines = true;
+ }
+
+ QString curTag = QString::fromLatin1(QTest::currentDataTag());
+ ImageItemList::const_iterator it = itemList.constBegin();
+ while (it != itemList.constEnd() && it->itemName != curTag)
+ ++it;
+ if (it == itemList.constEnd()) {
+ qWarning() << "Usage error: QBASELINE_TEST used without corresponding QBaselineTest::newRow() for row" << curTag;
+ return true;
+ }
+ return compareItem(*it, img, msg, error);
+}
+
+}
diff --git a/tests/arthur/common/qbaselinetest.h b/tests/arthur/common/qbaselinetest.h
new file mode 100644
index 0000000000..e27cda2fcf
--- /dev/null
+++ b/tests/arthur/common/qbaselinetest.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#ifndef BASELINETEST_H
+#define BASELINETEST_H
+
+#include <QTest>
+
+namespace QBaselineTest {
+bool checkImage(const QImage& img, const char *name, quint16 checksum, QByteArray *msg, bool *error);
+bool testImage(const QImage& img, QByteArray *msg, bool *error);
+QTestData &newRow(const char *dataTag, quint16 checksum = 0);
+}
+
+#define QBASELINE_CHECK_SUM(image, name, checksum)\
+do {\
+ QByteArray _msg;\
+ bool _err = false;\
+ if (!QBaselineTest::checkImage((image), (name), (checksum), &_msg, &_err)) {\
+ QFAIL(_msg.constData());\
+ } else if (_err) {\
+ QSKIP(_msg.constData(), SkipSingle);\
+ }\
+} while (0)
+
+#define QBASELINE_CHECK(image, name) QBASELINE_CHECK_SUM(image, name, 0)
+
+#define QBASELINE_TEST(image)\
+do {\
+ QByteArray _msg;\
+ bool _err = false;\
+ if (!QBaselineTest::testImage((image), &_msg, &_err)) {\
+ QFAIL(_msg.constData());\
+ } else if (_err) {\
+ QSKIP(_msg.constData(), SkipSingle);\
+ }\
+} while (0)
+
+#endif // BASELINETEST_H
diff --git a/tests/arthur/common/qbaselinetest.pri b/tests/arthur/common/qbaselinetest.pri
new file mode 100644
index 0000000000..5420c6ed1c
--- /dev/null
+++ b/tests/arthur/common/qbaselinetest.pri
@@ -0,0 +1,13 @@
+QT *= testlib
+
+SOURCES += \
+ $$PWD/qbaselinetest.cpp
+
+HEADERS += \
+ $$PWD/qbaselinetest.h
+
+win32|symbian*:MKSPEC=$$replace(QMAKESPEC, \\\\, /)
+else:MKSPEC=$$QMAKESPEC
+DEFINES += QMAKESPEC=\\\"$$MKSPEC\\\"
+
+include($$PWD/baselineprotocol.pri)
diff --git a/tests/arthur/lance/lance.pro b/tests/arthur/lance/lance.pro
index 3692f21afa..56b7f25b81 100644
--- a/tests/arthur/lance/lance.pro
+++ b/tests/arthur/lance/lance.pro
@@ -13,7 +13,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, o
contains(QT_CONFIG, qt3support):QT += qt3support
symbian*: {
- testData.sources = $$QT_BUILD_TREE/tests/arthur/data/qps
+ testData.files = $$QT_BUILD_TREE/tests/arthur/data/qps
testData.path = .
DEPLOYMENT += testData
}
diff --git a/tests/auto/baselineexample/baselineexample.pro b/tests/auto/baselineexample/baselineexample.pro
new file mode 100644
index 0000000000..30feecc74e
--- /dev/null
+++ b/tests/auto/baselineexample/baselineexample.pro
@@ -0,0 +1,18 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-12-09T14:55:13
+#
+#-------------------------------------------------
+
+QT += testlib
+
+TARGET = tst_baselineexample
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+SOURCES += tst_baselineexample.cpp
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
+
+include($$QT_SOURCE_TREE/tests/arthur/common/qbaselinetest.pri)
diff --git a/tests/auto/baselineexample/tst_baselineexample.cpp b/tests/auto/baselineexample/tst_baselineexample.cpp
new file mode 100644
index 0000000000..b97cc631f7
--- /dev/null
+++ b/tests/auto/baselineexample/tst_baselineexample.cpp
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <qbaselinetest.h>
+#include <QPushButton>
+
+class tst_BaselineExample : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_BaselineExample();
+
+private Q_SLOTS:
+ void testBasicUsage();
+ void testMultipleImages();
+ void testDataDriven_data();
+ void testDataDriven();
+ void testDataDrivenChecksum_data();
+ void testDataDrivenChecksum();
+};
+
+
+tst_BaselineExample::tst_BaselineExample()
+{
+}
+
+
+void tst_BaselineExample::testBasicUsage()
+{
+ // Generate an image:
+ QPushButton b("Press me!");
+ b.resize(100, 50);
+ b.show();
+ QTest::qWaitForWindowShown(&b);
+ QImage img1 = QPixmap::grabWidget(&b).toImage();
+ QVERIFY(!img1.isNull());
+
+ // Compare it to baseline on server:
+ QBASELINE_CHECK(img1, "button");
+}
+
+
+void tst_BaselineExample::testMultipleImages()
+{
+ QPushButton b("Press me!");
+ b.resize(100, 50);
+ b.show();
+ QTest::qWaitForWindowShown(&b);
+ QBASELINE_CHECK(QPixmap::grabWidget(&b).toImage(), "text1");
+
+ b.setText("Kick me!");
+ QTest::qWait(50);
+ QBASELINE_CHECK(QPixmap::grabWidget(&b).toImage(), "text2");
+}
+
+
+void tst_BaselineExample::testDataDriven_data()
+{
+ QTest::addColumn<QString>("label");
+ QBaselineTest::newRow("short") << "Ok!";
+ QBaselineTest::newRow("long") << "A really long button text that just does not seem to end";
+ QBaselineTest::newRow("empty") << "";
+ QBaselineTest::newRow("signs") << "!@#$%^&*()_";
+ QBaselineTest::newRow("html") << "<b>BOLD</b>";
+}
+
+
+void tst_BaselineExample::testDataDriven()
+{
+ QFETCH(QString, label);
+ QPushButton b(label);
+ b.resize(100, 50);
+ b.show();
+ QTest::qWaitForWindowShown(&b);
+ QBASELINE_TEST(QPixmap::grabWidget(&b).toImage());
+}
+
+
+void tst_BaselineExample::testDataDrivenChecksum_data()
+{
+ QTest::addColumn<QString>("label");
+
+ const int numItems = 5;
+ const char *tags[numItems] = {"short", "long", "empty", "signs", "html"};
+ const char *labels[numItems] = {"Ok!", "A really long button text that just does not seem to end", "", "!@#$%^&*()_", "<b>BOLD</b>"};
+
+ for (int i = 0; i<numItems; i++) {
+ quint16 checksum = qChecksum(labels[i], qstrlen(labels[i]));
+ QBaselineTest::newRow(tags[i], checksum) << labels[i];
+ }
+}
+
+
+void tst_BaselineExample::testDataDrivenChecksum()
+{
+ QFETCH(QString, label);
+ QPushButton b(label);
+ b.resize(100, 50);
+ b.show();
+ QTest::qWaitForWindowShown(&b);
+ QBASELINE_TEST(QPixmap::grabWidget(&b).toImage());
+}
+
+
+QTEST_MAIN(tst_BaselineExample);
+
+#include "tst_baselineexample.moc"
diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro
index 319ba9be4e..ab932f51d2 100644
--- a/tests/auto/checkxmlfiles/checkxmlfiles.pro
+++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro
@@ -8,7 +8,7 @@ include (../xmlpatterns.pri)
wince*|symbian: {
QT += network
-addFiles.sources = \
+addFiles.files = \
$$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \
$$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/globals.gccxml \
$$QT_SOURCE_TREE/doc/src/diagrams/stylesheet/treeview.svg \
diff --git a/tests/auto/collections/collections.pro b/tests/auto/collections/collections.pro
index 876e9034c4..8601ff877d 100644
--- a/tests/auto/collections/collections.pro
+++ b/tests/auto/collections/collections.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_collections.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp
index 710ffd266b..9b24660895 100644
--- a/tests/auto/collections/tst_collections.cpp
+++ b/tests/auto/collections/tst_collections.cpp
@@ -166,6 +166,9 @@ private slots:
void forwardDeclared();
void alignment();
void QTBUG13079_collectionInsideCollection();
+
+ void foreach_2();
+ void insert_remove_loop();
};
struct LargeStatic {
@@ -3448,27 +3451,16 @@ void tst_Collections::containerTypedefs()
testSetContainerTypedefs(QSet<int>());
}
-#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
-class Key1
-{};
-class T1
-{};
-class T2
-{};
-#else
class Key1;
class T1;
class T2;
-#endif
void tst_Collections::forwardDeclared()
{
{ typedef QHash<Key1, T1> C; C *x = 0; C::iterator i; C::const_iterator j; Q_UNUSED(x) }
{ typedef QMultiHash<Key1, T1> C; C *x = 0; C::iterator i; C::const_iterator j; Q_UNUSED(x) }
-#if !defined(Q_CC_MSVC_NET) || _MSC_VER >= 1310
{ typedef QMap<Key1, T1> C; C *x = 0; C::iterator i; C::const_iterator j; Q_UNUSED(x) }
{ typedef QMultiMap<Key1, T1> C; C *x = 0; C::iterator i; C::const_iterator j; Q_UNUSED(x) }
-#endif
#if !defined(Q_CC_RVCT)
// RVCT can't handle forward declared template parameters if those are used to declare
// class members inside templated class.
@@ -3643,7 +3635,7 @@ template<template<class, class> class C> void QTBUG13079_collectionInsideCollect
}
-static quint32 qHash(const QTBUG13079_Node<QSet> &)
+quint32 qHash(const QTBUG13079_Node<QSet> &)
{
return 0;
}
@@ -3718,5 +3710,214 @@ void tst_Collections::QTBUG13079_collectionInsideCollection()
#endif
}
+template<class Container> void foreach_test_arrays(const Container &container)
+{
+ typedef typename Container::value_type T;
+ int i = 0;
+ QSet <T> set;
+ foreach(const T & val, container) {
+ QVERIFY( val == container[i] );
+ set << val;
+ i++;
+ }
+ QCOMPARE(set.count(), container.count());
+
+ //modify the container while iterating.
+ Container c2 = container;
+ Container c3;
+ i = 0;
+ foreach (T val, c2) {
+ c3 << val;
+ c2.insert((i * 89) % c2.size(), T() );
+ QVERIFY( val == container.at(i) );
+ val = T();
+ i++;
+ }
+ QVERIFY(c3 == container);
+}
+
+
+void tst_Collections::foreach_2()
+{
+ QStringList strlist = QString::fromLatin1("a,b,c,d,e,f,g,h,ih,kl,mn,op,qr,st,uvw,xyz").split(",");
+ foreach_test_arrays(strlist);
+ foreach_test_arrays(QList<QString>(strlist));
+ foreach_test_arrays(strlist.toVector());
+
+ QList<int> intlist;
+ intlist << 1 << 2 << 3 << 4 <<5 << 6 << 7 << 8 << 9;
+ foreach_test_arrays(intlist);
+ foreach_test_arrays(intlist.toVector());
+
+ QVarLengthArray<int> varl1;
+ QVarLengthArray<int, 3> varl2;
+ QVarLengthArray<int, 10> varl3;
+ foreach(int i, intlist) {
+ varl1 << i;
+ varl2 << i;
+ varl3 << i;
+ }
+ QCOMPARE(varl1.count(), intlist.count());
+ QCOMPARE(varl2.count(), intlist.count());
+ QCOMPARE(varl3.count(), intlist.count());
+ foreach_test_arrays(varl1);
+ foreach_test_arrays(varl2);
+ foreach_test_arrays(varl3);
+
+ QVarLengthArray<QString> varl4;
+ QVarLengthArray<QString, 3> varl5;
+ QVarLengthArray<QString, 18> varl6;
+ foreach(const QString &str, strlist) {
+ varl4 << str;
+ varl5 << str;
+ varl6 << str;
+ }
+ QCOMPARE(varl4.count(), strlist.count());
+ QCOMPARE(varl5.count(), strlist.count());
+ QCOMPARE(varl6.count(), strlist.count());
+ foreach_test_arrays(varl4);
+ foreach_test_arrays(varl5);
+ foreach_test_arrays(varl6);
+}
+
+struct IntOrString
+{
+ int val;
+ IntOrString(int v) : val(v) { }
+ IntOrString(const QString &v) : val(v.toInt()) { }
+ operator int() { return val; }
+ operator QString() { return QString::number(val); }
+#ifndef QT_NO_STL
+ operator std::string() { return QString::number(val).toStdString(); }
+ IntOrString(const std::string &v) : val(QString::fromStdString(v).toInt()) { }
+#endif
+};
+
+template<class Container> void insert_remove_loop_impl()
+{
+ typedef typename Container::value_type T;
+ Container t;
+ t.append(T(IntOrString(1)));
+ t << (T(IntOrString(2)));
+ t += (T(IntOrString(3)));
+ t.prepend(T(IntOrString(4)));
+ t.insert(2, 3 , T(IntOrString(5)));
+ t.insert(4, T(IntOrString(6)));
+ t.insert(t.begin() + 2, T(IntOrString(7)));
+ t.insert(t.begin() + 5, 3, T(IntOrString(8)));
+ int expect1[] = { 4 , 1 , 7, 5 , 5 , 8, 8, 8, 6, 5, 2 , 3 };
+ QCOMPARE(size_t(t.count()), sizeof(expect1)/sizeof(int));
+ for (int i = 0; i < t.count(); i++) {
+ QCOMPARE(t[i], T(IntOrString(expect1[i])));
+ }
+
+ Container compare_test1 = t;
+ t.replace(5, T(IntOrString(9)));
+ Container compare_test2 = t;
+ QVERIFY(!(compare_test1 == t));
+ QVERIFY( (compare_test1 != t));
+ QVERIFY( (compare_test2 == t));
+ QVERIFY(!(compare_test2 != t));
+ t.remove(7);
+ t.remove(2, 3);
+ int expect2[] = { 4 , 1 , 9, 8, 6, 5, 2 , 3 };
+ QCOMPARE(size_t(t.count()), sizeof(expect2)/sizeof(int));
+ for (int i = 0; i < t.count(); i++) {
+ QCOMPARE(t[i], T(IntOrString(expect2[i])));
+ }
+
+ for (typename Container::iterator it = t.begin(); it != t.end(); ) {
+ if ( int(IntOrString(*it)) % 2 )
+ ++it;
+ else
+ it = t.erase(it);
+ }
+
+ int expect3[] = { 1 , 9, 5, 3 };
+ QCOMPARE(size_t(t.count()), sizeof(expect3)/sizeof(int));
+ for (int i = 0; i < t.count(); i++) {
+ QCOMPARE(t[i], T(IntOrString(expect3[i])));
+ }
+
+ t.erase(t.begin() + 1, t.end() - 1);
+
+ int expect4[] = { 1 , 3 };
+ QCOMPARE(size_t(t.count()), sizeof(expect4)/sizeof(int));
+ for (int i = 0; i < t.count(); i++) {
+ QCOMPARE(t[i], T(IntOrString(expect4[i])));
+ }
+
+ t << T(IntOrString(10)) << T(IntOrString(11)) << T(IntOrString(12)) << T(IntOrString(13));
+ t << T(IntOrString(14)) << T(IntOrString(15)) << T(IntOrString(16)) << T(IntOrString(17));
+ t << T(IntOrString(18)) << T(IntOrString(19)) << T(IntOrString(20)) << T(IntOrString(21));
+ for (typename Container::iterator it = t.begin(); it != t.end(); ++it) {
+ int iv = int(IntOrString(*it));
+ if ( iv % 2 ) {
+ it = t.insert(it, T(IntOrString(iv * iv)));
+ it = t.insert(it + 2, T(IntOrString(iv * iv + 1)));
+ }
+ }
+
+ int expect5[] = { 1, 1, 2, 3*3, 3, 3*3+1, 10, 11*11, 11, 11*11+1, 12 , 13*13, 13, 13*13+1, 14,
+ 15*15, 15, 15*15+1, 16 , 17*17, 17, 17*17+1 ,18 , 19*19, 19, 19*19+1, 20, 21*21, 21, 21*21+1 };
+ QCOMPARE(size_t(t.count()), sizeof(expect5)/sizeof(int));
+ for (int i = 0; i < t.count(); i++) {
+ QCOMPARE(t[i], T(IntOrString(expect5[i])));
+ }
+}
+
+
+//Add insert(int, int, T) so it has the same interface as QVector and QVarLengthArray for the test.
+template<typename T>
+struct ExtList : QList<T> {
+ using QList<T>::insert;
+ void insert(int before, int n, const T&x) {
+ while (n--) {
+ this->insert(before, x );
+ }
+ }
+ void insert(typename QList<T>::iterator before, int n, const T&x) {
+ while (n--) {
+ before = this->insert(before, x);
+ }
+ }
+
+ void remove(int i) {
+ this->removeAt(i);
+ }
+ void remove(int i, int n) {
+ while (n--) {
+ this->removeAt(i);
+ }
+ }
+};
+
+void tst_Collections::insert_remove_loop()
+{
+ insert_remove_loop_impl<ExtList<int> >();
+ insert_remove_loop_impl<ExtList<QString> >();
+ insert_remove_loop_impl<QVector<int> >();
+ insert_remove_loop_impl<QVector<QString> >();
+ insert_remove_loop_impl<QVarLengthArray<int> >();
+ insert_remove_loop_impl<QVarLengthArray<QString> >();
+ insert_remove_loop_impl<QVarLengthArray<int, 10> >();
+ insert_remove_loop_impl<QVarLengthArray<QString, 10> >();
+ insert_remove_loop_impl<QVarLengthArray<int, 3> >();
+ insert_remove_loop_impl<QVarLengthArray<QString, 3> >();
+ insert_remove_loop_impl<QVarLengthArray<int, 15> >();
+ insert_remove_loop_impl<QVarLengthArray<QString, 15> >();
+
+#ifndef QT_NO_STL
+ insert_remove_loop_impl<ExtList<std::string> >();
+ insert_remove_loop_impl<QVector<std::string> >();
+ insert_remove_loop_impl<QVarLengthArray<std::string> >();
+ insert_remove_loop_impl<QVarLengthArray<std::string, 10> >();
+ insert_remove_loop_impl<QVarLengthArray<std::string, 3> >();
+ insert_remove_loop_impl<QVarLengthArray<std::string, 15> >();
+#endif
+}
+
+
+
QTEST_APPLESS_MAIN(tst_Collections)
#include "tst_collections.moc"
diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro
index 531fed25bb..3451b5312c 100644
--- a/tests/auto/corelib.pro
+++ b/tests/auto/corelib.pro
@@ -75,6 +75,7 @@ SUBDIRS=\
qstringbuilder4 \
qstringlist \
qstringmatcher \
+ qstringref \
qtconcurrentfilter \
qtconcurrentiteratekernel \
qtconcurrentmap \
@@ -100,6 +101,8 @@ SUBDIRS=\
qwritelocker \
selftests \
utf8 \
+ qfilesystementry \
+ qabstractfileengine
symbian:SUBDIRS -= \
qtconcurrentfilter \
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
index f0fcfa9ed0..499c155697 100644
--- a/tests/auto/declarative/declarative.pro
+++ b/tests/auto/declarative/declarative.pro
@@ -8,74 +8,78 @@ SUBDIRS += \
SUBDIRS += \
examples \
parserstress \
+ qdeclarativecomponent \
+ qdeclarativecontext \
+ qdeclarativeengine \
+ qdeclarativeerror \
+ qdeclarativefolderlistmodel \
+ qdeclarativeinfo \
+ qdeclarativelayoutitem \
+ qdeclarativelistreference \
+ qdeclarativemoduleplugin \
+ qdeclarativeparticles \
+ qdeclarativepixmapcache \
+ qdeclarativeqt \
+ qdeclarativeview \
+ qdeclarativeviewer \
+ qdeclarativexmlhttprequest \
+ qmlvisual \
+ moduleqt47
+
+contains(QT_CONFIG, private_tests) {
+ SUBDIRS += \
qdeclarativeanchors \
qdeclarativeanimatedimage \
qdeclarativeanimations \
qdeclarativebehaviors \
qdeclarativebinding \
qdeclarativeborderimage \
- qdeclarativecomponent \
qdeclarativeconnection \
- qdeclarativecontext \
qdeclarativedebug \
qdeclarativedebugclient \
qdeclarativedebugservice \
qdeclarativedom \
qdeclarativeecmascript \
- qdeclarativeengine \
- qdeclarativeerror \
- qdeclarativefolderlistmodel \
- qdeclarativefontloader \
qdeclarativeflickable \
qdeclarativeflipable \
qdeclarativefocusscope \
+ qdeclarativefontloader \
qdeclarativegridview \
qdeclarativeimage \
qdeclarativeimageprovider \
- qdeclarativeinfo \
qdeclarativeinstruction \
qdeclarativeitem \
qdeclarativelanguage \
- qdeclarativelayoutitem \
qdeclarativelistmodel \
- qdeclarativelistreference \
qdeclarativelistview \
qdeclarativeloader \
- qdeclarativemoduleplugin \
qdeclarativemousearea \
- qdeclarativeparticles \
qdeclarativepathview \
- qdeclarativepixmapcache \
qdeclarativepositioners \
qdeclarativeproperty \
qdeclarativepropertymap \
- qdeclarativeqt \
qdeclarativerepeater \
qdeclarativesmoothedanimation \
qdeclarativespringanimation \
+ qdeclarativestyledtext \
qdeclarativesqldatabase \
qdeclarativestates \
- qdeclarativestyledtext \
qdeclarativesystempalette \
qdeclarativetext \
qdeclarativetextedit \
qdeclarativetextinput \
qdeclarativetimer \
qdeclarativevaluetypes \
- qdeclarativeview \
- qdeclarativeviewer \
qdeclarativevisualdatamodel \
qdeclarativeworkerscript \
- qdeclarativexmlhttprequest \
qdeclarativexmllistmodel \
- qmlvisual \
- qpacketprotocol \
- moduleqt47
+ qpacketprotocol
contains(QT_CONFIG, webkit) {
SUBDIRS += \
qdeclarativewebview
}
+}
# Tests which should run in Pulse
PULSE_TESTS = $$SUBDIRS
diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro
index 2e243b4957..dafc146610 100644
--- a/tests/auto/declarative/examples/examples.pro
+++ b/tests/auto/declarative/examples/examples.pro
@@ -6,10 +6,12 @@ SOURCES += tst_examples.cpp
include(../../../../tools/qml/qml.pri)
+include(../symbianlibs.pri)
+
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/moduleqt47/moduleqt47.pro b/tests/auto/declarative/moduleqt47/moduleqt47.pro
index 4ee634e188..ff773e8f86 100644
--- a/tests/auto/declarative/moduleqt47/moduleqt47.pro
+++ b/tests/auto/declarative/moduleqt47/moduleqt47.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_moduleqt47.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro
index bb1d69ff9d..6ef2432b5b 100644
--- a/tests/auto/declarative/parserstress/parserstress.pro
+++ b/tests/auto/declarative/parserstress/parserstress.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_parserstress.cpp
symbian: {
- importFiles.sources = ..\\..\\qscriptjstestsuite\\tests
+ importFiles.files = ..\\..\\qscriptjstestsuite\\tests
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
index 9798bb6a62..f09e8d9fe2 100644
--- a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
+++ b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
@@ -4,9 +4,9 @@ SOURCES += tst_qdeclarativeanchors.cpp
macx:CONFIG -= app_bundle
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
index 0a2f0f29b7..3d040a67ab 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
@@ -5,9 +5,9 @@ SOURCES += tst_qdeclarativeanimatedimage.cpp ../shared/testhttpserver.cpp
macx:CONFIG -= app_bundle
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
index ed47dcafa2..d00d51a6e0 100644
--- a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
+++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
@@ -4,9 +4,9 @@ SOURCES += tst_qdeclarativeanimations.cpp
macx:CONFIG -= app_bundle
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
index cfb59ef458..74168273fd 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
+++ b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
@@ -4,9 +4,9 @@ SOURCES += tst_qdeclarativebehaviors.cpp
macx:CONFIG -= app_bundle
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
index a7ba2a8bd8..fe12635657 100644
--- a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
+++ b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativebinding.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
index a21761b87a..a7463e894a 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
+++ b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
@@ -6,9 +6,9 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativeborderimage.cpp ../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
index d06ce4f7ba..6f9550d34f 100644
--- a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
+++ b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeconnection.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
index 7ccedfd41c..a807f35f22 100644
--- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
+++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
@@ -113,6 +113,7 @@ private slots:
void tst_QDeclarativeDebugContextReference();
void tst_QDeclarativeDebugPropertyReference();
+ void setBindingForObject();
void setMethodBody();
};
@@ -897,6 +898,78 @@ void tst_QDeclarativeDebug::tst_QDeclarativeDebugPropertyReference()
compareProperties(r, ref);
}
+
+void tst_QDeclarativeDebug::setBindingForObject()
+{
+ QDeclarativeDebugObjectReference rootObject = findRootObject();
+ QVERIFY(rootObject.debugId() != -1);
+ QDeclarativeDebugPropertyReference widthPropertyRef = findProperty(rootObject.properties(), "width");
+
+ QCOMPARE(widthPropertyRef.value(), QVariant(10));
+ QCOMPARE(widthPropertyRef.binding(), QString());
+
+ //
+ // set literal
+ //
+ m_dbg->setBindingForObject(rootObject.debugId(), "width", "15", true);
+
+ rootObject = findRootObject();
+ widthPropertyRef = findProperty(rootObject.properties(), "width");
+
+ QCOMPARE(widthPropertyRef.value(), QVariant(15));
+ QCOMPARE(widthPropertyRef.binding(), QString());
+
+ //
+ // set expression
+ //
+ m_dbg->setBindingForObject(rootObject.debugId(), "width", "height", false);
+
+ rootObject = findRootObject();
+ widthPropertyRef = findProperty(rootObject.properties(), "width");
+
+ QCOMPARE(widthPropertyRef.value(), QVariant(20));
+ QCOMPARE(widthPropertyRef.binding(), QString("height"));
+
+ //
+ // reset
+ //
+ m_dbg->resetBindingForObject(rootObject.debugId(), "width");
+
+ rootObject = findRootObject();
+ widthPropertyRef = findProperty(rootObject.properties(), "width");
+
+ // QCOMPARE(widthPropertyRef.value(), QVariant(0)); // TODO: Shouldn't this work?
+ QCOMPARE(widthPropertyRef.binding(), QString());
+
+ //
+ // set handler
+ //
+ rootObject = findRootObject();
+ QCOMPARE(rootObject.children().size(), 3);
+ QDeclarativeDebugObjectReference mouseAreaObject = rootObject.children().at(2);
+ QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObjectRecursive(mouseAreaObject, this);
+ waitForQuery(q_obj);
+ mouseAreaObject = q_obj->object();
+
+ QCOMPARE(mouseAreaObject.className(), QString("MouseArea"));
+
+ QDeclarativeDebugPropertyReference onEnteredRef = findProperty(mouseAreaObject.properties(), "onEntered");
+
+ QCOMPARE(onEnteredRef.name(), QString("onEntered"));
+ QCOMPARE(onEnteredRef.value(), QVariant("{ console.log('hello') }"));
+
+ m_dbg->setBindingForObject(mouseAreaObject.debugId(), "onEntered", "{console.log('hello, world') }", false) ;
+
+ rootObject = findRootObject();
+ mouseAreaObject = rootObject.children().at(2);
+ q_obj = m_dbg->queryObjectRecursive(mouseAreaObject, this);
+ waitForQuery(q_obj);
+ mouseAreaObject = q_obj->object();
+ onEnteredRef = findProperty(mouseAreaObject.properties(), "onEntered");
+ QCOMPARE(onEnteredRef.name(), QString("onEntered"));
+ QCOMPARE(onEnteredRef.value(), QVariant("{console.log('hello, world') }"));
+}
+
int main(int argc, char *argv[])
{
int _argc = argc + 1;
diff --git a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro
index 415d4e2d50..8ac69aac67 100644
--- a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro
+++ b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativedom.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
index 58cad34d28..69d25a4292 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
+++ b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
@@ -13,9 +13,9 @@ INCLUDEPATH += ../shared
# LIBS += -lgcov
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
index be0ba6c36f..c176e072e0 100644
--- a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
+++ b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeflickable.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
index 759e80b321..3b6d19a624 100644
--- a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
+++ b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeflipable.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
index 24749c61c5..eab983ffe4 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
+++ b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
@@ -4,9 +4,9 @@ SOURCES += tst_qdeclarativefocusscope.cpp
macx:CONFIG -= app_bundle
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro
index 91bf4a764f..b7e5e5fcc8 100644
--- a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro
+++ b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativefolderlistmodel.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
index 01dca2668c..357268b286 100644
--- a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
+++ b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
@@ -6,9 +6,9 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativefontloader.cpp ../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
index a99a1b9c3b..bc196fb50e 100644
--- a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
+++ b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativegridview.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
index 244a1e1e90..a22c8b5378 100644
--- a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
+++ b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
@@ -6,9 +6,9 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativeimage.cpp ../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
index 2c20e7ef09..423390f13f 100644
--- a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
+++ b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeinfo.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
index f4901c4428..d8007a092f 100644
--- a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
+++ b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeitem.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro
index 43c451fb32..cae85a7b6c 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro
+++ b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro
@@ -12,9 +12,9 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += ../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
index 5076e5150f..d89f16cd7d 100644
--- a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
+++ b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativelayoutitem.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
index e90db499ce..b5c5cf247a 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
+++ b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
@@ -6,9 +6,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativelistmodel.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
index 8c99f0895f..1633ffca2a 100644
--- a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
+++ b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
@@ -6,9 +6,9 @@ HEADERS += incrementalmodel.h
SOURCES += tst_qdeclarativelistview.cpp incrementalmodel.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
index b07bf9e903..1ede50964a 100644
--- a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
+++ b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
@@ -8,9 +8,9 @@ SOURCES += tst_qdeclarativeloader.cpp \
../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
index fb3630ffe0..2e8aa754b0 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
@@ -4,9 +4,9 @@ QT += declarative
CONFIG -= app_bundle
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
index 3d39aa8ab0..ed9313fe75 100644
--- a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
+++ b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
@@ -6,9 +6,9 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativemousearea.cpp ../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
index f9ca90fe7e..2cf826831f 100644
--- a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
+++ b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeparticles.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
index 04fd26b125..e0404c551d 100644
--- a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
+++ b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativepathview.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
index 31303640ec..88871e9523 100644
--- a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
+++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
@@ -10,9 +10,9 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += ../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
index 76fe2dc1f3..0dafc505e4 100644
--- a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
+++ b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
@@ -74,7 +74,9 @@ private slots:
void massive();
void cancelcrash();
void shrinkcache();
+#ifndef QT_NO_CONCURRENT
void networkCrash();
+#endif
private:
QDeclarativeEngine engine;
QUrl thisfile;
@@ -363,6 +365,7 @@ void createNetworkServer()
eventLoop.exec();
}
+#ifndef QT_NO_CONCURRENT
// QT-3957
void tst_qdeclarativepixmapcache::networkCrash()
{
@@ -377,6 +380,7 @@ void tst_qdeclarativepixmapcache::networkCrash()
}
future.cancel();
}
+#endif
QTEST_MAIN(tst_qdeclarativepixmapcache)
diff --git a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
index 5dc7bb810a..27e594850c 100644
--- a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
+++ b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
@@ -4,9 +4,9 @@ SOURCES += tst_qdeclarativepositioners.cpp
macx:CONFIG -= app_bundle
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
index 4121a335b6..1750860244 100644
--- a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
+++ b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeproperty.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
index 6af65008eb..71ff8a815c 100644
--- a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
+++ b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
@@ -4,9 +4,9 @@ SOURCES += tst_qdeclarativeqt.cpp
macx:CONFIG -= app_bundle
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
index f3ff9ed5c9..5230f698b7 100644
--- a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
+++ b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativerepeater.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro b/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro
index c2d30a0c11..171f308778 100644
--- a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro
+++ b/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro
@@ -9,9 +9,9 @@ INCLUDEPATH += ../shared
# LIBS += -lgcov
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
index 872aeb9888..1e77d6eb9a 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativesmoothedanimation.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro
index 213b262fce..da477fcebd 100644
--- a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro
+++ b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativespringanimation.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro b/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro
index 1462c9a28b..0d335a547d 100644
--- a/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro
+++ b/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro
@@ -6,9 +6,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativesqldatabase.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
index 2bae041398..4a0cc24b28 100644
--- a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
+++ b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativestates.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
index c1a36fdcbb..290cda3035 100644
--- a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
+++ b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
@@ -10,9 +10,9 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += ../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
index 4b6bd49de2..aaf753e640 100644
--- a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
+++ b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
@@ -6,9 +6,9 @@ SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp
HEADERS += ../shared/testhttpserver.h
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
index 8f42448587..0fee1c9391 100644
--- a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
+++ b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativetextinput.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
index 90e46d3967..59b3526838 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
+++ b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
@@ -8,9 +8,9 @@ SOURCES += tst_qdeclarativevaluetypes.cpp \
testtypes.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
index 21a9195606..fc4790d21f 100644
--- a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
+++ b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeview.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro
index 6189916a43..8d4b410567 100644
--- a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro
+++ b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro
@@ -6,10 +6,12 @@ include(../../../../tools/qml/qml.pri)
SOURCES += tst_qdeclarativeviewer.cpp
+include(../symbianlibs.pri)
+
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
index 92e5f605b7..fe3d79461b 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativevisualdatamodel.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro b/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro
index 562a9fbf3f..af13d33f73 100644
--- a/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro
+++ b/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro
@@ -6,9 +6,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativewebview.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
index 2f8f23db35..e20c3e6a53 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
+++ b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
@@ -5,9 +5,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeworkerscript.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
index 619b239174..8aefb8e685 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
@@ -9,9 +9,9 @@ SOURCES += tst_qdeclarativexmlhttprequest.cpp \
../shared/testhttpserver.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
index efcea12675..64b8267707 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
@@ -9,9 +9,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativexmllistmodel.cpp
symbian: {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qmlvisual/qmlvisual.pro b/tests/auto/declarative/qmlvisual/qmlvisual.pro
index cb7e5d7bd8..84df15cb3b 100644
--- a/tests/auto/declarative/qmlvisual/qmlvisual.pro
+++ b/tests/auto/declarative/qmlvisual/qmlvisual.pro
@@ -6,7 +6,7 @@ SOURCES += tst_qmlvisual.cpp
symbian: {
importFiles.path = .
- importFiles.sources = animation \
+ importFiles.files = animation \
fillmode \
focusscope \
ListView \
@@ -19,7 +19,6 @@ symbian: {
qdeclarativepathview \
qdeclarativepositioners \
qdeclarativesmoothedanimation \
- qdeclarativespringfollow \
qdeclarativetext \
qdeclarativetextedit \
qdeclarativetextinput \
@@ -27,7 +26,7 @@ symbian: {
repeater \
selftest_noimages \
webview
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += QT_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
}
diff --git a/tests/auto/declarative/symbianlibs.pri b/tests/auto/declarative/symbianlibs.pri
new file mode 100644
index 0000000000..4452f67faf
--- /dev/null
+++ b/tests/auto/declarative/symbianlibs.pri
@@ -0,0 +1,9 @@
+#additional libs required for orientation sensor
+symbian {
+ !contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
+ LIBS += -lsensrvclient -lsensrvutil
+ }
+ contains(QT_CONFIG, s60): {
+ LIBS += -lavkon -lcone
+ }
+}
diff --git a/tests/auto/exceptionsafety/exceptionsafety.pro b/tests/auto/exceptionsafety/exceptionsafety.pro
index d162219f7c..52ba9e27bd 100644
--- a/tests/auto/exceptionsafety/exceptionsafety.pro
+++ b/tests/auto/exceptionsafety/exceptionsafety.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_exceptionsafety.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index 802e74a18f..f74da54680 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -57,6 +57,7 @@ SUBDIRS=\
qfontdialog \
qfontmetrics \
qformlayout \
+ qglyphs \
qgraphicsanchorlayout \
qgraphicsanchorlayout1 \
qgraphicseffect \
@@ -145,6 +146,7 @@ SUBDIRS=\
qregion \
qscrollarea \
qscrollbar \
+ qscroller \
qsharedpointer_and_qwidget \
qshortcut \
qsidebar \
diff --git a/tests/auto/guiapplauncher/guiapplauncher.pro b/tests/auto/guiapplauncher/guiapplauncher.pro
index 30f5cf4f75..1fe9c8b0f6 100644
--- a/tests/auto/guiapplauncher/guiapplauncher.pro
+++ b/tests/auto/guiapplauncher/guiapplauncher.pro
@@ -3,6 +3,7 @@
# -------------------------------------------------
# Link against gui for X11,etc.
+load(qttest_p4)
DEFINES += SRCDIR=\\\"$$PWD/\\\"
TARGET = tst_guiapplauncher
diff --git a/tests/auto/guiapplauncher/tst_guiapplauncher.cpp b/tests/auto/guiapplauncher/tst_guiapplauncher.cpp
index 291da9fa9e..c3901bb691 100644
--- a/tests/auto/guiapplauncher/tst_guiapplauncher.cpp
+++ b/tests/auto/guiapplauncher/tst_guiapplauncher.cpp
@@ -270,7 +270,7 @@ private:
const QSharedPointer<WindowManager> m_wm;
};
-// Test mask from enviroment as test lib does not allow options.
+// Test mask from environment as test lib does not allow options.
static inline unsigned testMask()
{
unsigned testMask = tst_GuiAppLauncher::TestAll;
diff --git a/tests/auto/lancelot/.gitignore b/tests/auto/lancelot/.gitignore
new file mode 100644
index 0000000000..0a70416d57
--- /dev/null
+++ b/tests/auto/lancelot/.gitignore
@@ -0,0 +1 @@
+tst_lancelot
diff --git a/tests/auto/lancelot/lancelot.pro b/tests/auto/lancelot/lancelot.pro
new file mode 100644
index 0000000000..93841a30b5
--- /dev/null
+++ b/tests/auto/lancelot/lancelot.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+QT += xml svg
+contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
+
+SOURCES += tst_lancelot.cpp \
+ $$QT_SOURCE_TREE/tests/arthur/common/paintcommands.cpp
+HEADERS += $$QT_SOURCE_TREE/tests/arthur/common/paintcommands.h
+RESOURCES += $$QT_SOURCE_TREE/tests/arthur/common/images.qrc
+
+include($$QT_SOURCE_TREE/tests/arthur/common/qbaselinetest.pri)
+
+!symbian:!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
+linux-g++-maemo:DEFINES += USE_RUNTIME_DIR
diff --git a/tests/auto/lancelot/scripts/aliasing.qps b/tests/auto/lancelot/scripts/aliasing.qps
new file mode 100644
index 0000000000..59878f9c4d
--- /dev/null
+++ b/tests/auto/lancelot/scripts/aliasing.qps
@@ -0,0 +1,156 @@
+
+path_moveTo convexPath 25 0
+path_lineTo convexPath 50 50
+path_lineTo convexPath 25 25
+path_lineTo convexPath 0 50
+path_closeSubpath convexPath
+
+pixmap_load border.png pixmap
+
+setRenderHint LineAntialiasing false
+translate 10 10
+
+begin_block drawing
+ setPen black 1
+ setBrush 7f7fff
+ drawPath convexPath
+
+ setFont "monospace" 8
+ setPen black
+ drawText 0 68 "QwErTy@"
+
+
+ setPen black 1
+ setBrush 7f7fff
+ drawRect 0 80 10 5
+
+ setPen black 1
+ setBrush noBrush
+ drawRect 20 80 10 5
+
+ setPen noPen
+ setBrush 7f7fff
+ drawRect 40 80 10 5
+
+
+ setPen black 2
+ setBrush 7f7fff
+ drawRect 0 90 10 5
+
+ setPen black 2
+ setBrush noBrush
+ drawRect 20 90 10 5
+
+ setPen noPen
+ setBrush 7f7fff
+ drawRect 40 90 10 5
+
+
+ setPen black 3
+ setBrush 7f7fff
+ drawRect 0 100 10 5
+
+ setPen black 3
+ setBrush noBrush
+ drawRect 20 100 10 5
+
+ setPen noPen
+ setBrush 7f7fff
+ drawRect 40 100 10 5
+
+
+ setPen black 1
+ setBrush noBrush
+ drawLine 10 110 20 120
+ drawLine 30 120 40 110
+
+ setPen black 2
+ setBrush noBrush
+ drawLine 10 120 20 130
+ drawLine 30 130 40 120
+
+ setPen black 3
+ setBrush noBrush
+ drawLine 10 130 20 140
+ drawLine 30 140 40 130
+
+ drawPixmap pixmap 0 150
+
+ setRenderHint SmoothPixmapTransform false
+ drawPixmap pixmap 20 150 15 15 0 0 10 10
+
+end_block
+
+translate 0 180
+setRenderHint LineAntialiasing true
+repeat_block drawing
+drawText 15 185 "0.0"
+
+resetMatrix
+translate 70.2 10.2
+setRenderHint LineAntialiasing false
+repeat_block drawing
+translate 0 180
+setRenderHint LineAntialiasing true
+repeat_block drawing
+translate -0.2 -0.2
+drawText 15 185 "0.2"
+
+
+resetMatrix
+translate 130.4 10.4
+setRenderHint LineAntialiasing false
+repeat_block drawing
+translate 0 180
+setRenderHint LineAntialiasing true
+repeat_block drawing
+translate -0.4 -0.4
+drawText 15 185 "0.4"
+
+
+resetMatrix
+translate 190.5 10.5
+setRenderHint LineAntialiasing false
+repeat_block drawing
+translate 0 180
+setRenderHint LineAntialiasing true
+repeat_block drawing
+translate -0.5 -0.5
+drawText 15 185 "0.5"
+
+
+resetMatrix
+translate 250.6 10.6
+setRenderHint LineAntialiasing false
+repeat_block drawing
+translate 0 180
+setRenderHint LineAntialiasing true
+repeat_block drawing
+translate -0.6 -0.6
+drawText 15 185 "0.6"
+
+
+resetMatrix
+translate 310.8 10.8
+setRenderHint LineAntialiasing false
+repeat_block drawing
+translate 0 180
+setRenderHint LineAntialiasing true
+repeat_block drawing
+translate -0.8 -0.8
+drawText 15 185 "0.8"
+
+
+resetMatrix
+translate 371 11
+setRenderHint LineAntialiasing false
+repeat_block drawing
+translate 0 180
+setRenderHint LineAntialiasing true
+repeat_block drawing
+drawText 15 185 "1.0"
+
+
+resetMatrix
+drawText 430 95 "Aliased"
+drawText 430 275 "Anti-Aliased" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/arcs.qps b/tests/auto/lancelot/scripts/arcs.qps
new file mode 100644
index 0000000000..8a7a468df1
--- /dev/null
+++ b/tests/auto/lancelot/scripts/arcs.qps
@@ -0,0 +1,68 @@
+# Version: 1
+# CheckVsReference: 5
+
+setRenderHint LineAntialiasing
+
+setPen red
+
+drawEllipse 0 0 600 400
+
+path_moveTo arcs 300 200
+path_arcTo arcs 0 0 600 400 0 10
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 0 0 600 400 20 30
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 0 0 600 400 60 45
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 0 0 600 400 115 60
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 0 0 600 400 180 90
+path_closeSubpath arcs
+
+path_moveTo arcs 590 200
+path_arcTo arcs 10 10 580 380 0 360
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 20 20 560 360 0 -10
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 20 20 560 360 -20 -30
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 20 20 560 360 -60 -45
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 20 20 560 360 -115 -60
+path_closeSubpath arcs
+
+path_moveTo arcs 300 200
+path_arcTo arcs 20 20 560 360 -180 -90
+path_closeSubpath arcs
+
+setPen black 1 solidline
+setBrush #3f00ff00
+drawPath arcs
+
+# Then again with a matrix set...
+translate 200 400
+rotate 10
+scale 0.5 0.5
+setPen red
+setBrush nobrush
+drawEllipse 0 0 600 400
+
+setPen black 1 solidline
+setBrush #3f0000ff
+drawPath arcs \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/arcs2.qps b/tests/auto/lancelot/scripts/arcs2.qps
new file mode 100644
index 0000000000..411ff08014
--- /dev/null
+++ b/tests/auto/lancelot/scripts/arcs2.qps
@@ -0,0 +1,47 @@
+# Version: 1
+# CheckVsReference: 5
+
+drawArc 100 100 100 100 0 1440
+drawArc 100 100 100 100 1440 1440
+drawArc 100 100 100 100 2880 1440
+drawArc 100 100 100 100 4320 1440
+
+drawArc 100 200 100 100 0 -1440
+drawArc 100 200 100 100 -1440 -1440
+drawArc 100 200 100 100 -2880 -1440
+drawArc 100 200 100 100 -4320 -1440
+
+drawArc 200 100 100 100 720 1440
+drawArc 200 100 100 100 2160 1440
+drawArc 200 100 100 100 3600 1440
+drawArc 200 100 100 100 5040 1440
+
+drawArc 200 200 100 100 -720 -1440
+drawArc 200 200 100 100 -2160 -1440
+drawArc 200 200 100 100 -3600 -1440
+drawArc 200 200 100 100 -5040 -1440
+
+
+drawArc 300 100 100 100 3840 480
+drawArc 300 200 100 100 -3840 -480
+
+drawArc 300 100 100 100 1600 1340
+
+setPen black
+drawArc 400 100 200 200 0 5760
+setPen white
+drawArc 400 100 200 200 960 960
+drawArc 400 100 200 200 2880 960
+drawArc 400 100 200 200 4800 960
+
+setPen black
+drawArc 100 350 300 300 160 5760
+drawArc 100 350 300 300 320 5760
+drawArc 100 350 300 300 1920 5760
+drawArc 100 350 300 300 2080 5760
+drawArc 100 350 300 300 3680 5760
+drawArc 100 350 300 300 3840 5760
+drawArc 100 350 300 300 5440 5760
+drawArc 100 350 300 300 5600 5760
+setPen white
+drawArc 100 350 300 300 0 5760
diff --git a/tests/auto/lancelot/scripts/background.qps b/tests/auto/lancelot/scripts/background.qps
new file mode 100644
index 0000000000..000cfcdd91
--- /dev/null
+++ b/tests/auto/lancelot/scripts/background.qps
@@ -0,0 +1,136 @@
+# Version: 1
+# CheckVsReference: 5%
+
+translate 10 30
+setBackground 7f7fff
+setBackgroundMode Transparent
+setPen ff7f7f
+
+path_moveTo path 0 0
+path_lineTo path 25 0
+path_cubicTo path 50 0 25 25 25 50
+path_lineTo path 0 50
+
+bitmap_load bitmap.png bitmap
+
+begin_block drawing
+ save
+ drawRect 0 0 50 50
+
+ translate 60 0
+ drawEllipse 0 0 50 50
+
+ translate 60 0
+ drawPolygon [0 0 50 0 25 50 25 25]
+
+ translate 60 0
+ drawPath path
+
+ translate 60 0
+ drawPie 0 0 50 50 1440 2000
+
+ translate 60 0
+ drawChord 0 0 50 50 1440 2000
+
+ translate 60 0
+ drawLine 0 0 50 0
+ drawLine 0 0 50 50
+ drawLine 0 0 0 50
+
+ translate 60 0
+ drawPolyline [0 0 50 0 25 50 25 25]
+
+ translate 60 0
+ drawArc 0 0 50 50 1440 2000
+
+ translate 60 0
+ drawText 0 10 "Jambi-Bambi"
+
+ translate 80 0
+ drawPixmap bitmap 0 0
+ restore
+
+ save
+ setRenderHint Antialiasing
+ translate 5 55
+ drawRect 0 0 50 50
+
+ translate 60 0
+ drawEllipse 0 0 50 50
+
+ translate 60 0
+ drawPolygon [0 0 50 0 25 50 25 25]
+
+ translate 60 0
+ drawPath path
+
+ translate 60 0
+ drawPie 0 0 50 50 1440 2000
+
+ translate 60 0
+ drawChord 0 0 50 50 1440 2000
+
+ translate 60 0
+ drawLine 0 0 50 0
+ drawLine 0 0 50 50
+ drawLine 0 0 0 50
+
+ translate 60 0
+ drawPolyline [0 0 50 0 25 50 25 25]
+
+ translate 60 0
+ drawArc 0 0 50 50 1440 2000
+
+ translate 60 0
+ drawText 0 10 "Jambi-Bambi"
+
+ translate 80 0
+ drawPixmap bitmap 0 0
+ restore
+end_block
+
+translate 0 160
+setBackgroundMode Transparent
+setPen ff7f7f 0 dotline flatcap beveljoin
+repeat_block drawing
+
+translate 0 160
+setBackgroundMode Opaque
+setPen ff7f7f 0 dotline flatcap beveljoin
+repeat_block drawing
+
+translate 0 160
+setBackgroundMode Transparent
+setPen ff7f7f 4 dashline flatcap beveljoin
+repeat_block drawing
+
+translate 0 160
+setBackgroundMode OpaqueMode
+setPen ff7f7f 4 dashline flatcap beveljoin
+repeat_block drawing
+
+resetMatrix
+
+translate 5 5
+
+setBrush nobrush
+setPen black
+setBackgroundMode transparent
+drawText 10 15 "TransparentMode with solid 0-width pen"
+drawRect 0 0 685 135
+
+translate 0 160
+drawText 10 15 "TransparentMode with dotted 0-width pen"
+drawRect 0 0 685 135
+
+translate 0 160
+drawText 10 15 "OpaqueMode with dotted 0-width pen"
+drawRect 0 0 685 135
+
+translate 0 160
+drawText 10 15 "TransparentMode with dotted 4-width pen"
+drawRect 0 0 685 135
+
+translate 0 160
+drawText 10 15 "OpaqueMode with solid 4-width pen"
+drawRect 0 0 685 135
diff --git a/tests/auto/lancelot/scripts/background_brush.qps b/tests/auto/lancelot/scripts/background_brush.qps
new file mode 100644
index 0000000000..ca1f944964
--- /dev/null
+++ b/tests/auto/lancelot/scripts/background_brush.qps
@@ -0,0 +1,5 @@
+# Version: 1
+# CheckVsReference: 5%
+
+setBrush #00ff00 crosspattern
+import "background.qps" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/beziers.qps b/tests/auto/lancelot/scripts/beziers.qps
new file mode 100644
index 0000000000..9b47cd05ac
--- /dev/null
+++ b/tests/auto/lancelot/scripts/beziers.qps
@@ -0,0 +1,147 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+setRenderHint LineAntialiasing
+
+translate 20 20
+path_moveTo fullSize 0 0
+path_cubicTo fullSize 200 100 -100 100 100 0
+
+path_moveTo fullSize 0 200
+path_cubicTo fullSize 0 100 100 100 100 200
+
+path_moveTo fullSize 0 250
+path_cubicTo fullSize 50 200 50 200 100 250
+drawPath fullSize
+
+translate 110 0
+scale 10 10
+path_moveTo medSize 0 0
+path_cubicTo medSize 20 10 -10 10 10 0
+
+path_moveTo medSize 0 20
+path_cubicTo medSize 0 10 10 10 10 20
+
+path_moveTo medSize 0 25
+path_cubicTo medSize 5 20 5 20 10 25
+drawPath medSize
+
+resetMatrix
+translate 240 20
+scale 100 100
+path_moveTo smallSize 0 0
+path_cubicTo smallSize 2 1 -1 1 1 0
+
+path_moveTo smallSize 0 2
+path_cubicTo smallSize 0 1 1 1 1 2
+
+path_moveTo smallSize 0 2.5
+path_cubicTo smallSize 0.5 2 0.5 2 1 2.5
+drawPath smallSize
+
+resetMatrix
+translate 20 300
+drawPath medSize
+
+resetMatrix
+translate 250 -100
+path_moveTo maxSize 0 500
+path_cubicTo maxSize 1000 0 -500 0 500 500
+drawPath maxSize
+
+setRenderHint Antialiasing off
+resetMatrix
+
+path_moveTo path1 0 0
+path_cubicTo path1 10 10 0 10 10 0
+
+path_moveTo path2 0 0
+path_cubicTo path2 15 15 -5 15 10 0
+
+path_moveTo path3 0 0
+path_cubicTo path3 20 20 -10 20 10 0
+
+path_moveTo path4 0 0
+path_cubicTo path4 0 5 10 10 0 15
+
+path_moveTo path5 0 10
+path_cubicTo path5 10 10 -10 20 0 0
+
+path_moveTo path6 0 0
+path_cubicTo path6 10 5 -10 10 0 15
+
+setPen black 2
+setBrush nobrush
+
+translate 10 500
+scale 3 3
+begin_block paths
+save
+drawPath path1
+translate 20 0
+drawPath path2
+translate 20 0
+drawPath path3
+translate 20 0
+drawPath path4
+translate 20 0
+drawPath path5
+translate 20 0
+drawPath path6
+restore
+end_block
+
+setPen nopen
+setBrush black
+
+translate 0 20
+repeat_block paths
+
+setRenderHint Antialiasing
+
+setPen black 2
+setBrush nobrush
+
+translate 120 -20
+repeat_block paths
+
+setPen nopen
+setBrush black
+
+translate 0 20
+repeat_block paths
+
+resetMatrix
+path_moveTo miterPath 20 0
+path_cubicTo miterPath 20 20 0 0 1 0
+path_lineTo miterPath -1 -0.2
+
+setBrush nobrush
+
+translate 50 660
+scale 5 5
+
+setPen black 4 solidline flatcap miterjoin
+drawPath miterPath
+setPen red 0
+drawPath miterPath
+
+path_moveTo miterPath2 21 0.2
+path_lineTo miterPath2 19 0
+path_cubicTo miterPath2 20 0 0 20 0 0
+
+translate 30 0
+setPen black 4 solidline flatcap miterjoin
+drawPath miterPath2
+setPen red 0
+drawPath miterPath2
+
+path_moveTo wonkyPath 0 0
+path_cubicTo wonkyPath 5 15 20 0 17 0
+
+translate 30 0
+setPen black 4 solidline flatcap miterjoin
+drawPath wonkyPath
+setPen red 0
+drawPath wonkyPath
diff --git a/tests/auto/lancelot/scripts/bitmaps.qps b/tests/auto/lancelot/scripts/bitmaps.qps
new file mode 100644
index 0000000000..a816b9d497
--- /dev/null
+++ b/tests/auto/lancelot/scripts/bitmaps.qps
@@ -0,0 +1,166 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+#setRenderHint SmoothPixmapTransform
+
+translate 10 50
+setBackground ff7f7f
+setPen 3f3f9f
+
+bitmap_load dome_mono.png the_pixmap
+
+save
+ # Draw with opaque pen/bg in transparent/opaque mode
+ setBackgroundMode Transparent
+ drawPixmap the_pixmap 0 0
+ setBackgroundMode Opaque
+ drawPixmap the_pixmap 110 0
+
+ translate 220 0
+
+ # Draw with alpha pen/bg in transparent/opaque mode
+ save
+ setBackground 7fff7f7f
+ setPen 7f3f3f9f
+ setBackgroundMode Transparent
+ drawPixmap the_pixmap 0 0
+ setBackgroundMode Opaque
+ drawPixmap the_pixmap 110 0
+ restore
+
+ translate 220 0
+
+ # Draw with rotated opaque pen/bg in transparent/opaque mode
+ setBackgroundMode Transparent
+ save
+ translate 50 50
+ rotate 10
+ translate -50 -50
+ drawPixmap the_pixmap 0 0
+ restore
+ setBackgroundMode Opaque
+ translate 110 0
+ save
+ translate 50 50
+ rotate 10
+ translate -50 -50
+ drawPixmap the_pixmap 0 0
+ restore
+restore
+
+translate 0 150
+
+save
+ setBackgroundMode Transparent
+ drawTiledPixmap the_pixmap 0 0 200 100
+ setBackgroundMode Opaque
+ drawTiledPixmap the_pixmap 210 0 200 100
+
+ translate 440 -10
+ save
+ rotate 10
+ drawTiledPixmap the_pixmap 0 0 200 100
+ restore
+restore
+
+translate 0 150
+save
+ setBackgroundMode Transparent
+ drawTiledPixmap the_pixmap 0 0 200 100 10 20
+ setBackgroundMode Opaque
+ drawTiledPixmap the_pixmap 210 0 200 100 10 20
+
+ translate 440 -10
+ save
+ rotate 10
+ drawTiledPixmap the_pixmap 0 0 200 100 10 20
+ restore
+restore
+
+
+pixmap_setMask the_pixmap mask_100.png
+drawPixmap the_pixmap 0 150
+setBackgroundMode Opaque
+drawPixmap the_pixmap 110 150
+
+translate 220 150
+save
+ translate 50 50
+ rotate 10
+ translate -50 -50
+ setBackgroundMode Transparent
+ drawPixmap the_pixmap 0 0
+restore
+
+translate 110 0
+save
+ translate 50 50
+ rotate 10
+ translate -50 -50
+ setBackgroundMode Opaque
+ drawPixmap the_pixmap 0 0
+restore
+
+resetMatrix
+translate 10 650
+bitmap_load dome_mono.png the_bitmap
+setBackgroundMode Transparent
+
+begin_block draw_subrected
+ drawPixmap the_bitmap 0 0 50 50 0 0 50 50
+ drawPixmap the_bitmap 50 0 50 50 50 0 50 50
+ drawPixmap the_bitmap 0 50 50 50 0 50 50 50
+ drawPixmap the_bitmap 50 50 50 50 50 50 50 50
+end_block
+
+translate 110 0
+setBackgroundMode Opaque
+repeat_block draw_subrected
+
+translate 110 0
+save
+ translate 20 -10
+ rotate 10
+ setBackgroundMode Transparent
+ repeat_block draw_subrected
+restore
+
+translate 110 0
+save
+ translate 20 -10
+ rotate 10
+ setBackgroundMode Opaque
+ repeat_block draw_subrected
+restore
+
+# Some helpful texts
+
+resetMatrix
+setPen black
+drawText 10 40 "Transparent"
+drawText 120 40 "Opaque"
+drawText 230 40 "Trans w/alpha"
+drawText 340 40 "Opaque w/alpha"
+drawText 450 40 "Trans w/xform"
+drawText 560 40 "Opaque w/xform"
+
+drawText 10 190 "Transparent tiled"
+drawText 220 190 "Opaque tiled"
+drawText 440 190 "Opaque w/xform"
+
+drawText 10 340 "Transparent tiled w/offset"
+drawText 220 340 "Opaque tiled w/offset"
+drawText 440 340 "Opaque w/xform w/offset"
+
+drawText 10 490 "Trans masked"
+drawText 120 490 "Opaque masked"
+drawText 230 490 "masked w/xform"
+drawText 340 490 "masked w/xform"
+
+drawText 10 640 "Subrected"
+drawText 110 640 "Subrected opaque"
+drawText 220 640 "subrect w/xform"
+drawText 330 640 "subrect w/xform opaque"
+
+
diff --git a/tests/auto/lancelot/scripts/borderimage.qps b/tests/auto/lancelot/scripts/borderimage.qps
new file mode 100644
index 0000000000..ebd4f4d249
--- /dev/null
+++ b/tests/auto/lancelot/scripts/borderimage.qps
@@ -0,0 +1,120 @@
+# Version: 1
+# CheckVsReference: 10%
+
+image_load borderimage.png borderimage
+translate -128 -128
+begin_block draw_border
+# top
+drawImage borderimage 0 0 16 16 0 0 16 16
+drawImage borderimage 16 0 36 16 16 0 32 16
+drawImage borderimage 52 0 16 16 48 0 16 16
+# sides
+drawImage borderimage 0 16 16 16 0 16 16 32
+drawImage borderimage 52 16 16 16 48 16 16 32
+#bottom
+drawImage borderimage 0 32 16 16 0 48 16 16
+drawImage borderimage 16 32 36 16 16 48 32 16
+drawImage borderimage 52 32 16 16 48 48 16 16
+end_block draw_border
+resetMatrix
+begin_block draw_column
+translate 1 1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+translate 0.1 64.1
+repeat_block draw_border
+end_block draw_column
+setRenderHint Antialiasing
+resetMatrix
+translate 72 0
+repeat_block draw_column
+resetMatrix
+scale 1.25 1.25
+translate 144 0
+repeat_block draw_border
+resetMatrix
+scale 1.25 1.25
+translate 246 0
+rotate 30
+repeat_block draw_border
+setRenderHint SmoothPixmapTransform
+resetMatrix
+scale 1.25 1.25
+translate 144 120
+repeat_block draw_border
+resetMatrix
+scale 1.25 1.25
+translate 246 120
+rotate 30
+repeat_block draw_border
+resetMatrix
+translate 215 260
+scale 3.55 3.55
+rotate 30
+repeat_block draw_border
+resetMatrix
+setRenderHint SmoothPixmapTransform off
+setRenderHint Antialiasing off
+translate 480 627
+rotate 180
+repeat_block draw_column
+resetMatrix
+setRenderHint Antialiasing
+translate 552 627
+rotate 180
+repeat_block draw_column
+resetMatrix
+setRenderHint Antialiasing off
+translate 200.1 520.1
+begin_block one_pixel_border
+drawImage borderimage 0 0 16 16 0 0 16 16
+drawImage borderimage 16 0 64 16 16 0 1 1
+drawImage borderimage 80 0 16 16 48 0 16 16
+drawImage borderimage 0 16 16 64 16 0 1 1
+drawImage borderimage 80 16 16 64 16 0 1 1
+drawImage borderimage 0 80 16 16 0 48 16 16
+drawImage borderimage 16 80 64 16 16 0 1 1
+drawImage borderimage 80 80 16 16 48 48 16 16
+end_block one_pixel_border
+resetMatrix
+translate 205.1 626.1
+scale 0.4 0.4
+repeat_block one_pixel_border
+resetMatrix
+translate 255.1 624.1
+scale 0.4 0.4
+rotate 10
+repeat_block one_pixel_border
+resetMatrix
+setPen red
+drawRect 0 0 70 680
+drawText 10 670 "aa off"
+drawRect 72 0 70 680
+drawText 80 670 "aa on"
+drawRect 409 0 70 680
+drawText 419 650 "rot 180"
+drawText 419 670 "aa off"
+drawRect 481 0 70 680
+drawText 491 650 "rot 180"
+drawText 491 670 "aa on"
+drawRect 164 0 224 124
+drawText 174 114 "smoothpixmaptransform off"
+drawRect 164 128 224 134
+drawText 174 252 "smoothpixmaptransform on"
+drawRect 200 520 97 188
+drawText 210 698 "1x1 edges" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/brush_pens.qps b/tests/auto/lancelot/scripts/brush_pens.qps
new file mode 100644
index 0000000000..b9a2bc0ada
--- /dev/null
+++ b/tests/auto/lancelot/scripts/brush_pens.qps
@@ -0,0 +1,104 @@
+# Version: 1
+# CheckVsReference: 5%
+
+path_addRect p 0 0 75 75
+path_addEllipse p 25 25 75 75
+
+translate 10 10
+
+begin_block setup_gradient
+ gradient_clearStops
+ gradient_appendStop 0 red
+ gradient_appendStop 0.1 blue
+ gradient_appendStop 0.2 yellow
+ gradient_appendStop 0.3 cyan
+ gradient_appendStop 0.4 magenta
+ gradient_appendStop 0.5 green
+ gradient_appendStop 0.6 black
+ gradient_appendStop 0.7 indianred
+ gradient_appendStop 0.8 white
+ gradient_appendStop 0.9 orange
+ gradient_appendStop 1 blue
+ gradient_setLinear 0 0 100 100
+end_block
+
+setPen brush 0
+setBrush nobrush
+
+begin_block drawing
+ save
+ drawLine 0 0 100 100
+
+ translate 0 100
+ drawPath p
+
+ translate 0 110
+ drawRect 0 0 100 100
+
+ translate 0 110
+ drawPolyline [0 0 100 0 50 50]
+
+ drawPoint 40 40
+ drawPoint 41 40
+ drawPoint 42 40
+ drawPoint 43 40
+ drawPoint 44 40
+ drawPoint 45 40
+ drawPoint 46 40
+ drawPoint 47 40
+ drawPoint 48 40
+ drawPoint 49 40
+ drawPoint 50 40
+
+ restore
+end_block
+
+save
+ translate 110 0
+ save
+ setRenderHint Antialiasing
+ repeat_block drawing
+ restore
+
+ setBrush dome_rgb32.png
+ setPen brush 0
+ setBrush nobrush
+
+ translate 110 0
+ repeat_block drawing
+
+ translate 110 0
+ save
+ setRenderHint Antialiasing
+ repeat_block drawing
+ restore
+restore
+
+translate 0 0
+
+save
+ repeat_block setup_gradient
+ setPen brush 5
+ setBrush nobrush
+ translate 0 350
+ repeat_block drawing
+
+ translate 110 0
+ save
+ setRenderHint Antialiasing
+ repeat_block drawing
+ restore
+
+ setBrush dome_rgb32.png
+ setPen brush 5
+ setBrush nobrush
+
+ translate 110 0
+ repeat_block drawing
+
+ translate 110 0
+ save
+ setRenderHint Antialiasing
+ repeat_block drawing
+ restore
+restore \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/brushes.qps b/tests/auto/lancelot/scripts/brushes.qps
new file mode 100644
index 0000000000..82cbff48b9
--- /dev/null
+++ b/tests/auto/lancelot/scripts/brushes.qps
@@ -0,0 +1,79 @@
+# Version: 1
+# CheckVsReference: 5%
+
+# Fill the background
+drawRect 0 0 width height
+
+setRenderHint Antialiasing
+setRenderHint SmoothPixmapTransform
+
+translate 10 10
+# Draw all the pattern types as 40x40 rects using green, transparent background
+begin_block drawrects
+setBrush green Dense1Pattern
+drawRect 0 0 40 40
+setBrush green Dense2Pattern
+drawRect 40 0 40 40
+setBrush green Dense3Pattern
+drawRect 80 0 40 40
+setBrush green Dense4Pattern
+drawRect 120 0 40 40
+setBrush green Dense5Pattern
+drawRect 160 0 40 40
+setBrush green Dense6Pattern
+drawRect 200 0 40 40
+setBrush green Dense7Pattern
+drawRect 240 0 40 40
+setBrush green HorPattern
+drawRect 280 0 40 40
+setBrush green VerPattern
+drawRect 320 0 40 40
+setBrush green CrossPattern
+drawRect 360 0 40 40
+setBrush green BDiagPattern
+drawRect 400 0 40 40
+setBrush green FDiagPattern
+drawRect 440 0 40 40
+setBrush green DiagCrossPattern
+drawRect 480 0 40 40
+setBrush green SolidPattern
+drawRect 520 0 40 40
+setBrush green NoBrush
+drawRect 560 0 40 40
+gradient_setLinear 0 0 0 40
+drawRect 600 0 40 40
+setBrush face.png
+drawRect 640 0 80 40
+end_block
+
+# Switch to opaque mode
+setBackground #7fff7f
+setBackgroundMode OpaqueMode
+translate 0 50
+
+# Draw all the pattern types as 40x40 rects using green, opaque background
+repeat_block drawrects
+
+translate 50 50
+rotate 10
+
+
+setBackgroundMode TransparentMode
+repeat_block drawrects
+setBackgroundMode OpaqueMode
+translate 0 40
+repeat_block drawrects
+
+
+setBrush dot.png
+setPen nopen
+resetMatrix
+drawRect 0 200 50 50
+drawRect 50 200 50 50
+
+setPen red
+setBrushOrigin 0 250
+drawRect 0 250 50 50
+setBrushOrigin 50 250
+drawRect 50 250 50 50
+
diff --git a/tests/auto/lancelot/scripts/clippaths.qps b/tests/auto/lancelot/scripts/clippaths.qps
new file mode 100644
index 0000000000..fba89784df
--- /dev/null
+++ b/tests/auto/lancelot/scripts/clippaths.qps
@@ -0,0 +1,60 @@
+# Version: 1
+# CheckVsReference: 5%
+
+path_addRect hor 0 0 50 10
+path_addRect ver 0 0 10 50
+
+translate 10 10
+setPen NoPen
+
+begin_block clipping
+save
+
+ setBrush 0x7f7fff
+ save
+ setClipPath hor
+ drawRect 0 0 100 100
+
+ setClipPath ver IntersectClip
+ setBrush black CrossPattern
+ drawRect 0 0 100 100
+ restore
+
+ translate 100 0
+ save
+ setClipPath hor
+ drawRect 0 0 100 100
+
+ setClipPath ver ReplaceClip
+ setBrush black CrossPattern
+ drawRect 0 0 100 100
+ restore
+
+ translate 100 0
+ save
+ setClipPath hor
+ drawRect 0 0 100 100
+
+ setClipPath ver UniteClip
+ setBrush black CrossPattern
+ drawRect 0 0 100 100
+ restore
+
+restore
+end_block
+
+translate 300 0
+setRenderHint Antialiasing
+repeat_block clipping
+
+translate -300 100
+setRenderHint Antialiasing false
+scale 1.2 1.2
+repeat_block clipping
+
+translate 300 0
+setRenderHint Antialiasing
+setRenderHint SmoothPixmapTransform
+repeat_block clipping
+
+
diff --git a/tests/auto/lancelot/scripts/clipping.qps b/tests/auto/lancelot/scripts/clipping.qps
new file mode 100644
index 0000000000..3694ff2ba7
--- /dev/null
+++ b/tests/auto/lancelot/scripts/clipping.qps
@@ -0,0 +1,182 @@
+# Version: 1
+# CheckVsReference: 5%
+
+region_addRect clip 50 0 90 190
+region_addRect clip 0 50 180 90
+
+region_addRect clip2 30 30 60 60
+
+region_addRect clip3 10 10 60 60
+
+path_cubicTo path 90 0 50 50 90 90
+path_cubicTo path 0 90 50 50 0 0
+
+path_addRect path2 0 0 90 90
+path_moveTo path2 90 45
+path_arcTo path2 0 0 90 90 0 -360
+
+path_addRect emptypath 0 0 0 0
+region_addRect emptyregion 0 0 0 0
+
+# Normal clip rect
+setClipRect 0 0 50 150
+begin_block repaint
+save
+setBrush red
+setPen nopen
+resetMatrix
+region_getClipRegion tmpclip
+path_getClipPath tmpclippath
+drawRect 0 0 width height
+setBrush #3f0000ff
+setClipRegion tmpclip
+drawRect 0 0 width height
+setClipPath tmpclippath
+setBrush #3f00ff00
+drawRect 0 0 width height
+restore
+end_block
+
+# Rotated clip rect
+translate 100 0
+rotate 10
+setClipRect 0 0 50 150
+repeat_block repaint
+
+# simple clip region
+resetMatrix
+translate 0 200
+setClipRegion clip
+repeat_block repaint
+
+# simle rotated clip region
+translate 250 -10
+rotate 10
+setClipRegion clip
+repeat_block repaint
+
+# verify that clip is not xformed with painter
+resetMatrix
+translate 200 0
+setClipRegion clip
+rotate 30
+setBrush red
+setPen nopen
+drawRect 0 0 width height
+
+resetMatrix
+translate 0 400
+save
+setClipRegion clip
+setClipRegion clip2 IntersectClip
+repeat_block repaint
+translate 0 100
+rotate 10
+setClipRegion clip
+setClipRegion clip2 IntersectClip
+restore
+
+translate 100 0
+save
+setClipRegion clip3
+setClipRegion clip2 UniteClip
+repeat_block repaint
+translate 0 100
+rotate 10
+setClipRegion clip3
+setClipRegion clip2 UniteClip
+repeat_block repaint
+restore
+
+translate 100 0
+save
+setClipPath path
+repeat_block repaint
+translate 50 100
+rotate 45
+setClipPath path
+repeat_block repaint
+restore
+
+translate 100 0
+save
+setClipPath path
+setClipPath path2 IntersectClip
+repeat_block repaint
+translate 0 100
+rotate 10
+setClipPath path
+setClipPath path2 IntersectClip
+repeat_block repaint
+restore
+
+translate 100 0
+save
+setClipPath path
+setClipPath path2 UniteClip
+repeat_block repaint
+translate 0 100
+rotate 10
+setClipPath path
+setClipPath path2 UniteClip
+repeat_block repaint
+restore
+
+translate 100 0
+save
+setClipPath path
+setClipRegion clip3 IntersectClip
+repeat_block repaint
+translate 0 100
+rotate 10
+setClipRegion clip3
+setClipPath path IntersectClip
+repeat_block repaint
+restore
+
+translate 100 0
+save
+setClipPath path
+setClipRegion clip3 UniteClip
+repeat_block repaint
+translate 0 100
+rotate 10
+setClipRegion clip3
+setClipPath path UniteClip
+repeat_block repaint
+restore
+
+# test that an empty region is not drawn.
+resetMatrix
+setClipRegion emptyregion
+setBrush #3f00ff00
+drawRect 0 0 300 300
+drawText 50 50 "Text should be clipped away by region"
+setClipping false
+
+setClipPath emptypath
+setBrush #3fffff00
+drawRect 50 50 300 300
+drawText 70 80 "Text should be clipped away by path"
+
+# Test that we can extract a clipregion when a matrix is set too
+resetMatrix
+translate 500 10
+scale 2 1
+setBrush blue
+setClipping false
+rotate 5
+drawRect 0 0 100 100
+setClipRect 0 0 100 100
+resetMatrix
+rotate 10
+region_getClipRegion xclip
+setClipRegion xclip
+resetMatrix
+setBrush #7f00ff00
+drawRect 0 0 width height
+
+# the below used to assert in debug mode
+setClipRect 10 10 20 20
+setClipping false
+setClipping true \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/clipping_state.qps b/tests/auto/lancelot/scripts/clipping_state.qps
new file mode 100644
index 0000000000..a29d3738c8
--- /dev/null
+++ b/tests/auto/lancelot/scripts/clipping_state.qps
@@ -0,0 +1,47 @@
+# Version: 1
+# CheckVsReference: 5%
+
+path_addRect path1 10 10 50 50
+path_addRect path2 30 30 50 50
+# enable/disable a clip path
+setPen nopen
+setBrush red
+setClipPath path1
+setClipPath path2 UniteClip
+drawRect 0 0 100 100
+setClipping false
+setBrush #630000ff
+drawRect 0 0 100 100
+setClipping true
+setBrush #6300ff00
+drawRect 0 0 100 100
+# enable/disable noclip
+translate 150 0
+setClipPath path1 NoClip
+setClipping false
+setBrush #630000ff
+drawRect 0 0 100 100
+setClipping true
+setBrush #6300ff00
+drawRect 25 25 50 50
+# enable/disable full clipping
+translate 150 0
+path_addRect path3 0 0 10 10
+path_addRect path4 20 20 10 10
+setClipPath path3
+setClipPath path4 IntersectClip
+setClipping false
+setBrush #630000ff
+drawRect 0 0 100 100
+setClipping true
+setBrush #6300ff00
+drawRect 25 25 50 50
+# disable clipping followed by setClipRect
+translate 150 0
+setClipRect 0 0 50 50 ReplaceClip
+setClipping false
+setBrush #630000ff
+drawRect 0 0 100 100
+setClipRect 25 25 75 75 IntersectClip
+setBrush #6300ff00
+drawRect 25 25 50 50 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/cliprects.qps b/tests/auto/lancelot/scripts/cliprects.qps
new file mode 100644
index 0000000000..0d28b035b4
--- /dev/null
+++ b/tests/auto/lancelot/scripts/cliprects.qps
@@ -0,0 +1,59 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+
+translate 10 10
+setPen NoPen
+
+begin_block clipping
+save
+
+ setBrush 0x7f7fff
+ save
+ setClipRect 0 0 50 10
+ drawRect 0 0 100 100
+
+ setClipRect 0 0 10 50 IntersectClip
+ setBrush black CrossPattern
+ drawRect 0 0 100 100
+ restore
+
+ translate 100 0
+ save
+ setClipRect 0 0 50 10
+ drawRect 0 0 100 100
+
+ setClipRect 0 0 10 50 ReplaceClip
+ setBrush black CrossPattern
+ drawRect 0 0 100 100
+ restore
+
+ translate 100 0
+ save
+ setClipRect 0 0 50 10
+ drawRect 0 0 100 100
+
+ setClipRect 0 0 10 50 UniteClip
+ setBrush black CrossPattern
+ drawRect 0 0 100 100
+ restore
+
+restore
+end_block
+
+translate 300 0
+setRenderHint Antialiasing
+repeat_block clipping
+
+translate -300 100
+setRenderHint Antialiasing false
+scale 1.2 1.2
+repeat_block clipping
+
+translate 300 0
+setRenderHint Antialiasing
+setRenderHint SmoothPixmapTransform
+repeat_block clipping
+
+
diff --git a/tests/auto/lancelot/scripts/conical_gradients.qps b/tests/auto/lancelot/scripts/conical_gradients.qps
new file mode 100644
index 0000000000..2e897b1813
--- /dev/null
+++ b/tests/auto/lancelot/scripts/conical_gradients.qps
@@ -0,0 +1,85 @@
+# Version: 1
+# CheckVsReference: 5%
+
+path_addRect path 300 0 80 80
+path_addEllipse path 340 40 60 60
+
+setRenderHint Antialiasing
+
+setPen black
+
+begin_block gradients
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setConical 40 40 50
+drawRect 0 0 100 100
+
+gradient_setConical 140 40 230
+drawEllipse 100 0 100 100
+
+gradient_clearStops
+gradient_appendStop 0 3f7f7fff
+gradient_appendStop 0.5 dfdfffff
+gradient_appendStop 1 7f00007f
+
+gradient_setConical 240 40 50
+drawPolygon [200 0 290 0 250 99]
+
+gradient_setConical 340 40 230
+drawPath path
+
+end_block
+
+translate 0 100
+scale 1 2
+repeat_block gradients
+
+resetMatrix
+translate 0 300
+brushTranslate 30 0
+brushScale 0.9 0.9
+brushRotate 20
+repeat_block gradients
+
+# Some helpful info perhaps?
+resetMatrix
+setPen black
+
+drawText 410 50 "No XForm"
+drawText 410 200 "scale 1x2"
+drawText 410 300 "brush transform"
+drawText 10 450 "50 deg"
+drawText 110 450 "230 deg"
+drawText 210 450 "50 deg w/alpha "
+drawText 310 450 "230 deg w/alpha"
+
+setPen 3f000000
+setBrush nobrush
+
+begin_block ellipse_draw
+ setClipRect 0 0 100 100
+ drawEllipse 35 35 11 11
+ save
+ translate 40 40
+ rotate -50
+ drawLine -100 0 100 0
+ restore
+ translate 100 0
+end_block
+
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+
+resetMatrix
+translate 0 100
+scale 1 2
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/conical_gradients_perspectives.qps b/tests/auto/lancelot/scripts/conical_gradients_perspectives.qps
new file mode 100644
index 0000000000..a9c14f1ce7
--- /dev/null
+++ b/tests/auto/lancelot/scripts/conical_gradients_perspectives.qps
@@ -0,0 +1,64 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+setRenderHint Antialiasing
+
+setPen #00ff00
+
+translate 10 10
+# standard draw
+begin_block gradient
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 0.9 cyan
+gradient_appendStop 1 red
+
+gradient_setSpread PadSpread
+gradient_setConical 140 140 100
+drawRect 0 0 300 300
+end_block gradient
+
+# Rotation w/o smooth xform
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0
+ repeat_block gradient
+restore
+restore
+
+translate 0 320
+
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0
+ repeat_block gradient
+restore
+
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50
+ repeat_block gradient
+restore
+restore
+
+
+resetMatrix
+setPen black
+translate 125 20
+drawText 0 0 "No transform"
+translate 350 0
+drawText 0 0 "Left Tilted"
+resetMatrix
+translate 125 350
+drawText 0 0 "Bottom Tilted"
+translate 350 0
+drawText 0 0 "Right Tilted"
+translate 120 0 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/dashes.qps b/tests/auto/lancelot/scripts/dashes.qps
new file mode 100644
index 0000000000..649f56cf66
--- /dev/null
+++ b/tests/auto/lancelot/scripts/dashes.qps
@@ -0,0 +1,268 @@
+# Version: 1
+# CheckVsReference: 5%
+
+translate 20 20
+
+begin_block draw
+save
+ save
+ setPen black 1 SolidLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 SolidLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 SolidLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 2 SolidLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 SolidLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 SolidLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 6 SolidLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 6 SolidLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 6 SolidLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ restore
+
+
+ translate 100 0
+ save
+ setPen black 1 DotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 DotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 DotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 2 DotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 DotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 DotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 6 DotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 6 DotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 6 DotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ restore
+
+ translate 100 0
+ save
+ setPen black 1 DashLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 DashLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 DashLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 2 DashLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 DashLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 DashLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 6 DashLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 6 DashLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 6 DashLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ restore
+
+ translate 100 0
+
+ save
+ setPen black 1 DashDotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 DashDotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 DashDotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 2 DashDotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 DashDotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 DashDotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 6 DashDotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 6 DashDotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 6 DashDotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ restore
+
+ translate 100 0
+
+ save
+ setPen black 1 DashDotDotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 DashDotDotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 DashDotDotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 2 DashDotDotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 DashDotDotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 DashDotDotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 4 DashDotDotLine FlatCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 4 DashDotDotLine SquareCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 4 DashDotDotLine RoundCap BevelJoin
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ restore
+
+ translate 100 0
+
+ save
+ setPen black 1 SolidLine FlatCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 SolidLine SquareCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 1 SolidLine RoundCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 2 SolidLine FlatCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 SolidLine SquareCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 2 SolidLine RoundCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+
+ setPen black 4 SolidLine FlatCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 4 SolidLine SquareCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ setPen black 4 SolidLine RoundCap BevelJoin
+ pen_setDashPattern [1 4 9 4 27 4]
+ drawPolyline [0 0 80 0 80 30 40 20 0 30]
+ translate 0 40
+ restore
+
+restore
+end_block
+
+translate 0 400
+setRenderHint Antialiasing
+repeat_block draw
+
+translate 0 -20
+drawText 30 0 "Solid"
+
+translate 100 0
+drawText 20 0 "DotLine"
+
+translate 100 0
+drawText 10 0 "DashLine"
+
+translate 100 0
+drawText 0 0 "DashDotLine"
+
+translate 100 0
+drawText 0 0 "DashDotDotLine"
+
+translate 100 0
+drawText 0 0 "CustomDashLine"
+
+resetMatrix
+
+translate 620 40
+
+begin_block width_and_caps_texts
+ drawText 0 0 "Width=1, FlatCap"
+ translate 0 40
+ drawText 0 0 "Width=1, SquareCap"
+ translate 0 40
+ drawText 0 0 "Width=1, RoundCap"
+ translate 0 40
+ drawText 0 0 "Width=2, FlatCap"
+ translate 0 40
+ drawText 0 0 "Width=2, SquareCap"
+ translate 0 40
+ drawText 0 0 "Width=2, RoundCap"
+ translate 0 40
+ drawText 0 0 "Width=6, FlatCap"
+ translate 0 40
+ drawText 0 0 "Width=6, SqareCap"
+ translate 0 40
+ drawText 0 0 "Width=6, RoundCap"
+end_block
+
+translate 0 80
+repeat_block width_and_caps_texts \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/degeneratebeziers.qps b/tests/auto/lancelot/scripts/degeneratebeziers.qps
new file mode 100644
index 0000000000..fb223d5b1f
--- /dev/null
+++ b/tests/auto/lancelot/scripts/degeneratebeziers.qps
@@ -0,0 +1,10 @@
+# Version: 1
+# CheckVsReference: 5%
+
+path_moveTo degenerate 3427.0918499999997948 3872.1318999999998596
+path_cubicTo degenerate 3427.0918499999997948 3872.1318999999994048 4729.4590867905308187 5176.8613451144155988 5389.9325499999995372 5837.8072499999998399
+
+scale 0.05 0.05
+translate -2500 -3000
+setPen black 800
+drawPath degenerate \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/deviceclipping.qps b/tests/auto/lancelot/scripts/deviceclipping.qps
new file mode 100644
index 0000000000..cedfc1e363
--- /dev/null
+++ b/tests/auto/lancelot/scripts/deviceclipping.qps
@@ -0,0 +1,48 @@
+# Version: 1
+# CheckVsReference: 5%
+
+setBrush 0xff7f7f
+setPen 0x7f0000
+
+path_moveTo path -1000000 10000
+path_cubicTo path 100 100 100 150 150 400
+path_closeSubpath path
+
+begin_block drawing
+
+ drawPath ellipse
+
+ drawLine -1000000 200 200 200
+ drawLine 200 -1000000 200 200
+ drawLine 200 200 1000000 200
+ drawLine 200 200 200 1000000
+ drawLine -1000000 -1000000 200 200
+
+ drawPolygon [-1000000 100 100 -1000000 100 100]
+ drawRect 300 -500000 1000000 1000000
+
+ drawPath path
+
+end_block
+
+save
+translate 20 20
+setBrush #0x7f7f7fff
+setPen #0x7f00007f
+repeat_block drawing
+
+translate 20 20
+setRenderHint Antialiasing
+setBrush #0x7f7fff7f
+setPen #0x7f007f00
+repeat_block drawing
+restore
+
+setPen 0x00007f 2
+setRenderHint Antialiasing
+
+drawLine 0 -200 200 200
+
+setPen 0x007f00 10
+
+drawLine 0 -200 200 0 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/drawpoints.qps b/tests/auto/lancelot/scripts/drawpoints.qps
new file mode 100644
index 0000000000..c02cd85737
--- /dev/null
+++ b/tests/auto/lancelot/scripts/drawpoints.qps
@@ -0,0 +1,101 @@
+# Version: 1
+# CheckVsReference: 5%
+
+#setRenderHint Antialiasing
+
+setPen red 0 solidline
+begin_block points
+drawPoint 00 00
+drawPoint 10 00
+drawPoint 20 00
+drawPoint 30 00
+drawPoint 40 00
+drawPoint 50 00
+drawPoint 00 10
+drawPoint 10 10
+drawPoint 20 10
+drawPoint 30 10
+drawPoint 40 10
+drawPoint 50 10
+drawPoint 00 20
+drawPoint 10 20
+drawPoint 20 20
+drawPoint 30 20
+drawPoint 40 20
+drawPoint 50 20
+drawPoint 00 30
+drawPoint 10 30
+drawPoint 20 30
+drawPoint 30 30
+drawPoint 40 30
+drawPoint 50 30
+drawPoint 00 40
+drawPoint 10 40
+drawPoint 20 40
+drawPoint 30 40
+drawPoint 40 40
+drawPoint 50 40
+drawPoint 00 50
+drawPoint 10 50
+drawPoint 20 50
+drawPoint 30 50
+drawPoint 40 50
+drawPoint 50 50
+end_block points
+
+translate 100 0
+setPen blue 1 solidline
+repeat_block points
+
+translate 100 0
+setPen green 5 solidline roundcap
+repeat_block points
+
+resetMatrix
+
+translate 0 100
+scale 3 3
+setPen red 0 solidline roundcap
+repeat_block points
+
+translate 60 0
+setPen blue 1 solidline roundcap
+repeat_block points
+
+translate 60 0
+setPen green 5 solidline roundcap
+repeat_block points
+
+resetMatrix
+
+translate 0 300
+scale 3 3
+setPen red 0 solidline flatcap
+repeat_block points
+
+translate 60 0
+setPen blue 1 solidline flatcap
+repeat_block points
+
+translate 60 0
+setPen green 5 solidline flatcap
+repeat_block points
+
+resetMatrix
+translate 10 500
+setPen black 1 solidline flatcap
+drawPoint 0 0
+setPen black 2 solidline flatcap
+drawPoint 3 0
+setPen black 3 solidline flatcap
+drawPoint 8 0
+setPen black 4 solidline flatcap
+drawPoint 15 0
+setPen black 5 solidline flatcap
+drawPoint 24 0
+setPen black 6 solidline flatcap
+drawPoint 35 0
+setPen black 7 solidline flatcap
+drawPoint 48 0
+setPen black 8 solidline flatcap
+drawPoint 63 0 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/ellipses.qps b/tests/auto/lancelot/scripts/ellipses.qps
new file mode 100644
index 0000000000..e2cffd7f27
--- /dev/null
+++ b/tests/auto/lancelot/scripts/ellipses.qps
@@ -0,0 +1,86 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+surface_begin 0 0 600 600
+translate 0 50
+
+setPen nopen
+setBrush 0x7f000000
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setRadial 20 20 220 200
+
+drawEllipse 10 10 80 80
+drawEllipse 50 50 120 90
+
+translate 100 0
+brushTranslate 40 20
+brushScale 0.25 0.25
+
+setPen black
+
+drawEllipse 10 10 80 80
+setOpacity 0.5
+setCompositionMode SourceIn
+drawEllipse 50 50 120 90
+setOpacity 1.0
+setRenderHint Antialiasing
+setCompositionMode Xor
+brushTranslate 70 0
+translate 100 0
+drawEllipse 10 10 80 80
+
+setPen nopen
+drawEllipse 50 50 120 90
+
+setOpacity 0.7
+setBrush red
+translate 100 0
+setCompositionMode SourceOver
+
+drawEllipse 10 10 80 80
+
+setOpacity 0.6
+setPen black 5.0
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setLinear 20 20 120 100
+drawEllipse 50 50 120 90
+
+
+translate 100 0
+
+setOpacity 1.0
+drawEllipse 10 10 80 80
+
+setCompositionMode SourceIn
+setOpacity 0.7
+setPen black 3.0
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setLinear 50 50 80 90
+drawEllipse 50 50 120 90
+
+surface_end
+
+drawText 200 220 "Testing Ellipse drawing with varios combinations"
+drawText 200 240 "of features such as brushes, pens and composition modes" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/filltest.qps b/tests/auto/lancelot/scripts/filltest.qps
new file mode 100644
index 0000000000..2eeba2ecf6
--- /dev/null
+++ b/tests/auto/lancelot/scripts/filltest.qps
@@ -0,0 +1,413 @@
+# Version: 1
+# CheckVsReference: 5%
+
+setPen nopen
+setBrush red
+translate 0 4
+begin_block polys
+drawPolygon [0 0 2 -2 4 0]
+drawPolygon [0 2 2 4 4 2]
+end_block polys
+translate 6 .5
+repeat_block polys
+translate 6.5 0
+repeat_block polys
+translate 6 .5
+repeat_block polys
+
+resetMatrix
+
+translate 0 12
+setPen black
+drawPolygon [0 0 5 0 5 5 0 5]
+
+translate 10 0
+setPen nopen
+drawPolygon [0 0 5 0 5 5 0 5]
+
+translate 10 0
+drawPolygon [0 0 5 0 5 5 0 5]
+
+setBrush black
+path_addRect stroke -.5 -.5 6 6
+path_addRect stroke .5 .5 4 4
+drawPath stroke
+
+resetMatrix
+
+translate 0 65
+
+setPen red
+drawText 0 0 "path"
+drawText 40 0 "rect"
+drawText 80 0 "img"
+drawText 120 0 "pix"
+drawText 160 0 "brush"
+setPen nopen
+
+translate 0 5
+
+image_load border.png img
+pixmap_load border.png pix
+
+path_addRect rect 0 0 10 10
+begin_block rects
+drawPath rect
+drawRect 40 0 10 10
+drawImage img 80 0
+drawPixmap pix 120 0
+setBrush border.png
+drawRect 160 0 10 10
+setBrush black
+end_block rects
+
+setPen red
+drawText 180 10 "0.0"
+setPen nopen
+
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.1"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.2"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.3"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.4"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.5"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.6"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.7"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.8"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "0.9"
+setPen nopen
+translate 0.1 20
+repeat_block rects
+setPen red
+drawText 180 10 "1.0"
+setPen nopen
+
+resetMatrix
+
+translate 0 400
+
+setPen red
+drawText 0 10 "path"
+drawText 0 30 "rect"
+drawText 0 50 "img"
+drawText 0 70 "pix"
+drawText 0 90 "brush"
+drawText 0 110 "stroke"
+drawText 0 130 "scale"
+drawText 0 170 "rotate"
+setPen nopen
+
+translate 50 0
+
+begin_block rects
+drawPath rect
+drawRect 0 20 10 10
+drawImage img 0 40
+drawPixmap pix 0 60
+save
+setBrush border.png
+drawRect 0 80 10 10
+translate 0 100
+setBrush red
+setPen black
+drawRect 0 0 10 10
+setBrush border.png
+setPen nopen
+translate 0 20
+scale 2 2
+drawRect 0 0 10 10
+translate 10 20
+rotate 90
+drawRect 0 0 10 10
+restore
+end_block rects
+
+setPen red
+drawText -5 -10 "0.0"
+setPen nopen
+
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.1"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.2"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.3"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.4"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.5"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.6"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.7"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.8"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "0.9"
+setPen nopen
+translate 40 0.1
+repeat_block rects
+setPen red
+drawText -5 -10 "1.0"
+setPen nopen
+
+resetMatrix
+
+translate 0 620
+
+setPen red
+drawText 0 10 "path"
+setPen nopen
+
+path_addRect rect2 -5 -5 10 10
+
+translate 55 5
+drawPath rect2
+
+translate 20 0
+rotate 10
+drawPath rect2
+rotate -10
+translate 20 0
+rotate 20
+drawPath rect2
+rotate -20
+translate 20 0
+rotate 30
+drawPath rect2
+rotate -30
+translate 20 0
+rotate 40
+drawPath rect2
+rotate -40
+translate 20 0
+rotate 50
+drawPath rect2
+rotate -50
+translate 20 0
+rotate 60
+drawPath rect2
+rotate -60
+translate 20 0
+rotate 70
+drawPath rect2
+rotate -70
+translate 20 0
+rotate 80
+drawPath rect2
+rotate -80
+translate 20 0
+rotate 90
+drawPath rect2
+rotate -90
+
+resetMatrix
+
+translate 0 600
+
+setPen red
+drawText 0 10 "rect"
+setPen nopen
+
+translate 55 5
+drawRect -5 -5 10 10
+
+translate 20 0
+rotate 10
+drawRect -5 -5 10 10
+rotate -10
+translate 20 0
+rotate 20
+drawRect -5 -5 10 10
+rotate -20
+translate 20 0
+rotate 30
+drawRect -5 -5 10 10
+rotate -30
+translate 20 0
+rotate 40
+drawRect -5 -5 10 10
+rotate -40
+translate 20 0
+rotate 50
+drawRect -5 -5 10 10
+rotate -50
+translate 20 0
+rotate 60
+drawRect -5 -5 10 10
+rotate -60
+translate 20 0
+rotate 70
+drawRect -5 -5 10 10
+rotate -70
+translate 20 0
+rotate 80
+drawRect -5 -5 10 10
+rotate -80
+translate 20 0
+rotate 90
+drawRect -5 -5 10 10
+rotate -90
+
+resetMatrix
+path_addRect vertical 0.1 0.1 0.2 10
+
+translate 0 320
+drawPath vertical
+translate 2.2 0
+drawPath vertical
+translate 2.2 0
+drawPath vertical
+translate 2.2 0
+drawPath vertical
+translate 2.2 0
+drawPath vertical
+
+resetMatrix
+path_addRect horizontal 0.1 0.1 10 0.2
+
+translate 0 340
+drawPath horizontal
+translate 0 2.2
+drawPath horizontal
+translate 0 2.2
+drawPath horizontal
+translate 0 2.2
+drawPath horizontal
+translate 0 2.2
+drawPath horizontal
+
+setOpacity 0.8
+resetMatrix
+
+translate 0.1 24.7
+translate 400 0
+#rotate 88.8
+rotate 89.9
+setBrush red
+drawPolygon [0 0 300 0 0 173]
+setBrush green
+drawPolygon [0 173 300 0 300 173]
+
+resetMatrix
+
+translate 410 24
+path_lineTo left 0 273
+path_lineTo left 300 273
+path_cubicTo left 50 273 250 0 0 0
+
+path_cubicTo right 250 0 50 273 300 273
+path_lineTo right 300 0
+
+translate 310 0
+rotate 90
+setBrush red
+drawPath left
+setBrush green
+drawPath right
+
+resetMatrix
+translate 0.1 680.1
+setPen red
+setOpacity 1
+drawText 115 -20 "0.1"
+drawText 0 0 "pixmap w/ opacity"
+setOpacity 0.6
+drawPixmap pix 120 -10
+translate 0 20
+setOpacity 1
+drawText 0 0 "image w/ opacity"
+setOpacity 0.6
+drawImage img 120 -10
+
+resetMatrix
+path_lineTo fillpath 0 50
+path_lineTo fillpath 50 50
+path_moveTo fillpath 70 50
+path_lineTo fillpath 70 100
+path_lineTo fillpath 40 100
+translate 500 400
+drawPath fillpath
+
+resetMatrix
+path_moveTo vectorarne 50 10
+path_lineTo vectorarne 50 50
+path_lineTo vectorarne 100 50
+path_addEllipse vectorarne 350 20 230 230
+path_moveTo vectorarne 500 500
+path_cubicTo vectorarne 20 20 250 30 50 150
+translate 500 550
+scale 0.4 0.4
+setRenderHint antialiasing
+drawPath vectorarne
+
+resetMatrix
+translate 200 730
+setRenderHint antialiasing off
+setOpacity 1
+setPen red
+drawText 0 0 "outline/fill consistency"
+setPen red
+setBrush green
+translate 80 -30
+drawPolygon [13.6965 -99.1837 -71.4767 13.823 32.4596 -33.1847] \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/gradients.qps b/tests/auto/lancelot/scripts/gradients.qps
new file mode 100644
index 0000000000..eb3cda9cad
--- /dev/null
+++ b/tests/auto/lancelot/scripts/gradients.qps
@@ -0,0 +1,44 @@
+# Version: 1
+# CheckVsReference: 5%
+
+drawText 75 20 "Linear"
+drawText 176 20 "Radial"
+drawText 277 20 "Conical"
+translate 0 30
+drawText 0 50 "AA off"
+drawText 0 151 "AA on"
+
+setPen nopen
+
+gradient_clearStops
+gradient_appendStop 0 0x00000000
+gradient_appendStop 0.001 red
+gradient_appendStop 0.2 blue
+gradient_appendStop 0.4 yellow
+gradient_appendStop 0.6 cyan
+gradient_appendStop 0.8 green
+gradient_appendStop 0.999 red
+gradient_appendStop 1 0x00000000
+
+gradient_setSpread PadSpread
+gradient_setCoordinateMode ObjectBoundingMode
+
+begin_block row
+save
+gradient_setLinear 0.1 0.0 0.9 0.0
+drawRect 50 0 100 100
+
+gradient_setRadial 0.5 0.5 0.5 0.5 0.5
+translate 101 0
+drawRect 50 0 100 100
+
+gradient_setConical 0.5 0.5 45
+translate 101 0
+drawRect 50 0 100 100
+restore
+end_block row
+
+setRenderHint Antialiasing
+
+translate 0 101
+repeat_block row \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/image_formats.qps b/tests/auto/lancelot/scripts/image_formats.qps
new file mode 100644
index 0000000000..d817d04bf8
--- /dev/null
+++ b/tests/auto/lancelot/scripts/image_formats.qps
@@ -0,0 +1,81 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+image_load dome_argb32.png the_pixmap
+image_convertToFormat the_pixmap the_pixmap ARGB32_Premultiplied
+
+begin_block draw_stuff
+ save
+ image_convertToFormat the_pixmap converted ARGB32_Premultiplied
+ drawImage converted 0 0
+ translate 0 110
+
+ image_convertToFormat the_pixmap converted ARGB32
+ drawImage converted 0 0
+ translate 0 110
+
+ image_convertToFormat the_pixmap converted RGB32
+ drawImage converted 0 0
+ translate 0 110
+
+ image_convertToFormat the_pixmap converted Indexed8
+ drawImage converted 0 0
+ translate 0 110
+
+ image_convertToFormat the_pixmap converted MonoLSB
+ drawImage converted 0 0
+ translate 0 110
+
+ image_convertToFormat the_pixmap converted Mono
+ drawImage converted 0 0
+ translate 0 110
+ restore
+end_block
+
+
+image_load dome_argb32.png the_pixmap
+translate 110 0
+repeat_block draw_stuff
+
+
+image_load dome_rgb32.png the_pixmap
+translate 110 0
+repeat_block draw_stuff
+
+image_load dome_indexed.png the_pixmap
+translate 110 0
+repeat_block draw_stuff
+
+
+image_load dome_mono.png the_pixmap
+translate 110 0
+repeat_block draw_stuff
+
+image_load dome_mono_palette.png the_pixmap
+translate 110 0
+repeat_block draw_stuff
+
+image_load dome_indexed_mask.png the_pixmap
+translate 110 0
+repeat_block draw_stuff
+
+
+# helpful texts
+resetMatrix
+setPen black
+
+drawText 10 670 "ARGB32_PM"
+drawText 120 670 "ARGB32"
+drawText 230 670 "RGB32"
+drawText 340 670 "Indexed"
+drawText 450 670 "Mono"
+drawText 560 670 "Mono w/lut"
+drawText 670 670 "Indexed w/mask"
+
+drawText 770 50 "ARGB32_PM"
+drawText 770 160 "ARGB32"
+drawText 770 270 "RGB32"
+drawText 770 380 "Indexed"
+drawText 770 490 "MonoLSB"
+drawText 770 600 "Mono" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/images.qps b/tests/auto/lancelot/scripts/images.qps
new file mode 100644
index 0000000000..3f892400e2
--- /dev/null
+++ b/tests/auto/lancelot/scripts/images.qps
@@ -0,0 +1,106 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+setRenderHint Antialiasing
+
+setPen #00ff00
+
+image_load dome_argb32.png the_image
+begin_block draw_stuff
+
+save
+
+ # standard draw
+ drawImage the_image 0 0
+
+ # sub recting
+ translate 120 0
+ drawImage the_image 0 0 40 40 0 0 40 40
+ drawImage the_image 60 0 40 40 60 0 40 40
+ drawImage the_image 0 60 40 40 0 60 40 40
+ drawImage the_image 60 60 40 40 60 60 40 40
+ drawImage the_image 0 40 40 20 0 40 40 20
+ drawImage the_image 60 40 40 20 60 40 40 20
+ drawImage the_image 40 0 20 100 40 0 20 100
+
+ # subrecting w/scale
+ translate 120 0
+ drawImage the_image 0 0 50 50 0 0 25 25
+ drawImage the_image 50 0 50 50 25 0 25 25
+ drawImage the_image 0 50 50 50 0 25 25 25
+ drawImage the_image 50 50 50 50 25 25 25 25
+
+ # subrecting w/scale & smooth xform
+ translate 120 0
+ setRenderHint SmoothPixmapTransformation
+ drawImage the_image 0 0 50 50 0 0 25 25
+ drawImage the_image 50 0 50 50 25 0 25 25
+ drawImage the_image 0 50 50 50 0 25 25 25
+ drawImage the_image 50 50 50 50 25 25 25 25
+
+
+ # Rotation w/o smooth xform
+ translate 120 0
+ save
+ setRenderHint SmoothPixmapTransform off
+ rotate 10
+ drawImage the_image 0 0
+ restore
+
+ # Rotation w smooth xform
+ translate 120 0
+ save
+ setRenderHint SmoothPixmapTransform
+ rotate 10
+ drawImage the_image 0 0
+ restore
+
+restore
+
+end_block
+
+
+translate 0 120
+image_load dome_rgb32.png the_image
+repeat_block draw_stuff
+
+translate 0 120
+image_load dome_indexed.png the_image
+repeat_block draw_stuff
+
+translate 0 120
+image_load dome_indexed_mask.png the_image
+repeat_block draw_stuff
+
+translate 0 120
+image_load dome_mono.png the_image
+repeat_block draw_stuff
+
+
+resetMatrix
+translate 700 60
+setPen black
+drawText 0 0 "32 bit w/alpha"
+translate 0 120
+drawText 0 0 "32 bit w/o alpha"
+translate 0 120
+drawText 0 0 "8 bit indexed"
+translate 0 120
+drawText 0 0 "8 bit indexed w/mask"
+translate 0 120
+drawText 0 0 "1 bit"
+resetMatrix
+translate 0 600
+drawText 0 0 "normal"
+translate 120 0
+drawText 0 0 "subrect"
+translate 120 0
+drawText 0 0 "subrect scale"
+translate 120 0
+drawText 0 0 "subrect scale smooth"
+translate 120 0
+drawText 0 0 "xform"
+translate 120 0
+drawText 0 0 "smooth xform"
+translate 120 0 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/images2.qps b/tests/auto/lancelot/scripts/images2.qps
new file mode 100644
index 0000000000..5159abc928
--- /dev/null
+++ b/tests/auto/lancelot/scripts/images2.qps
@@ -0,0 +1,145 @@
+# Version: 1
+# CheckVsReference: 5%
+
+image_load dome_argb32.png the_image
+begin_block draw_stuff
+
+save
+ # standard draw
+ drawImage the_image 0 0
+
+ # flip x
+ translate 220 0
+ scale -1 1
+ drawImage the_image 0 0
+ scale -1 1
+
+ # flip y
+ translate 20 100
+ scale 1 -1
+ drawImage the_image 0 0
+ scale 1 -1
+
+ # flip x and y
+ translate 220 0
+ scale -1 -1
+ drawImage the_image 0 0
+ scale -1 -1
+
+ # flip y and scale
+ translate 20 10
+ save
+ scale 1 -1.1
+ drawImage the_image 0 0
+ restore
+
+ # flip y and scale
+ translate 220 -110
+ save
+ scale -1.1 0.9
+ drawImage the_image 0 0
+ restore
+restore
+end_block
+
+setRenderHint Antialiasing
+
+resetMatrix
+translate 0 120
+repeat_block draw_stuff
+
+resetMatrix
+translate 720 60
+setPen black
+drawText 0 0 "aliased"
+translate 0 120
+drawText 0 0 "antialiased"
+resetMatrix
+translate 0 260
+drawText 0 0 "normal"
+translate 120 0
+drawText 0 0 "flip x"
+translate 120 0
+drawText 0 0 "flip y"
+translate 120 0
+drawText 0 0 "flip x and y"
+translate 120 0
+drawText 0 0 "flip y and scale"
+translate 120 0
+drawText 0 0 "flip x and scale"
+translate 120 0
+
+setRenderHint SmoothPixmapTransform
+
+resetMatrix
+translate 20 300
+drawImage border.png 0 0 100 100 1 1 8 8
+drawText 0 -5 "subrect color bleeding"
+translate 0 120
+drawImage border.png 0 0 100 100 0 0 10 10
+
+image_load sign.png the_image
+resetMatrix
+drawText 240 300 "drawImage() with varying sx/sy offsets"
+translate 0 10
+drawRect 240 300 50 50
+drawImage the_image 240 300 50 50 20 0 80 80
+drawRect 300 300 50 50
+drawImage the_image 300 300 50 50 -20 0 80 80
+drawRect 240 370 50 50
+drawImage the_image 240 370 50 50 0 20 80 80
+drawRect 300 370 50 50
+drawImage the_image 300 370 50 50 0 -20 80 80
+
+pixmap_load sign.png the_pixmap
+translate 220 0
+translate 0 -10
+drawText 240 300 "drawPixmap() with varying sx/sy offsets"
+translate 0 10
+drawRect 240 300 50 50
+drawPixmap the_pixmap 240 300 50 50 20 0 80 80
+drawRect 300 300 50 50
+drawPixmap the_pixmap 300 300 50 50 -20 0 80 80
+drawRect 240 370 50 50
+drawPixmap the_pixmap 240 370 50 50 0 20 80 80
+drawRect 300 370 50 50
+drawPixmap the_pixmap 300 370 50 50 0 -20 80 80
+
+
+resetMatrix
+translate 0 170
+drawText 240 300 "drawImage() with varying sx/sy offsets"
+translate 0 10
+drawRect 240 300 50 50
+drawImage the_image 240 300 50 50 50 0 50 50
+drawRect 300 300 50 50
+drawImage the_image 300 300 50 50 -20 0 50 50
+drawRect 240 370 50 50
+drawImage the_image 240 370 50 50 0 50 50 50
+drawRect 300 370 50 50
+drawImage the_image 300 370 50 50 0 -20 50 50
+
+resetMatrix
+translate 220 170
+drawText 240 300 "drawPixmap() with varying sx/sy offsets"
+translate 0 10
+drawRect 240 300 50 50
+drawPixmap the_pixmap 240 300 50 50 50 0 50 50
+drawRect 300 300 50 50
+drawPixmap the_pixmap 300 300 50 50 -20 0 50 50
+drawRect 240 370 50 50
+drawPixmap the_pixmap 240 370 50 50 0 50 50 50
+drawRect 300 370 50 50
+drawPixmap the_pixmap 300 370 50 50 0 -20 50 50
+
+resetMatrix
+drawText 10 620 "drawImage/Pixmap() with negative x/y and sx/sy"
+setPen red
+
+translate 20 640
+drawImage the_image -10 -10 -1 -1 -10 -10 0 0
+drawRect 0 0 80 80
+
+translate 100 0
+drawPixmap the_pixmap -10 -10 -1 -1 -10 -10 0 0
+drawRect 0 0 80 80
diff --git a/tests/auto/lancelot/scripts/join_cap_styles.qps b/tests/auto/lancelot/scripts/join_cap_styles.qps
new file mode 100644
index 0000000000..ed823f53f5
--- /dev/null
+++ b/tests/auto/lancelot/scripts/join_cap_styles.qps
@@ -0,0 +1,63 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+setRenderHint Antialiasing
+
+path_moveTo p 20 20
+path_cubicTo p 100 20 100 180 180 100
+path_lineTo p 20 180
+path_lineTo p 180 20
+
+setPen black 20 solidline roundcap roundjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 200 0
+setPen black 20 solidline roundcap miterjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 200 0
+setPen black 20 solidline roundcap beveljoin
+drawPath p
+setPen red
+drawPath p
+
+translate -400 200
+setPen black 20 solidline squarecap roundjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 200 0
+setPen black 20 solidline squarecap miterjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 200 0
+setPen black 20 solidline squarecap beveljoin
+drawPath p
+setPen red
+drawPath p
+
+translate -400 200
+setPen black 20 solidline flatcap roundjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 200 0
+setPen black 20 solidline flatcap miterjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 200 0
+setPen black 20 solidline flatcap beveljoin
+drawPath p
+setPen red
+drawPath p \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/join_cap_styles_duplicate_control_points.qps b/tests/auto/lancelot/scripts/join_cap_styles_duplicate_control_points.qps
new file mode 100644
index 0000000000..b4630148e2
--- /dev/null
+++ b/tests/auto/lancelot/scripts/join_cap_styles_duplicate_control_points.qps
@@ -0,0 +1,68 @@
+# Version: 1
+# CheckVsReference: 1% (0 0 600 650)
+
+
+setRenderHint Antialiasing
+
+path_moveTo p 40 70
+path_lineTo p 20 70
+path_cubicTo p 20 70 40 20 80 80
+
+path_moveTo p 20 120
+path_cubicTo p 50 60 80 110 80 110
+path_lineTo p 60 110
+
+scale 2 2
+
+setPen black 10 solidline roundcap roundjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 100 0
+setPen black 10 solidline roundcap miterjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 100 0
+setPen black 10 solidline roundcap beveljoin
+drawPath p
+setPen red
+drawPath p
+
+translate -200 100
+setPen black 10 solidline squarecap roundjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 100 0
+setPen black 10 solidline squarecap miterjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 100 0
+setPen black 10 solidline squarecap beveljoin
+drawPath p
+setPen red
+drawPath p
+
+translate -200 100
+setPen black 10 solidline flatcap roundjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 100 0
+setPen black 10 solidline flatcap miterjoin
+drawPath p
+setPen red
+drawPath p
+
+translate 100 0
+setPen black 10 solidline flatcap beveljoin
+drawPath p
+setPen red
+drawPath p \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/linear_gradients.qps b/tests/auto/lancelot/scripts/linear_gradients.qps
new file mode 100644
index 0000000000..b1b8dd69e7
--- /dev/null
+++ b/tests/auto/lancelot/scripts/linear_gradients.qps
@@ -0,0 +1,144 @@
+# Version: 1
+# CheckVsReference: 2% (0 0 600 750)
+
+path_addRect path 400 0 80 80
+path_addEllipse path 440 40 60 60
+
+setRenderHint Antialiasing
+
+setPen black
+
+begin_block gradients
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setLinear 20 20 70 70
+drawRect 0 0 100 100
+
+gradient_setSpread ReflectSpread
+gradient_setLinear 120 20 170 70
+drawEllipse 100 0 100 100
+
+gradient_setSpread RepeatSpread
+gradient_setLinear 220 20 270 70
+drawRoundRect 200 0 100 100
+
+gradient_clearStops
+gradient_appendStop 0 3f7f7fff
+gradient_appendStop 0.5 dfdfffff
+gradient_appendStop 1 7f00007f
+
+gradient_setSpread PadSpread
+gradient_setLinear 320 20 340 40
+drawPolygon [300 0 390 0 350 99]
+
+gradient_setSpread ReflectSpread
+gradient_setLinear 420 20 440 40
+drawPath path
+
+gradient_setSpread RepeatSpread
+gradient_setLinear 520 20 540 40
+drawPie 500 0 100 100 720 4320
+end_block
+
+translate 0 100
+scale 1 2
+repeat_block gradients
+
+resetMatrix
+translate 0 300
+brushTranslate 30 0
+brushScale 0.9 0.9
+brushRotate 20
+repeat_block gradients
+
+# Vertical gradient tests
+resetMatrix
+setBrush noBrush
+translate 0 400
+
+begin_block vertical_gradients
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setLinear 20 20 20 70
+drawRect 0 0 100 100
+
+gradient_setSpread ReflectSpread
+gradient_setLinear 120 20 120 70
+drawEllipse 100 0 100 100
+
+gradient_setSpread RepeatSpread
+gradient_setLinear 220 20 220 70
+drawRoundRect 200 0 100 100
+
+gradient_clearStops
+gradient_appendStop 0 3f7f7fff
+gradient_appendStop 0.5 dfdfffff
+gradient_appendStop 1 7f00007f
+
+gradient_setSpread PadSpread
+gradient_setLinear 320 20 320 40
+drawPolygon [300 0 390 0 350 99]
+
+gradient_setSpread ReflectSpread
+gradient_setLinear 420 20 420 40
+drawPath path
+
+gradient_setSpread RepeatSpread
+gradient_setLinear 520 20 520 40
+drawPie 500 0 100 100 720 4320
+end_block
+
+translate 0 100
+scale 1 1.5
+repeat_block vertical_gradients
+
+resetMatrix
+translate 0 650
+brushTranslate 30 0
+brushScale 0.9 0.9
+brushRotate 20
+repeat_block vertical_gradients
+
+# Some helpful info perhaps?
+resetMatrix
+setPen black
+# gradient line indicators
+drawLine 20 20 70 70
+drawLine 120 20 170 70
+drawLine 220 20 270 70
+drawLine 320 20 340 40
+drawLine 420 20 440 40
+drawLine 520 20 540 40
+
+drawLine 20 140 70 240
+drawLine 120 140 170 240
+drawLine 220 140 270 240
+drawLine 320 140 340 180
+drawLine 420 140 440 180
+drawLine 520 140 540 180
+
+drawText 610 50 "No XForm"
+drawText 610 200 "scale 1x2"
+drawText 610 350 "brush transform"
+drawText 610 450 "vertical brush"
+drawText 610 570 "vertical brush scale 1x1.5"
+drawText 610 700 "vertical brush transform"
+
+drawText 10 780 "Pad"
+drawText 110 780 "Reflect"
+drawText 210 780 "Repeat"
+drawText 310 780 "Pad w/alpha"
+drawText 410 780 "Reflect w/alpha"
+drawText 510 780 "Repeat w/alpha" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/linear_gradients_perspectives.qps b/tests/auto/lancelot/scripts/linear_gradients_perspectives.qps
new file mode 100644
index 0000000000..3ea39fbe46
--- /dev/null
+++ b/tests/auto/lancelot/scripts/linear_gradients_perspectives.qps
@@ -0,0 +1,62 @@
+# Version: 1
+
+
+setRenderHint Antialiasing
+
+setPen #00ff00
+
+translate 10 10
+# standard draw
+begin_block gradient
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setLinear 10 10 290 290
+drawRect 0 0 300 300
+end_block gradient
+
+# Rotation w/o smooth xform
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0
+ repeat_block gradient
+restore
+restore
+
+translate 0 320
+
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0
+ repeat_block gradient
+restore
+
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50
+ repeat_block gradient
+restore
+restore
+
+
+resetMatrix
+setPen black
+translate 125 20
+drawText 0 0 "No transform"
+translate 350 0
+drawText 0 0 "Left Tilted"
+resetMatrix
+translate 125 350
+drawText 0 0 "Bottom Tilted"
+translate 350 0
+drawText 0 0 "Right Tilted"
+translate 120 0 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/linear_resolving_gradients.qps b/tests/auto/lancelot/scripts/linear_resolving_gradients.qps
new file mode 100644
index 0000000000..779760cb9a
--- /dev/null
+++ b/tests/auto/lancelot/scripts/linear_resolving_gradients.qps
@@ -0,0 +1,66 @@
+# Version: 2
+# CheckVsReference: 2% (0 0 500 400)
+
+setRenderHint Antialiasing
+
+setPen black
+
+begin_block gradients
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setCoordinateMode ObjectBoundingMode
+gradient_setLinear 0.2 0.2 0.7 0.7
+drawRect 0 0 100 100
+
+gradient_setSpread ReflectSpread
+gradient_setLinear 0.2 0.2 0.7 0.7
+drawEllipse 100 0 100 100
+
+gradient_setSpread RepeatSpread
+gradient_setLinear 0.2 0.2 0.7 0.7
+drawRoundRect 200 0 100 100
+
+gradient_clearStops
+gradient_appendStop 0 3f7f7fff
+gradient_appendStop 0.5 dfdfffff
+gradient_appendStop 1 7f00007f
+
+gradient_setSpread PadSpread
+gradient_setLinear 0.2 0.2 0.8 0.4
+drawPolygon [300 0 400 0 350 100]
+
+gradient_setSpread RepeatSpread
+gradient_setLinear 0.2 0.2 0.4 0.4
+drawPie 400 0 100 100 0 4320
+end_block
+
+translate 0 100
+scale 1 2
+repeat_block gradients
+
+resetMatrix
+translate 0 300
+brushTranslate 30 0
+brushScale 0.9 0.9
+brushRotate 20
+repeat_block gradients
+
+# Some helpful info perhaps?
+resetMatrix
+setPen black
+
+drawText 510 50 "No XForm"
+drawText 510 200 "scale 1x2"
+drawText 510 350 "brush transform"
+
+drawText 10 450 "Pad"
+drawText 110 450 "Reflect"
+drawText 210 450 "Repeat"
+drawText 310 450 "Pad w/alpha"
+drawText 410 450 "Repeat w/alpha" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/lineconsistency.qps b/tests/auto/lancelot/scripts/lineconsistency.qps
new file mode 100644
index 0000000000..0b40577659
--- /dev/null
+++ b/tests/auto/lancelot/scripts/lineconsistency.qps
@@ -0,0 +1,72 @@
+# Version: 1
+
+begin_block draw
+setPen red
+drawPolygon [1.1 1 3.3 30.6 23.1 39.2 38.9 6.5]
+setPen black
+drawLine 1.1 1 3.3 30.6
+drawLine 3.3 30.6 23.1 39.2
+drawLine 23.1 39.2 38.9 6.5
+drawLine 38.9 6.5 1.1 1
+end_block draw
+drawText 0 60 "0.0 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.1 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.2 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.3 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.4 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.5 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.6 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.7 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.8 aligned"
+translate 0.1 80.1
+repeat_block draw
+drawText 0 60 "0.9 aligned"
+
+resetMatrix
+translate 100 0
+setPen black
+drawText 0 20 "Line and text, 0.0 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.1 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.2 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.3 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.4 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.5 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.6 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.7 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.8 aligned"
+drawLine 0 21 160 21
+translate 0 40.1
+drawText 0 20 "Line and text, 0.9 aligned"
+drawLine 0 21 160 21 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/linedashes.qps b/tests/auto/lancelot/scripts/linedashes.qps
new file mode 100644
index 0000000000..ee7d18b156
--- /dev/null
+++ b/tests/auto/lancelot/scripts/linedashes.qps
@@ -0,0 +1,94 @@
+# Version: 1
+
+translate 10 10
+
+setPen 0xffff0000 0 solidline squarecap
+translate 50 50
+begin_block draw_lines
+ save
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ restore
+end_block
+
+setPen 0xffff0000 0 dotline squarecap
+translate 100 0
+repeat_block draw_lines
+setPen 0xffff0000 0 dashdotline squarecap
+translate 100 0
+repeat_block draw_lines
+setPen 0xffff0000 0 dashdotdotline squarecap
+translate 100 0
+repeat_block draw_lines
+setPen 0xffff0000 0 dashline squarecap
+translate 100 0
+repeat_block draw_lines \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/linedashes2.qps b/tests/auto/lancelot/scripts/linedashes2.qps
new file mode 100644
index 0000000000..1dc4fd310e
--- /dev/null
+++ b/tests/auto/lancelot/scripts/linedashes2.qps
@@ -0,0 +1,154 @@
+# Version: 1
+# CheckVsReference: 5% (0 0 800 800)
+
+translate -30 10
+
+setPen 0xffff0000 0 dashline squarecap
+pen_setDashPattern [10 5]
+
+save
+translate 100 100
+begin_block lines
+drawLine 100 100 200 100
+drawLine 100 100 200 200
+drawLine 100 100 100 200
+end_block
+
+setPen 0xffff0000 2 dashline squarecap
+translate 150 0
+repeat_block lines
+restore
+
+save
+save
+begin_block horizontal
+drawLine 0 0 50 0
+drawLine 3 10 53 10
+drawLine 6 20 56 20
+drawLine 9 30 59 30
+
+translate 0 50
+
+drawLine 0 0 50 5
+drawLine 3 10 53 15
+drawLine 6 20 56 25
+drawLine 9 30 59 35
+
+translate 0 50
+
+drawLine 0 0 50 -5
+drawLine 3 10 53 5
+drawLine 6 20 56 15
+drawLine 9 30 59 25
+end_block
+restore
+
+save
+translate 80 0
+repeat_block horizontal
+restore
+save
+translate 800 0
+repeat_block horizontal
+restore
+
+translate 180 -40
+save
+begin_block vertical
+drawLine 0 0 0 50
+drawLine 10 3 10 53
+drawLine 20 6 20 56
+drawLine 30 9 30 59
+
+translate 50 0
+
+drawLine 0 0 5 50
+drawLine 10 3 15 53
+drawLine 20 6 25 56
+drawLine 30 9 35 59
+
+translate 50 0
+
+drawLine 0 0 -5 50
+drawLine 10 3 5 53
+drawLine 20 6 15 56
+drawLine 30 9 25 59
+end_block
+restore
+
+save
+translate 0 80
+repeat_block vertical
+restore
+translate 0 800
+repeat_block vertical
+restore
+
+translate 0 200
+
+setPen 0xffff0000 2 dashline squarecap
+save
+repeat_block horizontal
+restore
+save
+translate 80 0
+repeat_block horizontal
+restore
+save
+translate 780 0
+repeat_block horizontal
+restore
+
+translate 360 -240
+save
+repeat_block vertical
+restore
+save
+translate 0 80
+repeat_block vertical
+restore
+translate 0 780
+repeat_block vertical
+
+resetMatrix
+translate 40 400
+setPen 0xffff0000 5 dashdotline flatcap
+pen_setDashPattern [1 1 4 1 1 4]
+pen_setDashOffset -4
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset -2
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 0
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 2
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 4
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 6
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 8
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 10
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 12
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 14
+drawLine 0 0 300 0
+translate 0 8
+pen_setDashOffset 16
+drawLine 0 0 300 0
+
+resetMatrix
+setPen black 3 dashdotline
+pen_setCosmetic true
+translate 0 -150
+drawLine 500 160 500 410 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/linedashes2_aa.qps b/tests/auto/lancelot/scripts/linedashes2_aa.qps
new file mode 100644
index 0000000000..c818ab62fe
--- /dev/null
+++ b/tests/auto/lancelot/scripts/linedashes2_aa.qps
@@ -0,0 +1,5 @@
+# Version: 1
+# CheckVsReference: 1% (0 0 800 800)
+
+setRenderHint LineAntialiasing
+import "linedashes2.qps" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/lines.qps b/tests/auto/lancelot/scripts/lines.qps
new file mode 100644
index 0000000000..c0daffb1b0
--- /dev/null
+++ b/tests/auto/lancelot/scripts/lines.qps
@@ -0,0 +1,558 @@
+# Version: 1
+# CheckVsReference: 5% (0 0 310 425)
+
+
+translate 10 10
+
+begin_block draw_lines
+ save
+ translate 50 50
+
+ save
+ setPen 0x7fff0000
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ restore
+
+ # and then draw the lines the other direction
+ save
+ setPen 0x7f0000ff
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ rotate 10
+ drawLine 50 0 10 0
+ restore
+
+ # and now with a clip
+ save
+ setClipRect -30 -30 60 60
+ setPen 0x7f00ff00
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ rotate 10
+ drawLine 10 0 50 0
+ restore
+
+ restore
+end_block
+
+save
+ translate 100 0
+ scale 2 2
+ repeat_block draw_lines
+restore
+
+translate 0 10
+
+save
+ translate 0 200
+ setRenderHint Antialiasing
+ repeat_block draw_lines
+restore
+
+save
+ translate 100 200
+ scale 2 2
+ setRenderHint Antialiasing
+ repeat_block draw_lines
+restore
+
+translate 320 0
+
+setPen black 0 solidline squarecap
+
+begin_block lines
+
+# 0 -> 45 degress
+drawLine 100 100 200 90
+drawLine 100 100 200 80
+drawLine 100 100 200 70
+drawLine 100 100 200 60
+drawLine 100 100 200 50
+drawLine 100 100 200 40
+drawLine 100 100 200 30
+drawLine 100 100 200 20
+drawLine 100 100 200 10
+
+# 45
+drawLine 100 100 200 0
+
+# 45 -> 90
+drawLine 100 100 190 0
+drawLine 100 100 180 0
+drawLine 100 100 170 0
+drawLine 100 100 160 0
+drawLine 100 100 150 0
+drawLine 100 100 140 0
+drawLine 100 100 130 0
+drawLine 100 100 120 0
+drawLine 100 100 110 0
+
+# 90
+drawLine 100 100 100 0
+
+# 90 -> 135
+drawLine 100 100 90 0
+drawLine 100 100 80 0
+drawLine 100 100 70 0
+drawLine 100 100 60 0
+drawLine 100 100 50 0
+drawLine 100 100 40 0
+drawLine 100 100 30 0
+drawLine 100 100 20 0
+drawLine 100 100 10 0
+
+# 135
+drawLine 100 100 0 0
+
+# 135 -> 180 degress
+drawLine 100 100 0 10
+drawLine 100 100 0 20
+drawLine 100 100 0 30
+drawLine 100 100 0 40
+drawLine 100 100 0 50
+drawLine 100 100 0 60
+drawLine 100 100 0 70
+drawLine 100 100 0 80
+drawLine 100 100 0 90
+
+# 180
+drawLine 100 100 0 100
+
+# 180 -> 225
+drawLine 100 100 0 110
+drawLine 100 100 0 120
+drawLine 100 100 0 130
+drawLine 100 100 0 140
+drawLine 100 100 0 150
+drawLine 100 100 0 160
+drawLine 100 100 0 170
+drawLine 100 100 0 180
+drawLine 100 100 0 190
+
+# 225
+drawLine 100 100 0 200
+
+# 225 -> 270
+drawLine 100 100 10 200
+drawLine 100 100 20 200
+drawLine 100 100 30 200
+drawLine 100 100 40 200
+drawLine 100 100 50 200
+drawLine 100 100 60 200
+drawLine 100 100 70 200
+drawLine 100 100 80 200
+drawLine 100 100 90 200
+
+# 270
+drawLine 100 100 100 200
+
+# 270 -> 315 degrees
+drawLine 100 100 110 200
+drawLine 100 100 120 200
+drawLine 100 100 130 200
+drawLine 100 100 140 200
+drawLine 100 100 150 200
+drawLine 100 100 160 200
+drawLine 100 100 170 200
+drawLine 100 100 180 200
+drawLine 100 100 190 200
+
+# 315
+drawLine 100 100 200 200
+
+# 315 -> 360 degress
+drawLine 100 100 200 100
+drawLine 100 100 200 110
+drawLine 100 100 200 120
+drawLine 100 100 200 130
+drawLine 100 100 200 140
+drawLine 100 100 200 150
+drawLine 100 100 200 160
+drawLine 100 100 200 170
+drawLine 100 100 200 180
+drawLine 100 100 200 190
+
+end_block
+
+
+setRenderHint Antialiasing
+setPen 0x7fff0000
+translate 0.5 0.5
+repeat_block lines
+
+setPen 0x000000 8
+translate 20 240
+drawText 0 0 "Steep slopes:"
+
+translate 0 10
+
+drawLine 0 0 -8 400
+translate 20 0
+drawLine 0 0 -7 400
+translate 20 0
+drawLine 0 0 -6 400
+translate 20 0
+drawLine 0 0 -5 400
+translate 20 0
+drawLine 0 0 -4 400
+translate 20 0
+drawLine 0 0 -3 400
+translate 20 0
+drawLine 0 0 -2 400
+translate 20 0
+drawLine 0 0 -1 400
+translate 20 0
+drawLine 0 0 0 400
+translate 20 0
+drawLine 0 0 1 400
+translate 20 0
+drawLine 0 0 2 400
+translate 20 0
+drawLine 0 0 3 400
+translate 20 0
+drawLine 0 0 4 400
+translate 20 0
+drawLine 0 0 5 400
+translate 20 0
+drawLine 0 0 6 400
+translate 20 0
+drawLine 0 0 7 400
+translate 20 0
+drawLine 0 0 8 400
+
+resetMatrix
+
+translate 20 450
+
+drawText 0 0 "Zero length lines:"
+
+translate 0 20
+drawText 100 10 "Square cap"
+save
+begin_block points
+setPen 0x000000 1 solidline squarecap
+drawLine 0 0 0 0
+setPen 0x000000 2 solidline squarecap
+drawLine 8 0 8 0
+setPen 0x000000 3 solidline squarecap
+drawLine 16 0 16 0
+setPen 0x000000 4 solidline squarecap
+drawLine 24 0 24 0
+setPen 0x000000 5 solidline squarecap
+drawLine 32 0 32 0
+setPen 0x000000 6 solidline squarecap
+drawLine 40 0 40 0
+setPen 0x000000 7 solidline squarecap
+drawLine 48 0 48 0
+setPen 0x000000 8 solidline squarecap
+drawLine 57 0 57 0
+setPen 0x000000 9 solidline squarecap
+drawLine 67 0 67 0
+setPen 0x000000 10 solidline squarecap
+drawLine 78 0 78 0
+end_block points
+restore
+
+translate 0 12
+setRenderHint Antialiasing off
+repeat_block points
+setRenderHint Antialiasing
+
+translate 0 20
+drawText 100 10 "Round cap"
+save
+begin_block points2
+setPen 0x000000 1 solidline roundcap
+drawLine 0 0 0 0
+setPen 0x000000 2 solidline roundcap
+drawLine 8 0 8 0
+setPen 0x000000 3 solidline roundcap
+drawLine 16 0 16 0
+setPen 0x000000 4 solidline roundcap
+drawLine 24 0 24 0
+setPen 0x000000 5 solidline roundcap
+drawLine 32 0 32 0
+setPen 0x000000 6 solidline roundcap
+drawLine 40 0 40 0
+setPen 0x000000 7 solidline roundcap
+drawLine 48 0 48 0
+setPen 0x000000 8 solidline roundcap
+drawLine 57 0 57 0
+setPen 0x000000 9 solidline roundcap
+drawLine 67 0 67 0
+setPen 0x000000 10 solidline roundcap
+drawLine 78 0 78 0
+end_block points2
+restore
+
+translate 0 12
+setRenderHint Antialiasing off
+repeat_block points2
+setRenderHint Antialiasing
+
+translate 0 20
+drawText 100 10 "Flat cap"
+save
+begin_block points3
+setPen 0x000000 1 solidline flatcap
+drawLine 0 0 0 0
+setPen 0x000000 2 solidline flatcap
+drawLine 8 0 8 0
+setPen 0x000000 3 solidline flatcap
+drawLine 16 0 16 0
+setPen 0x000000 4 solidline flatcap
+drawLine 24 0 24 0
+setPen 0x000000 5 solidline flatcap
+drawLine 32 0 32 0
+setPen 0x000000 6 solidline flatcap
+drawLine 40 0 40 0
+setPen 0x000000 7 solidline flatcap
+drawLine 48 0 48 0
+setPen 0x000000 8 solidline flatcap
+drawLine 57 0 57 0
+setPen 0x000000 9 solidline flatcap
+drawLine 67 0 67 0
+setPen 0x000000 10 solidline flatcap
+drawLine 78 0 78 0
+end_block points3
+restore
+
+translate 0 12
+setRenderHint Antialiasing off
+repeat_block points3
+
+resetMatrix
+translate -220 667.226
+drawText 230 -80 "Task 194266 (should see only one line):"
+setPen black
+drawRect 230.5 -70.5 122 12
+setRenderHint Antialiasing
+setPen red
+drawLine 236.842105263 -63.775117299 247.368421053 -63.775437504
+
+setRenderHint Antialiasing off
+resetMatrix
+translate 10 640
+setPen black
+drawText 0 -10 "Task 207147 (should see two lines):"
+drawRect 0.5 0.5 64 64
+setRenderHint Antialiasing
+setPen red
+
+drawLine 4.5 4.5 4.5001 60.5
+drawLine 4.5 4.5 60.5 4.5001
+
+setRenderHint Antialiasing off
+resetMatrix
+translate 10 730
+setPen black
+drawText 0 -10 "Task 229459 (should see one diagonal line):"
+drawRect 0.5 0.5 64 64
+setPen red 2 solidline flatcap
+
+setClipRect 2 2 63 63
+drawLine 1.5 1.5 33560000 33560000 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/lines2.qps b/tests/auto/lancelot/scripts/lines2.qps
new file mode 100644
index 0000000000..af6ad65939
--- /dev/null
+++ b/tests/auto/lancelot/scripts/lines2.qps
@@ -0,0 +1,179 @@
+# Version: 1
+# CheckVsReference: 5%
+
+translate 10 20
+drawText 0 0 "Thin lines"
+
+translate 60 70
+
+save
+begin_block lines
+translate 0 -60
+translate 0 5
+setPen 0x000000 0.05
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.1
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.15
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.2
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.25
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.3
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.35
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.2
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.25
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.5
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.55
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.6
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.65
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.7
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.75
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.8
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.85
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.9
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 0.95
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.05
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.1
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.15
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.2
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.25
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.3
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.35
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.2
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.25
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.5
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.55
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.6
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.65
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.7
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.75
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.8
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.85
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.9
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 1.95
+drawLine -60 -2 60 2
+translate 0 5
+setPen 0x000000 2
+drawLine -60 -2 60 2
+end_block
+restore
+
+save
+translate 150 0
+scale -1 1
+repeat_block lines
+restore
+
+save
+translate 80 220
+rotate 90
+repeat_block lines
+restore
+
+save
+translate 80 370
+rotate 90
+scale -1 1
+repeat_block lines
+restore
+
+setRenderHint Antialiasing
+
+translate 300 0
+
+save
+repeat_block lines
+restore
+
+save
+translate 150 0
+scale -1 1
+repeat_block lines
+restore
+
+save
+translate 80 220
+rotate 90
+repeat_block lines
+restore
+
+save
+translate 80 370
+rotate 90
+scale -1 1
+repeat_block lines
+restore \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/pathfill.qps b/tests/auto/lancelot/scripts/pathfill.qps
new file mode 100644
index 0000000000..821b4684c9
--- /dev/null
+++ b/tests/auto/lancelot/scripts/pathfill.qps
@@ -0,0 +1,38 @@
+# Version: 1
+# CheckVsReference: 1% (0 0 850 420)
+
+setPen afff0000 4
+
+setBrush dome_rgb32.png
+drawEllipse 10 10 200 200
+
+setBrush dome_argb32.png
+drawEllipse 220 10 200 200
+
+setPen NoPen
+
+setBrush dome_rgb32.png
+drawEllipse 10 220 200 200
+
+setBrush dome_argb32.png
+drawEllipse 220 220 200 200
+
+setBrushOrigin -30 -30
+
+setPen afff0000 4
+setBrush dome_rgb32.png
+drawEllipse 430 10 200 200
+
+setBrush dome_argb32.png
+drawEllipse 640 10 200 200
+
+setPen NoPen
+setBrush dome_rgb32.png
+drawEllipse 430 220 200 200
+
+setBrush dome_argb32.png
+drawEllipse 640 220 200 200
+
+setPen black
+drawText 150 450 "No offset RGB/ARGB"
+drawText 550 450 "-30 offset RGB/ARGB" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/paths.qps b/tests/auto/lancelot/scripts/paths.qps
new file mode 100644
index 0000000000..083026ee17
--- /dev/null
+++ b/tests/auto/lancelot/scripts/paths.qps
@@ -0,0 +1,34 @@
+# Version: 1
+
+setPen black
+setBrush 7f7fff
+
+path_moveTo star 50 0
+path_lineTo star 30 90
+path_lineTo star 100 60
+path_lineTo star 0 20
+path_lineTo star 80 100
+
+setFont "times" 50
+path_addText text 0 50 "ABCD, 1234, abcd, #¤%&"
+
+path_addRect rectncircle 0 0 75 75
+path_addEllipse rectncircle 25 25 75 75
+path_setFillRule rectncircle winding
+
+path_moveTo curve 100 0
+path_cubicTo curve 100 100 50 50 0 100
+
+begin_block drawing
+drawPath star
+translate 100 0
+drawPath rectncircle
+translate 100 0
+drawPath curve
+translate -200 100
+drawPath text
+end_block
+
+translate 50 100
+rotate 10
+repeat_block drawing
diff --git a/tests/auto/lancelot/scripts/paths_aa.qps b/tests/auto/lancelot/scripts/paths_aa.qps
new file mode 100644
index 0000000000..4812e2fa5f
--- /dev/null
+++ b/tests/auto/lancelot/scripts/paths_aa.qps
@@ -0,0 +1,4 @@
+# Version: 1
+
+setRenderHint LineAntialiasing
+import "paths.qps"
diff --git a/tests/auto/lancelot/scripts/pens.qps b/tests/auto/lancelot/scripts/pens.qps
new file mode 100644
index 0000000000..c72636dcef
--- /dev/null
+++ b/tests/auto/lancelot/scripts/pens.qps
@@ -0,0 +1,133 @@
+# Version: 1
+# CheckVsReference: 1% (0 0 800 800)
+
+
+translate 10 10
+
+begin_block penstyles
+setPen black 0 solidline flatcap
+drawLine 0 0 100 0
+setPen black 0 dashline flatcap
+drawLine 100 0 100 40
+setPen black 0 dotline flatcap
+drawLine 100 40 200 0
+setPen black 0 dashdotline flatcap
+drawLine 200 0 300 0
+setPen black 0 dashdotdotline flatcap
+drawLine 300 0 400 40
+
+translate 0 50
+setPen blue 2 solidline flatcap
+drawLine 0 0 100 0
+setPen blue 2 dashline flatcap
+drawLine 100 0 100 40
+setPen blue 2 dotline flatcap
+drawLine 100 40 200 0
+setPen blue 2 dashdotline flatcap
+drawLine 200 0 300 0
+setPen blue 2 dashdotdotline flatcap
+drawLine 300 0 400 40
+
+translate 0 50
+setPen red 5 solidline flatcap
+drawLine 0 0 100 0
+setPen red 5 dashline flatcap
+drawLine 100 0 100 40
+setPen red 5 dotline flatcap
+drawLine 100 40 200 0
+setPen red 5 dashdotline flatcap
+drawLine 200 0 300 0
+setPen red 5 dashdotdotline flatcap
+drawLine 300 0 400 40
+end_block
+
+translate 0 50
+scale 1 2
+repeat_block penstyles
+
+
+# Test cap styles
+resetMatrix
+translate 420 10
+setPen green 5 dashdotline flatcap
+drawLine 0 0 200 0
+setPen green 5 dashdotline roundcap
+drawLine 0 20 200 20
+setPen green 5 dashdotline squarecap
+drawLine 0 40 200 40
+
+
+# Test join styles
+resetMatrix
+translate 420 80
+setBrush nobrush
+begin_block joinstyles
+setPen orange 10 solidline flatcap miterjoin
+drawPolyline [ 0 0 80 0 80 80 0 80 ]
+
+translate 0 100
+setPen aquamarine 10 solidline squarecap beveljoin
+drawPolyline [ 0 0 80 0 80 80 0 80 ]
+
+translate 0 100
+setPen purple 10 solidline roundcap roundjoin
+drawPolyline [ 0 0 80 0 80 80 0 80 ]
+end_block
+
+translate 130 -200
+scale 2 1
+rotate 1
+repeat_block joinstyles
+
+# transparent lines
+resetMatrix
+translate 10 400
+setPen #7f000000
+drawLine 0 0 50 0
+setPen #7f000000 1 SolidLine
+drawLine 0 10 50 10
+setPen #7f000000 5 SolidLine
+drawLine 0 20 50 20
+setPen #7f000000 10 SolidLine
+drawLine 0 30 50 30
+setPen #7f000000
+drawLine 0 0 0 50
+setPen #7f000000 1 SolidLine
+drawLine 10 0 10 50
+setPen #7f000000 5 SolidLine
+drawLine 20 0 20 50
+setPen #7f000000 10 SolidLine
+drawLine 30 0 30 50
+
+# pen styles
+resetMatrix
+translate 0 500
+setPen black 0 DashLine
+drawLine 20 20 100 20
+translate 0 10
+setPen black 0 DotLine
+drawLine 20 20 100 20
+translate 0 10
+setPen black 0 DashDotLine
+drawLine 20 20 100 20
+translate 0 10
+setPen black 0 DashDotDotLine
+drawLine 20 20 100 20
+
+# scaling ellipse
+resetMatrix
+setPen black 0.008 DashLine
+translate 250 550
+rotate 30
+scale 250 250
+drawEllipse -0.4 -0.4 0.8 0.8
+
+# scaling path
+path_addEllipse star -0.3 -0.3 0.6 0.6
+
+resetMatrix
+setPen black 0.008 DashLine
+translate 250 550
+rotate 30
+scale 250 250
+drawPath star
diff --git a/tests/auto/lancelot/scripts/pens_aa.qps b/tests/auto/lancelot/scripts/pens_aa.qps
new file mode 100644
index 0000000000..066cac365f
--- /dev/null
+++ b/tests/auto/lancelot/scripts/pens_aa.qps
@@ -0,0 +1,6 @@
+# Version: 1
+# CheckVsReference: 1% (0 0 800 800)
+
+setRenderHint LineAntialiasing
+
+import "pens.qps" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/pens_cosmetic.qps b/tests/auto/lancelot/scripts/pens_cosmetic.qps
new file mode 100644
index 0000000000..d1a60d150d
--- /dev/null
+++ b/tests/auto/lancelot/scripts/pens_cosmetic.qps
@@ -0,0 +1,110 @@
+# Version: 1
+# CheckVsReference: 1% (0 0 585 470)
+
+path_addEllipse path 22 0 7 7
+path_addRect path 25 5 4 4
+
+translate 20 20
+
+begin_block lines
+ save
+ drawLine 0 0 10 10
+ drawLine 2 0 10 0
+ drawLine 0 2 0 10
+ drawPolygon [12 0 20 0 15 10]
+ drawPath path
+ drawEllipse 32 0 8 8
+ drawPoint 36 4
+
+ translate 100 0
+ save
+ scale 4 1
+ drawLine 0 0 10 10
+ drawLine 2 0 10 0
+ drawLine 0 2 0 10
+ drawPolygon [12 0 20 0 15 10]
+ drawPath path
+ drawEllipse 32 0 8 8
+ drawPoint 36 4
+ restore
+
+ translate 200 0
+ save
+ scale 1 4
+ drawLine 0 0 10 10
+ drawLine 2 0 10 0
+ drawLine 0 2 0 10
+ drawPolygon [12 0 20 0 15 10]
+ drawPath path
+ drawEllipse 32 0 8 8
+ drawPoint 36 4
+ restore
+
+ translate 100 0
+ save
+ scale 4 4
+ drawLine 0 0 10 10
+ drawLine 2 0 10 0
+ drawLine 0 2 0 10
+ drawPolygon [12 0 20 0 15 10]
+ drawPath path
+ drawEllipse 32 0 8 8
+ drawPoint 36 4
+ restore
+ restore
+end_block
+
+drawText 580 15 "non-cosmetic, 0-width"
+translate 0 50
+
+setPen black 2
+repeat_block lines
+drawText 580 15 "non-cosmetic, 2-width"
+
+translate 0 20
+translate 0 50
+setPen black 0
+pen_setCosmetic true
+repeat_block lines
+drawText 580 15 "cosmetic, 0-width"
+
+translate 0 50
+setPen black 2
+pen_setCosmetic true
+repeat_block lines
+drawText 580 15 "cosmetic, 2-width"
+
+
+setRenderHint Antialiasing
+translate 0 20
+
+translate 0 50
+setPen black 0
+repeat_block lines
+drawText 580 15 "non-cosmetic, 0-width"
+
+translate 0 50
+
+setPen black 2
+repeat_block lines
+drawText 580 15 "non-cosmetic, 2-width"
+
+translate 0 20
+translate 0 50
+setPen black 0
+pen_setCosmetic true
+repeat_block lines
+drawText 580 15 "cosmetic, 0-width"
+
+translate 0 50
+setPen black 2
+pen_setCosmetic true
+repeat_block lines
+drawText 580 15 "cosmetic, 2-width"
+
+
+translate 0 70
+drawText 0 0 "scale(1, 1)"
+drawText 150 0 "scale(4, 1)"
+drawText 300 0 "scale(1, 4)"
+drawText 450 0 "scale(4, 4)" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/perspectives.qps b/tests/auto/lancelot/scripts/perspectives.qps
new file mode 100644
index 0000000000..0b903e5260
--- /dev/null
+++ b/tests/auto/lancelot/scripts/perspectives.qps
@@ -0,0 +1,72 @@
+# Version: 1
+
+
+setRenderHint Antialiasing
+
+setPen #00ff00
+
+image_load image.png the_image
+
+translate 10 10
+# standard draw
+drawImage the_image 0 0
+
+# Rotation w/o smooth xform
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0
+ drawImage the_image 0 0
+restore
+restore
+
+translate 0 320
+
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0
+ drawImage the_image 0 0
+restore
+
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50
+ drawImage the_image 0 0
+restore
+restore
+
+setRenderHint SmoothPixmapTransform on
+setBrush red
+setPen black
+resetMatrix
+translate 100 720
+rotate_y 85
+scale 7 0.01
+drawRect -150 -150 300 300
+
+resetMatrix
+setBrush gam030.png
+setPen black 30
+translate 700 700
+rotate_y -85
+scale 7 0.01
+drawRect -150 -150 300 300
+
+resetMatrix
+setPen black
+translate 125 20
+drawText 0 0 "No transform"
+translate 350 0
+drawText 0 0 "Left Tilted"
+resetMatrix
+translate 125 350
+drawText 0 0 "Bottom Tilted"
+translate 350 0
+drawText 0 0 "Right Tilted"
+translate 120 0
+resetMatrix
+translate 300 760
+drawText 0 0 "Perspective Clipping" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/perspectives2.qps b/tests/auto/lancelot/scripts/perspectives2.qps
new file mode 100644
index 0000000000..2f6d1d653c
--- /dev/null
+++ b/tests/auto/lancelot/scripts/perspectives2.qps
@@ -0,0 +1,309 @@
+# Version: 1
+
+setRenderHint Antialiasing
+
+image_load zebra.png zebra_png
+
+image_convertToFormat zebra_png zebra ARGB32_Premultiplied
+
+translate 75 100
+# standard draw
+begin_block row
+drawImage zebra -50 -50
+
+translate 90 0
+save
+rotate_y 50
+drawImage zebra -50 -50
+restore
+
+translate 65 0
+save
+rotate_y 60
+drawImage zebra -50 -50
+restore
+
+translate 50 0
+save
+rotate_y 70
+drawImage zebra -50 -50
+restore
+
+translate 30 0
+save
+rotate_y 80
+drawImage zebra -50 -50
+restore
+
+translate 24 0
+save
+rotate_y 82
+drawImage zebra -50 -50
+restore
+
+translate 20 0
+save
+rotate_y 84
+drawImage zebra -50 -50
+restore
+
+translate 16 0
+save
+rotate_y 86
+drawImage zebra -50 -50
+restore
+
+translate 12 0
+save
+rotate_y 87
+drawImage zebra -50 -50
+restore
+
+translate 8 0
+save
+rotate_y 88
+drawImage zebra -50 -50
+restore
+
+translate 6 0
+save
+rotate_y 89
+drawImage zebra -50 -50
+restore
+
+translate 6 0
+save
+rotate_y 91
+drawImage zebra -50 -50
+restore
+
+translate 6 0
+save
+rotate_y 92
+drawImage zebra -50 -50
+restore
+
+translate 8 0
+save
+rotate_y 93
+drawImage zebra -50 -50
+restore
+
+translate 12 0
+save
+rotate_y 94
+drawImage zebra -50 -50
+restore
+
+translate 16 0
+save
+rotate_y 96
+drawImage zebra -50 -50
+restore
+
+translate 20 0
+save
+rotate_y 98
+drawImage zebra -50 -50
+restore
+
+translate 24 0
+save
+rotate_y 100
+drawImage zebra -50 -50
+restore
+
+translate 30 0
+save
+rotate_y 110
+drawImage zebra -50 -50
+restore
+
+translate 50 0
+save
+rotate_y 120
+drawImage zebra -50 -50
+restore
+
+translate 65 0
+save
+rotate_y 130
+drawImage zebra -50 -50
+restore
+
+translate 90 0
+save
+rotate_y 180
+drawImage zebra -50 -50
+restore
+end_block
+
+resetMatrix
+translate 75 280
+setRenderHint SmoothPixmapTransform
+repeat_block row
+
+resetMatrix
+setPen black
+translate 300 20
+drawText 0 0 "Fast Pixmap Transform"
+resetMatrix
+translate 300 210
+drawText 0 0 "Smooth Pixmap Transform"
+
+resetMatrix
+translate 0 400
+
+image_load dome_argb32.png the_pixmap
+
+image_convertToFormat the_pixmap dome ARGB32
+
+setRenderHint SmoothPixmapTransform false
+
+translate 75 100
+# standard draw
+begin_block row
+drawImage dome -50 -50
+
+translate 90 0
+save
+rotate_y 50
+drawImage dome -50 -50
+restore
+
+translate 65 0
+save
+rotate_y 60
+drawImage dome -50 -50
+restore
+
+translate 50 0
+save
+rotate_y 70
+drawImage dome -50 -50
+restore
+
+translate 30 0
+save
+rotate_y 80
+drawImage dome -50 -50
+restore
+
+translate 24 0
+save
+rotate_y 82
+drawImage dome -50 -50
+restore
+
+translate 20 0
+save
+rotate_y 84
+drawImage dome -50 -50
+restore
+
+translate 16 0
+save
+rotate_y 86
+drawImage dome -50 -50
+restore
+
+translate 12 0
+save
+rotate_y 87
+drawImage dome -50 -50
+restore
+
+translate 8 0
+save
+rotate_y 88
+drawImage dome -50 -50
+restore
+
+translate 6 0
+save
+rotate_y 89
+drawImage dome -50 -50
+restore
+
+translate 6 0
+save
+rotate_y 91
+drawImage dome -50 -50
+restore
+
+translate 6 0
+save
+rotate_y 92
+drawImage dome -50 -50
+restore
+
+translate 8 0
+save
+rotate_y 93
+drawImage dome -50 -50
+restore
+
+translate 12 0
+save
+rotate_y 94
+drawImage dome -50 -50
+restore
+
+translate 16 0
+save
+rotate_y 96
+drawImage dome -50 -50
+restore
+
+translate 20 0
+save
+rotate_y 98
+drawImage dome -50 -50
+restore
+
+translate 24 0
+save
+rotate_y 100
+drawImage dome -50 -50
+restore
+
+translate 30 0
+save
+rotate_y 110
+drawImage dome -50 -50
+restore
+
+translate 50 0
+save
+rotate_y 120
+drawImage dome -50 -50
+restore
+
+translate 65 0
+save
+rotate_y 130
+drawImage dome -50 -50
+restore
+
+translate 90 0
+save
+rotate_y 180
+drawImage dome -50 -50
+restore
+end_block
+
+resetMatrix
+translate 0 400
+translate 75 280
+setRenderHint SmoothPixmapTransform
+repeat_block row
+
+resetMatrix
+setPen black
+translate 0 400
+translate 300 20
+drawText 0 0 "Fast Pixmap Transform"
+resetMatrix
+translate 0 400
+translate 300 210
+drawText 0 0 "Smooth Pixmap Transform" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/pixmap_rotation.qps b/tests/auto/lancelot/scripts/pixmap_rotation.qps
new file mode 100644
index 0000000000..2f1ffb53e6
--- /dev/null
+++ b/tests/auto/lancelot/scripts/pixmap_rotation.qps
@@ -0,0 +1,30 @@
+# Version: 1
+# CheckVsReference: 0% (0 0 440 220)
+
+translate 120 120
+
+begin_block drawing
+save
+ rotate 90
+ drawPixmap solid.png 0 0
+
+ rotate 90
+ drawPixmap solid.png 0 0
+
+ rotate 90
+ drawPixmap solid.png 0 0
+
+ rotate 90
+ drawPixmap solid.png 0 0
+restore
+end_block
+
+resetMatrix
+
+translate 340 120
+repeat_block drawing
+
+resetMatrix
+
+drawText 50 240 "Normal X form"
+drawText 270 240 "Smooth xform" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/pixmap_scaling.qps b/tests/auto/lancelot/scripts/pixmap_scaling.qps
new file mode 100644
index 0000000000..651896f4a3
--- /dev/null
+++ b/tests/auto/lancelot/scripts/pixmap_scaling.qps
@@ -0,0 +1,224 @@
+# Version: 1
+# CheckVsReference: 0% (0 30 600 70)
+# CheckVsReference: 0% (290 130 280 60)
+# CheckVsReference: 0% (0 180 250 90)
+
+# Hurra! Force line endings (?)
+
+translate 5 25
+setFont "arial" 8
+
+save
+ drawText 15 0 "opaque image"
+ translate 50 50
+ save
+ translate 1 1
+ scale 20 20
+ drawImage solid2x2.png 0 0
+ restore
+ save
+ translate -1 1
+ scale -20 20
+ drawImage solid2x2.png 0 0
+ restore
+ save
+ translate 1 -1
+ scale 20 -20
+ drawImage solid2x2.png 0 0
+ restore
+ save
+ translate -1 -1
+ scale -20 -20
+ drawImage solid2x2.png 0 0
+ restore
+
+
+restore
+
+save
+ translate 150 0
+ drawText 15 0 "alpha image"
+ translate 50 50
+ save
+ translate 1 1
+ scale 20 20
+ drawImage alpha2x2.png 0 0
+ restore
+ save
+ translate -1 1
+ scale -20 20
+ drawImage alpha2x2.png 0 0
+ restore
+ save
+ translate 1 -1
+ scale 20 -20
+ drawImage alpha2x2.png 0 0
+ restore
+ save
+ translate -1 -1
+ scale -20 -20
+ drawImage alpha2x2.png 0 0
+ restore
+restore
+
+
+save
+ translate 0 150
+ drawText 15 0 "solid pixmap"
+ translate 50 50
+ save
+ translate 1 1
+ scale 20 20
+ drawPixmap solid2x2.png 0 0
+ restore
+ save
+ translate -1 1
+ scale -20 20
+ drawPixmap solid2x2.png 0 0
+ restore
+ save
+ translate 1 -1
+ scale 20 -20
+ drawPixmap solid2x2.png 0 0
+ restore
+ save
+ translate -1 -1
+ scale -20 -20
+ drawPixmap solid2x2.png 0 0
+ restore
+restore
+
+
+save
+ translate 150 150
+ drawText 15 0 "alpha pixmap"
+ translate 50 50
+ save
+ translate 1 1
+ scale 20 20
+ drawPixmap alpha2x2.png 0 0
+ restore
+ save
+ translate -1 1
+ scale -20 20
+ drawPixmap alpha2x2.png 0 0
+ restore
+ save
+ translate 1 -1
+ scale 20 -20
+ drawPixmap alpha2x2.png 0 0
+ restore
+ save
+ translate -1 -1
+ scale -20 -20
+ drawPixmap alpha2x2.png 0 0
+ restore
+restore
+
+
+save
+ translate 300 10
+ save
+ drawText 0 -10 "subrect solid image"
+ drawImage solid2x2.png 0 0 50 5 0 0.0 2 0.2
+ drawImage solid2x2.png 0 5 50 5 0 0.2 2 0.2
+ drawImage solid2x2.png 0 10 50 5 0 0.4 2 0.2
+ drawImage solid2x2.png 0 15 50 5 0 0.6 2 0.2
+ drawImage solid2x2.png 0 20 50 5 0 0.8 2 0.2
+ drawImage solid2x2.png 0 25 50 5 0 1.0 2 0.2
+ drawImage solid2x2.png 0 30 50 5 0 1.2 2 0.2
+ drawImage solid2x2.png 0 35 50 5 0 1.4 2 0.2
+ drawImage solid2x2.png 0 40 50 5 0 1.6 2 0.2
+ drawImage solid2x2.png 0 45 50 5 0 1.8 2 0.2
+ translate 60 0
+ drawImage solid2x2.png 0 0 5 50 0.0 0 0.2 2
+ drawImage solid2x2.png 5 0 5 50 0.2 0 0.2 2
+ drawImage solid2x2.png 10 0 5 50 0.4 0 0.2 2
+ drawImage solid2x2.png 15 0 5 50 0.6 0 0.2 2
+ drawImage solid2x2.png 20 0 5 50 0.8 0 0.2 2
+ drawImage solid2x2.png 25 0 5 50 1.0 0 0.2 2
+ drawImage solid2x2.png 30 0 5 50 1.2 0 0.2 2
+ drawImage solid2x2.png 35 0 5 50 1.4 0 0.2 2
+ drawImage solid2x2.png 40 0 5 50 1.6 0 0.2 2
+ drawImage solid2x2.png 45 0 5 50 1.8 0 0.2 2
+ restore
+
+ save
+ translate 150 0
+ drawText 0 -10 "subrect solid image"
+ drawImage alpha2x2.png 0 0 50 5 0 0.0 2 0.2
+ drawImage alpha2x2.png 0 5 50 5 0 0.2 2 0.2
+ drawImage alpha2x2.png 0 10 50 5 0 0.4 2 0.2
+ drawImage alpha2x2.png 0 15 50 5 0 0.6 2 0.2
+ drawImage alpha2x2.png 0 20 50 5 0 0.8 2 0.2
+ drawImage alpha2x2.png 0 25 50 5 0 1.0 2 0.2
+ drawImage alpha2x2.png 0 30 50 5 0 1.2 2 0.2
+ drawImage alpha2x2.png 0 35 50 5 0 1.4 2 0.2
+ drawImage alpha2x2.png 0 40 50 5 0 1.6 2 0.2
+ drawImage alpha2x2.png 0 45 50 5 0 1.8 2 0.2
+ translate 60 0
+ drawImage alpha2x2.png 0 0 5 50 0.0 0 0.2 2
+ drawImage alpha2x2.png 5 0 5 50 0.2 0 0.2 2
+ drawImage alpha2x2.png 10 0 5 50 0.4 0 0.2 2
+ drawImage alpha2x2.png 15 0 5 50 0.6 0 0.2 2
+ drawImage alpha2x2.png 20 0 5 50 0.8 0 0.2 2
+ drawImage alpha2x2.png 25 0 5 50 1.0 0 0.2 2
+ drawImage alpha2x2.png 30 0 5 50 1.2 0 0.2 2
+ drawImage alpha2x2.png 35 0 5 50 1.4 0 0.2 2
+ drawImage alpha2x2.png 40 0 5 50 1.6 0 0.2 2
+ drawImage alpha2x2.png 45 0 5 50 1.8 0 0.2 2
+ restore
+
+ save
+ translate 0 100
+ drawText 0 -10 "subrect alpha pixmap"
+ drawPixmap solid2x2.png 0 0 50 5 0 0.0 2 0.2
+ drawPixmap solid2x2.png 0 5 50 5 0 0.2 2 0.2
+ drawPixmap solid2x2.png 0 10 50 5 0 0.4 2 0.2
+ drawPixmap solid2x2.png 0 15 50 5 0 0.6 2 0.2
+ drawPixmap solid2x2.png 0 20 50 5 0 0.8 2 0.2
+ drawPixmap solid2x2.png 0 25 50 5 0 1.0 2 0.2
+ drawPixmap solid2x2.png 0 30 50 5 0 1.2 2 0.2
+ drawPixmap solid2x2.png 0 35 50 5 0 1.4 2 0.2
+ drawPixmap solid2x2.png 0 40 50 5 0 1.6 2 0.2
+ drawPixmap solid2x2.png 0 45 50 5 0 1.8 2 0.2
+ translate 60 0
+ drawPixmap solid2x2.png 0 0 5 50 0.0 0 0.2 2
+ drawPixmap solid2x2.png 5 0 5 50 0.2 0 0.2 2
+ drawPixmap solid2x2.png 10 0 5 50 0.4 0 0.2 2
+ drawPixmap solid2x2.png 15 0 5 50 0.6 0 0.2 2
+ drawPixmap solid2x2.png 20 0 5 50 0.8 0 0.2 2
+ drawPixmap solid2x2.png 25 0 5 50 1.0 0 0.2 2
+ drawPixmap solid2x2.png 30 0 5 50 1.2 0 0.2 2
+ drawPixmap solid2x2.png 35 0 5 50 1.4 0 0.2 2
+ drawPixmap solid2x2.png 40 0 5 50 1.6 0 0.2 2
+ drawPixmap solid2x2.png 45 0 5 50 1.8 0 0.2 2
+ restore
+
+ save
+ translate 150 100
+ drawText 0 -10 "subrect alpha pixmap"
+ drawPixmap alpha2x2.png 0 0 50 5 0 0.0 2 0.2
+ drawPixmap alpha2x2.png 0 5 50 5 0 0.2 2 0.2
+ drawPixmap alpha2x2.png 0 10 50 5 0 0.4 2 0.2
+ drawPixmap alpha2x2.png 0 15 50 5 0 0.6 2 0.2
+ drawPixmap alpha2x2.png 0 20 50 5 0 0.8 2 0.2
+ drawPixmap alpha2x2.png 0 25 50 5 0 1.0 2 0.2
+ drawPixmap alpha2x2.png 0 30 50 5 0 1.2 2 0.2
+ drawPixmap alpha2x2.png 0 35 50 5 0 1.4 2 0.2
+ drawPixmap alpha2x2.png 0 40 50 5 0 1.6 2 0.2
+ drawPixmap alpha2x2.png 0 45 50 5 0 1.8 2 0.2
+ translate 60 0
+ drawPixmap alpha2x2.png 0 0 5 50 0.0 0 0.2 2
+ drawPixmap alpha2x2.png 5 0 5 50 0.2 0 0.2 2
+ drawPixmap alpha2x2.png 10 0 5 50 0.4 0 0.2 2
+ drawPixmap alpha2x2.png 15 0 5 50 0.6 0 0.2 2
+ drawPixmap alpha2x2.png 20 0 5 50 0.8 0 0.2 2
+ drawPixmap alpha2x2.png 25 0 5 50 1.0 0 0.2 2
+ drawPixmap alpha2x2.png 30 0 5 50 1.2 0 0.2 2
+ drawPixmap alpha2x2.png 35 0 5 50 1.4 0 0.2 2
+ drawPixmap alpha2x2.png 40 0 5 50 1.6 0 0.2 2
+ drawPixmap alpha2x2.png 45 0 5 50 1.8 0 0.2 2
+ restore
+
+restore \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/pixmap_subpixel.qps b/tests/auto/lancelot/scripts/pixmap_subpixel.qps
new file mode 100644
index 0000000000..908f7c3465
--- /dev/null
+++ b/tests/auto/lancelot/scripts/pixmap_subpixel.qps
@@ -0,0 +1,117 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+translate 50 50
+
+# Pixmaps at 0.1 offset, unclipped
+begin_block draw_pixmaps
+save
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+ drawPixmap border.png 0 0
+ translate 20.1 0.1
+restore
+end_block
+
+# Tiled pixmaps at 0.1 offsets, unclipped
+translate 0 50
+begin_block draw_tiled
+save
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+ drawTiledPixmap border.png 0 0 16 16 0 0
+ translate 20.1 0.1
+restore
+end_block
+
+
+path_moveTo clip 0 0
+path_lineTo clip width 0
+path_lineTo clip width 400
+path_lineTo clip 0 height
+setClipPath clip
+
+translate 0 50
+# Pixmaps at 0.1 offset, clipped
+repeat_block draw_pixmaps
+
+
+# Tiled pixmaps at 0.1 offsets...
+translate 0 50
+repeat_block draw_tiled
+
diff --git a/tests/auto/lancelot/scripts/pixmaps.qps b/tests/auto/lancelot/scripts/pixmaps.qps
new file mode 100644
index 0000000000..8e60997acc
--- /dev/null
+++ b/tests/auto/lancelot/scripts/pixmaps.qps
@@ -0,0 +1,106 @@
+# Version: 1
+# CheckVsReference: 1% (0 0 690 580)
+
+
+setRenderHint Antialiasing
+
+setPen #00ff00
+
+pixmap_load dome_argb32.png the_pixmap
+begin_block draw_stuff
+
+save
+
+ # standard draw
+ drawPixmap the_pixmap 0 0
+
+ # sub recting
+ translate 120 0
+ drawPixmap the_pixmap 0 0 40 40 0 0 40 40
+ drawPixmap the_pixmap 60 0 40 40 60 0 40 40
+ drawPixmap the_pixmap 0 60 40 40 0 60 40 40
+ drawPixmap the_pixmap 60 60 40 40 60 60 40 40
+ drawPixmap the_pixmap 0 40 40 20 0 40 40 20
+ drawPixmap the_pixmap 60 40 40 20 60 40 40 20
+ drawPixmap the_pixmap 40 0 20 100 40 0 20 100
+
+ # subrecting w/scale
+ translate 120 0
+ drawPixmap the_pixmap 0 0 50 50 0 0 25 25
+ drawPixmap the_pixmap 50 0 50 50 25 0 25 25
+ drawPixmap the_pixmap 0 50 50 50 0 25 25 25
+ drawPixmap the_pixmap 50 50 50 50 25 25 25 25
+
+ # subrecting w/scale & smooth xform
+ translate 120 0
+ setRenderHint SmoothPixmapTransformation
+ drawPixmap the_pixmap 0 0 50 50 0 0 25 25
+ drawPixmap the_pixmap 50 0 50 50 25 0 25 25
+ drawPixmap the_pixmap 0 50 50 50 0 25 25 25
+ drawPixmap the_pixmap 50 50 50 50 25 25 25 25
+
+
+ # Rotation w/o smooth xform
+ translate 120 0
+ save
+ setRenderHint SmoothPixmapTransform off
+ rotate 10
+ drawPixmap the_pixmap 0 0
+ restore
+
+ # Rotation w smooth xform
+ translate 120 0
+ save
+ setRenderHint SmoothPixmapTransform
+ rotate 10
+ drawPixmap the_pixmap 0 0
+ restore
+
+restore
+
+end_block
+
+
+translate 0 120
+pixmap_load dome_rgb32.png the_pixmap
+repeat_block draw_stuff
+
+translate 0 120
+pixmap_load dome_indexed.png the_pixmap
+repeat_block draw_stuff
+
+translate 0 120
+pixmap_load dome_indexed_mask.png the_pixmap
+repeat_block draw_stuff
+
+translate 0 120
+pixmap_load dome_mono.png the_pixmap
+repeat_block draw_stuff
+
+
+resetMatrix
+translate 700 60
+setPen black
+drawText 0 0 "32 bit w/alpha"
+translate 0 120
+drawText 0 0 "32 bit w/o alpha"
+translate 0 120
+drawText 0 0 "8 bit indexed"
+translate 0 120
+drawText 0 0 "8 bit indexed w/mask"
+translate 0 120
+drawText 0 0 "1 bit"
+resetMatrix
+translate 0 600
+drawText 0 0 "normal"
+translate 120 0
+drawText 0 0 "subrect"
+translate 120 0
+drawText 0 0 "subrect scale"
+translate 120 0
+drawText 0 0 "subrect scale smooth"
+translate 120 0
+drawText 0 0 "xform"
+translate 120 0
+drawText 0 0 "smooth xform"
+translate 120 0 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/porter_duff.qps b/tests/auto/lancelot/scripts/porter_duff.qps
new file mode 100644
index 0000000000..166e48a57f
--- /dev/null
+++ b/tests/auto/lancelot/scripts/porter_duff.qps
@@ -0,0 +1,251 @@
+# Version: 1
+# CheckVsReference: 5%
+
+
+translate 0 50
+
+surface_begin 0 0 100 100
+
+begin_block predraw
+setRenderHint Antialiasing
+setPen nopen
+setBrush 0x7f000000
+drawEllipse 10 10 80 80
+end_block
+
+setCompositionMode SourceOver
+
+begin_block postdraw
+
+
+setBrush 0x1fff0000
+drawRect 0 0 50 50
+
+setBrush 0xdf00ff00
+drawRect 50 50 50 50
+
+setBrush 0x7f0000ff
+drawEllipse 30 30 40 40
+
+# a black rectangle around
+setCompositionMode SourceOver
+setPen black
+setBrush nobrush
+drawRect 0.5 0.5 99 99
+
+end_block
+surface_end
+
+
+# Destination over
+surface_begin 100 0 100 100
+repeat_block predraw
+setCompositionMode DestinationOver
+repeat_block postdraw
+surface_end
+
+
+# Clear
+surface_begin 200 0 100 100
+repeat_block predraw
+setCompositionMode Clear
+repeat_block postdraw
+surface_end
+
+
+# Source
+surface_begin 300 0 100 100
+repeat_block predraw
+setCompositionMode Source
+repeat_block postdraw
+surface_end
+
+
+# Destination
+surface_begin 400 0 100 100
+repeat_block predraw
+setCompositionMode Destination
+repeat_block postdraw
+surface_end
+
+
+# Source In
+surface_begin 500 0 100 100
+repeat_block predraw
+setCompositionMode SourceIn
+repeat_block postdraw
+surface_end
+
+translate 0 50
+
+# Destination In
+surface_begin 0 100 100 100
+repeat_block predraw
+setCompositionMode DestinationIn
+repeat_block postdraw
+surface_end
+
+
+# Source Out
+surface_begin 100 100 100 100
+repeat_block predraw
+setCompositionMode SourceOut
+repeat_block postdraw
+surface_end
+
+
+# Destination Out
+surface_begin 200 100 100 100
+repeat_block predraw
+setCompositionMode DestinationOut
+repeat_block postdraw
+surface_end
+
+
+# SourceAtop
+surface_begin 300 100 100 100
+repeat_block predraw
+setCompositionMode SourceAtop
+repeat_block postdraw
+surface_end
+
+
+# DestinationAtop
+surface_begin 400 100 100 100
+repeat_block predraw
+setCompositionMode DestinationAtop
+repeat_block postdraw
+surface_end
+
+
+# Xor
+surface_begin 500 100 100 100
+repeat_block predraw
+setCompositionMode Xor
+repeat_block postdraw
+surface_end
+
+translate 0 50
+
+# Plus
+surface_begin 0 200 100 100
+repeat_block predraw
+setCompositionMode Plus
+repeat_block postdraw
+surface_end
+
+
+# Multiply
+surface_begin 100 200 100 100
+repeat_block predraw
+setCompositionMode Multiply
+repeat_block postdraw
+surface_end
+
+
+# Screen
+surface_begin 200 200 100 100
+repeat_block predraw
+setCompositionMode Screen
+repeat_block postdraw
+surface_end
+
+
+# Overlay
+surface_begin 300 200 100 100
+repeat_block predraw
+setCompositionMode Overlay
+repeat_block postdraw
+surface_end
+
+
+# Darken
+surface_begin 400 200 100 100
+repeat_block predraw
+setCompositionMode Darken
+repeat_block postdraw
+surface_end
+
+
+# Lighten
+surface_begin 500 200 100 100
+repeat_block predraw
+setCompositionMode Lighten
+repeat_block postdraw
+surface_end
+
+translate 0 50
+
+# ColorDodge
+surface_begin 0 300 100 100
+repeat_block predraw
+setCompositionMode ColorDodge
+repeat_block postdraw
+surface_end
+
+
+# Multiply
+surface_begin 100 300 100 100
+repeat_block predraw
+setCompositionMode ColorBurn
+repeat_block postdraw
+surface_end
+
+
+# Screen
+surface_begin 200 300 100 100
+repeat_block predraw
+setCompositionMode HardLight
+repeat_block postdraw
+surface_end
+
+
+# Overlay
+surface_begin 300 300 100 100
+repeat_block predraw
+setCompositionMode SoftLight
+repeat_block postdraw
+surface_end
+
+
+# Darken
+surface_begin 400 300 100 100
+repeat_block predraw
+setCompositionMode Difference
+repeat_block postdraw
+surface_end
+
+
+# Lighten
+surface_begin 500 300 100 100
+repeat_block predraw
+setCompositionMode Exclusion
+repeat_block postdraw
+surface_end
+
+resetMatrix
+
+drawText 0 50 "SourceOver"
+drawText 100 50 "DestinationOver"
+drawText 200 50 "Clear"
+drawText 300 50 "Source"
+drawText 400 50 "Destination"
+drawText 500 50 "SourceIn"
+drawText 0 200 "DestinationIn"
+drawText 100 200 "SourceOut"
+drawText 200 200 "DestinationOut"
+drawText 300 200 "SourceAtop"
+drawText 400 200 "DestinationAtop"
+drawText 500 200 "Xor"
+drawText 0 350 "Plus"
+drawText 100 350 "Multiply"
+drawText 200 350 "Screen"
+drawText 300 350 "Overlay"
+drawText 400 350 "Darken"
+drawText 500 350 "Lighten"
+drawText 0 500 "ColorDodge"
+drawText 100 500 "ColorBurn"
+drawText 200 500 "HardLight"
+drawText 300 500 "SoftLight"
+drawText 400 500 "Difference"
+drawText 500 500 "Exclusion" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/porter_duff2.qps b/tests/auto/lancelot/scripts/porter_duff2.qps
new file mode 100644
index 0000000000..a792d9b278
--- /dev/null
+++ b/tests/auto/lancelot/scripts/porter_duff2.qps
@@ -0,0 +1,261 @@
+# Version: 1
+# CheckVsReference: 1% (0 50 600 100)
+# CheckVsReference: 1% (0 200 600 100)
+# CheckVsReference: 1% (0 350 600 100)
+# CheckVsReference: 1% (0 500 600 100)
+
+translate 0 50
+
+surface_begin 0 0 100 100
+
+begin_block predraw
+setRenderHint Antialiasing
+setPen nopen
+gradient_clearStops
+gradient_appendStop 0 efff0000
+gradient_appendStop 0.5 dfffff00
+gradient_appendStop 1 ef00ff00
+
+gradient_setSpread PadSpread
+gradient_setLinear 10 10 90 90
+drawEllipse 10 10 80 80
+end_block
+
+setCompositionMode SourceOver
+
+begin_block postdraw
+
+gradient_clearStops
+gradient_appendStop 0 afff0000
+gradient_appendStop 0.5 cf0000ff
+gradient_appendStop 1 bf00ff00
+
+gradient_setSpread PadSpread
+gradient_setLinear 0 0 100 0
+drawEllipse 10 10 30 30
+drawEllipse 10 60 30 30
+drawEllipse 60 60 30 30
+drawEllipse 60 10 30 30
+drawEllipse 35 35 30 30
+
+# a black rectangle around
+setCompositionMode SourceOver
+setPen black
+setBrush nobrush
+drawRect 0.5 0.5 99 99
+
+end_block
+surface_end
+
+# Destination over
+surface_begin 100 0 100 100
+repeat_block predraw
+setCompositionMode DestinationOver
+repeat_block postdraw
+surface_end
+
+
+# Clear
+surface_begin 200 0 100 100
+repeat_block predraw
+setCompositionMode Clear
+repeat_block postdraw
+surface_end
+
+
+# Source
+surface_begin 300 0 100 100
+repeat_block predraw
+setCompositionMode Source
+repeat_block postdraw
+surface_end
+
+
+# Destination
+surface_begin 400 0 100 100
+repeat_block predraw
+setCompositionMode Destination
+repeat_block postdraw
+surface_end
+
+
+# Source In
+surface_begin 500 0 100 100
+repeat_block predraw
+setCompositionMode SourceIn
+repeat_block postdraw
+surface_end
+
+translate 0 50
+
+# Destination In
+surface_begin 0 100 100 100
+repeat_block predraw
+setCompositionMode DestinationIn
+repeat_block postdraw
+surface_end
+
+
+# Source Out
+surface_begin 100 100 100 100
+repeat_block predraw
+setCompositionMode SourceOut
+repeat_block postdraw
+surface_end
+
+
+# Destination Out
+surface_begin 200 100 100 100
+repeat_block predraw
+setCompositionMode DestinationOut
+repeat_block postdraw
+surface_end
+
+
+# SourceAtop
+surface_begin 300 100 100 100
+repeat_block predraw
+setCompositionMode SourceAtop
+repeat_block postdraw
+surface_end
+
+
+# DestinationAtop
+surface_begin 400 100 100 100
+repeat_block predraw
+setCompositionMode DestinationAtop
+repeat_block postdraw
+surface_end
+
+
+# Xor
+surface_begin 500 100 100 100
+repeat_block predraw
+setCompositionMode Xor
+repeat_block postdraw
+surface_end
+
+translate 0 50
+
+# Plus
+surface_begin 0 200 100 100
+repeat_block predraw
+setCompositionMode Plus
+repeat_block postdraw
+surface_end
+
+
+# Multiply
+surface_begin 100 200 100 100
+repeat_block predraw
+setCompositionMode Multiply
+repeat_block postdraw
+surface_end
+
+
+# Screen
+surface_begin 200 200 100 100
+repeat_block predraw
+setCompositionMode Screen
+repeat_block postdraw
+surface_end
+
+
+# Overlay
+surface_begin 300 200 100 100
+repeat_block predraw
+setCompositionMode Overlay
+repeat_block postdraw
+surface_end
+
+
+# Darken
+surface_begin 400 200 100 100
+repeat_block predraw
+setCompositionMode Darken
+repeat_block postdraw
+surface_end
+
+
+# Lighten
+surface_begin 500 200 100 100
+repeat_block predraw
+setCompositionMode Lighten
+repeat_block postdraw
+surface_end
+
+translate 0 50
+
+# ColorDodge
+surface_begin 0 300 100 100
+repeat_block predraw
+setCompositionMode ColorDodge
+repeat_block postdraw
+surface_end
+
+
+# Multiply
+surface_begin 100 300 100 100
+repeat_block predraw
+setCompositionMode ColorBurn
+repeat_block postdraw
+surface_end
+
+
+# Screen
+surface_begin 200 300 100 100
+repeat_block predraw
+setCompositionMode HardLight
+repeat_block postdraw
+surface_end
+
+
+# Overlay
+surface_begin 300 300 100 100
+repeat_block predraw
+setCompositionMode SoftLight
+repeat_block postdraw
+surface_end
+
+
+# Darken
+surface_begin 400 300 100 100
+repeat_block predraw
+setCompositionMode Difference
+repeat_block postdraw
+surface_end
+
+
+# Lighten
+surface_begin 500 300 100 100
+repeat_block predraw
+setCompositionMode Exclusion
+repeat_block postdraw
+surface_end
+
+resetMatrix
+
+drawText 0 50 "SourceOver"
+drawText 100 50 "DestinationOver"
+drawText 200 50 "Clear"
+drawText 300 50 "Source"
+drawText 400 50 "Destination"
+drawText 500 50 "SourceIn"
+drawText 0 200 "DestinationIn"
+drawText 100 200 "SourceOut"
+drawText 200 200 "DestinationOut"
+drawText 300 200 "SourceAtop"
+drawText 400 200 "DestinationAtop"
+drawText 500 200 "Xor"
+drawText 0 350 "Plus"
+drawText 100 350 "Multiply"
+drawText 200 350 "Screen"
+drawText 300 350 "Overlay"
+drawText 400 350 "Darken"
+drawText 500 350 "Lighten"
+drawText 0 500 "ColorDodge"
+drawText 100 500 "ColorBurn"
+drawText 200 500 "HardLight"
+drawText 300 500 "SoftLight"
+drawText 400 500 "Difference"
+drawText 500 500 "Exclusion" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/primitives.qps b/tests/auto/lancelot/scripts/primitives.qps
new file mode 100644
index 0000000000..f44ba27566
--- /dev/null
+++ b/tests/auto/lancelot/scripts/primitives.qps
@@ -0,0 +1,184 @@
+# Version: 1#Version: 1
+# CheckVsReference: 5%
+
+
+# CheckVsReference: 5%
+
+setBrush #ff7f7fff
+setPen black 1 solidline
+translate 20 20
+begin_block testblock
+save
+drawRect 0 0 10 10
+drawRect 20 0 20 10
+drawRect 0 20 10 20
+drawRect 20 20 20 20
+translate 50 0
+setPen NoPen
+drawRect 0 0 10 10
+drawRect 20 0 20 10
+drawRect 0 20 10 20
+drawRect 20 20 20 20
+restore
+save
+translate 0 50
+drawEllipse 0 0 10 10
+drawEllipse 20 0 20 10
+drawEllipse 0 20 10 20
+drawEllipse 20 20 20 20
+translate 50 0
+setPen NoPen
+drawEllipse 0 0 10 10
+drawEllipse 20 0 20 10
+drawEllipse 0 20 10 20
+drawEllipse 20 20 20 20
+restore
+save
+translate 0 100
+drawPolygon [ 0 0 30 0 30 30 10 30 10 10 40 10 40 40 0 40 ]
+save
+translate 0 50
+drawPolygon [ 0 0 30 0 30 30 10 30 10 10 40 10 40 40 0 40 ] Winding
+translate 0 45
+drawPolyline [ 0 0 50 0 25 25 ]
+restore
+setPen NoPen
+translate 50 0
+drawPolygon [ 0 0 30 0 30 30 10 30 10 10 40 10 40 40 0 40 ]
+save
+translate 0 50
+drawPolygon [ 0 0 30 0 30 30 10 30 10 10 40 10 40 40 0 40 ] Winding
+restore
+save
+translate -20 100
+drawPie 0 0 50 50 0 1500
+restore
+restore
+end_block
+setPen black 1 SolidLine FlatCap
+translate 200 0
+scale 2 1
+rotate 10
+repeat_block testblock
+resetMatrix
+translate 0 250
+setBrush 7f7f7fff
+translate 20 20
+repeat_block testblock
+setPen black 1 SolidLine FlatCap
+translate 200 0
+scale 2 1
+rotate 10
+repeat_block testblock
+resetMatrix
+save
+setRenderHint LineAntialiasing
+setBrush 7f7fff
+translate 20 500
+repeat_block testblock
+translate 200 0
+scale 2 1
+rotate 10
+repeat_block testblock
+restore
+setRenderHint LineAntialiasing false
+translate 420 20
+begin_block lines
+drawLine 0 0 100 0
+drawLine 0 0 100 10
+drawLine 0 0 100 20
+drawLine 0 0 100 30
+drawLine 0 0 100 40
+drawLine 0 0 100 50
+drawLine 0 0 100 60
+drawLine 0 0 100 70
+drawLine 0 0 100 80
+drawLine 0 0 100 90
+drawLine 0 0 100 100
+drawLine 0 0 90 100
+drawLine 0 0 80 100
+drawLine 0 0 70 100
+drawLine 0 0 60 100
+drawLine 0 0 50 100
+drawLine 0 0 40 100
+drawLine 0 0 30 100
+drawLine 0 0 20 100
+drawLine 0 0 10 100
+drawLine 0 0 0 100
+end_block
+setRenderHint LineAntialiasing
+translate 0 120
+repeat_block lines
+translate 0 120
+scale 5 2
+repeat_block lines
+resetMatrix
+translate 420 500
+begin_block roundedrects
+save
+drawRoundedRect 0 0 50 30 5 5
+translate 60 0
+drawRoundedRect 0 0 50 30 7.5 7.5
+translate 60 0
+drawRoundedRect 0 0 50 30 10 10
+translate 60 0
+drawRoundedRect 0 0 50 30 12.5 12.5
+translate 60 0
+drawRoundedRect 0 0 50 30 15 15
+restore
+save
+translate 0 40
+drawRoundedRect 0 0 50 30 20 20 RelativeSize
+translate 60 0
+drawRoundedRect 0 0 50 30 40 40 RelativeSize
+translate 60 0
+drawRoundedRect 0 0 50 30 60 60 RelativeSize
+translate 60 0
+drawRoundedRect 0 0 50 30 80 80 RelativeSize
+translate 60 0
+drawRoundedRect 0 0 50 30 100 100 RelativeSize
+restore
+end_block
+translate 0.5 80.5
+repeat_block roundedrects
+translate -0.5 79.5
+setRenderHint Antialiasing off
+repeat_block roundedrects
+resetMatrix
+setRenderHint Antialiasing off
+setPen black 1
+begin_block drawShapes
+translate 550.5 25
+rotate 45
+setBrush nobrush
+drawEllipse -10 -10 20 20
+drawLine 10 0 50 0
+drawRect 50 -7 14 14
+resetMatrix
+end_block
+setPen black 2
+translate 25 0
+repeat_block drawShapes
+setPen black 3
+translate 50 0
+repeat_block drawShapes
+setPen black 4
+translate 75 0
+repeat_block drawShapes
+resetMatrix
+setRenderHint Antialiasing off
+setPen nopen
+translate 550 100
+setBrush #7f7f7fff
+drawRect -0.5 -0.5 21 21
+setBrush red
+drawEllipse 0 0 20 20
+setBrush nobrush
+setPen black
+drawEllipse 0 0 20 20
+translate 25 0
+setPen nopen
+setBrush #7f7f7fff
+drawRect 0 0 20 20
+setBrush red
+drawEllipse 0 0 20 20 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/radial_gradients.qps b/tests/auto/lancelot/scripts/radial_gradients.qps
new file mode 100644
index 0000000000..b55df8bde6
--- /dev/null
+++ b/tests/auto/lancelot/scripts/radial_gradients.qps
@@ -0,0 +1,99 @@
+# Version: 1
+# CheckVsReference: 5% (0 0 600 400)
+
+path_addRect path 400 0 80 80
+path_addEllipse path 440 40 60 60
+
+setRenderHint Antialiasing
+
+setPen black
+
+begin_block gradients
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setRadial 20 20 50 40 40
+drawRect 0 0 100 100
+
+gradient_setSpread ReflectSpread
+gradient_setRadial 120 20 50 140 40
+drawEllipse 100 0 100 100
+
+gradient_setSpread RepeatSpread
+gradient_setRadial 220 20 50 240 40
+drawRoundRect 200 0 100 100
+
+gradient_clearStops
+gradient_appendStop 0 3f7f7fff
+gradient_appendStop 0.5 dfdfffff
+gradient_appendStop 1 7f00007f
+
+gradient_setSpread PadSpread
+gradient_setRadial 320 20 50 340 40
+drawPolygon [300 0 390 0 350 99]
+
+gradient_setSpread ReflectSpread
+gradient_setRadial 420 20 50 440 40
+drawPath path
+
+gradient_setSpread RepeatSpread
+gradient_setRadial 520 20 50 540 40
+drawPie 500 0 100 100 720 4320
+end_block
+
+translate 0 100
+scale 1 2
+repeat_block gradients
+
+resetMatrix
+translate 0 300
+brushTranslate 30 0
+brushScale 0.9 0.9
+brushRotate 20
+repeat_block gradients
+
+# Some helpful info perhaps?
+resetMatrix
+setPen black
+
+drawText 610 50 "No XForm"
+drawText 610 200 "scale 1x2"
+drawText 610 300 "brush transform"
+drawText 10 450 "Pad"
+drawText 110 450 "Reflect"
+drawText 210 450 "Repeat"
+drawText 310 450 "Pad w/alpha"
+drawText 410 450 "Reflect w/alpha"
+drawText 510 450 "Repeat w/alpha"
+
+# Radius and focal indicators
+setPen 3f000000
+setBrush nobrush
+
+begin_block ellipse_draw
+setClipRect 0 0 100 100
+drawEllipse -30 -30 100 100
+drawEllipse 35 35 11 11
+translate 100 0
+end_block
+
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+
+resetMatrix
+translate 0 100
+scale 1 2
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw
+repeat_block ellipse_draw \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/radial_gradients_perspectives.qps b/tests/auto/lancelot/scripts/radial_gradients_perspectives.qps
new file mode 100644
index 0000000000..4557354dce
--- /dev/null
+++ b/tests/auto/lancelot/scripts/radial_gradients_perspectives.qps
@@ -0,0 +1,62 @@
+# Version: 1
+
+
+setRenderHint Antialiasing
+
+setPen #00ff00
+
+translate 10 10
+# standard draw
+begin_block gradient
+gradient_clearStops
+gradient_appendStop 0 red
+gradient_appendStop 0.25 orange
+gradient_appendStop 0.5 yellow
+gradient_appendStop 0.8 green
+gradient_appendStop 1 cyan
+
+gradient_setSpread PadSpread
+gradient_setRadial 110 100 230 230 240
+drawRect 0 0 300 300
+end_block gradient
+
+# Rotation w/o smooth xform
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0
+ repeat_block gradient
+restore
+restore
+
+translate 0 320
+
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0
+ repeat_block gradient
+restore
+
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50
+ repeat_block gradient
+restore
+restore
+
+
+resetMatrix
+setPen black
+translate 125 20
+drawText 0 0 "No transform"
+translate 350 0
+drawText 0 0 "Left Tilted"
+resetMatrix
+translate 125 350
+drawText 0 0 "Bottom Tilted"
+translate 350 0
+drawText 0 0 "Right Tilted"
+translate 120 0 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/rasterops.qps b/tests/auto/lancelot/scripts/rasterops.qps
new file mode 100644
index 0000000000..21f943b543
--- /dev/null
+++ b/tests/auto/lancelot/scripts/rasterops.qps
@@ -0,0 +1,87 @@
+# Version: 1
+# CheckVsReference: 5%
+
+setPen NoPen
+
+setBrush black
+drawRect 10 10 60 500
+
+setCompositionMode SourceOrDestination
+translate 20 20
+
+begin_block drawShape
+ setBrush 0xffff0000
+ drawEllipse 5 5 30 30
+ setBrush 0xff00ff00
+ drawRect 0 0 20 20
+ setBrush 0xff0000ff
+ drawRect 20 20 20 20
+end_block
+
+begin_block loop
+ setCompositionMode SourceAndDestination
+ translate 0 50
+repeat_block drawShape
+
+setCompositionMode SourceXorDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSourceAndNotDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSourceOrNotDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSourceXorDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSource
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSourceAndDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode SourceAndNotDestination
+translate 0 50
+repeat_block drawShape
+end_block
+
+resetMatrix
+setCompositionMode Source
+setBrush white
+drawRect 100 10 60 500
+translate 110 20
+repeat_block loop
+
+resetMatrix
+setCompositionMode Source
+translate 190 20
+repeat_block loop
+
+resetMatrix
+setPen black
+setCompositionMode SourceOver
+translate 250 45
+drawText 20 0 "Or ROP"
+translate 0 50
+drawText 20 0 "And ROP"
+translate 0 50
+drawText 20 0 "Xor ROP"
+translate 0 50
+drawText 20 0 "Nor ROP"
+translate 0 50
+drawText 20 0 "Nand ROP"
+translate 0 50
+drawText 0 0 "NSrcXorDst ROP"
+translate 0 50
+drawText 20 0 "NSrc ROP"
+translate 0 50
+drawText 0 0 "NSrcAndDst ROP"
+translate 0 50
+drawText 0 0 "SrcAndNDst ROP" \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/sizes.qps b/tests/auto/lancelot/scripts/sizes.qps
new file mode 100644
index 0000000000..268808ec09
--- /dev/null
+++ b/tests/auto/lancelot/scripts/sizes.qps
@@ -0,0 +1,150 @@
+# Version: 1
+# CheckVsReference: 5%
+
+setPen NoPen
+setBrush black
+
+translate 10 10
+
+begin_block testblock
+drawRect 0 0 10 10
+drawRect 20 0 11 11
+drawRect 40 0 12 12
+drawRect 60 0 13 13
+drawRect 80 0 14 14
+drawRect 100 0 15 15
+drawRect 120 0 16 16
+drawRect 140 0 17 17
+drawRect 160 0 18 18
+drawRect 180 0 19 19
+# qt3_drawRect 200 0 10 10
+# qt3_drawRect 220 0 11 11
+# qt3_drawRect 240 0 12 12
+# qt3_drawRect 260 0 13 13
+# qt3_drawRect 280 0 14 14
+# qt3_drawRect 300 0 15 15
+# qt3_drawRect 320 0 16 16
+# qt3_drawRect 340 0 17 17
+# qt3_drawRect 360 0 18 18
+# qt3_drawRect 380 0 19 19
+
+drawEllipse 0 20 10 10
+drawEllipse 20 20 11 11
+drawEllipse 40 20 12 12
+drawEllipse 60 20 13 13
+drawEllipse 80 20 14 14
+drawEllipse 100 20 15 15
+drawEllipse 120 20 16 16
+drawEllipse 140 20 17 17
+drawEllipse 160 20 18 18
+drawEllipse 180 20 19 19
+# qt3_drawEllipse 200 20 10 10
+# qt3_drawEllipse 220 20 11 11
+# qt3_drawEllipse 240 20 12 12
+# qt3_drawEllipse 260 20 13 13
+# qt3_drawEllipse 280 20 14 14
+# qt3_drawEllipse 300 20 15 15
+# qt3_drawEllipse 320 20 16 16
+# qt3_drawEllipse 340 20 17 17
+# qt3_drawEllipse 360 20 18 18
+# qt3_drawEllipse 380 20 19 19
+
+drawRoundRect 0 40 10 10
+drawRoundRect 20 40 11 11
+drawRoundRect 40 40 12 12
+drawRoundRect 60 40 13 13
+drawRoundRect 80 40 14 14
+drawRoundRect 100 40 15 15
+drawRoundRect 120 40 16 16
+drawRoundRect 140 40 17 17
+drawRoundRect 160 40 18 18
+drawRoundRect 180 40 19 19
+# qt3_drawRoundRect 200 40 10 10
+# qt3_drawRoundRect 220 40 11 11
+# qt3_drawRoundRect 240 40 12 12
+# qt3_drawRoundRect 260 40 13 13
+# qt3_drawRoundRect 280 40 14 14
+# qt3_drawRoundRect 300 40 15 15
+# qt3_drawRoundRect 320 40 16 16
+# qt3_drawRoundRect 340 40 17 17
+# qt3_drawRoundRect 360 40 18 18
+# qt3_drawRoundRect 380 40 19 19
+
+drawPie 0 60 10 10 0 4320
+drawPie 20 60 11 11 0 4320
+drawPie 40 60 12 12 0 4320
+drawPie 60 60 13 13 0 4320
+drawPie 80 60 14 14 0 4320
+drawPie 100 60 15 15 0 4320
+drawPie 120 60 16 16 0 4320
+drawPie 140 60 17 17 0 4320
+drawPie 160 60 18 18 0 4320
+drawPie 180 60 19 19 0 4320
+# qt3_drawPie 200 60 10 10 0 4320
+# qt3_drawPie 220 60 11 11 0 4320
+# qt3_drawPie 240 60 12 12 0 4320
+# qt3_drawPie 260 60 13 13 0 4320
+# qt3_drawPie 280 60 14 14 0 4320
+# qt3_drawPie 300 60 15 15 0 4320
+# qt3_drawPie 320 60 16 16 0 4320
+# qt3_drawPie 340 60 17 17 0 4320
+# qt3_drawPie 360 60 18 18 0 4320
+# qt3_drawPie 380 60 19 19 0 4320
+
+drawArc 0 80 10 10 0 4320
+drawArc 20 80 11 11 0 4320
+drawArc 40 80 12 12 0 4320
+drawArc 60 80 13 13 0 4320
+drawArc 80 80 14 14 0 4320
+drawArc 100 80 15 15 0 4320
+drawArc 120 80 16 16 0 4320
+drawArc 140 80 17 17 0 4320
+drawArc 160 80 18 18 0 4320
+drawArc 180 80 19 19 0 4320
+# qt3_drawArc 200 80 10 10 0 4320
+# qt3_drawArc 220 80 11 11 0 4320
+# qt3_drawArc 240 80 12 12 0 4320
+# qt3_drawArc 260 80 13 13 0 4320
+# qt3_drawArc 280 80 14 14 0 4320
+# qt3_drawArc 300 80 15 15 0 4320
+# qt3_drawArc 320 80 16 16 0 4320
+# qt3_drawArc 340 80 17 17 0 4320
+# qt3_drawArc 360 80 18 18 0 4320
+# qt3_drawArc 380 80 19 19 0 4320
+
+drawChord 0 100 10 10 0 4320
+drawChord 20 100 11 11 0 4320
+drawChord 40 100 12 12 0 4320
+drawChord 60 100 13 13 0 4320
+drawChord 80 100 14 14 0 4320
+drawChord 100 100 15 15 0 4320
+drawChord 120 100 16 16 0 4320
+drawChord 140 100 17 17 0 4320
+drawChord 160 100 18 18 0 4320
+drawChord 180 100 19 19 0 4320
+# qt3_drawChord 200 100 10 10 0 4320
+# qt3_drawChord 220 100 11 11 0 4320
+# qt3_drawChord 240 100 12 12 0 4320
+# qt3_drawChord 260 100 13 13 0 4320
+# qt3_drawChord 280 100 14 14 0 4320
+# qt3_drawChord 300 100 15 15 0 4320
+# qt3_drawChord 320 100 16 16 0 4320
+# qt3_drawChord 340 100 17 17 0 4320
+# qt3_drawChord 360 100 18 18 0 4320
+# qt3_drawChord 380 100 19 19 0 4320
+
+end_block
+
+setPen red
+translate 0 150
+repeat_block testblock
+
+setRenderHint LineAntialiasing
+
+setPen nopen
+translate 0 150
+repeat_block testblock
+
+setPen red
+translate 0 150
+repeat_block testblock
diff --git a/tests/auto/lancelot/scripts/text.qps b/tests/auto/lancelot/scripts/text.qps
new file mode 100644
index 0000000000..d7ee83290b
--- /dev/null
+++ b/tests/auto/lancelot/scripts/text.qps
@@ -0,0 +1,124 @@
+# Version: 1
+
+drawText -5 5 "Text that is drawn outside the bounds..."
+
+translate 20 20
+begin_block text_drawing
+save
+ setFont "sansserif" 10 normal
+ drawText 0 20 "sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawText 0 40 "sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawText 0 60 "sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawText 0 80 "sansserif 10pt, bold italic"
+
+
+ translate 0 100
+ setPen #7fff0000
+
+ setFont "sansserif" 10 normal
+ drawText 0 20 "alpha sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawText 0 40 "alpha sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawText 0 60 "alpha sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawText 0 80 "alpha sansserif 10pt, bold italic"
+
+
+ translate 0 100
+ setPen black
+ save
+ scale 0.9 0.9
+
+ setFont "sansserif" 10 normal
+ drawText 0 20 "scaled sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawText 0 40 "scaled sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawText 0 60 "scaled sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawText 0 80 "scaled sansserif 10pt, bold italic"
+ restore
+
+ translate 0 100
+ setPen black
+ save
+ translate 200 90
+ rotate 185
+
+ setFont "sansserif" 10 normal
+ drawText 0 20 "scaled sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawText 0 40 "scaled sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawText 0 60 "scaled sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawText 0 80 "scaled sansserif 10pt, bold italic"
+ restore
+
+ translate 0 100
+ gradient_appendStop 0 red
+ gradient_appendStop 0.5 #00ff00
+ gradient_appendStop 1 blue
+ gradient_setLinear 0 0 200 0
+ setPen brush
+
+ setFont "sansserif" 10 normal
+ drawText 0 0 "gradient sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawText 0 20 "gradient sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawText 0 40 "gradient sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawText 0 60 "gradient sansserif 10pt, bold italic"
+restore
+end_block
+
+translate 250 0
+drawText 25 520 "clipped to rectangle"
+save
+ setPen #3f000000
+ setBrush nobrush
+ drawRect 20 0 100 500
+ setClipRect 20 0 100 500
+ setPen black
+ repeat_block text_drawing
+restore
+
+translate 150 0
+drawText 25 520 "clipped to path"
+save
+ path_moveTo clip 20 0
+ path_cubicTo clip 0 200 40 400 20 400
+ path_lineTo clip 30 500
+ path_lineTo clip 30 0
+ path_lineTo clip 40 0
+ path_lineTo clip 40 500
+ path_lineTo clip 120 500
+ path_lineTo clip 120 0
+ path_lineTo clip 20 0
+ setPen #3f000000
+ setBrush nobrush
+ drawPath clip
+ setClipPath clip
+ setPen black
+ repeat_block text_drawing
+restore \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/text_perspectives.qps b/tests/auto/lancelot/scripts/text_perspectives.qps
new file mode 100644
index 0000000000..4c74306265
--- /dev/null
+++ b/tests/auto/lancelot/scripts/text_perspectives.qps
@@ -0,0 +1,102 @@
+# Version: 1
+
+
+setRenderHint Antialiasing
+
+setPen black
+
+translate 10 10
+# standard draw
+begin_block text
+setBrush gray
+drawRect 0 0 300 300
+
+setFont "times" 3
+drawText 10 10 "Hello World...."
+
+setFont "times" 4
+drawText 10 20 "Hello World...."
+
+setFont "times" 5
+drawText 10 30 "Hello World...."
+
+setFont "times" 6
+drawText 10 40 "Hello World...."
+
+setFont "times" 7
+drawText 10 50 "Hello World...."
+
+setFont "times" 8
+drawText 10 60 "Hello World...."
+
+setFont "times" 9
+drawText 10 70 "Hello World...."
+
+setFont "times" 10
+drawText 10 80 "Hello World...."
+
+setFont "times" 16
+drawText 10 100 "Hello World...."
+
+setFont "times" 17
+drawText 10 120 "Hello World...."
+
+setFont "times" 18
+drawText 10 140 "Hello World...."
+
+setFont "times" 20
+drawText 10 160 "Hello World...."
+
+setFont "times" 22
+drawText 10 180 "Hello World...."
+
+setFont "times" 24
+drawText 10 205 "Hello World...."
+
+setFont "times" 26
+drawText 10 230 "Hello World...."
+
+setFont "times" 32
+drawText 10 260 "Hello World...."
+end_block text
+
+# Rotation w/o smooth xform
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0
+ repeat_block text
+restore
+restore
+
+translate 0 320
+
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0
+ repeat_block text
+restore
+
+save
+translate 350 0
+save
+ setRenderHint SmoothPixmapTransform on
+ mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50
+ repeat_block text
+restore
+restore
+
+
+resetMatrix
+setPen black
+translate 125 20
+drawText 0 0 "No transform"
+translate 350 0
+drawText 0 0 "Left Tilted"
+resetMatrix
+translate 125 350
+drawText 0 0 "Bottom Tilted"
+translate 350 0
+drawText 0 0 "Right Tilted"
+translate 120 0 \ No newline at end of file
diff --git a/tests/auto/lancelot/scripts/tiled_pixmap.qps b/tests/auto/lancelot/scripts/tiled_pixmap.qps
new file mode 100644
index 0000000000..9cb5e0dd1f
--- /dev/null
+++ b/tests/auto/lancelot/scripts/tiled_pixmap.qps
@@ -0,0 +1,84 @@
+# Version: 1
+# CheckVsReference: 5% (0 0 639 638)
+
+
+translate 0 10
+setRenderHint Antialiasing
+
+pixmap_load dome_argb32 the_pixmap
+
+begin_block draw_stuff
+save
+
+ # Standard draw
+ drawTiledPixmap the_pixmap 0 0 150 100 0 0
+
+ # Standard draw with offset
+ translate 160 0
+ drawTiledPixmap the_pixmap 0 0 150 100 25 25
+
+ # xformed
+ translate 160 0
+ save
+ translate 10 -10
+ rotate 10
+ setRenderHint SmoothPixmapTransform false
+ drawTiledPixmap the_pixmap 0 0 150 100 25 25
+ restore
+
+ # xformed with smooth xform
+ translate 160 0
+ save
+ translate 10 -10
+ rotate 10
+ setRenderHint SmoothPixmapTransform
+ drawTiledPixmap the_pixmap 0 0 150 100 25 25
+ restore
+restore
+end_block
+
+translate 0 120
+pixmap_load dome_rgb32 the_pixmap
+repeat_block draw_stuff
+
+
+translate 0 120
+pixmap_load dome_indexed the_pixmap
+repeat_block draw_stuff
+
+
+translate 0 120
+pixmap_load dome_indexed_mask the_pixmap
+repeat_block draw_stuff
+
+
+translate 0 120
+pixmap_load dome_mono the_pixmap
+repeat_block draw_stuff
+
+
+################################################################################
+# Some helpful text...
+#
+
+resetMatrix
+translate 650 80
+drawText 0 0 "32 bit w/alpha"
+translate 0 120
+drawText 0 0 "32 bit w/o alpha"
+translate 0 120
+drawText 0 0 "8 bit indexed"
+translate 0 120
+drawText 0 0 "8 bit indexed w/mask"
+translate 0 120
+drawText 0 0 "1 bit"
+
+resetMatrix
+translate 10 630
+drawText 0 0 "normal"
+translate 160 0
+drawText 0 0 "offset"
+translate 160 0
+drawText 0 0 "xformed"
+translate 160 0
+drawText 0 0 "smooth xformed"
diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp
new file mode 100644
index 0000000000..0e8757bfa6
--- /dev/null
+++ b/tests/auto/lancelot/tst_lancelot.cpp
@@ -0,0 +1,334 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <paintcommands.h>
+#include <QPainter>
+#include <QLibraryInfo>
+#include <baselineprotocol.h>
+#include <QHash>
+
+#ifndef QT_NO_OPENGL
+#include <QtOpenGL>
+#endif
+
+#ifndef SRCDIR
+#define SRCDIR "."
+#endif
+
+class tst_Lancelot : public QObject
+{
+Q_OBJECT
+
+public:
+ tst_Lancelot();
+
+ static bool simfail;
+
+private:
+ enum GraphicsEngine {
+ Raster = 0,
+ OpenGL = 1
+ };
+
+ bool setupTestSuite(const QStringList& blacklist);
+ void runTestSuite(GraphicsEngine engine, QImage::Format format);
+ ImageItem render(const ImageItem &item, GraphicsEngine engine, QImage::Format format);
+ void paint(QPaintDevice *device, const QStringList &script, const QString &filePath);
+
+ BaselineProtocol proto;
+ ImageItemList baseList;
+ QHash<QString, QStringList> scripts;
+ bool dryRunMode;
+ QString scriptsDir;
+
+private slots:
+ void initTestCase();
+ void cleanupTestCase() {}
+
+ void testRasterARGB32PM_data();
+ void testRasterARGB32PM();
+ void testRasterRGB32_data();
+ void testRasterRGB32();
+ void testRasterRGB16_data();
+ void testRasterRGB16();
+
+#ifndef QT_NO_OPENGL
+ void testOpenGL_data();
+ void testOpenGL();
+#endif
+};
+
+bool tst_Lancelot::simfail = false;
+
+tst_Lancelot::tst_Lancelot()
+{
+}
+
+void tst_Lancelot::initTestCase()
+{
+ // Check and setup the environment. We treat failures because of test environment
+ // (e.g. script files not found) as just warnings, and not QFAILs, to avoid false negatives
+ // caused by environment or server instability
+
+#if defined(Q_OS_SOMEPLATFORM)
+ QSKIP("This test is not supported on this platform.", SkipAll);
+#endif
+ if (!proto.connect(QLatin1String("tst_Lancelot"), &dryRunMode))
+ QSKIP(qPrintable(proto.errorMessage()), SkipAll);
+
+#if defined(USE_RUNTIME_DIR)
+ scriptsDir = QCoreApplication::applicationDirPath() + "/scripts/";
+#else
+ scriptsDir = SRCDIR "/scripts/";
+#endif
+ QDir qpsDir(scriptsDir);
+ QStringList files = qpsDir.entryList(QStringList() << QLatin1String("*.qps"), QDir::Files | QDir::Readable);
+ if (files.isEmpty()) {
+ QWARN("No qps script files found in " + qpsDir.path().toLatin1());
+ QSKIP("Aborted due to errors.", SkipAll);
+ }
+
+ baseList.resize(files.count());
+ ImageItemList::iterator it = baseList.begin();
+ foreach(const QString& fileName, files) {
+ QFile file(scriptsDir + fileName);
+ file.open(QFile::ReadOnly);
+ QByteArray cont = file.readAll();
+ scripts.insert(fileName, QString::fromLatin1(cont).split(QLatin1Char('\n'), QString::SkipEmptyParts));
+ it->itemName = fileName;
+ it->itemChecksum = qChecksum(cont.constData(), cont.size());
+ it++;
+ }
+}
+
+
+void tst_Lancelot::testRasterARGB32PM_data()
+{
+ QStringList localBlacklist;
+ if (!setupTestSuite(localBlacklist))
+ QSKIP("Communication with baseline image server failed.", SkipAll);
+}
+
+
+void tst_Lancelot::testRasterARGB32PM()
+{
+ runTestSuite(Raster, QImage::Format_ARGB32_Premultiplied);
+}
+
+
+void tst_Lancelot::testRasterRGB32_data()
+{
+ QStringList localBlacklist;
+ if (!setupTestSuite(localBlacklist))
+ QSKIP("Communication with baseline image server failed.", SkipAll);
+}
+
+
+void tst_Lancelot::testRasterRGB32()
+{
+ runTestSuite(Raster, QImage::Format_RGB32);
+}
+
+
+void tst_Lancelot::testRasterRGB16_data()
+{
+ QStringList localBlacklist;
+ if (!setupTestSuite(localBlacklist))
+ QSKIP("Communication with baseline image server failed.", SkipAll);
+}
+
+
+void tst_Lancelot::testRasterRGB16()
+{
+ runTestSuite(Raster, QImage::Format_RGB16);
+}
+
+
+#ifndef QT_NO_OPENGL
+void tst_Lancelot::testOpenGL_data()
+{
+ QStringList localBlacklist = QStringList() << QLatin1String("rasterops.qps");
+ if (!setupTestSuite(localBlacklist))
+ QSKIP("Communication with baseline image server failed.", SkipAll);
+}
+
+
+void tst_Lancelot::testOpenGL()
+{
+ bool ok = false;
+ QGLWidget glWidget;
+ if (glWidget.isValid() && glWidget.format().directRendering()
+ && ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0)
+ || (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0))
+ && QGLFramebufferObject::hasOpenGLFramebufferObjects())
+ {
+ glWidget.makeCurrent();
+ if (!QByteArray((const char *)glGetString(GL_VERSION)).contains("Mesa"))
+ ok = true;
+ }
+ if (ok)
+ runTestSuite(OpenGL, QImage::Format_RGB32);
+ else
+ QSKIP("System under test does not meet preconditions for GL testing. Skipping.", SkipAll);
+}
+#endif
+
+
+bool tst_Lancelot::setupTestSuite(const QStringList& blacklist)
+{
+ QTest::addColumn<ImageItem>("baseline");
+
+ ImageItemList itemList(baseList);
+ if (!proto.requestBaselineChecksums(QTest::currentTestFunction(), &itemList)) {
+ QWARN(qPrintable(proto.errorMessage()));
+ return false;
+ }
+
+ foreach(const ImageItem& item, itemList) {
+ if (!blacklist.contains(item.itemName))
+ QTest::newRow(item.itemName.toLatin1()) << item;
+ }
+ return true;
+}
+
+
+void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format)
+{
+ QFETCH(ImageItem, baseline);
+
+ if (baseline.status == ImageItem::IgnoreItem)
+ QSKIP("Blacklisted by baseline server.", SkipSingle);
+
+ ImageItem rendered = render(baseline, engine, format);
+ if (rendered.image.isNull()) { // Assume an error in the test environment, not Qt
+ QWARN("Error: Failed to render image.");
+ QSKIP("Aborted due to errors.", SkipSingle);
+ }
+
+ if (baseline.status == ImageItem::BaselineNotFound) {
+ proto.submitNewBaseline(rendered, 0);
+ QSKIP("Baseline not found; new baseline created.", SkipSingle);
+ }
+
+ if (!baseline.imageChecksums.contains(rendered.imageChecksums.at(0))) {
+ QByteArray serverMsg;
+ if (!proto.submitMismatch(rendered, &serverMsg))
+ serverMsg = "Failed to submit mismatching image to server.";
+ if (dryRunMode)
+ qDebug() << "Dryrun mode, ignoring detected mismatch." << serverMsg;
+ else
+ QFAIL("Rendered image differs from baseline. Report:\n " + serverMsg);
+ }
+}
+
+
+ImageItem tst_Lancelot::render(const ImageItem &item, GraphicsEngine engine, QImage::Format format)
+{
+ ImageItem res = item;
+ res.imageChecksums.clear();
+ res.image = QImage();
+ QString filePath = scriptsDir + item.itemName;
+ QStringList script = scripts.value(item.itemName);
+
+ if (engine == Raster) {
+ QImage img(800, 800, format);
+ paint(&img, script, QFileInfo(filePath).absoluteFilePath()); // eh yuck (filePath stuff)
+ res.image = img;
+ res.imageChecksums.append(ImageItem::computeChecksum(img));
+#ifndef QT_NO_OPENGL
+ } else if (engine == OpenGL) {
+ QGLWidget glWidget;
+ if (glWidget.isValid()) {
+ glWidget.makeCurrent();
+ QGLFramebufferObjectFormat fboFormat;
+ fboFormat.setSamples(16);
+ fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ QGLFramebufferObject fbo(800, 800, fboFormat);
+ paint(&fbo, script, QFileInfo(filePath).absoluteFilePath()); // eh yuck (filePath stuff)
+ res.image = fbo.toImage().convertToFormat(format);
+ res.imageChecksums.append(ImageItem::computeChecksum(res.image));
+ }
+#endif
+ }
+
+ return res;
+}
+
+void tst_Lancelot::paint(QPaintDevice *device, const QStringList &script, const QString &filePath)
+{
+ QPainter p(device);
+ PaintCommands pcmd(script, 800, 800);
+ //pcmd.setShouldDrawText(false);
+ pcmd.setType(ImageType);
+ pcmd.setPainter(&p);
+ pcmd.setFilePath(filePath);
+ pcmd.runCommands();
+ p.end();
+
+ if (simfail) {
+ QPainter p2(device);
+ p2.setPen(QPen(QBrush(Qt::cyan), 3, Qt::DashLine));
+ p2.drawLine(200, 200, 600, 600);
+ p2.drawLine(600, 200, 200, 600);
+ simfail = false;
+ }
+}
+
+#define main rmain
+QTEST_MAIN(tst_Lancelot)
+#undef main
+
+int main(int argc, char *argv[])
+{
+ char *fargv[20];
+ int fargc = 0;
+ for (int i = 0; i < qMin(argc, 19); i++) {
+ if (!qstrcmp(argv[i], "-simfail"))
+ tst_Lancelot::simfail = true;
+ else
+ fargv[fargc++] = argv[i];
+ }
+ fargv[fargc] = 0;
+ return rmain(fargc, fargv);
+}
+
+#include "tst_lancelot.moc"
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/main.js b/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/main.js
new file mode 100644
index 0000000000..aa510c1ae8
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/main.js
@@ -0,0 +1,29 @@
+// No context specified, default should be used.
+qsTr("One");
+QT_TR_NOOP("Two");
+
+// TRANSLATOR Foo
+qsTr("Three");
+QT_TR_NOOP("Four");
+
+// TRANSLATOR Bar
+qsTr("Five");
+
+/*
+ TRANSLATOR Baz
+ This is a comment to the translator.
+*/
+QT_TR_NOOP("Six");
+
+// TRANSLATOR Foo.Bar
+qsTr("Seven");
+
+/* TRANSLATOR Bar::Baz */
+QT_TR_NOOP("Eight");
+
+// qsTranslate() context is not affected.
+qsTranslate("Foo", "Nine");
+
+// Empty context.
+// TRANSLATOR
+qsTr("Ten");
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/project.pro
new file mode 100644
index 0000000000..d549039c4b
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/project.pro
@@ -0,0 +1,3 @@
+SOURCES += main.js
+
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/project.ts.result
new file mode 100644
index 0000000000..18407b2f8b
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parsejscontexts/project.ts.result
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name></name>
+ <message>
+ <location filename="main.js" line="29"/>
+ <source>Ten</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Bar</name>
+ <message>
+ <location filename="main.js" line="10"/>
+ <source>Five</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Bar::Baz</name>
+ <message>
+ <location filename="main.js" line="22"/>
+ <source>Eight</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Baz</name>
+ <message>
+ <location filename="main.js" line="12"/>
+ <source></source>
+ <comment>This is a comment to the translator.</comment>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="main.js" line="16"/>
+ <source>Six</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Foo</name>
+ <message>
+ <location filename="main.js" line="6"/>
+ <source>Three</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.js" line="7"/>
+ <source>Four</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.js" line="25"/>
+ <source>Nine</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Foo.Bar</name>
+ <message>
+ <location filename="main.js" line="19"/>
+ <source>Seven</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>main</name>
+ <message>
+ <location filename="main.js" line="2"/>
+ <source>One</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.js" line="3"/>
+ <source>Two</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/macnativeevents/expectedeventlist.cpp b/tests/auto/macnativeevents/expectedeventlist.cpp
index a1dc9c36c6..78be0976d4 100644
--- a/tests/auto/macnativeevents/expectedeventlist.cpp
+++ b/tests/auto/macnativeevents/expectedeventlist.cpp
@@ -49,7 +49,9 @@ ExpectedEventList::ExpectedEventList(QObject *target)
: QObject(target), eventCount(0)
{
target->installEventFilter(this);
- debug = !qgetenv("NATIVEDEBUG").isEmpty();
+ debug = qgetenv("NATIVEDEBUG").toInt();
+ if (debug > 0)
+ qDebug() << "Debug level sat to:" << debug;
}
ExpectedEventList::~ExpectedEventList()
@@ -104,14 +106,17 @@ void ExpectedEventList::compareMouseEvents(QEvent *received, QEvent *expected)
&& (e1->globalPos() == e2->globalPos())
&& (e1->button() == e2->button())
&& (e1->buttons() == e2->buttons())
- && (e1->modifiers() == e2->modifiers()))
+ && (e1->modifiers() == e2->modifiers())) {
+ if (debug > 0)
+ qDebug() << " Received (OK):" << e1 << e1->globalPos();
return; // equal
+ }
// INVARIANT: The two events are not equal. So we fail. Depending
// on whether debug mode is no or not, we let QTest fail. Otherwise
// we let the test continue for debugging puposes.
int eventListNr = eventCount - eventList.size();
- if (!debug) {
+ if (debug == 0) {
qWarning() << "Expected event" << eventListNr << "differs from received event:";
QCOMPARE(e1->pos(), e2->pos());
QCOMPARE(e1->globalPos(), e2->globalPos());
@@ -135,14 +140,17 @@ void ExpectedEventList::compareKeyEvents(QEvent *received, QEvent *expected)
if (e1->key() == e2->key()
&& (e1->modifiers() == e2->modifiers())
&& (e1->count() == e2->count())
- && (e1->isAutoRepeat() == e2->isAutoRepeat()))
+ && (e1->isAutoRepeat() == e2->isAutoRepeat())) {
+ if (debug > 0)
+ qDebug() << " Received (OK):" << e1 << QKeySequence(e1->key()).toString(QKeySequence::NativeText);
return; // equal
+ }
// INVARIANT: The two events are not equal. So we fail. Depending
// on whether debug mode is no or not, we let QTest fail. Otherwise
// we let the test continue for debugging puposes.
int eventListNr = eventCount - eventList.size();
- if (!debug) {
+ if (debug == 0) {
qWarning() << "Expected event" << eventListNr << "differs from received event:";
QCOMPARE(e1->key(), e2->key());
QCOMPARE(e1->modifiers(), e2->modifiers());
@@ -150,18 +158,19 @@ void ExpectedEventList::compareKeyEvents(QEvent *received, QEvent *expected)
QCOMPARE(e1->isAutoRepeat(), e2->isAutoRepeat());
} else {
qWarning() << "*** FAIL *** : Expected event" << eventListNr << "differs from received event:";
- qWarning() << "Received:" << e1 << e1->key();
- qWarning() << "Expected:" << e2 << e2->key();
+ qWarning() << "Received:" << e1 << QKeySequence(e1->key()).toString(QKeySequence::NativeText);
+ qWarning() << "Expected:" << e2 << QKeySequence(e2->key()).toString(QKeySequence::NativeText);
}
}
bool ExpectedEventList::eventFilter(QObject *, QEvent *received)
{
- if (debug)
+ if (debug > 1)
qDebug() << received;
if (eventList.isEmpty())
return false;
+ bool eat = false;
QEvent *expected = eventList.first();
if (expected->type() == received->type()) {
eventList.removeFirst();
@@ -175,11 +184,13 @@ bool ExpectedEventList::eventFilter(QObject *, QEvent *received)
case QEvent::NonClientAreaMouseButtonDblClick:
case QEvent::NonClientAreaMouseMove: {
compareMouseEvents(received, expected);
+ eat = true;
break;
}
case QEvent::KeyPress:
case QEvent::KeyRelease: {
compareKeyEvents(received, expected);
+ eat = true;
break;
}
case QEvent::Resize: {
@@ -198,6 +209,6 @@ bool ExpectedEventList::eventFilter(QObject *, QEvent *received)
QAbstractEventDispatcher::instance()->interrupt();
}
- return false;
+ return eat;
}
diff --git a/tests/auto/macnativeevents/expectedeventlist.h b/tests/auto/macnativeevents/expectedeventlist.h
index e43e74414b..850c0a5362 100644
--- a/tests/auto/macnativeevents/expectedeventlist.h
+++ b/tests/auto/macnativeevents/expectedeventlist.h
@@ -51,7 +51,7 @@ class ExpectedEventList : public QObject
{
QList<QEvent *> eventList;
QBasicTimer timer;
- bool debug;
+ int debug;
int eventCount;
void timerEvent(QTimerEvent *);
diff --git a/tests/auto/macnativeevents/nativeeventlist.cpp b/tests/auto/macnativeevents/nativeeventlist.cpp
index 59ed3886ff..c3303c2fed 100644
--- a/tests/auto/macnativeevents/nativeeventlist.cpp
+++ b/tests/auto/macnativeevents/nativeeventlist.cpp
@@ -47,7 +47,8 @@ NativeEventList::NativeEventList(int defaultWaitMs)
, wait(false)
, defaultWaitMs(defaultWaitMs)
{
- QString multiplier = qgetenv("NATIVEDEBUG");
+ debug = qgetenv("NATIVEDEBUG").toInt();
+ QString multiplier = qgetenv("NATIVEDEBUGSPEED");
if (!multiplier.isEmpty())
setTimeMultiplier(multiplier.toFloat());
}
@@ -61,8 +62,11 @@ NativeEventList::~NativeEventList()
void NativeEventList::sendNextEvent()
{
QNativeEvent *e = eventList.at(currIndex).second;
- if (e)
+ if (e) {
+ if (debug > 0)
+ qDebug() << "Sending:" << *e;
QNativeInput::sendNativeEvent(*e);
+ }
waitNextEvent();
}
diff --git a/tests/auto/macnativeevents/nativeeventlist.h b/tests/auto/macnativeevents/nativeeventlist.h
index 35d560fa8d..551e9603ae 100644
--- a/tests/auto/macnativeevents/nativeeventlist.h
+++ b/tests/auto/macnativeevents/nativeeventlist.h
@@ -76,6 +76,7 @@ private:
int currIndex;
bool wait;
int defaultWaitMs;
+ int debug;
};
#endif
diff --git a/tests/auto/macnativeevents/qnativeevents_mac.cpp b/tests/auto/macnativeevents/qnativeevents_mac.cpp
index 6eba94f904..ee08cc8adf 100644
--- a/tests/auto/macnativeevents/qnativeevents_mac.cpp
+++ b/tests/auto/macnativeevents/qnativeevents_mac.cpp
@@ -54,11 +54,11 @@ static Qt::KeyboardModifiers getModifiersFromQuartzEvent(CGEventRef inEvent)
if (flags & kCGEventFlagMaskShift || flags & kCGEventFlagMaskAlphaShift)
m |= Qt::ShiftModifier;
if (flags & kCGEventFlagMaskControl)
- m |= Qt::MetaModifier;
+ m |= Qt::ControlModifier;
if (flags & kCGEventFlagMaskAlternate)
m |= Qt::AltModifier;
if (flags & kCGEventFlagMaskCommand)
- m |= Qt::ControlModifier;
+ m |= Qt::MetaModifier;
return m;
}
@@ -67,11 +67,11 @@ static void setModifiersFromQNativeEvent(CGEventRef inEvent, const QNativeEvent
CGEventFlags flags = 0;
if (event.modifiers.testFlag(Qt::ShiftModifier))
flags |= kCGEventFlagMaskShift;
- if (event.modifiers.testFlag(Qt::MetaModifier))
+ if (event.modifiers.testFlag(Qt::ControlModifier))
flags |= kCGEventFlagMaskControl;
if (event.modifiers.testFlag(Qt::AltModifier))
flags |= kCGEventFlagMaskAlternate;
- if (event.modifiers.testFlag(Qt::ControlModifier))
+ if (event.modifiers.testFlag(Qt::MetaModifier))
flags |= kCGEventFlagMaskCommand;
CGEventSetFlags(inEvent, flags);
}
diff --git a/tests/auto/macnativeevents/tst_macnativeevents.cpp b/tests/auto/macnativeevents/tst_macnativeevents.cpp
index ac7298c781..3dc0506637 100644
--- a/tests/auto/macnativeevents/tst_macnativeevents.cpp
+++ b/tests/auto/macnativeevents/tst_macnativeevents.cpp
@@ -48,6 +48,7 @@
#include "qnativeevents.h"
#include "nativeeventlist.h"
#include "expectedeventlist.h"
+#include <Carbon/Carbon.h>
#ifdef Q_OS_MAC
@@ -73,6 +74,10 @@ private slots:
void testChildWindowInFrontOfStaysOnTopParentWindow();
#endif
void testKeyPressOnToplevel();
+ void testModifierShift();
+ void testModifierAlt();
+ void testModifierCtrl();
+ void testModifierCtrlWithDontSwapCtrlAndMeta();
};
void tst_MacNativeEvents::testMouseMoveLocation()
@@ -411,6 +416,108 @@ void tst_MacNativeEvents::testKeyPressOnToplevel()
QVERIFY2(expected.waitForAllEvents(), "the test did not receive all expected events!");
}
+void tst_MacNativeEvents::testModifierShift()
+{
+ QWidget w;
+ w.show();
+
+ NativeEventList native;
+ native.append(new QNativeModifierEvent(Qt::ShiftModifier));
+ native.append(new QNativeKeyEvent(QNativeKeyEvent::Key_A, true, Qt::ShiftModifier));
+ native.append(new QNativeKeyEvent(QNativeKeyEvent::Key_A, false, Qt::ShiftModifier));
+ native.append(new QNativeModifierEvent(Qt::NoModifier));
+
+ ExpectedEventList expected(&w);
+ expected.append(new QKeyEvent(QEvent::KeyPress, Qt::Key_Shift, Qt::NoModifier));
+ expected.append(new QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::ShiftModifier));
+ expected.append(new QKeyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::ShiftModifier));
+ expected.append(new QKeyEvent(QEvent::KeyRelease, Qt::Key_Shift, Qt::ShiftModifier));
+
+ native.play();
+ QVERIFY2(expected.waitForAllEvents(), "the test did not receive all expected events!");
+}
+
+void tst_MacNativeEvents::testModifierAlt()
+{
+ QWidget w;
+ w.show();
+
+ NativeEventList native;
+ native.append(new QNativeModifierEvent(Qt::AltModifier));
+ native.append(new QNativeKeyEvent(QNativeKeyEvent::Key_A, true, Qt::AltModifier));
+ native.append(new QNativeKeyEvent(QNativeKeyEvent::Key_A, false, Qt::AltModifier));
+ native.append(new QNativeModifierEvent(Qt::NoModifier));
+
+ ExpectedEventList expected(&w);
+ expected.append(new QKeyEvent(QEvent::KeyPress, Qt::Key_Alt, Qt::NoModifier));
+ expected.append(new QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::AltModifier));
+ expected.append(new QKeyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::AltModifier));
+ expected.append(new QKeyEvent(QEvent::KeyRelease, Qt::Key_Alt, Qt::AltModifier));
+
+ native.play();
+ QVERIFY2(expected.waitForAllEvents(), "the test did not receive all expected events!");
+}
+
+void tst_MacNativeEvents::testModifierCtrl()
+{
+ // On Mac, we switch the Command and Control modifier by default, so that Command
+ // means Meta, and Control means Command. Lets check that this works:
+ QWidget w;
+ w.show();
+
+ QVERIFY(kControlUnicode == QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText)[0]);
+ QVERIFY(kCommandUnicode == QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText)[0]);
+
+ NativeEventList native;
+ native.append(new QNativeModifierEvent(Qt::ControlModifier));
+ native.append(new QNativeKeyEvent(QNativeKeyEvent::Key_A, true, Qt::ControlModifier));
+ native.append(new QNativeKeyEvent(QNativeKeyEvent::Key_A, false, Qt::ControlModifier));
+ native.append(new QNativeModifierEvent(Qt::NoModifier));
+
+ ExpectedEventList expected(&w);
+ expected.append(new QKeyEvent(QEvent::KeyPress, Qt::Key_Meta, Qt::NoModifier));
+ expected.append(new QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::MetaModifier));
+ expected.append(new QKeyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::MetaModifier));
+ expected.append(new QKeyEvent(QEvent::KeyRelease, Qt::Key_Meta, Qt::MetaModifier));
+
+ native.play();
+ QVERIFY2(expected.waitForAllEvents(), "the test did not receive all expected events!");
+}
+
+void tst_MacNativeEvents::testModifierCtrlWithDontSwapCtrlAndMeta()
+{
+ // On Mac, we switch the Command and Control modifier by default, so that Command
+ // means Meta, and Control means Command. Lets check that the flag to swith off
+ // this behaviour works. While working on this test I realized that we actually
+ // don't (and never have) respected this flag for raw key events. Only for
+ // menus, through QKeySequence. I don't want to change this behaviour now, at
+ // least not until someone complains. So I choose to let the test just stop
+ // any unintended regressions instead. If we decide to resepect the the flag at one
+ // point, fix the test.
+ QCoreApplication::setAttribute(Qt::AA_MacDontSwapCtrlAndMeta);
+ QWidget w;
+ w.show();
+
+ QVERIFY(kCommandUnicode == QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText)[0]);
+ QVERIFY(kControlUnicode == QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText)[0]);
+
+ NativeEventList native;
+ native.append(new QNativeModifierEvent(Qt::ControlModifier));
+ native.append(new QNativeKeyEvent(QNativeKeyEvent::Key_A, true, Qt::ControlModifier));
+ native.append(new QNativeKeyEvent(QNativeKeyEvent::Key_A, false, Qt::ControlModifier));
+ native.append(new QNativeModifierEvent(Qt::NoModifier));
+
+ ExpectedEventList expected(&w);
+ expected.append(new QKeyEvent(QEvent::KeyPress, Qt::Key_Meta, Qt::NoModifier));
+ expected.append(new QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::ControlModifier));
+ expected.append(new QKeyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::ControlModifier));
+ expected.append(new QKeyEvent(QEvent::KeyRelease, Qt::Key_Meta, Qt::ControlModifier));
+
+ native.play();
+ QVERIFY2(expected.waitForAllEvents(), "the test did not receive all expected events!");
+ QCoreApplication::setAttribute(Qt::AA_MacDontSwapCtrlAndMeta, false);
+}
+
#include "tst_macnativeevents.moc"
QTEST_MAIN(tst_MacNativeEvents)
diff --git a/tests/auto/mediaobject/mediaobject.pro b/tests/auto/mediaobject/mediaobject.pro
index 1fc76a28c1..23ec56bbe7 100755
--- a/tests/auto/mediaobject/mediaobject.pro
+++ b/tests/auto/mediaobject/mediaobject.pro
@@ -15,7 +15,7 @@ wince*{
}
symbian:{
- addFiles.sources = media/test.sdp
+ addFiles.files = media/test.sdp
addFiles.path = media
DEPLOYMENT += addFiles
LIBS += -lCommDb -lconnmon
diff --git a/tests/auto/moc/moc.pro b/tests/auto/moc/moc.pro
index a89ff07e78..4fb9ac4f5a 100644
--- a/tests/auto/moc/moc.pro
+++ b/tests/auto/moc/moc.pro
@@ -17,7 +17,7 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n
escapes-in-string-literals.h cstyle-enums.h qprivateslots.h gadgetwithnoenums.h \
dir-in-include-path.h single_function_keyword.h task192552.h task189996.h \
task234909.h task240368.h pure-virtual-signals.h
-if(*-g++*|*-icc*):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h
+if(*-g++*|*-icc*|*-clang|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h
SOURCES += tst_moc.cpp
QT += sql network svg
diff --git a/tests/auto/networkselftest/networkselftest.pro b/tests/auto/networkselftest/networkselftest.pro
index d7cb7f33c0..98e981c5c0 100644
--- a/tests/auto/networkselftest/networkselftest.pro
+++ b/tests/auto/networkselftest/networkselftest.pro
@@ -4,14 +4,14 @@ SOURCES += tst_networkselftest.cpp
QT = core network
wince*: {
- addFiles.sources = rfc3252.txt
+ addFiles.files = rfc3252.txt
addFiles.path = .
- DEPLOYMENT = addFiles
+ DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
} else:symbian {
- addFiles.sources = rfc3252.txt
+ addFiles.files = rfc3252.txt
addFiles.path = .
- DEPLOYMENT = addFiles
+ DEPLOYMENT += addFiles
} else:vxworks*: {
DEFINES += SRCDIR=\\\"\\\"
} else {
diff --git a/tests/auto/networkselftest/tst_networkselftest.cpp b/tests/auto/networkselftest/tst_networkselftest.cpp
index 1caeee311d..cfcafc0154 100644
--- a/tests/auto/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/networkselftest/tst_networkselftest.cpp
@@ -42,6 +42,8 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
+#include <time.h>
+
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
// Current path (C:\private\<UID>) contains only ascii chars
@@ -72,14 +74,20 @@ private slots:
// specific protocol tests
void ftpServer();
+ void ftpProxyServer();
void imapServer();
void httpServer();
+ void httpServerFiles_data();
+ void httpServerFiles();
+ void httpServerCGI_data();
+ void httpServerCGI();
void httpsServer();
void httpProxy();
void httpProxyBasicAuth();
void httpProxyNtlmAuth();
void socks5Proxy();
void socks5ProxyAuth();
+ void smbServer();
// ssl supported test
void supportsSsl();
@@ -158,7 +166,7 @@ static QString prettyByteArray(const QByteArray &array)
static bool doSocketRead(QTcpSocket *socket, int minBytesAvailable, int timeout = 4000)
{
- QTime timer;
+ QElapsedTimer timer;
timer.start();
forever {
if (socket->bytesAvailable() >= minBytesAvailable)
@@ -410,6 +418,8 @@ void tst_NetworkSelfTest::remotePortsOpen_data()
QTest::newRow("http-proxy-auth-ntlm") << 3130;
QTest::newRow("socks5-proxy") << 1080;
QTest::newRow("socks5-proxy-auth") << 1081;
+ QTest::newRow("ftp-proxy") << 2121;
+ QTest::newRow("smb") << 139;
}
void tst_NetworkSelfTest::remotePortsOpen()
@@ -457,16 +467,43 @@ void tst_NetworkSelfTest::fileLineEndingTest()
QVERIFY2(!lineEndingType.compare("LF"), QString("Reference file %1 has %2 as line ending - Git checkout issue !?!").arg(referenceName, lineEndingType).toLocal8Bit());
}
-static QList<Chat> ftpChat()
+static QList<Chat> ftpChat(const QByteArray &userSuffix = QByteArray())
{
return QList<Chat>() << Chat::expect("220")
<< Chat::discardUntil("\r\n")
- << Chat::send("USER anonymous\r\n")
+ << Chat::send("USER anonymous" + userSuffix + "\r\n")
<< Chat::expect("331")
<< Chat::discardUntil("\r\n")
<< Chat::send("PASS user@hostname\r\n")
<< Chat::expect("230")
<< Chat::discardUntil("\r\n")
+
+ << Chat::send("CWD pub\r\n")
+ << Chat::expect("250")
+ << Chat::discardUntil("\r\n")
+ << Chat::send("CWD dir-not-readable\r\n")
+ << Chat::expect("550")
+ << Chat::discardUntil("\r\n")
+ << Chat::send("PWD\r\n")
+ << Chat::expect("257 \"/pub\"\r\n")
+ << Chat::send("SIZE file-not-readable.txt\r\n")
+ << Chat::expect("213 41\r\n")
+ << Chat::send("CWD qxmlquery\r\n")
+ << Chat::expect("250")
+ << Chat::discardUntil("\r\n")
+
+ << Chat::send("CWD /qtest\r\n")
+ << Chat::expect("250")
+ << Chat::discardUntil("\r\n")
+ << Chat::send("SIZE bigfile\r\n")
+ << Chat::expect("213 519240\r\n")
+ << Chat::send("SIZE rfc3252\r\n")
+ << Chat::expect("213 25962\r\n")
+ << Chat::send("SIZE rfc3252.txt\r\n")
+ << Chat::expect("213 25962\r\n")
+// << Chat::send("SIZE nonASCII/german_\344\366\374\304\326\334\337\r\n")
+// << Chat::expect("213 40\r\n")
+
<< Chat::send("QUIT\r\n")
<< Chat::expect("221")
<< Chat::discardUntil("\r\n")
@@ -478,6 +515,11 @@ void tst_NetworkSelfTest::ftpServer()
netChat(21, ftpChat());
}
+void tst_NetworkSelfTest::ftpProxyServer()
+{
+ netChat(2121, ftpChat("@" + QtNetworkSettings::serverName().toLatin1()));
+}
+
void tst_NetworkSelfTest::imapServer()
{
netChat(143, QList<Chat>()
@@ -495,6 +537,14 @@ void tst_NetworkSelfTest::imapServer()
void tst_NetworkSelfTest::httpServer()
{
+ QString uniqueExtension;
+ qsrand(time(0));
+#ifndef Q_OS_WINCE
+ uniqueExtension = QString("%1%2%3").arg((qulonglong)this).arg(qrand()).arg((qulonglong)time(0));
+#else
+ uniqueExtension = QString("%1%2").arg((qulonglong)this).arg(qrand());
+#endif
+
netChat(80, QList<Chat>()
// HTTP/0.9 chat:
<< Chat::send("GET /\r\n")
@@ -523,9 +573,185 @@ void tst_NetworkSelfTest::httpServer()
<< Chat::discardUntil(" ")
<< Chat::expect("200 ")
<< Chat::DiscardUntilDisconnect
+
+ // HTTP protected area
+ << Chat::Reconnect
+ << Chat::send("GET /qtest/protected/rfc3252.txt HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("401 ")
+ << Chat::DiscardUntilDisconnect
+
+ << Chat::Reconnect
+ << Chat::send("HEAD /qtest/protected/rfc3252.txt HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "Authorization: Basic cXNvY2tzdGVzdDpwYXNzd29yZA==\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::DiscardUntilDisconnect
+
+ // DAV area
+ << Chat::Reconnect
+ << Chat::send("HEAD /dav/ HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::DiscardUntilDisconnect
+
+ // HTTP/1.0 PUT
+ << Chat::Reconnect
+ << Chat::send("PUT /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n"
+ "Content-Length: 5\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "\r\n"
+ "Hello")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("201 ")
+ << Chat::DiscardUntilDisconnect
+
+ // check that the file did get uploaded
+ << Chat::Reconnect
+ << Chat::send("HEAD /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::discardUntil("\r\nContent-Length: 5\r\n")
+ << Chat::DiscardUntilDisconnect
+
+ // HTTP/1.0 DELETE
+ << Chat::Reconnect
+ << Chat::send("DELETE /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("204 ")
+ << Chat::DiscardUntilDisconnect
);
}
+void tst_NetworkSelfTest::httpServerFiles_data()
+{
+ QTest::addColumn<QString>("uri");
+ QTest::addColumn<int>("size");
+
+ QTest::newRow("fluke.gif") << "/qtest/fluke.gif" << -1;
+ QTest::newRow("bigfile") << "/qtest/bigfile" << 519240;
+ QTest::newRow("rfc3252.txt") << "/qtest/rfc3252.txt" << 25962;
+ QTest::newRow("protected/rfc3252.txt") << "/qtest/protected/rfc3252.txt" << 25962;
+ QTest::newRow("completelyEmptyQuery.xq") << "/qtest/qxmlquery/completelyEmptyQuery.xq" << -1;
+ QTest::newRow("notWellformedViaHttps.xml") << "/qtest/qxmlquery/notWellformedViaHttps.xml" << -1;
+ QTest::newRow("notWellformed.xml") << "/qtest/qxmlquery/notWellformed.xml" << -1;
+ QTest::newRow("viaHttp.xq") << "/qtest/qxmlquery/viaHttp.xq" << -1;
+ QTest::newRow("wellFormedViaHttps.xml") << "/qtest/qxmlquery/wellFormedViaHttps.xml" << -1;
+ QTest::newRow("wellFormed.xml") << "/qtest/qxmlquery/wellFormed.xml" << -1;
+}
+
+void tst_NetworkSelfTest::httpServerFiles()
+{
+ QFETCH(QString, uri);
+ QFETCH(int, size);
+
+ QList<Chat> chat;
+ chat << Chat::send("HEAD " + QUrl::toPercentEncoding(uri, "/") + " HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "Authorization: Basic cXNvY2tzdGVzdDpwYXNzd29yZA==\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::skipBytes(1) // HTTP/1.0 or 1.1 reply
+ << Chat::expect(" 200 ");
+ if (size != -1)
+ chat << Chat::discardUntil("\r\nContent-Length: " + QByteArray::number(size) + "\r\n");
+ chat << Chat::DiscardUntilDisconnect;
+ netChat(80, chat);
+}
+
+void tst_NetworkSelfTest::httpServerCGI_data()
+{
+ QTest::addColumn<QByteArray>("request");
+ QTest::addColumn<QByteArray>("result");
+ QTest::addColumn<QByteArray>("additionalHeader");
+
+ QTest::newRow("echo.cgi")
+ << QByteArray("GET /qtest/cgi-bin/echo.cgi?Hello+World HTTP/1.0\r\n"
+ "Connection: close\r\n"
+ "\r\n")
+ << QByteArray("Hello+World")
+ << QByteArray();
+
+ QTest::newRow("echo.cgi(POST)")
+ << QByteArray("POST /qtest/cgi-bin/echo.cgi?Hello+World HTTP/1.0\r\n"
+ "Connection: close\r\n"
+ "Content-Length: 15\r\n"
+ "\r\n"
+ "Hello, World!\r\n")
+ << QByteArray("Hello, World!\r\n")
+ << QByteArray();
+
+ QTest::newRow("md5sum.cgi")
+ << QByteArray("POST /qtest/cgi-bin/md5sum.cgi HTTP/1.0\r\n"
+ "Connection: close\r\n"
+ "Content-Length: 15\r\n"
+ "\r\n"
+ "Hello, World!\r\n")
+ << QByteArray("29b933a8d9a0fcef0af75f1713f4940e\n")
+ << QByteArray();
+
+ QTest::newRow("protected/md5sum.cgi")
+ << QByteArray("POST /qtest/protected/cgi-bin/md5sum.cgi HTTP/1.0\r\n"
+ "Connection: close\r\n"
+ "Authorization: Basic cXNvY2tzdGVzdDpwYXNzd29yZA==\r\n"
+ "Content-Length: 15\r\n"
+ "\r\n"
+ "Hello, World!\r\n")
+ << QByteArray("29b933a8d9a0fcef0af75f1713f4940e\n")
+ << QByteArray();
+
+ QTest::newRow("set-cookie.cgi")
+ << QByteArray("POST /qtest/cgi-bin/set-cookie.cgi HTTP/1.0\r\n"
+ "Connection: close\r\n"
+ "Content-Length: 8\r\n"
+ "\r\n"
+ "foo=bar\n")
+ << QByteArray("Success\n")
+ << QByteArray("\r\nSet-Cookie: foo=bar\r\n");
+}
+
+void tst_NetworkSelfTest::httpServerCGI()
+{
+ QFETCH(QByteArray, request);
+ QFETCH(QByteArray, result);
+ QFETCH(QByteArray, additionalHeader);
+ QList<Chat> chat;
+ chat << Chat::send(request)
+ << Chat::expect("HTTP/1.") << Chat::skipBytes(1)
+ << Chat::expect(" 200 ");
+
+ if (!additionalHeader.isEmpty())
+ chat << Chat::discardUntil(additionalHeader);
+
+ chat << Chat::discardUntil("\r\n\r\n")
+ << Chat::expect(result)
+ << Chat::RemoteDisconnect;
+ netChat(80, chat);
+}
+
void tst_NetworkSelfTest::httpsServer()
{
#ifndef QT_NO_OPENSSL
@@ -727,7 +953,63 @@ void tst_NetworkSelfTest::supportsSsl()
#ifdef QT_NO_OPENSSL
QFAIL("SSL not compiled in");
#else
- QVERIFY(QSslSocket::supportsSsl());
+ QVERIFY2(QSslSocket::supportsSsl(), "Could not load SSL libraries");
+#endif
+}
+
+void tst_NetworkSelfTest::smbServer()
+{
+ static const char contents[] = "This is 34 bytes. Do not change...";
+#ifdef Q_OS_WIN
+ // use Windows's native UNC support to try and open a file on the server
+ QString filepath = QString("\\\\%1\\testshare\\test.pri").arg(QtNetworkSettings::winServerName());
+ FILE *f = fopen(filepath.toLatin1(), "rb");
+ QVERIFY2(f, qt_error_string().toLocal8Bit());
+
+ char buf[128];
+ size_t ret = fread(buf, sizeof buf, 1, f);
+ fclose(f);
+
+ QCOMPARE(ret, strlen(contents));
+ QVERIFY(memcmp(buf, contents, strlen(contents)) == 0);
+#else
+ // try to use Samba
+ QString progname = "smbclient";
+ QProcess smbclient;
+ smbclient.start(progname, QIODevice::ReadOnly);
+ if (!smbclient.waitForStarted(2000))
+ QSKIP("Could not find smbclient (from Samba), cannot continue testing", SkipAll);
+ if (!smbclient.waitForFinished(2000) || smbclient.exitStatus() != QProcess::NormalExit)
+ QSKIP("smbclient isn't working, cannot continue testing", SkipAll);
+ smbclient.close();
+
+ // try listing the server
+ smbclient.start(progname, QStringList() << "-g" << "-N" << "-L" << QtNetworkSettings::winServerName(), QIODevice::ReadOnly);
+ QVERIFY(smbclient.waitForFinished(5000));
+ if (smbclient.exitStatus() != QProcess::NormalExit)
+ QSKIP("smbclient crashed", SkipAll);
+ QVERIFY2(smbclient.exitCode() == 0, "Test server not found");
+
+ QByteArray output = smbclient.readAll();
+ QVERIFY(output.contains("Disk|testshare|"));
+ QVERIFY(output.contains("Disk|testsharewritable|"));
+ QVERIFY(output.contains("Disk|testsharelargefile|"));
+ qDebug() << "Test server found and shares are correct";
+
+ // try getting a file
+ QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+ env.insert("PAGER", "/bin/cat"); // just in case
+ smbclient.setProcessEnvironment(env);
+ smbclient.start(progname, QStringList() << "-N" << "-c" << "more test.pri"
+ << QString("\\\\%1\\testshare").arg(QtNetworkSettings::winServerName()), QIODevice::ReadOnly);
+ QVERIFY(smbclient.waitForFinished(5000));
+ if (smbclient.exitStatus() != QProcess::NormalExit)
+ QSKIP("smbclient crashed", SkipAll);
+ QVERIFY2(smbclient.exitCode() == 0, "File //qt-test-server/testshare/test.pri not found");
+
+ output = smbclient.readAll();
+ QCOMPARE(output.constData(), contents);
+ qDebug() << "Test file is correct";
#endif
}
diff --git a/tests/auto/opengl.pro b/tests/auto/opengl.pro
index 9b59cd14d2..6c8e4ca96b 100644
--- a/tests/auto/opengl.pro
+++ b/tests/auto/opengl.pro
@@ -3,4 +3,5 @@ SUBDIRS=\
qgl \
qglthreads \
qglbuffer \
+ qglfunctions \
diff --git a/tests/auto/other.pro b/tests/auto/other.pro
index 3c8f856a6b..512cd25c1a 100644
--- a/tests/auto/other.pro
+++ b/tests/auto/other.pro
@@ -4,6 +4,8 @@
TEMPLATE=subdirs
SUBDIRS=\
# exceptionsafety_objects \ shouldn't enable it
+# baselineexample \ Just an example demonstrating qbaselinetest usage
+ lancelot \
qaccessibility \
qalgorithms \
qcombobox \
diff --git a/tests/auto/patternistexamples/patternistexamples.pro b/tests/auto/patternistexamples/patternistexamples.pro
index f83e0aab39..098b0fe933 100644
--- a/tests/auto/patternistexamples/patternistexamples.pro
+++ b/tests/auto/patternistexamples/patternistexamples.pro
@@ -2,17 +2,17 @@ load(qttest_p4)
SOURCES += tst_patternistexamples.cpp
CONFIG += qtestlib
wince*|symbian: {
- snippets.sources = $$QT_SOURCE_TREE/doc/src/snippets/patternist/*
+ snippets.files = $$QT_SOURCE_TREE/doc/src/snippets/patternist/*
snippets.path = patternist
- widgetRen.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/*
+ widgetRen.files = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/*
widgetRen.path = widgetRenderer
- globVar.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/*
+ globVar.files = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/*
globVar.path = globalVariables
- filetree.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/filetree/*
+ filetree.files = $$QT_SOURCE_TREE/examples/xmlpatterns/filetree/*
filetree.path = filetree
- recipes.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/*
+ recipes.files = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/*
recipes.path = recipes
- files.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/files/*
+ files.files = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/files/*
files.path = recipes\\files
DEPLOYMENT += snippets widgetRen globVar filetree recipes files
diff --git a/tests/auto/q_func_info/q_func_info.pro b/tests/auto/q_func_info/q_func_info.pro
index b30e3fb857..64f08d4d8d 100644
--- a/tests/auto/q_func_info/q_func_info.pro
+++ b/tests/auto/q_func_info/q_func_info.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_q_func_info.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qabstractfileengine/qabstractfileengine.pro b/tests/auto/qabstractfileengine/qabstractfileengine.pro
new file mode 100644
index 0000000000..870473a4cb
--- /dev/null
+++ b/tests/auto/qabstractfileengine/qabstractfileengine.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+QT = core
+
+SOURCES = tst_qabstractfileengine.cpp
+RESOURCES += qabstractfileengine.qrc
+
diff --git a/tests/auto/qabstractfileengine/qabstractfileengine.qrc b/tests/auto/qabstractfileengine/qabstractfileengine.qrc
new file mode 100644
index 0000000000..5401b086b2
--- /dev/null
+++ b/tests/auto/qabstractfileengine/qabstractfileengine.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/tst_qabstractfileengine/">
+ <file>resources/</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/qabstractfileengine/resources/file.txt b/tests/auto/qabstractfileengine/resources/file.txt
new file mode 100644
index 0000000000..8a03e0e55f
--- /dev/null
+++ b/tests/auto/qabstractfileengine/resources/file.txt
@@ -0,0 +1 @@
+This is a simple text file.
diff --git a/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp
new file mode 100644
index 0000000000..5952252744
--- /dev/null
+++ b/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp
@@ -0,0 +1,765 @@
+/****************************************************************************
+**
+** 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 FOO 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 <QtCore/QAbstractFileEngine>
+#include <QtCore/QFSFileEngine>
+
+#include <QtCore/QMutex>
+#include <QtCore/QMutexLocker>
+#include <QtCore/QSharedPointer>
+#include <QtCore/QScopedPointer>
+#include <QtCore/QHash>
+
+#include <QtTest/QTest>
+
+#include <QtCore/QDebug>
+
+class tst_QAbstractFileEngine
+ : public QObject
+{
+ Q_OBJECT
+public slots:
+ void cleanupTestCase();
+
+private slots:
+ void customHandler();
+
+ void fileIO_data();
+ void fileIO();
+
+private:
+ QStringList filesForRemoval;
+};
+
+class ReferenceFileEngine
+ : public QAbstractFileEngine
+{
+public:
+ ReferenceFileEngine(const QString &fileName)
+ : fileName_(fileName)
+ , position_(-1)
+ , openForRead_(false)
+ , openForWrite_(false)
+ {
+ }
+
+ bool open(QIODevice::OpenMode openMode)
+ {
+ Q_ASSERT(!openForRead_);
+ Q_ASSERT(!openForWrite_);
+
+ openFile_ = resolveFile(openMode & QIODevice::WriteOnly);
+ if (!openFile_)
+ return false;
+
+ position_ = 0;
+ if (openMode & QIODevice::ReadOnly)
+ openForRead_ = true;
+
+ if (openMode & QIODevice::WriteOnly) {
+ openForWrite_ = true;
+
+ QMutexLocker lock(&openFile_->mutex);
+ if (openMode & QIODevice::Truncate
+ || !(openForRead_ || openMode & QIODevice::Append))
+ openFile_->content.clear();
+
+ if (openMode & QIODevice::Append)
+ position_ = openFile_->content.size();
+ }
+
+ return true;
+ }
+
+ bool close()
+ {
+ openFile_.clear();
+
+ openForRead_ = false;
+ openForWrite_ = false;
+ position_ = -1;
+
+ return true;
+ }
+
+ qint64 size() const
+ {
+ QSharedPointer<File> file = resolveFile(false);
+ if (!file)
+ return 0;
+
+ QMutexLocker lock(&file->mutex);
+ return file->content.size();
+ }
+
+ qint64 pos() const
+ {
+ Q_ASSERT(openForRead_ || openForWrite_);
+ return position_;
+ }
+
+ bool seek(qint64 pos)
+ {
+ Q_ASSERT(openForRead_ || openForWrite_);
+
+ if (pos >= 0) {
+ position_ = pos;
+ return true;
+ }
+
+ return false;
+ }
+
+ bool flush()
+ {
+ Q_ASSERT(openForRead_ || openForWrite_);
+ return true;
+ }
+
+ bool remove()
+ {
+ QMutexLocker lock(&fileSystemMutex);
+ int count = fileSystem.remove(fileName_);
+
+ return (count == 1);
+ }
+
+ bool copy(const QString &newName)
+ {
+ QMutexLocker lock(&fileSystemMutex);
+ if (!fileSystem.contains(fileName_)
+ || fileSystem.contains(newName))
+ return false;
+
+ fileSystem.insert(newName, fileSystem.value(fileName_));
+ return true;
+ }
+
+ bool rename(const QString &newName)
+ {
+ QMutexLocker lock(&fileSystemMutex);
+ if (!fileSystem.contains(fileName_)
+ || fileSystem.contains(newName))
+ return false;
+
+ fileSystem.insert(newName, fileSystem.take(fileName_));
+ return true;
+ }
+
+ // bool link(const QString &newName)
+ // {
+ // Q_UNUSED(newName)
+ // return false;
+ // }
+
+ // bool mkdir(const QString &dirName, bool createParentDirectories) const
+ // {
+ // Q_UNUSED(dirName)
+ // Q_UNUSED(createParentDirectories)
+
+ // return false;
+ // }
+
+ // bool rmdir(const QString &dirName, bool recurseParentDirectories) const
+ // {
+ // Q_UNUSED(dirName)
+ // Q_UNUSED(recurseParentDirectories)
+
+ // return false;
+ // }
+
+ bool setSize(qint64 size)
+ {
+ if (size < 0)
+ return false;
+
+ QSharedPointer<File> file = resolveFile(false);
+ if (!file)
+ return false;
+
+ QMutexLocker lock(&file->mutex);
+ file->content.resize(size);
+
+ if (openForRead_ || openForWrite_)
+ if (position_ > size)
+ position_ = size;
+
+ return (file->content.size() == size);
+ }
+
+ FileFlags fileFlags(FileFlags type) const
+ {
+ QSharedPointer<File> file = resolveFile(false);
+ if (file) {
+ QMutexLocker lock(&file->mutex);
+ return (file->fileFlags & type);
+ }
+
+ return FileFlags();
+ }
+
+ // bool setPermissions(uint perms)
+ // {
+ // Q_UNUSED(perms)
+
+ // return false;
+ // }
+
+ QString fileName(FileName file) const
+ {
+ switch (file) {
+ case DefaultName:
+ return QLatin1String("DefaultName");
+ case BaseName:
+ return QLatin1String("BaseName");
+ case PathName:
+ return QLatin1String("PathName");
+ case AbsoluteName:
+ return QLatin1String("AbsoluteName");
+ case AbsolutePathName:
+ return QLatin1String("AbsolutePathName");
+ case LinkName:
+ return QLatin1String("LinkName");
+ case CanonicalName:
+ return QLatin1String("CanonicalName");
+ case CanonicalPathName:
+ return QLatin1String("CanonicalPathName");
+ case BundleName:
+ return QLatin1String("BundleName");
+
+ default:
+ break;
+ }
+
+ return QString();
+ }
+
+ uint ownerId(FileOwner owner) const
+ {
+ QSharedPointer<File> file = resolveFile(false);
+ if (file) {
+ switch (owner) {
+ case OwnerUser:
+ {
+ QMutexLocker lock(&file->mutex);
+ return file->userId;
+ }
+ case OwnerGroup:
+ {
+ QMutexLocker lock(&file->mutex);
+ return file->groupId;
+ }
+ }
+ }
+
+ return -2;
+ }
+
+ QString owner(FileOwner owner) const
+ {
+ QSharedPointer<File> file = resolveFile(false);
+ if (file) {
+ uint ownerId;
+ switch (owner) {
+ case OwnerUser:
+ {
+ QMutexLocker lock(&file->mutex);
+ ownerId = file->userId;
+ }
+
+ {
+ QMutexLocker lock(&fileSystemMutex);
+ return fileSystemUsers.value(ownerId);
+ }
+
+ case OwnerGroup:
+ {
+ QMutexLocker lock(&file->mutex);
+ ownerId = file->groupId;
+ }
+
+ {
+ QMutexLocker lock(&fileSystemMutex);
+ return fileSystemGroups.value(ownerId);
+ }
+ }
+ }
+
+ return QString();
+ }
+
+ QDateTime fileTime(FileTime time) const
+ {
+ QSharedPointer<File> file = resolveFile(false);
+ if (file) {
+ QMutexLocker lock(&file->mutex);
+ switch (time) {
+ case CreationTime:
+ return file->creation;
+ case ModificationTime:
+ return file->modification;
+ case AccessTime:
+ return file->access;
+ }
+ }
+
+ return QDateTime();
+ }
+
+ void setFileName(const QString &file)
+ {
+ Q_ASSERT(!openForRead_);
+ Q_ASSERT(!openForWrite_);
+
+ fileName_ = file;
+ }
+
+ // typedef QAbstractFileEngineIterator Iterator;
+ // Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames)
+ // {
+ // Q_UNUSED(filters)
+ // Q_UNUSED(filterNames)
+
+ // return 0;
+ // }
+
+ // Iterator *endEntryList()
+ // {
+ // return 0;
+ // }
+
+ qint64 read(char *data, qint64 maxLen)
+ {
+ Q_ASSERT(openForRead_);
+
+ Q_ASSERT(!openFile_.isNull());
+ QMutexLocker lock(&openFile_->mutex);
+ qint64 readSize = qMin(openFile_->content.size() - position_, maxLen);
+ if (readSize < 0)
+ return -1;
+
+ qMemCopy(data, openFile_->content.constData() + position_, readSize);
+ position_ += readSize;
+
+ return readSize;
+ }
+
+ qint64 write(const char *data, qint64 length)
+ {
+ Q_ASSERT(openForWrite_);
+
+ if (length < 0)
+ return -1;
+
+ Q_ASSERT(!openFile_.isNull());
+ QMutexLocker lock(&openFile_->mutex);
+ if (openFile_->content.size() == position_)
+ openFile_->content.append(data, length);
+ else {
+ if (position_ + length > openFile_->content.size())
+ openFile_->content.resize(position_ + length);
+ openFile_->content.replace(position_, length, data, length);
+ }
+
+ qint64 writeSize = qMin(length, openFile_->content.size() - position_);
+ position_ += writeSize;
+
+ return writeSize;
+ }
+
+protected:
+ // void setError(QFile::FileError error, const QString &str);
+
+ struct File
+ {
+ File()
+ : userId(0)
+ , groupId(0)
+ , fileFlags(
+ ReadOwnerPerm | WriteOwnerPerm | ExeOwnerPerm
+ | ReadUserPerm | WriteUserPerm | ExeUserPerm
+ | ReadGroupPerm | WriteGroupPerm | ExeGroupPerm
+ | ReadOtherPerm | WriteOtherPerm | ExeOtherPerm
+ | FileType | ExistsFlag)
+ {
+ }
+
+ QMutex mutex;
+
+ uint userId, groupId;
+ QAbstractFileEngine::FileFlags fileFlags;
+ QDateTime creation, modification, access;
+
+ QByteArray content;
+ };
+
+ QSharedPointer<File> resolveFile(bool create) const
+ {
+ if (openForRead_ || openForWrite_) {
+ Q_ASSERT(openFile_);
+ return openFile_;
+ }
+
+ QMutexLocker lock(&fileSystemMutex);
+ if (create) {
+ QSharedPointer<File> &p = fileSystem[fileName_];
+ if (p.isNull())
+ p = QSharedPointer<File>(new File);
+ return p;
+ }
+
+ return fileSystem.value(fileName_);
+ }
+
+ static QMutex fileSystemMutex;
+ static QHash<uint, QString> fileSystemUsers, fileSystemGroups;
+ static QHash<QString, QSharedPointer<File> > fileSystem;
+
+private:
+ QString fileName_;
+ qint64 position_;
+ bool openForRead_;
+ bool openForWrite_;
+
+ mutable QSharedPointer<File> openFile_;
+};
+
+QMutex ReferenceFileEngine::fileSystemMutex;
+QHash<uint, QString> ReferenceFileEngine::fileSystemUsers, ReferenceFileEngine::fileSystemGroups;
+QHash<QString, QSharedPointer<ReferenceFileEngine::File> > ReferenceFileEngine::fileSystem;
+
+class FileEngineHandler
+ : QAbstractFileEngineHandler
+{
+ QAbstractFileEngine *create(const QString &fileName) const
+ {
+ if (fileName.startsWith("QFSFileEngine:"))
+ return new QFSFileEngine(fileName.mid(14));
+ if (fileName.startsWith("reference-file-engine:"))
+ return new ReferenceFileEngine(fileName.mid(22));
+ if (fileName.startsWith("resource:"))
+ return QAbstractFileEngine::create(QLatin1String(":/tst_qabstractfileengine/resources/") + fileName.mid(9));
+ return 0;
+ }
+};
+
+void tst_QAbstractFileEngine::cleanupTestCase()
+{
+ bool failed = false;
+
+ FileEngineHandler handler;
+ Q_FOREACH(QString file, filesForRemoval)
+ if (!QFile::remove(file)
+ || QFile::exists(file)) {
+ failed = true;
+ qDebug() << "Couldn't remove file:" << file;
+ }
+
+ QVERIFY(!failed);
+}
+
+void tst_QAbstractFileEngine::customHandler()
+{
+ QScopedPointer<QAbstractFileEngine> file;
+ {
+ file.reset(QAbstractFileEngine::create("resource:file.txt"));
+
+ QVERIFY(file);
+ }
+
+ {
+ FileEngineHandler handler;
+
+ QFile file("resource:file.txt");
+ QVERIFY(file.exists());
+ }
+
+ {
+ QFile file("resource:file.txt");
+ QVERIFY(!file.exists());
+ }
+}
+
+void tst_QAbstractFileEngine::fileIO_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QByteArray>("readContent");
+ QTest::addColumn<QByteArray>("writeContent");
+ QTest::addColumn<bool>("fileExists");
+
+ QString resourceTxtFile(":/tst_qabstractfileengine/resources/file.txt");
+ QByteArray readContent("This is a simple text file.\n");
+ QByteArray writeContent("This contains two lines of text.\n");
+
+ QTest::newRow("resource") << resourceTxtFile << readContent << QByteArray() << true;
+ QTest::newRow("native") << "native-file.txt" << readContent << writeContent << false;
+ QTest::newRow("Forced QFSFileEngine") << "QFSFileEngine:QFSFileEngine-file.txt" << readContent << writeContent << false;
+ QTest::newRow("Custom FE") << "reference-file-engine:file.txt" << readContent << writeContent << false;
+
+ QTest::newRow("Forced QFSFileEngine (native)") << "QFSFileEngine:native-file.txt" << readContent << writeContent << true;
+ QTest::newRow("native (Forced QFSFileEngine)") << "QFSFileEngine-file.txt" << readContent << writeContent << true;
+ QTest::newRow("Custom FE (2)") << "reference-file-engine:file.txt" << readContent << writeContent << true;
+}
+
+void tst_QAbstractFileEngine::fileIO()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QByteArray, readContent);
+ QFETCH(QByteArray, writeContent);
+ QFETCH(bool, fileExists);
+
+ FileEngineHandler handler;
+
+
+ {
+ QFile file(fileName);
+ QCOMPARE(file.exists(), fileExists);
+
+ if (!fileExists) {
+ QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Unbuffered));
+ filesForRemoval.append(fileName);
+
+ QCOMPARE(file.write(readContent), qint64(readContent.size()));
+ }
+ }
+
+ //
+ // File content is: readContent
+ //
+
+ qint64 fileSize = readContent.size();
+ {
+ // Reading
+ QFile file(fileName);
+
+ QVERIFY(!file.isOpen());
+ QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered));
+
+ QVERIFY(file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ QCOMPARE(file.pos(), qint64(0));
+
+ QCOMPARE(file.size(), fileSize);
+ QCOMPARE(file.readAll(), readContent);
+ QCOMPARE(file.pos(), fileSize);
+
+ file.close();
+ QVERIFY(!file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ }
+
+ if (writeContent.isEmpty())
+ return;
+
+ {
+ // Writing / appending
+ QFile file(fileName);
+
+ QVERIFY(!file.isOpen());
+ QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Unbuffered));
+
+ QVERIFY(file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ QCOMPARE(file.pos(), fileSize);
+
+ QCOMPARE(file.write(writeContent), qint64(writeContent.size()));
+
+ fileSize += writeContent.size();
+ QCOMPARE(file.pos(), fileSize);
+ QCOMPARE(file.size(), fileSize);
+
+ file.close();
+ QVERIFY(!file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ }
+
+ //
+ // File content is: readContent + writeContent
+ //
+
+ {
+ // Reading and Writing
+ QFile file(fileName);
+
+ QVERIFY(!file.isOpen());
+ QVERIFY(file.open(QIODevice::ReadWrite | QIODevice::Unbuffered));
+
+ QVERIFY(file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ QCOMPARE(file.pos(), qint64(0));
+
+ QCOMPARE(file.readAll(), readContent + writeContent);
+ QCOMPARE(file.pos(), fileSize);
+ QCOMPARE(file.size(), fileSize);
+
+ QVERIFY(file.seek(writeContent.size()));
+ QCOMPARE(file.pos(), qint64(writeContent.size()));
+ QCOMPARE(file.size(), fileSize);
+
+ QCOMPARE(file.write(readContent), qint64(readContent.size()));
+ QCOMPARE(file.pos(), fileSize);
+ QCOMPARE(file.size(), fileSize);
+
+ QVERIFY(file.seek(0));
+ QCOMPARE(file.pos(), qint64(0));
+ QCOMPARE(file.size(), fileSize);
+
+ QCOMPARE(file.write(writeContent), qint64(writeContent.size()));
+ QCOMPARE(file.pos(), qint64(writeContent.size()));
+ QCOMPARE(file.size(), fileSize);
+
+ QVERIFY(file.seek(0));
+ QCOMPARE(file.read(writeContent.size()), writeContent);
+ QCOMPARE(file.pos(), qint64(writeContent.size()));
+ QCOMPARE(file.size(), fileSize);
+
+ QCOMPARE(file.readAll(), readContent);
+ QCOMPARE(file.pos(), fileSize);
+ QCOMPARE(file.size(), fileSize);
+
+ file.close();
+ QVERIFY(!file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ }
+
+ //
+ // File content is: writeContent + readContent
+ //
+
+ {
+ // Writing
+ QFile file(fileName);
+
+ QVERIFY(!file.isOpen());
+ QVERIFY(file.open(QIODevice::ReadWrite | QIODevice::Unbuffered));
+
+ QVERIFY(file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ QCOMPARE(file.pos(), qint64(0));
+
+ QCOMPARE(file.write(writeContent), qint64(writeContent.size()));
+ QCOMPARE(file.pos(), qint64(writeContent.size()));
+ QCOMPARE(file.size(), fileSize);
+
+ QVERIFY(file.resize(writeContent.size()));
+ QCOMPARE(file.size(), qint64(writeContent.size()));
+
+ file.close();
+ QVERIFY(!file.isOpen());
+ QCOMPARE(file.size(), qint64(writeContent.size()));
+
+ QVERIFY(file.resize(fileSize));
+ QCOMPARE(file.size(), fileSize);
+ }
+
+ //
+ // File content is: writeContent + <undefined>
+ // File size is : (readContent + writeContent).size()
+ //
+
+ {
+ // Writing / extending
+ QFile file(fileName);
+
+ QVERIFY(!file.isOpen());
+ QVERIFY(file.open(QIODevice::ReadWrite | QIODevice::Unbuffered));
+
+ QVERIFY(file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ QCOMPARE(file.pos(), qint64(0));
+
+ QVERIFY(file.seek(1024));
+ QCOMPARE(file.pos(), qint64(1024));
+ QCOMPARE(file.size(), fileSize);
+
+ fileSize = 1024 + writeContent.size();
+ QCOMPARE(file.write(writeContent), qint64(writeContent.size()));
+ QCOMPARE(file.pos(), fileSize);
+ QCOMPARE(file.size(), fileSize);
+
+ QVERIFY(file.seek(1028));
+ QCOMPARE(file.pos(), qint64(1028));
+ QCOMPARE(file.size(), fileSize);
+
+ fileSize = 1028 + writeContent.size();
+ QCOMPARE(file.write(writeContent), qint64(writeContent.size()));
+ QCOMPARE(file.pos(), fileSize);
+ QCOMPARE(file.size(), fileSize);
+
+ file.close();
+ QVERIFY(!file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ }
+
+ //
+ // File content is: writeContent + <undefined> + writeContent
+ // File size is : 1024 + writeContent.size()
+ //
+
+ {
+ // Writing / truncating
+ QFile file(fileName);
+
+ QVERIFY(!file.isOpen());
+ QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Unbuffered));
+
+ QVERIFY(file.isOpen());
+ QCOMPARE(file.size(), qint64(0));
+ QCOMPARE(file.pos(), qint64(0));
+
+ fileSize = readContent.size();
+ QCOMPARE(file.write(readContent), fileSize);
+ QCOMPARE(file.pos(), fileSize);
+ QCOMPARE(file.size(), fileSize);
+
+ file.close();
+ QVERIFY(!file.isOpen());
+ QCOMPARE(file.size(), fileSize);
+ }
+
+ //
+ // File content is: readContent
+ //
+}
+
+QTEST_APPLESS_MAIN(tst_QAbstractFileEngine)
+#include "tst_qabstractfileengine.moc"
+
diff --git a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
index 2e2577dcb1..6f5044f6bb 100644
--- a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
+++ b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
@@ -4,7 +4,7 @@ QT -= gui
SOURCES += tst_qabstractnetworkcache.cpp
wince*|symbian: {
- testFiles.sources = tests
+ testFiles.files = tests
testFiles.path = .
DEPLOYMENT += testFiles
}
diff --git a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro
index a18f4ca7cc..b8f509dc41 100644
--- a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro
+++ b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro
@@ -7,7 +7,7 @@ HEADERS += TestNodeModel.h LoadingModel.h
include (../xmlpatterns.pri)
wince*: {
- addFiles.sources = tree.xml
+ addFiles.files = tree.xml
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qaccessibility/qaccessibility.pro b/tests/auto/qaccessibility/qaccessibility.pro
index 1b30beb302..a4f606c672 100644
--- a/tests/auto/qaccessibility/qaccessibility.pro
+++ b/tests/auto/qaccessibility/qaccessibility.pro
@@ -5,7 +5,7 @@ unix:!mac:LIBS+=-lm
contains(QT_CONFIG, qt3support): QT += qt3support
wince*: {
- accessneeded.sources = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll
+ accessneeded.files = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll
accessneeded.path = accessible
DEPLOYMENT += accessneeded
} \ No newline at end of file
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index 81caec2ffe..8d9603b6d7 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -4075,7 +4075,8 @@ void tst_QAccessibility::accelerators()
window->show();
QAccessibleInterface *accLineEdit = QAccessible::queryAccessibleInterface(le);
- QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QKeySequence(Qt::ALT).toString() + QLatin1String("L"));
+ QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QKeySequence(Qt::ALT).toString(QKeySequence::NativeText) + QLatin1String("L"));
+ QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QKeySequence(Qt::ALT).toString(QKeySequence::NativeText) + QLatin1String("L"));
label->setText(tr("Q &"));
QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QString());
label->setText(tr("Q &&"));
@@ -4083,11 +4084,11 @@ void tst_QAccessibility::accelerators()
label->setText(tr("Q && A"));
QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QString());
label->setText(tr("Q &&&A"));
- QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QKeySequence(Qt::ALT).toString() + QLatin1String("A"));
+ QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QKeySequence(Qt::ALT).toString(QKeySequence::NativeText) + QLatin1String("A"));
label->setText(tr("Q &&A"));
QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QString());
label->setText(tr("Q &A&B"));
- QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QKeySequence(Qt::ALT).toString() + QLatin1String("A"));
+ QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QKeySequence(Qt::ALT).toString(QKeySequence::NativeText) + QLatin1String("A"));
#if defined(Q_WS_X11)
qt_x11_wait_for_window_manager(window);
diff --git a/tests/auto/qaction/tst_qaction.cpp b/tests/auto/qaction/tst_qaction.cpp
index aaca8b51b6..260ac1f44a 100644
--- a/tests/auto/qaction/tst_qaction.cpp
+++ b/tests/auto/qaction/tst_qaction.cpp
@@ -242,7 +242,7 @@ void tst_QAction::setStandardKeys()
QList<QKeySequence> expected;
#if defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN)
expected << QKeySequence("CTRL+C");
-#elif defined(Q_WS_WIN) || defined(Q_WS_QWS)
+#elif defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
expected << QKeySequence("CTRL+C") << QKeySequence("CTRL+INSERT");
#else
expected << QKeySequence("CTRL+C") << QKeySequence("F16") << QKeySequence("CTRL+INSERT");
diff --git a/tests/auto/qalgorithms/tst_qalgorithms.cpp b/tests/auto/qalgorithms/tst_qalgorithms.cpp
index a493ce2713..8dd7cbcc28 100644
--- a/tests/auto/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/qalgorithms/tst_qalgorithms.cpp
@@ -81,6 +81,7 @@ private slots:
void test_qBinaryFind();
void qBinaryFindOneEntry();
void swap();
+ void swap2();
void sortEmptyList();
void sortedList();
void sortAPItest();
@@ -521,6 +522,28 @@ void tst_QAlgorithms::swap()
}
}
+namespace SwapTest {
+ struct ST { int i; int j; };
+ void swap(ST &a, ST &b) {
+ a.i = b.j;
+ b.i = a.j;
+ }
+}
+
+void tst_QAlgorithms::swap2()
+{
+ {
+#ifndef QT_NO_SQL
+ //check the namespace lookup works correctly
+ SwapTest::ST a = { 45, 65 };
+ SwapTest::ST b = { 48, 68 };
+ qSwap(a, b);
+ QCOMPARE(a.i, 68);
+ QCOMPARE(b.i, 65);
+#endif
+ }
+}
+
void tst_QAlgorithms::sortEmptyList()
{
// Only test if it crashes
diff --git a/tests/auto/qanimationgroup/qanimationgroup.pro b/tests/auto/qanimationgroup/qanimationgroup.pro
index 31667a8388..5e1be0cb10 100644
--- a/tests/auto/qanimationgroup/qanimationgroup.pro
+++ b/tests/auto/qanimationgroup/qanimationgroup.pro
@@ -3,3 +3,4 @@ QT = core
SOURCES += tst_qanimationgroup.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro
index d946e7e4ae..73799f4e2b 100644
--- a/tests/auto/qapplication/test/test.pro
+++ b/tests/auto/qapplication/test/test.pro
@@ -4,19 +4,19 @@ SOURCES += ../tst_qapplication.cpp
TARGET = ../tst_qapplication
wince* {
- additional.sources = ../desktopsettingsaware/desktopsettingsaware.exe
+ additional.files = ../desktopsettingsaware/desktopsettingsaware.exe
additional.path = desktopsettingsaware
- someTest.sources = test.pro
+ someTest.files = test.pro
someTest.path = test
- DEPLOYMENT = additional deploy someTest
+ DEPLOYMENT += additional deploy someTest
}
symbian: {
- additional.sources = $$OUT_PWD/../desktopsettingsaware/desktopsettingsaware.exe
+ additional.files = $$OUT_PWD/../desktopsettingsaware/desktopsettingsaware.exe
additional.path = desktopsettingsaware
- someTest.sources = test.pro
+ someTest.files = test.pro
someTest.path = test
- windowIcon.sources = ../heart.svg
+ windowIcon.files = ../heart.svg
DEPLOYMENT += additional deploy someTest windowIcon
LIBS += -lcone -lavkon
}
diff --git a/tests/auto/qatomicint/qatomicint.pro b/tests/auto/qatomicint/qatomicint.pro
index 4a09d5f176..7850d93dc7 100644
--- a/tests/auto/qatomicint/qatomicint.pro
+++ b/tests/auto/qatomicint/qatomicint.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qatomicint.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qatomicpointer/qatomicpointer.pro b/tests/auto/qatomicpointer/qatomicpointer.pro
index d192bad5dc..89ff137d39 100644
--- a/tests/auto/qatomicpointer/qatomicpointer.pro
+++ b/tests/auto/qatomicpointer/qatomicpointer.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qatomicpointer.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qaudioinput/qaudioinput.pro b/tests/auto/qaudioinput/qaudioinput.pro
index 5eb1613d5d..aac7fb45e2 100644
--- a/tests/auto/qaudioinput/qaudioinput.pro
+++ b/tests/auto/qaudioinput/qaudioinput.pro
@@ -5,8 +5,8 @@ SOURCES += tst_qaudioinput.cpp
QT = core multimedia
wince* {
- deploy.sources += 4.wav
- DEPLOYMENT = deploy
+ deploy.files += 4.wav
+ DEPLOYMENT += deploy
DEFINES += SRCDIR=\\\"\\\"
QT += gui
} else {
diff --git a/tests/auto/qaudiooutput/qaudiooutput.pro b/tests/auto/qaudiooutput/qaudiooutput.pro
index e1734e0b07..f4d840a97d 100644
--- a/tests/auto/qaudiooutput/qaudiooutput.pro
+++ b/tests/auto/qaudiooutput/qaudiooutput.pro
@@ -5,8 +5,8 @@ SOURCES += tst_qaudiooutput.cpp
QT = core multimedia
wince*|symbian: {
- deploy.sources += 4.wav
- DEPLOYMENT = deploy
+ deploy.files += 4.wav
+ DEPLOYMENT += deploy
!symbian {
DEFINES += SRCDIR=\\\"\\\"
QT += gui
diff --git a/tests/auto/qbitarray/qbitarray.pro b/tests/auto/qbitarray/qbitarray.pro
index ec110c62cd..358d81bad1 100644
--- a/tests/auto/qbitarray/qbitarray.pro
+++ b/tests/auto/qbitarray/qbitarray.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qbitarray.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qbitarray/tst_qbitarray.cpp b/tests/auto/qbitarray/tst_qbitarray.cpp
index ba3682a071..341e9073ff 100644
--- a/tests/auto/qbitarray/tst_qbitarray.cpp
+++ b/tests/auto/qbitarray/tst_qbitarray.cpp
@@ -88,6 +88,7 @@ private slots:
void countBits();
void countBits2();
void isEmpty();
+ void swap();
void fill();
void toggleBit_data();
void toggleBit();
@@ -269,6 +270,14 @@ void tst_QBitArray::isEmpty()
QVERIFY(a1.size() == 2);
}
+void tst_QBitArray::swap()
+{
+ QBitArray b1 = QStringToQBitArray("1"), b2 = QStringToQBitArray("10");
+ b1.swap(b2);
+ QCOMPARE(b1,QStringToQBitArray("10"));
+ QCOMPARE(b2,QStringToQBitArray("1"));
+}
+
void tst_QBitArray::fill()
{
int N = 64;
diff --git a/tests/auto/qbrush/tst_qbrush.cpp b/tests/auto/qbrush/tst_qbrush.cpp
index fe3167c72c..f6d056eb45 100644
--- a/tests/auto/qbrush/tst_qbrush.cpp
+++ b/tests/auto/qbrush/tst_qbrush.cpp
@@ -76,6 +76,7 @@ private slots:
void textures();
+ void swap();
void nullBrush();
void isOpaque();
void debug();
@@ -385,6 +386,14 @@ void tst_QBrush::textures()
QCOMPARE(image_brush.textureImage(), image_source);
}
+void tst_QBrush::swap()
+{
+ QBrush b1(Qt::black), b2(Qt::white);
+ b1.swap(b2);
+ QCOMPARE(b1.color(), QColor(Qt::white));
+ QCOMPARE(b2.color(), QColor(Qt::black));
+}
+
void tst_QBrush::nullBrush()
{
QBrush brush(QColor(100,0,0), Qt::NoBrush);
diff --git a/tests/auto/qbuffer/qbuffer.pro b/tests/auto/qbuffer/qbuffer.pro
index ea8365766b..b768eb82d8 100644
--- a/tests/auto/qbuffer/qbuffer.pro
+++ b/tests/auto/qbuffer/qbuffer.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qbuffer.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qbytearray/qbytearray.pro b/tests/auto/qbytearray/qbytearray.pro
index a0c143e038..f195dc8c71 100644
--- a/tests/auto/qbytearray/qbytearray.pro
+++ b/tests/auto/qbytearray/qbytearray.pro
@@ -5,7 +5,7 @@ SOURCES += tst_qbytearray.cpp
QT = core
wince*|symbian {
- addFile.sources = rfc3252.txt
+ addFile.files = rfc3252.txt
addFile.path = .
DEPLOYMENT += addFile
}
@@ -18,3 +18,4 @@ wince* {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+CONFIG += parallel_test
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp
index 6237f670f3..5fff22a2aa 100644
--- a/tests/auto/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/qbytearray/tst_qbytearray.cpp
@@ -71,6 +71,7 @@ public slots:
void init();
void cleanup();
private slots:
+ void swap();
void qCompress_data();
#ifndef QT_NO_COMPRESS
void qCompress();
@@ -142,6 +143,8 @@ private slots:
void repeated_data() const;
void byteRefDetaching() const;
+
+ void reserve();
};
tst_QByteArray::tst_QByteArray()
@@ -221,18 +224,18 @@ void tst_QByteArray::qUncompress_data()
QTest::addColumn<QByteArray>("in");
QTest::addColumn<QByteArray>("out");
- QTest::newRow("0x00000000") << QByteArray("\x00\x00\x00\x00") << QByteArray();
- QTest::newRow("0x000000ff") << QByteArray("\x00\x00\x00\xff") << QByteArray();
- QTest::newRow("0x3f000000") << QByteArray("\x3f\x00\x00\x00") << QByteArray();
- QTest::newRow("0x3fffffff") << QByteArray("\x3f\xff\xff\xff") << QByteArray();
- QTest::newRow("0x7fffff00") << QByteArray("\x7f\xff\xff\x00") << QByteArray();
- QTest::newRow("0x7fffffff") << QByteArray("\x7f\xff\xff\xff") << QByteArray();
- QTest::newRow("0x80000000") << QByteArray("\x80\x00\x00\x00") << QByteArray();
- QTest::newRow("0x800000ff") << QByteArray("\x80\x00\x00\xff") << QByteArray();
- QTest::newRow("0xcf000000") << QByteArray("\xcf\x00\x00\x00") << QByteArray();
- QTest::newRow("0xcfffffff") << QByteArray("\xcf\xff\xff\xff") << QByteArray();
- QTest::newRow("0xffffff00") << QByteArray("\xff\xff\xff\x00") << QByteArray();
- QTest::newRow("0xffffffff") << QByteArray("\xff\xff\xff\xff") << QByteArray();
+ QTest::newRow("0x00000000") << QByteArray("\x00\x00\x00\x00", 4) << QByteArray();
+ QTest::newRow("0x000000ff") << QByteArray("\x00\x00\x00\xff", 4) << QByteArray();
+ QTest::newRow("0x3f000000") << QByteArray("\x3f\x00\x00\x00", 4) << QByteArray();
+ QTest::newRow("0x3fffffff") << QByteArray("\x3f\xff\xff\xff", 4) << QByteArray();
+ QTest::newRow("0x7fffff00") << QByteArray("\x7f\xff\xff\x00", 4) << QByteArray();
+ QTest::newRow("0x7fffffff") << QByteArray("\x7f\xff\xff\xff", 4) << QByteArray();
+ QTest::newRow("0x80000000") << QByteArray("\x80\x00\x00\x00", 4) << QByteArray();
+ QTest::newRow("0x800000ff") << QByteArray("\x80\x00\x00\xff", 4) << QByteArray();
+ QTest::newRow("0xcf000000") << QByteArray("\xcf\x00\x00\x00", 4) << QByteArray();
+ QTest::newRow("0xcfffffff") << QByteArray("\xcf\xff\xff\xff", 4) << QByteArray();
+ QTest::newRow("0xffffff00") << QByteArray("\xff\xff\xff\x00", 4) << QByteArray();
+ QTest::newRow("0xffffffff") << QByteArray("\xff\xff\xff\xff", 4) << QByteArray();
}
void tst_QByteArray::qUncompress()
@@ -249,18 +252,10 @@ void tst_QByteArray::qUncompress()
#endif
QByteArray res;
- QT_TRY {
- res = ::qUncompress(in);
- } QT_CATCH(const std::bad_alloc &) {
- res = QByteArray();
- }
+ res = ::qUncompress(in);
QCOMPARE(res, out);
- QT_TRY {
- res = ::qUncompress(in + "blah");
- } QT_CATCH(const std::bad_alloc &) {
- res = QByteArray();
- }
+ res = ::qUncompress(in + "blah");
QCOMPARE(res, out);
}
@@ -459,6 +454,14 @@ void tst_QByteArray::split()
QCOMPARE(list.count(), size);
}
+void tst_QByteArray::swap()
+{
+ QByteArray b1 = "b1", b2 = "b2";
+ b1.swap(b2);
+ QCOMPARE(b1, QByteArray("b2"));
+ QCOMPARE(b2, QByteArray("b1"));
+}
+
void tst_QByteArray::base64_data()
{
QTest::addColumn<QByteArray>("rawdata");
@@ -1516,6 +1519,22 @@ void tst_QByteArray::byteRefDetaching() const
}
}
+void tst_QByteArray::reserve()
+{
+ int capacity = 100;
+ QByteArray qba;
+ qba.reserve(capacity);
+ QVERIFY(qba.capacity() == capacity);
+ char *data = qba.data();
+
+ // FIXME count from 0 to make it fail
+ for (int i = 1; i < capacity; i++) {
+ qba.resize(i);
+ QVERIFY(capacity == qba.capacity());
+ QVERIFY(data == qba.data());
+ }
+}
+
const char globalChar = '1';
QTEST_APPLESS_MAIN(tst_QByteArray)
diff --git a/tests/auto/qbytearraymatcher/qbytearraymatcher.pro b/tests/auto/qbytearraymatcher/qbytearraymatcher.pro
index 1618c3e18e..a2458e623f 100644
--- a/tests/auto/qbytearraymatcher/qbytearraymatcher.pro
+++ b/tests/auto/qbytearraymatcher/qbytearraymatcher.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
SOURCES += tst_qbytearraymatcher.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qcache/qcache.pro b/tests/auto/qcache/qcache.pro
index 728b0b646f..0da4e1414f 100644
--- a/tests/auto/qcache/qcache.pro
+++ b/tests/auto/qcache/qcache.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qcache.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro
index 3813e4e3f2..1681220117 100644
--- a/tests/auto/qchar/qchar.pro
+++ b/tests/auto/qchar/qchar.pro
@@ -4,8 +4,8 @@ SOURCES += tst_qchar.cpp
QT = core
wince*|symbian: {
-deploy.sources += NormalizationTest.txt
-DEPLOYMENT = deploy
+deploy.files += NormalizationTest.txt
+DEPLOYMENT += deploy
}
symbian: {
@@ -13,3 +13,4 @@ symbian: {
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+CONFIG += parallel_test
diff --git a/tests/auto/qcheckbox/tst_qcheckbox.cpp b/tests/auto/qcheckbox/tst_qcheckbox.cpp
index 70b30c946b..e0cd23efe9 100644
--- a/tests/auto/qcheckbox/tst_qcheckbox.cpp
+++ b/tests/auto/qcheckbox/tst_qcheckbox.cpp
@@ -92,6 +92,7 @@ private slots:
void setAccel();
void group();
void foregroundRole();
+ void minimumSizeHint();
protected slots:
void onClicked();
@@ -425,5 +426,11 @@ void tst_QCheckBox::foregroundRole()
QVERIFY(testWidget->foregroundRole() == QPalette::WindowText);
}
+void tst_QCheckBox::minimumSizeHint()
+{
+ QCheckBox box(tr("CheckBox's sizeHint is the same as it's minimumSizeHint"));
+ QCOMPARE(box.sizeHint(), box.minimumSizeHint());
+}
+
QTEST_MAIN(tst_QCheckBox)
#include "tst_qcheckbox.moc"
diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro
index 97b0c9c320..12c6b6ce4f 100644
--- a/tests/auto/qclipboard/test/test.pro
+++ b/tests/auto/qclipboard/test/test.pro
@@ -11,22 +11,22 @@ win32 {
}
wince*|symbian: {
- copier.sources = ../copier/copier.exe
+ copier.files = ../copier/copier.exe
copier.path = copier
- paster.sources = ../paster/paster.exe
+ paster.files = ../paster/paster.exe
paster.path = paster
symbian: {
LIBS += -lbafl -lestor -letext
load(data_caging_paths)
- rsc.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc
- rsc.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc
+ rsc.files = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc
+ rsc.files += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc
rsc.path = $$APP_RESOURCE_DIR
- reg_resource.sources = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc
- reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc
+ reg_resource.files = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc
+ reg_resource.files += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc
reg_resource.path = $$REG_RESOURCE_IMPORT_DIR
}
- DEPLOYMENT = copier paster rsc reg_resource
+ DEPLOYMENT += copier paster rsc reg_resource
} \ No newline at end of file
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index 6f450ba871..d525068893 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -157,6 +157,7 @@ private slots:
void keyBoardNavigationWithMouse();
void task_QTBUG_1071_changingFocusEmitsActivated();
void maxVisibleItems();
+ void task_QTBUG_10491_currentIndexAndModelColumn();
protected slots:
void onEditTextChanged( const QString &newString );
@@ -474,6 +475,18 @@ void tst_QComboBox::setPalette()
QVERIFY(((QWidget*)o)->palette() == pal);
}
}
+
+ testWidget->setEditable(true);
+ pal.setColor(QPalette::Base, Qt::red);
+ //Setting it on the lineedit should be separate form the combo
+ testWidget->lineEdit()->setPalette(pal);
+ QVERIFY(testWidget->palette() != pal);
+ QVERIFY(testWidget->lineEdit()->palette() == pal);
+ pal.setColor(QPalette::Base, Qt::green);
+ //Setting it on the combo directly should override lineedit
+ testWidget->setPalette(pal);
+ QVERIFY(testWidget->palette() == pal);
+ QVERIFY(testWidget->lineEdit()->palette() == pal);
}
void tst_QComboBox::sizeAdjustPolicy()
@@ -2555,11 +2568,33 @@ void tst_QComboBox::maxVisibleItems()
QAbstractItemView *v = comboBox.view();
int itemHeight = v->visualRect(v->model()->index(0,0)).height();
- if (v->style()->styleHint(QStyle::SH_ComboBox_Popup))
+ QListView *lv = qobject_cast<QListView*>(v);
+ if (lv)
+ itemHeight += lv->spacing();
+ QStyleOptionComboBox opt;
+ opt.initFrom(&comboBox);
+ if (!comboBox.style()->styleHint(QStyle::SH_ComboBox_Popup, &opt))
QCOMPARE(v->viewport()->height(), itemHeight * comboBox.maxVisibleItems());
- // QCombobox without a popup does not work, see QTBUG-760
}
+void tst_QComboBox::task_QTBUG_10491_currentIndexAndModelColumn()
+{
+ QComboBox comboBox;
+
+ QStandardItemModel model(4, 4, &comboBox);
+ for (int i = 0; i < 4; i++){
+ model.setItem(i, 0, new QStandardItem(QString("Employee Nr %1").arg(i)));
+ model.setItem(i, 1, new QStandardItem(QString("Street Nr %1").arg(i)));
+ model.setItem(i, 2, new QStandardItem(QString("Town Nr %1").arg(i)));
+ model.setItem(i, 3, new QStandardItem(QString("Phone Nr %1").arg(i)));
+ }
+ comboBox.setModel(&model);
+ comboBox.setModelColumn(0);
+
+ QComboBoxPrivate *d = static_cast<QComboBoxPrivate *>(QComboBoxPrivate::get(&comboBox));
+ d->setCurrentIndex(model.index(2, 2));
+ QCOMPARE(QModelIndex(d->currentIndex), model.index(2, comboBox.modelColumn()));
+}
QTEST_MAIN(tst_QComboBox)
#include "tst_qcombobox.moc"
diff --git a/tests/auto/qcompleter/tst_qcompleter.cpp b/tests/auto/qcompleter/tst_qcompleter.cpp
index 5a7be285b3..932c19ea54 100644
--- a/tests/auto/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/qcompleter/tst_qcompleter.cpp
@@ -49,6 +49,7 @@
#include <QPointer>
#include "../../shared/util.h"
+#include "../../shared/filesystem.h"
//TESTED_CLASS=
//TESTED_FILES=
@@ -1455,24 +1456,16 @@ void tst_QCompleter::task247560_keyboardNavigation()
void tst_QCompleter::QTBUG_14292_filesystem()
{
- QDir tmpDir = QDir::temp();
+ FileSystem fs;
+ QDir tmpDir = QDir::currentPath();
+
qsrand(QTime::currentTime().msec());
QString d = "tst_QCompleter_" + QString::number(qrand());
- QVERIFY(tmpDir.mkdir(d));
-
-#if 0
- struct Cleanup {
- QString dir;
- ~Cleanup() {
- qDebug() << dir <<
- QFile::remove(dir); }
- } cleanup;
- cleanup.dir = tmpDir.absolutePath()+"/" +d;
-#endif
+ QVERIFY(fs.createDirectory(tmpDir.filePath(d)));
QVERIFY(tmpDir.cd(d));
- QVERIFY(tmpDir.mkdir("hello"));
- QVERIFY(tmpDir.mkdir("holla"));
+ QVERIFY(fs.createDirectory(tmpDir.filePath("hello")));
+ QVERIFY(fs.createDirectory(tmpDir.filePath("holla")));
QLineEdit edit;
QCompleter comp;
@@ -1500,12 +1493,12 @@ void tst_QCompleter::QTBUG_14292_filesystem()
QCOMPARE(comp.popup()->model()->rowCount(), 1);
QTest::keyClick(&edit, 'r');
QTRY_VERIFY(!comp.popup()->isVisible());
- QVERIFY(tmpDir.mkdir("hero"));
+ QVERIFY(fs.createDirectory(tmpDir.filePath("hero")));
QTRY_VERIFY(comp.popup()->isVisible());
QCOMPARE(comp.popup()->model()->rowCount(), 1);
QTest::keyClick(comp.popup(), Qt::Key_Escape);
QTRY_VERIFY(!comp.popup()->isVisible());
- QVERIFY(tmpDir.mkdir("nothingThere"));
+ QVERIFY(fs.createDirectory(tmpDir.filePath("nothingThere")));
//there is no reason creating a file should open a popup, it did in Qt 4.7.0
QTest::qWait(60);
QVERIFY(!comp.popup()->isVisible());
@@ -1522,7 +1515,7 @@ void tst_QCompleter::QTBUG_14292_filesystem()
QTest::qWaitForWindowShown(&w);
QTRY_VERIFY(!edit.hasFocus() && !comp.popup()->hasFocus());
- QVERIFY(tmpDir.mkdir("hemo"));
+ QVERIFY(fs.createDirectory(tmpDir.filePath("hemo")));
//there is no reason creating a file should open a popup, it did in Qt 4.7.0
QTest::qWait(60);
QVERIFY(!comp.popup()->isVisible());
diff --git a/tests/auto/qcomplextext/tst_qcomplextext.cpp b/tests/auto/qcomplextext/tst_qcomplextext.cpp
index 3f6fdf9b8d..3d8e29057d 100644
--- a/tests/auto/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/qcomplextext/tst_qcomplextext.cpp
@@ -45,6 +45,7 @@
#if !defined(Q_WS_MAC)
#include <QtTest/QtTest>
+#include <QtGui/QtGui>
#include <private/qtextengine_p.h>
#include "bidireorderstring.h"
@@ -68,6 +69,8 @@ public slots:
private slots:
void bidiReorderString_data();
void bidiReorderString();
+ void bidiCursor_qtbug2795();
+ void bidiCursor_PDF();
};
tst_QComplexText::tst_QComplexText()
@@ -159,6 +162,42 @@ void tst_QComplexText::bidiReorderString()
QTEST(visual, "VISUAL");
}
+void tst_QComplexText::bidiCursor_qtbug2795()
+{
+ QString str = QString::fromUtf8("الجزيرة نت");
+ QTextLayout l1(str);
+
+ l1.beginLayout();
+ QTextLine line1 = l1.createLine();
+ l1.endLayout();
+
+ qreal x1 = line1.cursorToX(0) - line1.cursorToX(str.size());
+
+ str.append("1");
+ QTextLayout l2(str);
+ l2.beginLayout();
+ QTextLine line2 = l2.createLine();
+ l2.endLayout();
+
+ qreal x2 = line2.cursorToX(0) - line2.cursorToX(str.size());
+
+ // The cursor should remain at the same position after a digit is appended
+ QVERIFY(x1 == x2);
+}
+
+void tst_QComplexText::bidiCursor_PDF()
+{
+ QString str = QString::fromUtf8("\342\200\252hello\342\200\254");
+ QTextLayout layout(str);
+
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+
+ int size = str.size();
+
+ QVERIFY(line.cursorToX(size) == line.cursorToX(size - 1));
+}
QTEST_MAIN(tst_QComplexText)
#include "tst_qcomplextext.moc"
diff --git a/tests/auto/qcontiguouscache/qcontiguouscache.pro b/tests/auto/qcontiguouscache/qcontiguouscache.pro
index 618efed29f..5951f87f89 100644
--- a/tests/auto/qcontiguouscache/qcontiguouscache.pro
+++ b/tests/auto/qcontiguouscache/qcontiguouscache.pro
@@ -6,3 +6,4 @@ SOURCES += tst_qcontiguouscache.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
index 0175b6cd5e..b53b0a5f13 100644
--- a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
+++ b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp
@@ -55,6 +55,8 @@ public:
virtual ~tst_QContiguousCache() {}
private slots:
void empty();
+ void swap();
+
void append_data();
void append();
@@ -99,6 +101,17 @@ void tst_QContiguousCache::empty()
QCOMPARE(c.capacity(), 10);
}
+void tst_QContiguousCache::swap()
+{
+ QContiguousCache<int> c1(10), c2(100);
+ c1.append(1);
+ c1.swap(c2);
+ QCOMPARE(c1.capacity(), 100);
+ QCOMPARE(c1.count(), 0 );
+ QCOMPARE(c2.capacity(), 10 );
+ QCOMPARE(c2.count(), 1 );
+}
+
void tst_QContiguousCache::append_data()
{
QTest::addColumn<int>("start");
diff --git a/tests/auto/qcoreapplication/qcoreapplication.pro b/tests/auto/qcoreapplication/qcoreapplication.pro
index 27f5e58d6d..031af39df7 100644
--- a/tests/auto/qcoreapplication/qcoreapplication.pro
+++ b/tests/auto/qcoreapplication/qcoreapplication.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qcoreapplication.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qcryptographichash/qcryptographichash.pro b/tests/auto/qcryptographichash/qcryptographichash.pro
index 7e1a866bc3..65e31dcb57 100644
--- a/tests/auto/qcryptographichash/qcryptographichash.pro
+++ b/tests/auto/qcryptographichash/qcryptographichash.pro
@@ -6,3 +6,4 @@ symbian: {
TARGET.EPOCSTACKSIZE =0x5000
TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
+CONFIG += parallel_test
diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro
index 674064fc83..f696f195de 100644
--- a/tests/auto/qcssparser/qcssparser.pro
+++ b/tests/auto/qcssparser/qcssparser.pro
@@ -8,9 +8,9 @@ requires(contains(QT_CONFIG,private_tests))
}
wince*|symbian: {
- addFiles.sources = testdata
+ addFiles.files = testdata
addFiles.path = .
- timesFont.sources = C:/Windows/Fonts/times.ttf
+ timesFont.files = C:/Windows/Fonts/times.ttf
timesFont.path = .
DEPLOYMENT += addFiles timesFont
}
diff --git a/tests/auto/qdatastream/qdatastream.pro b/tests/auto/qdatastream/qdatastream.pro
index c132073aea..eba7c006e5 100644
--- a/tests/auto/qdatastream/qdatastream.pro
+++ b/tests/auto/qdatastream/qdatastream.pro
@@ -12,13 +12,13 @@ QT += svg
wince*: {
- addFiles.sources = datastream.q42 tests2.svg
+ addFiles.files = datastream.q42 tests2.svg
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
} else:symbian {
# SRCDIR and SVGFILE defined in code in symbian
- addFiles.sources = datastream.q42 tests2.svg
+ addFiles.files = datastream.q42 tests2.svg
addFiles.path = .
DEPLOYMENT += addFiles
TARGET.EPOCHEAPSIZE = 1000000 10000000
diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp
index 92d73305fd..70d37e9749 100644
--- a/tests/auto/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/qdatastream/tst_qdatastream.cpp
@@ -168,6 +168,8 @@ private slots:
void stream_atEnd_data();
void stream_atEnd();
+ void stream_writeError();
+
void stream_QByteArray2();
void setVersion_data();
@@ -2345,6 +2347,55 @@ void tst_QDataStream::stream_atEnd()
}
}
+class FakeBuffer : public QBuffer
+{
+protected:
+ qint64 writeData(const char *c, qint64 i) { return m_lock ? 0 : QBuffer::writeData(c, i); }
+public:
+ FakeBuffer(bool locked = false) : m_lock(locked) {}
+ void setLocked(bool locked) { m_lock = locked; }
+private:
+ bool m_lock;
+};
+
+#define TEST_WRITE_ERROR(op) \
+ { \
+ FakeBuffer fb(false); \
+ QVERIFY(fb.open(QBuffer::ReadWrite)); \
+ QDataStream fs(&fb); \
+ fs.writeRawData("hello", 5); \
+ /* first write some initial content */ \
+ QCOMPARE(fs.status(), QDataStream::Ok); \
+ QCOMPARE(fb.data(), QByteArray("hello")); \
+ /* then test that writing can cause an error */ \
+ fb.setLocked(true); \
+ fs op; \
+ QCOMPARE(fs.status(), QDataStream::WriteFailed); \
+ QCOMPARE(fb.data(), QByteArray("hello")); \
+ /* finally test that writing after an error doesn't change the stream any more */ \
+ fb.setLocked(false); \
+ fs op; \
+ QCOMPARE(fs.status(), QDataStream::WriteFailed); \
+ QCOMPARE(fb.data(), QByteArray("hello")); \
+ }
+
+void tst_QDataStream::stream_writeError()
+{
+ TEST_WRITE_ERROR(<< true)
+ TEST_WRITE_ERROR(<< (qint8)1)
+ TEST_WRITE_ERROR(<< (quint8)1)
+ TEST_WRITE_ERROR(<< (qint16)1)
+ TEST_WRITE_ERROR(<< (quint16)1)
+ TEST_WRITE_ERROR(<< (qint32)1)
+ TEST_WRITE_ERROR(<< (quint32)1)
+ TEST_WRITE_ERROR(<< (qint64)1)
+ TEST_WRITE_ERROR(<< (quint64)1)
+ TEST_WRITE_ERROR(<< "hello")
+ TEST_WRITE_ERROR(<< (float)1.0)
+ TEST_WRITE_ERROR(<< (double)1.0)
+ TEST_WRITE_ERROR(.writeRawData("test", 4))
+}
+
void tst_QDataStream::stream_QByteArray2()
{
QByteArray ba;
diff --git a/tests/auto/qdate/qdate.pro b/tests/auto/qdate/qdate.pro
index 6e2781b3d8..1c041004d3 100644
--- a/tests/auto/qdate/qdate.pro
+++ b/tests/auto/qdate/qdate.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qdate.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qdatetime/qdatetime.pro b/tests/auto/qdatetime/qdatetime.pro
index 02d39892a0..08a321ef75 100644
--- a/tests/auto/qdatetime/qdatetime.pro
+++ b/tests/auto/qdatetime/qdatetime.pro
@@ -12,3 +12,4 @@ win32-msvc|win32-msvc9x {
}
+CONFIG += parallel_test
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index 207d434920..fa9c70b8e1 100644
--- a/tests/auto/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/qdatetime/tst_qdatetime.cpp
@@ -705,12 +705,12 @@ void tst_QDateTime::addSecs_data()
}
// Year sign change
- QTest::newRow("toNegative") << QDateTime(QDate(1, 1, 1), QTime(0, 0, 0))
+ QTest::newRow("toNegative") << QDateTime(QDate(1, 1, 1), QTime(0, 0, 0), Qt::UTC)
<< -1
- << QDateTime(QDate(-1, 12, 31), QTime(23, 59, 59));
- QTest::newRow("toPositive") << QDateTime(QDate(-1, 12, 31), QTime(23, 59, 59))
+ << QDateTime(QDate(-1, 12, 31), QTime(23, 59, 59), Qt::UTC);
+ QTest::newRow("toPositive") << QDateTime(QDate(-1, 12, 31), QTime(23, 59, 59), Qt::UTC)
<< 1
- << QDateTime(QDate(1, 1, 1), QTime(0, 0, 0));
+ << QDateTime(QDate(1, 1, 1), QTime(0, 0, 0), Qt::UTC);
// Gregorian/Julian switchover
QTest::newRow("toGregorian") << QDateTime(QDate(1582, 10, 4), QTime(23, 59, 59))
diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
index 4970002370..c8c3b90712 100644
--- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -273,6 +273,9 @@ private slots:
void task196924();
void focusNextPrevChild();
+
+ void taskQTBUG_12384_timeSpecShowTimeOnly();
+
private:
EditorDateEdit* testWidget;
QWidget *testFocusWidget;
@@ -3420,7 +3423,20 @@ void tst_QDateTimeEdit::focusNextPrevChild()
QCOMPARE(edit.currentSection(), QDateTimeEdit::MonthSection);
}
+void tst_QDateTimeEdit::taskQTBUG_12384_timeSpecShowTimeOnly()
+{
+ QDateTime time = QDateTime::fromString("20100723 04:02:40", "yyyyMMdd hh:mm:ss");
+ time.setTimeSpec(Qt::UTC);
+
+ EditorDateEdit edit;
+ edit.setDisplayFormat("hh:mm:ss");
+ edit.setTimeSpec(Qt::UTC);
+ edit.setDateTime(time);
+ QCOMPARE(edit.minimumTime(), QTime(0, 0, 0, 0));
+ QCOMPARE(edit.maximumTime(), QTime(23, 59, 59, 999));
+ QCOMPARE(edit.time(), time.time());
+}
QTEST_MAIN(tst_QDateTimeEdit)
#include "tst_qdatetimeedit.moc"
diff --git a/tests/auto/qdebug/qdebug.pro b/tests/auto/qdebug/qdebug.pro
index 6e75a092e7..2b5716860c 100644
--- a/tests/auto/qdebug/qdebug.pro
+++ b/tests/auto/qdebug/qdebug.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qdebug.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro
index d32ed4c794..43f6cba267 100644
--- a/tests/auto/qdesktopservices/qdesktopservices.pro
+++ b/tests/auto/qdesktopservices/qdesktopservices.pro
@@ -3,22 +3,22 @@ CONFIG += qttest_p4
SOURCES += tst_qdesktopservices.cpp
TARGET = tst_qdesktopservices
symbian: {
- dummy.sources = text\\testfile.txt
+ dummy.files = text\\testfile.txt
dummy.path = .
- text.sources = text\\*
+ text.files = text\\*
text.path = \\data\\others
- image.sources = image\\*
+ image.files = image\\*
image.path = \\data\\images
- audio.sources = audio\\*
+ audio.files = audio\\*
audio.path = \\data\\sounds
- video.sources = video\\*
+ video.files = video\\*
video.path = \\data\\videos
- install.sources = install\\*
+ install.files = install\\*
install.path = \\data\\installs
DEPLOYMENT += image audio video install
diff --git a/tests/auto/qdial/tst_qdial.cpp b/tests/auto/qdial/tst_qdial.cpp
index c8cf8cd1f0..fdf49fd77d 100644
--- a/tests/auto/qdial/tst_qdial.cpp
+++ b/tests/auto/qdial/tst_qdial.cpp
@@ -54,6 +54,7 @@ private slots:
void getSetCheck();
void valueChanged();
void sliderMoved();
+ void wrappingCheck();
};
// Testing get/set functions
@@ -143,5 +144,68 @@ void tst_QDial::sliderMoved()
}
+void tst_QDial::wrappingCheck()
+{
+ //This tests if dial will wrap past the maximum value back to the minimum
+ //and vice versa when changing the value with a keypress
+ QDial dial;
+ dial.setMinimum(0);
+ dial.setMaximum(100);
+ dial.setSingleStep(1);
+ dial.setWrapping(true);
+ dial.setValue(99);
+ dial.show();
+
+ { //set value to maximum but do not wrap
+ QTest::keyPress(&dial, Qt::Key_Up);
+ QCOMPARE( dial.value(), 100);
+ }
+
+ { //step up once more and wrap clockwise to minimum + 1
+ QTest::keyPress(&dial, Qt::Key_Up);
+ QCOMPARE( dial.value(), 1);
+ }
+
+ { //step down once, and wrap anti-clockwise to minimum, then again to maximum - 1
+ QTest::keyPress(&dial, Qt::Key_Down);
+ QCOMPARE( dial.value(), 0);
+
+ QTest::keyPress(&dial, Qt::Key_Down);
+ QCOMPARE( dial.value(), 99);
+ }
+
+ { //when wrapping property is false no wrapping will occur
+ dial.setWrapping(false);
+ dial.setValue(100);
+
+ QTest::keyPress(&dial, Qt::Key_Up);
+ QCOMPARE( dial.value(), 100);
+
+ dial.setValue(0);
+ QTest::keyPress(&dial, Qt::Key_Down);
+ QCOMPARE( dial.value(), 0);
+ }
+
+ { //When the step is really big or small, wrapping should still behave
+ dial.setWrapping(true);
+ dial.setValue(dial.minimum());
+ dial.setSingleStep(305);
+
+ QTest::keyPress(&dial, Qt::Key_Up);
+ QCOMPARE( dial.value(), 5);
+
+ dial.setValue(dial.minimum());
+ QTest::keyPress(&dial, Qt::Key_Down);
+ QCOMPARE( dial.value(), 95);
+
+ dial.setMinimum(-30);
+ dial.setMaximum(-4);
+ dial.setSingleStep(200);
+ dial.setValue(dial.minimum());
+ QTest::keyPress(&dial, Qt::Key_Down);
+ QCOMPARE( dial.value(), -22);
+ }
+}
+
QTEST_MAIN(tst_QDial)
#include "tst_qdial.moc"
diff --git a/tests/auto/qdir/qdir.pro b/tests/auto/qdir/qdir.pro
index cf612f130c..472e646f55 100644
--- a/tests/auto/qdir/qdir.pro
+++ b/tests/auto/qdir/qdir.pro
@@ -4,7 +4,7 @@ RESOURCES += qdir.qrc
QT = core
wince*|symbian {
- DirFiles.sources = testdir testdata searchdir resources entrylist types tst_qdir.cpp
+ DirFiles.files = testdir testdata searchdir resources entrylist types tst_qdir.cpp
DirFiles.path = .
DEPLOYMENT += DirFiles
}
@@ -15,8 +15,11 @@ wince* {
TARGET.CAPABILITY += AllFiles
TARGET.UID3 = 0xE0340002
DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
+ LIBS += -lefsrv
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
} else {
contains(QT_CONFIG, qt3support):QT += qt3support
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+CONFIG += parallel_test
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index 6492bc98a7..2fa0c24a3d 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -49,14 +49,21 @@
#include <qregexp.h>
#include <qstringlist.h>
#include "../network-settings.h"
+
+#if defined(Q_OS_WIN)
+#define _WIN32_WINNT 0x500
+#endif
+
#include "../../shared/filesystem.h"
#if defined(Q_OS_SYMBIAN)
+# include <f32file.h>
# define STRINGIFY(x) #x
# define TOSTRING(x) STRINGIFY(x)
# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
#elif defined(Q_OS_UNIX)
# include <unistd.h>
+# include <sys/stat.h>
#endif
#if defined(Q_OS_VXWORKS)
@@ -64,7 +71,7 @@
#endif
#if defined(Q_OS_SYMBIAN)
-// Open C in Symbian doesn't support symbolic links to directories
+#define Q_NO_SYMLINKS
#define Q_NO_SYMLINKS_TO_DIRS
#endif
@@ -98,6 +105,8 @@ private slots:
void mkdir_data();
void mkdir();
+ void makedirReturnCode();
+
void rmdir_data();
void rmdir();
@@ -169,6 +178,32 @@ private slots:
void updateFileLists();
void detachingOperations();
+
+ void testCaching();
+
+ void isRoot_data();
+ void isRoot();
+
+#ifndef QT_NO_REGEXP
+ void match_data();
+ void match();
+#endif
+
+ void drives();
+
+ void arrayOperator();
+
+#ifdef QT3_SUPPORT
+ void setNameFilter();
+#endif
+
+ void equalityOperator_data();
+ void equalityOperator();
+
+ void isRelative_data();
+ void isRelative();
+
+ void isReadable();
};
// Testing get/set functions
@@ -283,6 +318,17 @@ void tst_QDir::mkdir()
QVERIFY(fi.exists() && fi.isDir());
}
+void tst_QDir::makedirReturnCode()
+{
+ QString dirName = QString::fromLatin1("makedirReturnCode");
+ QDir::current().rmdir(dirName); // cleanup a previous run.
+ QDir dir(dirName);
+ QVERIFY(!dir.exists());
+ QVERIFY(QDir::current().mkdir(dirName));
+ QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing dir will fail.
+ QVERIFY(QDir::current().mkpath(dirName)); // calling mkpath on an existing dir will pass
+}
+
void tst_QDir::rmdir_data()
{
QTest::addColumn<QString>("path");
@@ -587,6 +633,7 @@ void tst_QDir::entryList()
expected.removeAll("..");
#endif
+#ifndef Q_NO_SYMLINKS
#if defined(Q_OS_WIN)
// ### Sadly, this is a platform difference right now.
QFile::link(SRCDIR "entryList/file", SRCDIR "entrylist/linktofile.lnk");
@@ -641,6 +688,7 @@ void tst_QDir::entryList()
QFile::link("directory", SRCDIR "entrylist/linktodirectory.lnk");
QFile::link("nothing", SRCDIR "entrylist/brokenlink.lnk");
#endif
+#endif //Q_NO_SYMLINKS
#ifdef Q_WS_MAC
if (qstrcmp(QTest::currentDataTag(), "unprintablenames") == 0)
@@ -802,6 +850,24 @@ void tst_QDir::canonicalPath_data()
QTest::newRow("absPath") << appPath + "\\testData\\..\\testData" << appPath + "/testData";
#endif
QTest::newRow("nonexistant") << "testd" << QString();
+
+ QTest::newRow("rootPath") << QDir::rootPath() << QDir::rootPath();
+
+#ifdef Q_OS_MAC
+ // On Mac OS X 10.5 and earlier, canonicalPath depends on cleanPath which
+ // is itself very broken and fundamentally wrong on "/./" which, this would
+ // exercise
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6)
+#endif
+ QTest::newRow("rootPath + ./") << QDir::rootPath().append("./") << QDir::rootPath();
+
+ QTest::newRow("rootPath + ../.. ") << QDir::rootPath().append("../..") << QDir::rootPath();
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ QTest::newRow("drive:\\") << QDir::toNativeSeparators(QDir::rootPath()) << QDir::rootPath();
+ QTest::newRow("drive:\\.\\") << QDir::toNativeSeparators(QDir::rootPath().append("./")) << QDir::rootPath();
+ QTest::newRow("drive:\\..\\..") << QDir::toNativeSeparators(QDir::rootPath().append("../..")) << QDir::rootPath();
+ QTest::newRow("drive:") << QDir().canonicalPath().left(2) << QDir().canonicalPath();
+#endif
}
void tst_QDir::canonicalPath()
@@ -870,7 +936,7 @@ void tst_QDir::current()
if (!path.isEmpty()) {
bool b = QDir::setCurrent(path);
- // If path is non existant, then setCurrent should be false (currentDir is empty in testData)
+ // If path is non existent, then setCurrent should be false (currentDir is empty in testData)
QVERIFY(b == !currentDir.isEmpty());
}
if (!currentDir.isEmpty()) {
@@ -915,6 +981,7 @@ void tst_QDir::cd()
QFETCH(QString, newDir);
QDir d = startDir;
+ bool notUsed = d.exists(); // make sure we cache this before so we can see if 'cd' fails to flush this
QCOMPARE(d.cd(cdDir), successExpected);
if (successExpected)
QCOMPARE(d.absolutePath(), newDir);
@@ -1084,24 +1151,24 @@ void tst_QDir::relativeFilePath_data()
QTest::newRow("14") << "C:/foo/bar" << "/ding/dong" << "../../ding/dong";
QTest::newRow("15") << "C:/foo/bar" << "D:/ding/dong" << "D:/ding/dong";
QTest::newRow("16") << "C:" << "C:/ding/dong" << "ding/dong";
- QTest::newRow("16") << "C:/" << "C:/ding/dong" << "ding/dong";
- QTest::newRow("17") << "C:" << "C:" << "";
- QTest::newRow("18") << "C:/" << "C:" << "";
- QTest::newRow("19") << "C:" << "C:/" << "";
- QTest::newRow("20") << "C:/" << "C:/" << "";
- QTest::newRow("17") << "C:" << "C:file.txt" << "file.txt";
- QTest::newRow("18") << "C:/" << "C:file.txt" << "file.txt";
- QTest::newRow("19") << "C:" << "C:/file.txt" << "file.txt";
- QTest::newRow("20") << "C:/" << "C:/file.txt" << "file.txt";
- QTest::newRow("21") << "C:" << "D:" << "D:";
- QTest::newRow("22") << "C:" << "D:/" << "D:/";
- QTest::newRow("23") << "C:/" << "D:" << "D:";
- QTest::newRow("24") << "C:/" << "D:/" << "D:/";
+ QTest::newRow("17") << "C:/" << "C:/ding/dong" << "ding/dong";
+ QTest::newRow("18") << "C:" << "C:" << "";
+ QTest::newRow("19") << "C:/" << "C:" << "";
+ QTest::newRow("20") << "C:" << "C:/" << "";
+ QTest::newRow("21") << "C:/" << "C:/" << "";
+ QTest::newRow("22") << "C:" << "C:file.txt" << "file.txt";
+ QTest::newRow("23") << "C:/" << "C:file.txt" << "file.txt";
+ QTest::newRow("24") << "C:" << "C:/file.txt" << "file.txt";
+ QTest::newRow("25") << "C:/" << "C:/file.txt" << "file.txt";
+ QTest::newRow("26") << "C:" << "D:" << "D:";
+ QTest::newRow("27") << "C:" << "D:/" << "D:/";
+ QTest::newRow("28") << "C:/" << "D:" << "D:";
+ QTest::newRow("29") << "C:/" << "D:/" << "D:/";
# if !defined(Q_OS_SYMBIAN)
- QTest::newRow("25") << "C:/foo/bar" << "//anotherHost/foo/bar" << "//anotherHost/foo/bar";
- QTest::newRow("26") << "//anotherHost/foo" << "//anotherHost/foo/bar" << "bar";
- QTest::newRow("27") << "//anotherHost/foo" << "bar" << "bar";
- QTest::newRow("28") << "//anotherHost/foo" << "C:/foo/bar" << "C:/foo/bar";
+ QTest::newRow("30") << "C:/foo/bar" << "//anotherHost/foo/bar" << "//anotherHost/foo/bar";
+ QTest::newRow("31") << "//anotherHost/foo" << "//anotherHost/foo/bar" << "bar";
+ QTest::newRow("32") << "//anotherHost/foo" << "bar" << "bar";
+ QTest::newRow("33") << "//anotherHost/foo" << "C:/foo/bar" << "C:/foo/bar";
# endif
#endif
}
@@ -1147,6 +1214,8 @@ void tst_QDir::remove()
QDir dir;
QVERIFY(dir.remove("remove-test"));
QVERIFY(!dir.remove("/remove-test"));
+ QTest::ignoreMessage(QtWarningMsg, "QDir::remove: Empty or null file name");
+ QVERIFY(!dir.remove(""));
}
void tst_QDir::rename()
@@ -1159,10 +1228,18 @@ void tst_QDir::rename()
QVERIFY(dir.rename("rename-test-renamed", "rename-test"));
#if defined(Q_OS_MAC)
QVERIFY(!dir.rename("rename-test", "/etc/rename-test-renamed"));
-#elif !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
- // on windows/symbian this is possible - maybe make the test a bit better
+#elif defined(Q_OS_SYMBIAN)
+ QVERIFY(!dir.rename("rename-test", "/resource/rename-test-renamed"));
+#elif !defined(Q_OS_WIN)
+ // on windows this is possible - maybe make the test a bit better
QVERIFY(!dir.rename("rename-test", "/rename-test-renamed"));
#endif
+ QTest::ignoreMessage(QtWarningMsg, "QDir::rename: Empty or null file name(s)");
+ QVERIFY(!dir.rename("rename-test", ""));
+ QTest::ignoreMessage(QtWarningMsg, "QDir::rename: Empty or null file name(s)");
+ QVERIFY(!dir.rename("", "rename-test-renamed"));
+ QVERIFY(!dir.rename("some-file-that-does-not-exist", "rename-test-renamed"));
+
QVERIFY(dir.remove("rename-test"));
}
@@ -1236,12 +1313,13 @@ void tst_QDir::dotAndDotDot()
{
#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
QSKIP("WinCE and Symbian do not have . nor ..", SkipAll);
-#endif
+#else
QDir dir(QString(SRCDIR "testdir/"));
QStringList entryList = dir.entryList(QDir::Dirs);
QCOMPARE(entryList, QStringList() << QString(".") << QString("..") << QString("dir") << QString("spaces"));
entryList = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
QCOMPARE(entryList, QStringList() << QString("dir") << QString("spaces"));
+#endif
}
#ifdef QT3_SUPPORT
@@ -1396,6 +1474,29 @@ void tst_QDir::searchPaths()
for (int i = 0; i < searchPathPrefixList.count(); ++i) {
QVERIFY(QDir::searchPaths(searchPathPrefixList.at(i)).isEmpty());
}
+
+ for (int i = 0; i < searchPathPrefixList.count(); ++i) {
+ foreach (QString path, searchPathsList.at(i).split(",")) {
+ QDir::addSearchPath(searchPathPrefixList.at(i), path);
+ }
+ }
+ for (int i = 0; i < searchPathPrefixList.count(); ++i) {
+ QVERIFY(QDir::searchPaths(searchPathPrefixList.at(i)) == searchPathsList.at(i).split(","));
+ }
+
+ QCOMPARE(QFile(filename).exists(), exists);
+ QCOMPARE(QFileInfo(filename).exists(), exists);
+
+ if (exists) {
+ QCOMPARE(QFileInfo(filename).absoluteFilePath(), expectedAbsolutePath);
+ }
+
+ for (int i = 0; i < searchPathPrefixList.count(); ++i) {
+ QDir::setSearchPaths(searchPathPrefixList.at(i), QStringList());
+ }
+ for (int i = 0; i < searchPathPrefixList.count(); ++i) {
+ QVERIFY(QDir::searchPaths(searchPathPrefixList.at(i)).isEmpty());
+ }
}
void tst_QDir::entryListWithSearchPaths()
@@ -1640,6 +1741,250 @@ void tst_QDir::detachingOperations()
QCOMPARE(dir1.sorting(), sorting);
}
+void tst_QDir::testCaching()
+{
+ QString dirName = QString::fromLatin1("testCaching");
+ QDir::current().rmdir(dirName); // cleanup a previous run.
+ QDir dir(dirName);
+ QVERIFY(!dir.exists());
+ QDir::current().mkdir(dirName);
+ QVERIFY(QDir(dirName).exists()); // dir exists
+ QVERIFY(dir.exists()); // QDir doesn't cache the 'exist' between calls.
+}
+
+void tst_QDir::isRoot_data()
+{
+ QTest::addColumn<QString>("path");
+ QTest::addColumn<bool>("isRoot");
+
+ QString test = QDir::rootPath();
+ QTest::newRow(QString("rootPath " + test).toLatin1()) << test << true;
+ test = QDir::rootPath().append("./");
+ QTest::newRow(QString("./ appended " + test).toLatin1()) << test << false;
+
+ test = QDir(QDir::rootPath().append("./")).canonicalPath();
+#ifdef Q_OS_MAC
+ // On Mac OS X 10.5 and earlier, canonicalPath depends on cleanPath which
+ // is itself very broken and fundamentally wrong on "/./", which this would
+ // exercise
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6)
+#endif
+ QTest::newRow(QString("canonicalPath " + test).toLatin1()) << test << true;
+
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ test = QDir::rootPath().left(2);
+ QTest::newRow(QString("drive relative " + test).toLatin1()) << test << false;
+#endif
+
+ QTest::newRow("resources root") << ":/" << true;
+ QTest::newRow("resources nonroot") << ":/entrylist" << false;
+}
+
+void tst_QDir::isRoot()
+{
+ QFETCH(QString, path);
+ QFETCH(bool, isRoot);
+
+ QDir dir(path);
+ QCOMPARE(dir.isRoot(),isRoot);
+}
+
+#ifndef QT_NO_REGEXP
+void tst_QDir::match_data()
+{
+ QTest::addColumn<QString>("filter");
+ QTest::addColumn<QString>("filename");
+ QTest::addColumn<bool>("match");
+
+ QTest::newRow("single, matching") << "*.cpp" << "tst_qdir.cpp" << true;
+ QTest::newRow("single, not matching") << "*.cpp" << "tst_qdir.h" << false;
+ QTest::newRow("multi, matching") << "*.cpp;*.h" << "tst_qdir.cpp" << true;
+ QTest::newRow("multi, matching2") << "*.cpp;*.h" << "tst_qdir.h" << true;
+ QTest::newRow("multi, not matching") << "*.cpp;*.h" << "readme.txt" << false;
+}
+
+void tst_QDir::match()
+{
+ QFETCH(QString, filter);
+ QFETCH(QString, filename);
+ QFETCH(bool, match);
+
+ QCOMPARE(QDir::match(filter, filename), match);
+ QCOMPARE(QDir::match(filter.split(QLatin1Char(';')), filename), match);
+}
+#endif
+
+void tst_QDir::drives()
+{
+ QFileInfoList list(QDir::drives());
+#if defined(Q_OS_WIN)
+ QVERIFY(list.count() >= 1); //system
+ QLatin1Char systemdrive('c');
+#elif defined(Q_OS_SYMBIAN)
+ QVERIFY(list.count() >= 2); //system, rom
+ QLatin1Char romdrive('z');
+ QLatin1Char systemdrive('a' + int(RFs::GetSystemDrive()));
+#endif
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ QVERIFY(list.count() <= 26);
+ bool foundsystem = false;
+#ifdef Q_OS_SYMBIAN
+ bool foundrom = false;
+#endif
+ foreach (QFileInfo fi, list) {
+ QCOMPARE(fi.absolutePath().size(), 3); //"x:/"
+ QCOMPARE(fi.absolutePath().at(1), QChar(QLatin1Char(':')));
+ QCOMPARE(fi.absolutePath().at(2), QChar(QLatin1Char('/')));
+ if (fi.absolutePath().at(0).toLower() == systemdrive)
+ foundsystem = true;
+#ifdef Q_OS_SYMBIAN
+ if (fi.absolutePath().at(0).toLower() == romdrive)
+ foundrom = true;
+#endif
+ }
+ QCOMPARE(foundsystem, true);
+#ifdef Q_OS_SYMBIAN
+ QCOMPARE(foundrom, true);
+#endif
+#else
+ QCOMPARE(list.count(), 1); //root
+ QCOMPARE(list.at(0).absolutePath(), QLatin1String("/"));
+#endif
+}
+
+void tst_QDir::arrayOperator()
+{
+ QDir dir1(SRCDIR "entrylist/");
+ QDir dir2(SRCDIR "entrylist/");
+
+ QStringList entries(dir1.entryList());
+ int i = dir2.count();
+ QCOMPARE(i, entries.count());
+ --i;
+ for (;i>=0;--i) {
+ QCOMPARE(dir2[i], entries.at(i));
+ }
+}
+
+#ifdef QT3_SUPPORT
+void tst_QDir::setNameFilter()
+{
+ QStringList filters;
+ filters << "*.jpg" << "*.png" << "*.gif";
+ QStringList filters2;
+ filters2 << "*.cpp" << "*.h" << "*.c";
+
+ QDir dir(SRCDIR "entrylist/");
+
+ dir.setNameFilter(filters.join(";"));
+ QCOMPARE(filters, dir.nameFilters());
+ QCOMPARE(filters, dir.nameFilter().split(';'));
+
+ dir.setNameFilters(filters2);
+ QCOMPARE(filters2, dir.nameFilter().split(';'));
+
+ dir.setNameFilter(filters.join(" "));
+ QCOMPARE(filters, dir.nameFilters());
+ QCOMPARE(filters, dir.nameFilter().split(' '));
+
+ dir.setNameFilters(filters2);
+ QCOMPARE(filters2, dir.nameFilter().split(' '));
+}
+#endif
+
+void tst_QDir::equalityOperator_data()
+{
+ QTest::addColumn<QString>("leftPath");
+ QTest::addColumn<QString>("leftNameFilters");
+ QTest::addColumn<int>("leftSort");
+ QTest::addColumn<int>("leftFilters");
+ QTest::addColumn<QString>("rightPath");
+ QTest::addColumn<QString>("rightNameFilters");
+ QTest::addColumn<int>("rightSort");
+ QTest::addColumn<int>("rightFilters");
+ QTest::addColumn<bool>("expected");
+
+ QTest::newRow("same") << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Files)
+ << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Files)
+ << true;
+
+ QTest::newRow("relativepaths") << "entrylist/" << "*.cpp" << int(QDir::Name) << int(QDir::Files)
+ << "./entrylist" << "*.cpp" << int(QDir::Name) << int(QDir::Files)
+ << true;
+
+ QTest::newRow("diff-filters") << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Files)
+ << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Dirs)
+ << false;
+
+ QTest::newRow("diff-sort") << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Files)
+ << SRCDIR << "*.cpp" << int(QDir::Time) << int(QDir::Files)
+ << false;
+
+ QTest::newRow("diff-namefilters") << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Files)
+ << SRCDIR << "*.jpg" << int(QDir::Name) << int(QDir::Files)
+ << false;
+}
+
+void tst_QDir::equalityOperator()
+{
+ QFETCH(QString, leftPath);
+ QFETCH(QString, leftNameFilters);
+ QFETCH(int, leftSort);
+ QFETCH(int, leftFilters);
+ QFETCH(QString, rightPath);
+ QFETCH(QString, rightNameFilters);
+ QFETCH(int, rightSort);
+ QFETCH(int, rightFilters);
+ QFETCH(bool, expected);
+
+ QDir dir1(leftPath, leftNameFilters, QDir::SortFlags(leftSort), QDir::Filters(leftFilters));
+ QDir dir2(rightPath, rightNameFilters, QDir::SortFlags(rightSort), QDir::Filters(rightFilters));
+
+ QCOMPARE((dir1 == dir2), expected);
+ QCOMPARE((dir2 == dir1), expected);
+ QCOMPARE((dir1 != dir2), !expected);
+ QCOMPARE((dir2 != dir1), !expected);
+}
+
+void tst_QDir::isRelative_data()
+{
+ QTest::addColumn<QString>("path");
+ QTest::addColumn<bool>("relative");
+
+ QTest::newRow(".") << "./" << true;
+ QTest::newRow("..") << "../" << true;
+ QTest::newRow("content") << "entrylist/" << true;
+ QTest::newRow("current") << QDir::currentPath() << false;
+ QTest::newRow("homepath") << QDir::homePath() << false;
+ QTest::newRow("temppath") << QDir::tempPath() << false;
+ QTest::newRow("rootpath") << QDir::rootPath() << false;
+ foreach (QFileInfo root, QDir::drives()) {
+ QTest::newRow(root.absolutePath().toLocal8Bit()) << root.absolutePath() << false;
+ }
+}
+
+void tst_QDir::isRelative()
+{
+ QFETCH(QString, path);
+ QFETCH(bool, relative);
+
+ QCOMPARE(QDir(path).isRelative(), relative);
+}
+
+void tst_QDir::isReadable()
+{
+ QDir dir;
+
+ QVERIFY(dir.isReadable());
+#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN)
+ QVERIFY(dir.mkdir("nonreadabledir"));
+ QVERIFY(0 == ::chmod("nonreadabledir", 0));
+ QVERIFY(!QDir("nonreadabledir").isReadable());
+ QVERIFY(0 == ::chmod("nonreadabledir", S_IRUSR | S_IWUSR | S_IXUSR));
+ QVERIFY(dir.rmdir("nonreadabledir"));
+#endif
+}
+
QTEST_MAIN(tst_QDir)
#include "tst_qdir.moc"
diff --git a/tests/auto/qdiriterator/qdiriterator.pro b/tests/auto/qdiriterator/qdiriterator.pro
index d60b52d911..0807a18f8f 100644
--- a/tests/auto/qdiriterator/qdiriterator.pro
+++ b/tests/auto/qdiriterator/qdiriterator.pro
@@ -3,10 +3,6 @@ SOURCES += tst_qdiriterator.cpp
RESOURCES += qdiriterator.qrc
QT = core
-wince*|symbian: {
- addFiles.sources = entrylist recursiveDirs foo
- addFiles.path = .
- DEPLOYMENT += addFiles
wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1
-}
+CONFIG += parallel_test
diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp
index f7666dccfe..bdf0c3b32e 100644
--- a/tests/auto/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp
@@ -53,10 +53,14 @@
#endif
#if defined(Q_OS_SYMBIAN)
-// Open C in Symbian doesn't support symbolic links to directories
+#define Q_NO_SYMLINKS
#define Q_NO_SYMLINKS_TO_DIRS
#endif
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#include "../network-settings.h"
+#endif
+
Q_DECLARE_METATYPE(QDirIterator::IteratorFlags)
Q_DECLARE_METATYPE(QDir::Filters)
@@ -118,6 +122,10 @@ private slots:
void longPath();
void task185502_dirorder();
void relativePaths();
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ void uncPaths_data();
+ void uncPaths();
+#endif
};
tst_QDirIterator::tst_QDirIterator()
@@ -147,6 +155,8 @@ tst_QDirIterator::tst_QDirIterator()
createDirectory("foo/bar");
createFile("foo/bar/readme.txt");
+ createDirectory("empty");
+
#ifndef Q_NO_SYMLINKS
# if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
// ### Sadly, this is a platform difference right now.
@@ -288,6 +298,20 @@ void tst_QDirIterator::iterateRelativeDirectory_data()
#endif
"entrylist/directory/dummy,"
"entrylist/writable").split(',');
+
+ QTest::newRow("empty, default")
+ << QString("empty") << QDirIterator::IteratorFlags(0)
+ << QDir::Filters(QDir::NoFilter) << QStringList("*")
+#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE)
+ << QStringList();
+#else
+ << QString("empty/.,empty/..").split(',');
+#endif
+
+ QTest::newRow("empty, QDir::NoDotAndDotDot")
+ << QString("empty") << QDirIterator::IteratorFlags(0)
+ << QDir::Filters(QDir::NoDotAndDotDot) << QStringList("*")
+ << QStringList();
}
void tst_QDirIterator::iterateRelativeDirectory()
@@ -532,6 +556,28 @@ void tst_QDirIterator::relativePaths()
}
}
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+void tst_QDirIterator::uncPaths_data()
+{
+ QTest::addColumn<QString>("dirName");
+ QTest::newRow("uncserver")
+ <<QString("//" + QtNetworkSettings::winServerName());
+ QTest::newRow("uncserver/testshare")
+ <<QString("//" + QtNetworkSettings::winServerName() + "/testshare");
+ QTest::newRow("uncserver/testshare/tmp")
+ <<QString("//" + QtNetworkSettings::winServerName() + "/testshare/tmp");
+}
+void tst_QDirIterator::uncPaths()
+{
+ QFETCH(QString, dirName);
+ QDirIterator iterator(dirName, QDir::AllEntries|QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
+ while(iterator.hasNext()) {
+ iterator.next();
+ QCOMPARE(iterator.filePath(), QDir::cleanPath(iterator.filePath()));
+ }
+}
+#endif
+
QTEST_MAIN(tst_QDirIterator)
#include "tst_qdiriterator.moc"
diff --git a/tests/auto/qdirmodel/qdirmodel.pro b/tests/auto/qdirmodel/qdirmodel.pro
index 36929b9399..7037a79934 100644
--- a/tests/auto/qdirmodel/qdirmodel.pro
+++ b/tests/auto/qdirmodel/qdirmodel.pro
@@ -2,11 +2,11 @@ load(qttest_p4)
SOURCES += tst_qdirmodel.cpp
wince*|symbian {
- addit.sources = dirtest\\test1\\*
+ addit.files = dirtest\\test1\\*
addit.path = dirtest\\test1
- tests.sources = test\\*
+ tests.files = test\\*
tests.path = test
- sourceFile.sources = tst_qdirmodel.cpp
+ sourceFile.files = tst_qdirmodel.cpp
sourceFile.path = .
DEPLOYMENT += addit tests sourceFile
}
diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp
index 963f68d9b5..38a6b8acdb 100644
--- a/tests/auto/qdirmodel/tst_qdirmodel.cpp
+++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp
@@ -583,19 +583,15 @@ void tst_QDirModel::unreadable()
void tst_QDirModel::filePath()
{
+#ifdef Q_OS_SYMBIAN
+ QSKIP("OS doesn't support symbolic links", SkipAll);
+#else
QFile::remove(SRCDIR "test.lnk");
QVERIFY(QFile(SRCDIR "tst_qdirmodel.cpp").link(SRCDIR "test.lnk"));
QDirModel model;
model.setResolveSymlinks(false);
QModelIndex index = model.index(SRCDIR "test.lnk");
QVERIFY(index.isValid());
-#if defined(Q_OS_SYMBIAN)
- // Since model will force lowercase path in Symbian, make case insensitive compare
- // Note: Windows should fail this, too, if test path has any uppercase letters.
- QCOMPARE(model.filePath(index).toLower(), QString(SRCDIR).toLower() + "test.lnk");
- model.setResolveSymlinks(true);
- QCOMPARE(model.filePath(index).toLower(), QString(SRCDIR).toLower() + "tst_qdirmodel.cpp");
-#else
#ifndef Q_OS_WINCE
QString path = SRCDIR;
#else
@@ -604,8 +600,8 @@ void tst_QDirModel::filePath()
QCOMPARE(model.filePath(index), path + QString( "test.lnk"));
model.setResolveSymlinks(true);
QCOMPARE(model.filePath(index), path + QString( "tst_qdirmodel.cpp"));
-#endif
QFile::remove(SRCDIR "test.lnk");
+#endif
}
void tst_QDirModel::task196768_sorting()
@@ -613,11 +609,6 @@ void tst_QDirModel::task196768_sorting()
//this task showed that the persistent model indexes got corrupted when sorting
QString path = SRCDIR;
-#ifdef Q_OS_SYMBIAN
- if(!RProcess().HasCapability(ECapabilityAllFiles))
- QEXPECT_FAIL("", "QTBUG-9746", Continue);
-#endif
-
QDirModel model;
/* QDirModel has a bug if we show the content of the subdirectory inside a hidden directory
@@ -637,6 +628,11 @@ void tst_QDirModel::task196768_sorting()
QCOMPARE(index.data(), index2.data());
view.setSortingEnabled(true);
index2 = model.index(path);
+
+#ifdef Q_OS_SYMBIAN
+ if(!RProcess().HasCapability(ECapabilityAllFiles))
+ QEXPECT_FAIL("", "QTBUG-9746", Continue);
+#endif
QCOMPARE(index.data(), index2.data());
}
diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro
index 9040b91d6d..0a3c167a4b 100644
--- a/tests/auto/qdom/qdom.pro
+++ b/tests/auto/qdom/qdom.pro
@@ -5,7 +5,7 @@ QT = core xml
QT -= gui
wince*|symbian: {
- addFiles.sources = testdata doubleNamespaces.xml umlaut.xml
+ addFiles.files = testdata doubleNamespaces.xml umlaut.xml
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qeasingcurve/qeasingcurve.pro b/tests/auto/qeasingcurve/qeasingcurve.pro
index 2b66081914..2a3a075d8a 100644
--- a/tests/auto/qeasingcurve/qeasingcurve.pro
+++ b/tests/auto/qeasingcurve/qeasingcurve.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
QT = core
SOURCES += tst_qeasingcurve.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qelapsedtimer/qelapsedtimer.pro b/tests/auto/qelapsedtimer/qelapsedtimer.pro
index ed752284ec..876887678f 100644
--- a/tests/auto/qelapsedtimer/qelapsedtimer.pro
+++ b/tests/auto/qelapsedtimer/qelapsedtimer.pro
@@ -11,3 +11,4 @@ wince* {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+CONFIG += parallel_test
diff --git a/tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp b/tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp
index e44ba96524..6e83647a0c 100644
--- a/tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp
+++ b/tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp
@@ -122,11 +122,13 @@ void tst_QElapsedTimer::basics()
quint64 value1 = t1.msecsSinceReference();
qDebug() << value1 << t1;
+ qint64 nsecs = t1.nsecsElapsed();
qint64 elapsed = t1.restart();
QVERIFY(elapsed < minResolution);
+ QVERIFY(nsecs / 1000000 < minResolution);
quint64 value2 = t1.msecsSinceReference();
- qDebug() << value2 << t1 << elapsed;
+ qDebug() << value2 << t1 << elapsed << nsecs;
// in theory, elapsed == value2 - value1
// However, since QElapsedTimer keeps internally the full resolution,
@@ -150,7 +152,10 @@ void tst_QElapsedTimer::elapsed()
// don't check: t1.secsTo(t2)
// QVERIFY(t1 - t2 < 0);
+ QVERIFY(t1.nsecsElapsed() > 0);
QVERIFY(t1.elapsed() > 0);
+ // the number of elapsed nanoseconds and milliseconds should match
+ QVERIFY(t1.nsecsElapsed() - t1.elapsed() * 1000000 < 1000000);
QVERIFY(t1.hasExpired(minResolution));
QVERIFY(!t1.hasExpired(8*minResolution));
QVERIFY(!t2.hasExpired(minResolution));
diff --git a/tests/auto/qevent/qevent.pro b/tests/auto/qevent/qevent.pro
index 5c142996f1..6042b6cdc9 100644
--- a/tests/auto/qevent/qevent.pro
+++ b/tests/auto/qevent/qevent.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qevent.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro b/tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro
index 8a45aa27b2..cf574ffc40 100644
--- a/tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro
+++ b/tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qexplicitlyshareddatapointer.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qfile/largefile/largefile.pro b/tests/auto/qfile/largefile/largefile.pro
index d67cb46fad..6407cb6b3e 100644
--- a/tests/auto/qfile/largefile/largefile.pro
+++ b/tests/auto/qfile/largefile/largefile.pro
@@ -4,3 +4,5 @@ QT = core
SOURCES += tst_largefile.cpp
wince*: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp
+
+CONFIG += parallel_test
diff --git a/tests/auto/qfile/qfile.pro b/tests/auto/qfile/qfile.pro
index 727f660b30..f41d32789a 100644
--- a/tests/auto/qfile/qfile.pro
+++ b/tests/auto/qfile/qfile.pro
@@ -7,3 +7,4 @@ wince*|symbian:{
!symbian:SUBDIRS += largefile
+CONFIG += parallel_test
diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro
index 70c93ce2fb..c0049b025d 100644
--- a/tests/auto/qfile/test/test.pro
+++ b/tests/auto/qfile/test/test.pro
@@ -3,14 +3,14 @@ SOURCES += ../tst_qfile.cpp
wince*|symbian {
QT = core gui
- files.sources += ..\\dosfile.txt ..\\noendofline.txt ..\\testfile.txt \
+ files.files += ..\\dosfile.txt ..\\noendofline.txt ..\\testfile.txt \
..\\testlog.txt ..\\two.dots.file ..\\tst_qfile.cpp \
..\\Makefile ..\\forCopying.txt ..\\forRenaming.txt
files.path = .
- resour.sources += ..\\resources\\file1.ext1
+ resour.files += ..\\resources\\file1.ext1
resour.path = resources
- DEPLOYMENT = files resour
+ DEPLOYMENT += files resour
}
wince* {
@@ -37,4 +37,6 @@ win32 {
LIBS+=-lole32 -luuid
}
-
+symbian {
+ LIBS+=-lefsrv
+}
diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp
index 3dccc4990b..79539c9e33 100644
--- a/tests/auto/qfile/tst_qfile.cpp
+++ b/tests/auto/qfile/tst_qfile.cpp
@@ -70,9 +70,12 @@
#elif defined(Q_OS_WINCE)
# include <qplatformdefs.h>
# include <private/qfsfileengine_p.h>
+#elif defined(Q_OS_SYMBIAN)
+# include <f32file.h>
#endif
#include <stdio.h>
+#include <errno.h>
#include "../network-settings.h"
#if defined(Q_OS_SYMBIAN)
@@ -170,6 +173,7 @@ private slots:
void encodeName();
void truncate();
void seekToPos();
+ void seekAfterEndOfFile();
void FILEReadWrite();
void i18nFileName_data();
void i18nFileName();
@@ -210,6 +214,18 @@ private slots:
void openStandardStreams();
+ void resize_data();
+ void resize();
+
+ void objectConstructors();
+#ifdef Q_OS_SYMBIAN
+ void platformSecurity_data();
+ void platformSecurity();
+#endif
+ void caseSensitivity();
+
+ void autocloseHandle();
+
// --- Task related tests below this line
void task167217();
@@ -222,12 +238,20 @@ public:
void invalidFile();
private:
- enum FileType { OpenQFile, OpenFd, OpenStream };
+ enum FileType {
+ OpenQFile,
+ OpenFd,
+ OpenStream,
+#ifdef Q_OS_SYMBIAN
+ OpenRFile,
+#endif
+ NumberOfFileTypes
+ };
void openStandardStreamsFileDescriptors();
void openStandardStreamsBufferedStreams();
- bool openFd(QFile &file, QIODevice::OpenMode mode)
+ bool openFd(QFile &file, QIODevice::OpenMode mode, QFile::FileHandleFlags handleFlags)
{
int fdMode = QT_OPEN_LARGEFILE | QT_OPEN_BINARY;
@@ -239,10 +263,10 @@ private:
fd_ = QT_OPEN(qPrintable(file.fileName()), fdMode);
- return (-1 != fd_) && file.open(fd_, mode);
+ return (-1 != fd_) && file.open(fd_, mode, handleFlags);
}
- bool openStream(QFile &file, QIODevice::OpenMode mode)
+ bool openStream(QFile &file, QIODevice::OpenMode mode, QFile::FileHandleFlags handleFlags)
{
char const *streamMode = "";
@@ -254,10 +278,37 @@ private:
stream_ = QT_FOPEN(qPrintable(file.fileName()), streamMode);
- return stream_ && file.open(stream_, mode);
+ return stream_ && file.open(stream_, mode, handleFlags);
+ }
+
+#ifdef Q_OS_SYMBIAN
+ bool openRFile(QFile &file, QIODevice::OpenMode mode, QFile::FileHandleFlags handleFlags)
+ {
+ //connect file server first time
+ if (!rfs_.Handle() && rfs_.Connect() != KErrNone)
+ return false;
+ //symbian does not like ./ in filenames, so open by absolute path
+ QString fileName(QDir::toNativeSeparators(QFileInfo(file).absoluteFilePath()));
+ TPtrC fn(fileName.utf16(), fileName.length());
+ TInt smode = 0;
+ if (mode & QIODevice::WriteOnly)
+ smode |= EFileWrite;
+ if (mode & QIODevice::ReadOnly)
+ smode |= EFileRead;
+ TInt r;
+ if ((mode & QIODevice::Truncate) || (!(mode & QIODevice::ReadOnly) && !(mode & QIODevice::Append))) {
+ r = rfile_.Replace(rfs_, fn, smode);
+ } else {
+ r = rfile_.Open(rfs_, fn, smode);
+ if (r == KErrNotFound && (mode & QIODevice::WriteOnly)) {
+ r = rfile_.Create(rfs_, fn, smode);
+ }
+ }
+ return (r == KErrNone) && file.open(rfile_, mode, handleFlags);
}
+#endif
- bool openFile(QFile &file, QIODevice::OpenMode mode, FileType type = OpenQFile)
+ bool openFile(QFile &file, QIODevice::OpenMode mode, FileType type = OpenQFile, QFile::FileHandleFlags handleFlags = QFile::DontCloseHandle)
{
if (mode & QIODevice::WriteOnly && !file.exists())
{
@@ -274,10 +325,14 @@ private:
return file.open(mode);
case OpenFd:
- return openFd(file, mode);
+ return openFd(file, mode, handleFlags);
case OpenStream:
- return openStream(file, mode);
+ return openStream(file, mode, handleFlags);
+#ifdef Q_OS_SYMBIAN
+ case OpenRFile:
+ return openRFile(file, mode, handleFlags);
+#endif
}
return false;
@@ -291,6 +346,10 @@ private:
QT_CLOSE(fd_);
if (stream_)
::fclose(stream_);
+#ifdef Q_OS_SYMBIAN
+ if (rfile_.SubSessionHandle())
+ rfile_.Close();
+#endif
fd_ = -1;
stream_ = 0;
@@ -298,6 +357,10 @@ private:
int fd_;
FILE *stream_;
+#ifdef Q_OS_SYMBIAN
+ RFs rfs_;
+ RFile rfile_;
+#endif
};
tst_QFile::tst_QFile()
@@ -394,6 +457,7 @@ void tst_QFile::cleanupTestCase()
QFile::remove("qfile_map_testfile");
QFile::remove("readAllBuffer.txt");
QFile::remove("qt_file.tmp");
+ QFile::remove("File.txt");
}
//------------------------------------------
@@ -402,7 +466,7 @@ void tst_QFile::cleanupTestCase()
// attributes and the contents itself
// will be changed as far as we have a
// proper way to handle files in the
-// testing enviroment.
+// testing environment.
//------------------------------------------
void tst_QFile::exists()
@@ -1108,6 +1172,7 @@ void tst_QFile::permissions()
QFETCH(bool, expected);
QFile f(file);
QCOMPARE(((f.permissions() & perms) == QFile::Permissions(perms)), expected);
+ QCOMPARE(((QFile::permissions(file) & perms) == QFile::Permissions(perms)), expected);
}
void tst_QFile::setPermissions()
@@ -1285,17 +1350,32 @@ static QString getWorkingDirectoryForLink(const QString &linkFileName)
void tst_QFile::link()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian does not support links", SkipAll);
+#endif
QFile::remove("myLink.lnk");
- QFileInfo info1("tst_qfile.cpp");
- QVERIFY(QFile::link("tst_qfile.cpp", "myLink.lnk"));
+
+ QFileInfo info1(SRCDIR "tst_qfile.cpp");
+ QString referenceTarget = QDir::cleanPath(info1.absoluteFilePath());
+
+ QVERIFY(QFile::link(SRCDIR "tst_qfile.cpp", "myLink.lnk"));
+
QFileInfo info2("myLink.lnk");
QVERIFY(info2.isSymLink());
- QCOMPARE(info2.symLinkTarget(), info1.absoluteFilePath());
+ QCOMPARE(info2.symLinkTarget(), referenceTarget);
+
+ QFile link("myLink.lnk");
+ QVERIFY(link.open(QIODevice::ReadOnly));
+ QCOMPARE(link.symLinkTarget(), referenceTarget);
+ link.close();
+
+ QCOMPARE(QFile::symLinkTarget("myLink.lnk"), referenceTarget);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
QString wd = getWorkingDirectoryForLink(info2.absoluteFilePath());
- QCOMPARE(QDir::fromNativeSeparators(wd), info1.absolutePath());
+ QCOMPARE(QDir::fromNativeSeparators(wd), QDir::cleanPath(info1.absolutePath()));
#endif
+
QVERIFY(QFile::remove(info2.absoluteFilePath()));
}
@@ -1324,6 +1404,9 @@ void tst_QFile::linkToDir()
void tst_QFile::absolutePathLinkToRelativePath()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian does not support links", SkipAll);
+#endif
QFile::remove("myDir/test.txt");
QFile::remove("myDir/myLink.lnk");
QDir dir;
@@ -1346,6 +1429,9 @@ void tst_QFile::absolutePathLinkToRelativePath()
void tst_QFile::readBrokenLink()
{
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian does not support links", SkipAll);
+#endif
QFile::remove("myLink2.lnk");
QFileInfo info1("file12");
#if defined(Q_OS_SYMBIAN)
@@ -1635,10 +1721,40 @@ void tst_QFile::seekToPos()
}
+void tst_QFile::seekAfterEndOfFile()
+{
+ QLatin1String filename("seekAfterEof.dat");
+ QFile::remove(filename);
+ {
+ QFile file(filename);
+ QVERIFY(file.open(QFile::WriteOnly));
+ file.write("abcd");
+ QCOMPARE(file.size(), qint64(4));
+ file.seek(8);
+ file.write("ijkl");
+ QCOMPARE(file.size(), qint64(12));
+ file.seek(4);
+ file.write("efgh");
+ QCOMPARE(file.size(), qint64(12));
+ file.seek(16);
+ file.write("----");
+ QCOMPARE(file.size(), qint64(20));
+ file.flush();
+ }
+
+ QFile file(filename);
+ QVERIFY(file.open(QFile::ReadOnly));
+ QByteArray contents = file.readAll();
+ QCOMPARE(contents.left(12), QByteArray("abcdefghijkl", 12));
+ //bytes 12-15 are uninitialised so we don't care what they read as.
+ QCOMPARE(contents.mid(16), QByteArray("----", 4));
+ file.close();
+ QFile::remove(filename);
+}
void tst_QFile::FILEReadWrite()
{
- // Tests modifing a file. First creates it then reads in 4 bytes and then overwrites these
+ // Tests modifying a file. First creates it then reads in 4 bytes and then overwrites these
// 4 bytes with new values. At the end check to see the file contains the new values.
QFile::remove("FILEReadWrite.txt");
@@ -2150,6 +2266,9 @@ void tst_QFile::writeLargeDataBlock_data()
QTest::newRow("localfile-QFile") << "./largeblockfile.txt" << (int)OpenQFile;
QTest::newRow("localfile-Fd") << "./largeblockfile.txt" << (int)OpenFd;
QTest::newRow("localfile-Stream") << "./largeblockfile.txt" << (int)OpenStream;
+#ifdef Q_OS_SYMBIAN
+ QTest::newRow("localfile-RFile") << "./largeblockfile.txt" << (int)OpenRFile;
+#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// Some semi-randomness to avoid collisions.
@@ -2494,10 +2613,11 @@ void tst_QFile::standarderror()
void tst_QFile::handle()
{
-#ifndef Q_OS_WINCE
+ int fd;
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
QFile file(SRCDIR "tst_qfile.cpp");
QVERIFY(file.open(QIODevice::ReadOnly));
- int fd = int(file.handle());
+ fd = int(file.handle());
QVERIFY(fd > 2);
QCOMPARE(int(file.handle()), fd);
char c = '\0';
@@ -2524,6 +2644,7 @@ void tst_QFile::handle()
QCOMPARE(c, '*');
#endif
+ //test round trip of adopted stdio file handle
QFile file2;
FILE *fp = fopen(SRCDIR "tst_qfile.cpp", "r");
file2.open(fp, QIODevice::ReadOnly);
@@ -2531,6 +2652,7 @@ void tst_QFile::handle()
QCOMPARE(int(file2.handle()), int(fileno(fp)));
fclose(fp);
+ //test round trip of adopted posix file handle
#ifdef Q_OS_UNIX
QFile file3;
fd = QT_OPEN(SRCDIR "tst_qfile.cpp", QT_OPEN_RDONLY);
@@ -2542,6 +2664,9 @@ void tst_QFile::handle()
void tst_QFile::nativeHandleLeaks()
{
+#ifdef Q_OS_SYMBIAN
+ QSKIP("test assumptions invalid for symbian", SkipAll);
+#else
int fd1, fd2;
#ifdef Q_OS_WIN
@@ -2583,6 +2708,7 @@ void tst_QFile::nativeHandleLeaks()
#ifdef Q_OS_WIN
QCOMPARE( handle2, handle1 );
#endif
+#endif
}
void tst_QFile::readEof_data()
@@ -2898,6 +3024,7 @@ void tst_QFile::mapOpenMode()
{
QFETCH(int, openMode);
static const qint64 fileSize = 4096;
+
QByteArray pattern(fileSize, 'A');
QString fileName = QDir::currentPath() + '/' + "qfile_map_testfile";
@@ -3028,7 +3155,7 @@ void tst_QFile::openStandardStreams()
void tst_QFile::writeNothing()
{
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < NumberOfFileTypes; ++i) {
QFile file("file.txt");
QVERIFY( openFile(file, QIODevice::WriteOnly | QIODevice::Unbuffered, FileType(i)) );
QVERIFY( 0 == file.write((char *)0, 0) );
@@ -3037,5 +3164,236 @@ void tst_QFile::writeNothing()
}
}
+void tst_QFile::resize_data()
+{
+ QTest::addColumn<int>("filetype");
+
+ QTest::newRow("native") << int(OpenQFile);
+ QTest::newRow("fileno") << int(OpenFd);
+ QTest::newRow("stream") << int(OpenStream);
+#ifdef Q_OS_SYMBIAN
+ QTest::newRow("rfile") << int(OpenRFile);
+#endif
+}
+
+void tst_QFile::resize()
+{
+ QFETCH(int, filetype);
+ QString filename(QLatin1String("file.txt"));
+ QFile file(filename);
+ QVERIFY(openFile(file, QIODevice::ReadWrite, FileType(filetype)));
+ QVERIFY(file.resize(8));
+ QCOMPARE(file.size(), qint64(8));
+ closeFile(file);
+ QFile::resize(filename, 4);
+ QCOMPARE(QFileInfo(filename).size(), qint64(4));
+ QVERIFY(QFile::remove(filename));
+}
+
+void tst_QFile::objectConstructors()
+{
+ QObject ob;
+ QFile* file1 = new QFile(SRCDIR "testfile.txt", &ob);
+ QFile* file2 = new QFile(&ob);
+ QVERIFY(file1->exists());
+ QVERIFY(!file2->exists());
+}
+
+#ifdef Q_OS_SYMBIAN
+void tst_QFile::platformSecurity_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<bool>("readable");
+ QTest::addColumn<bool>("writable");
+
+ QString selfname = QCoreApplication::applicationFilePath();
+ QString ownprivate = QCoreApplication::applicationDirPath();
+ QString owndrive = selfname.left(2);
+ bool amiprivileged = RProcess().HasCapability(ECapabilityAllFiles);
+ QTest::newRow("resource") << owndrive + "/resource/apps/tst_qfile.rsc" << true << amiprivileged;
+ QTest::newRow("sys") << selfname << amiprivileged << false;
+ QTest::newRow("own private") << ownprivate + "/testfile.txt" << true << true;
+ QTest::newRow("other private") << owndrive + "/private/10003a3f/import/apps/tst_qfile_reg.rsc" << amiprivileged << amiprivileged;
+}
+
+void tst_QFile::platformSecurity()
+{
+ QFETCH(QString,file);
+ QFETCH(bool,readable);
+ QFETCH(bool,writable);
+
+ {
+ QFile f(file);
+ QCOMPARE(f.open(QIODevice::ReadOnly), readable);
+ }
+
+ {
+ QFile f(file);
+ QCOMPARE(f.open(QIODevice::ReadOnly | QIODevice::Unbuffered), readable);
+ }
+
+ //append mode used to avoid truncating the files.
+ {
+ QFile f(file);
+ QCOMPARE(f.open(QIODevice::WriteOnly | QIODevice::Append), writable);
+ }
+
+ {
+ QFile f(file);
+ QCOMPARE(f.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Unbuffered), writable);
+ }
+
+ {
+ QFile f(file);
+ QCOMPARE(f.open(QIODevice::ReadWrite), writable);
+ }
+
+ {
+ QFile f(file);
+ QCOMPARE(f.open(QIODevice::ReadWrite | QIODevice::Unbuffered), writable);
+ }
+}
+#endif
+
+void tst_QFile::caseSensitivity()
+{
+#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WIN) || defined(Q_OS_MAC)
+ const bool caseSensitive = false;
+#else
+ const bool caseSensitive = true;
+#endif
+ QByteArray testData("a little test");
+ QString filename("File.txt");
+ {
+ QFile f(filename);
+ QVERIFY(f.open(QIODevice::WriteOnly));
+ QVERIFY(f.write(testData));
+ f.close();
+ }
+ QStringList alternates;
+ QFileInfo fi(filename);
+ QVERIFY(fi.exists());
+ alternates << "file.txt" << "File.TXT" << "fIlE.TxT" << fi.absoluteFilePath().toUpper() << fi.absoluteFilePath().toLower();
+ foreach (QString alt, alternates) {
+ QFileInfo fi2(alt);
+ QCOMPARE(fi2.exists(), !caseSensitive);
+ QCOMPARE(fi.size() == fi2.size(), !caseSensitive);
+ QFile f2(alt);
+ QCOMPARE(f2.open(QIODevice::ReadOnly), !caseSensitive);
+ if (!caseSensitive)
+ QCOMPARE(f2.readAll(), testData);
+ }
+}
+
+//MSVCRT asserts when any function is called with a closed file handle.
+//This replaces the default crashing error handler with one that ignores the error (allowing EBADF to be returned)
+class AutoIgnoreInvalidParameter
+{
+public:
+#if defined(Q_OS_WIN) && defined (Q_CC_MSVC)
+ static void ignore_invalid_parameter(const wchar_t*, const wchar_t*, const wchar_t*, unsigned int, uintptr_t) {}
+ AutoIgnoreInvalidParameter()
+ {
+ old = _set_invalid_parameter_handler(ignore_invalid_parameter);
+ }
+ ~AutoIgnoreInvalidParameter()
+ {
+ _set_invalid_parameter_handler(old);
+ }
+ _invalid_parameter_handler old;
+#endif
+};
+
+void tst_QFile::autocloseHandle()
+{
+#ifdef Q_OS_SYMBIAN
+ // these tests are a bit different, because using a closed file handle results in a panic rather than error
+ {
+ QFile file("readonlyfile");
+ QFile file2("readonlyfile");
+ QVERIFY(openFile(file, QIODevice::ReadOnly, OpenRFile, QFile::AutoCloseHandle));
+ // file is opened with mandatory lock, so opening again should fail
+ QVERIFY(!file2.open(QIODevice::ReadOnly));
+
+ file.close();
+ // opening again should now succeed (because handle is closed)
+ QVERIFY(file2.open(QIODevice::ReadOnly));
+ }
+
+ {
+ QFile file("readonlyfile");
+ QFile file2("readonlyfile");
+ QVERIFY(openFile(file, QIODevice::ReadOnly, OpenRFile, QFile::DontCloseHandle));
+ // file is opened with mandatory lock, so opening again should fail
+ QVERIFY(!file2.open(QIODevice::ReadOnly));
+
+ file.close();
+ // opening again should still fail (because handle is not auto closed)
+ QVERIFY(!file2.open(QIODevice::ReadOnly));
+
+ rfile_.Close();
+ // now it should succeed
+ QVERIFY(file2.open(QIODevice::ReadOnly));
+ }
+#endif
+
+ {
+ QFile file("readonlyfile");
+ QVERIFY(openFile(file, QIODevice::ReadOnly, OpenFd, QFile::AutoCloseHandle));
+ int fd = fd_;
+ QCOMPARE(file.handle(), fd);
+ file.close();
+ fd_ = -1;
+ QCOMPARE(file.handle(), -1);
+ AutoIgnoreInvalidParameter a;
+ Q_UNUSED(a);
+ //file is closed, read should fail
+ char buf;
+ QCOMPARE((int)QT_READ(fd, &buf, 1), -1);
+ QVERIFY(errno = EBADF);
+ }
+
+ {
+ QFile file("readonlyfile");
+ QVERIFY(openFile(file, QIODevice::ReadOnly, OpenFd, QFile::DontCloseHandle));
+ QCOMPARE(file.handle(), fd_);
+ file.close();
+ QCOMPARE(file.handle(), -1);
+ //file is not closed, read should succeed
+ char buf;
+ QCOMPARE((int)QT_READ(fd_, &buf, 1), 1);
+ ::close(fd_);
+ fd_ = -1;
+ }
+
+ {
+ QFile file("readonlyfile");
+ QVERIFY(openFile(file, QIODevice::ReadOnly, OpenStream, QFile::AutoCloseHandle));
+ int fd = fileno(stream_);
+ QCOMPARE(file.handle(), fd);
+ file.close();
+ stream_ = 0;
+ QCOMPARE(file.handle(), -1);
+ AutoIgnoreInvalidParameter a;
+ Q_UNUSED(a);
+ //file is closed, read should fail
+ char buf;
+ QCOMPARE((int)QT_READ(fd, &buf, 1), -1); //not using fread because the FILE* was freed by fclose
+ }
+
+ {
+ QFile file("readonlyfile");
+ QVERIFY(openFile(file, QIODevice::ReadOnly, OpenStream, QFile::DontCloseHandle));
+ QCOMPARE(file.handle(), fileno(stream_));
+ file.close();
+ QCOMPARE(file.handle(), -1);
+ //file is not closed, read should succeed
+ char buf;
+ QCOMPARE(int(::fread(&buf, 1, 1, stream_)), 1);
+ ::fclose(stream_);
+ stream_ = 0;
+ }
+}
+
QTEST_MAIN(tst_QFile)
#include "tst_qfile.moc"
diff --git a/tests/auto/qfiledialog/qfiledialog.pro b/tests/auto/qfiledialog/qfiledialog.pro
index 2b87cf124f..68f2e3c146 100644
--- a/tests/auto/qfiledialog/qfiledialog.pro
+++ b/tests/auto/qfiledialog/qfiledialog.pro
@@ -7,9 +7,9 @@ load(qttest_p4)
SOURCES += tst_qfiledialog.cpp
wince*|symbian {
- addFiles.sources = *.cpp
+ addFiles.files = *.cpp
addFiles.path = .
- filesInDir.sources = *.pro
+ filesInDir.files = *.pro
filesInDir.path = someDir
DEPLOYMENT += addFiles filesInDir
}
diff --git a/tests/auto/qfiledialog/resources/file.txt b/tests/auto/qfiledialog/resources/file.txt
new file mode 100644
index 0000000000..8a03e0e55f
--- /dev/null
+++ b/tests/auto/qfiledialog/resources/file.txt
@@ -0,0 +1 @@
+This is a simple text file.
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index 91f652165f..42e82a929d 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -61,9 +61,13 @@
#include <qlineedit.h>
#include <qlayout.h>
#include "../../shared/util.h"
+#if defined QT_BUILD_INTERNAL
#include "../../../src/gui/dialogs/qsidebar_p.h"
#include "../../../src/gui/dialogs/qfilesystemmodel_p.h"
#include "../../../src/gui/dialogs/qfiledialog_p.h"
+#endif
+#include <QFileDialog>
+#include <QFileSystemModel>
#include "../network-settings.h"
@@ -183,7 +187,7 @@ public:
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { return QSize(); }
};
-// emited any time the selection model emits current changed
+// emitted any time the selection model emits current changed
void tst_QFiledialog::currentChangedSignal()
{
QNonNativeFileDialog fd;
@@ -208,7 +212,7 @@ void tst_QFiledialog::currentChangedSignal()
QCOMPARE(spyCurrentChanged.count(), 1);
}
-// only emited from the views, sidebar, or lookin combo
+// only emitted from the views, sidebar, or lookin combo
void tst_QFiledialog::directoryEnteredSignal()
{
#if defined QT_BUILD_INTERNAL
@@ -269,13 +273,13 @@ void tst_QFiledialog::filesSelectedSignal_data()
QTest::newRow("existingFiles") << QFileDialog::ExistingFiles;
}
-// emited when the dialog closes with the selected files
+// emitted when the dialog closes with the selected files
void tst_QFiledialog::filesSelectedSignal()
{
QNonNativeFileDialog fd;
fd.setViewMode(QFileDialog::List);
fd.setOptions(QFileDialog::DontUseNativeDialog);
- QDir testDir(SRCDIR"/../../..");
+ QDir testDir(SRCDIR);
fd.setDirectory(testDir);
QFETCH(QFileDialog::FileMode, fileMode);
fd.setFileMode(fileMode);
@@ -313,7 +317,7 @@ void tst_QFiledialog::filesSelectedSignal()
QCOMPARE(spyFilesSelected.count(), 1);
}
-// only emited when the combo box is activated
+// only emitted when the combo box is activated
void tst_QFiledialog::filterSelectedSignal()
{
QNonNativeFileDialog fd;
@@ -1304,6 +1308,10 @@ QString saveName(QWidget *, const QString &, const QString &, const QString &, Q
void tst_QFiledialog::hooks()
{
+#ifdef Q_OS_SYMBIAN
+ if(QSysInfo::symbianVersion() < QSysInfo::SV_SF_3)
+ QSKIP("writing to data exports in paged dll not supported and crashes on symbian versions prior to ^3", SkipAll);
+#endif
qt_filedialog_existing_directory_hook = &existing;
qt_filedialog_save_filename_hook = &saveName;
qt_filedialog_open_filename_hook = &openName;
diff --git a/tests/auto/qfiledialog2/qfiledialog2.pro b/tests/auto/qfiledialog2/qfiledialog2.pro
index 4ebf9775d8..b8924c161b 100644
--- a/tests/auto/qfiledialog2/qfiledialog2.pro
+++ b/tests/auto/qfiledialog2/qfiledialog2.pro
@@ -7,9 +7,9 @@ load(qttest_p4)
SOURCES += tst_qfiledialog2.cpp
wince*|symbian {
- addFiles.sources = *.cpp
+ addFiles.files = *.cpp
addFiles.path = .
- filesInDir.sources = *.pro
+ filesInDir.files = *.pro
filesInDir.path = someDir
DEPLOYMENT += addFiles filesInDir
}
diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
index 93a80567d2..5e9f1306c4 100644
--- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
@@ -548,7 +548,7 @@ void tst_QFileDialog2::task226366_lowerCaseHardDriveWindows()
QTest::qWait(200);
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down);
QTest::qWait(200);
- QCOMPARE(edit->text(), QString("C:"));
+ QCOMPARE(edit->text(), QString("C:/"));
QTest::qWait(2000);
//i clear my previous selection in the completer
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down);
@@ -556,7 +556,7 @@ void tst_QFileDialog2::task226366_lowerCaseHardDriveWindows()
QTest::keyClick(edit, (char)(Qt::Key_C | Qt::SHIFT));
QTest::qWait(200);
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down);
- QCOMPARE(edit->text(), QString("C:"));
+ QCOMPARE(edit->text(), QString("C:/"));
}
#endif
diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro
index 30656e25da..b35b1e0028 100644
--- a/tests/auto/qfileinfo/qfileinfo.pro
+++ b/tests/auto/qfileinfo/qfileinfo.pro
@@ -7,12 +7,14 @@ QT = core
RESOURCES += qfileinfo.qrc
wince*:|symbian: {
- deploy.sources += qfileinfo.qrc tst_qfileinfo.cpp
- res.sources = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2
+ deploy.files += qfileinfo.qrc tst_qfileinfo.cpp
+ res.files = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2
res.path = resources
- DEPLOYMENT = deploy res
+ DEPLOYMENT += deploy res
}
+win32*:LIBS += -ladvapi32 -lnetapi32
+
symbian {
TARGET.CAPABILITY=AllFiles
LIBS *= -lefsrv
@@ -28,3 +30,6 @@ wince* {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+contains(QT_CONFIG, qt3support): QT += qt3support
+
+CONFIG += parallel_test
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index a375fa5efe..7d628f50a0 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -46,6 +46,7 @@
#include <qfile.h>
#include <qdir.h>
#include <qcoreapplication.h>
+#include <qlibrary.h>
#include <qtemporaryfile.h>
#include <qdir.h>
#include <qfileinfo.h>
@@ -53,9 +54,14 @@
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
+#include <sys/types.h>
+#include <pwd.h>
#endif
#ifdef Q_OS_WIN
+#define _WIN32_WINNT 0x500
#include <qt_windows.h>
+#include <qlibrary.h>
+#include <lm.h>
#endif
#include <qplatformdefs.h>
#include <qdebug.h>
@@ -65,9 +71,11 @@
#endif
#include "../network-settings.h"
#include <private/qfileinfo_p.h>
+#include "../../shared/filesystem.h"
#if defined(Q_OS_SYMBIAN)
# define SRCDIR ""
+# define NO_SYMLINKS
#endif
QT_BEGIN_NAMESPACE
@@ -155,6 +163,9 @@ private slots:
void isHidden_data();
void isHidden();
+#if defined(Q_OS_MAC)
+ void isHiddenFromFinder();
+#endif
void isBundle_data();
void isBundle();
@@ -165,6 +176,8 @@ private slots:
void refresh();
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ void ntfsJunctionPointsAndSymlinks_data();
+ void ntfsJunctionPointsAndSymlinks();
void brokenShortcut();
#endif
@@ -178,6 +191,13 @@ private slots:
void notEqualOperator() const;
void detachingOperations();
+
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+ void owner();
+#endif
+ void group();
+
+ void invalidState();
};
tst_QFileInfo::tst_QFileInfo()
@@ -190,6 +210,8 @@ tst_QFileInfo::~tst_QFileInfo()
QFile::remove("link.lnk");
QFile::remove("file1");
QFile::remove("dummyfile");
+ QFile::remove("simplefile.txt");
+ QFile::remove("longFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileName.txt");
#ifdef Q_OS_SYMBIAN
QFile::remove("hidden.txt");
QFile::remove("nothidden.txt");
@@ -199,9 +221,17 @@ tst_QFileInfo::~tst_QFileInfo()
#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
QDir().rmdir("./.hidden-directory");
+ QFile::remove("link_to_tst_qfileinfo");
#endif
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
QDir().rmdir("./hidden-directory");
+ QDir().rmdir("abs_symlink");
+ QDir().rmdir("rel_symlink");
+ QDir().rmdir("junction_pwd");
+ QDir().rmdir("junction_root");
+ QDir().rmdir("mountpoint");
+ QFile::remove("abs_symlink.cpp");
+ QFile::remove("rel_symlink.cpp");
#endif
}
@@ -396,6 +426,7 @@ void tst_QFileInfo::exists_data()
QTest::newRow("data9") << SRCDIR "resources/file?.ext1" << false;
QTest::newRow("data10") << "." << true;
QTest::newRow("data11") << ". " << false;
+ QTest::newRow("empty") << "" << false;
QTest::newRow("simple dir") << SRCDIR "resources" << true;
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << true;
@@ -498,7 +529,11 @@ void tst_QFileInfo::absFilePath()
QFETCH(QString, expected);
QFileInfo fi(file);
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ QVERIFY(QString::compare(fi.absoluteFilePath(), expected, Qt::CaseInsensitive) == 0);
+#else
QCOMPARE(fi.absoluteFilePath(), expected);
+#endif
}
void tst_QFileInfo::canonicalPath()
@@ -584,6 +619,34 @@ void tst_QFileInfo::canonicalFilePath()
}
# endif
#endif
+
+#ifdef Q_OS_WIN
+ typedef BOOL (WINAPI *PtrCreateSymbolicLink)(LPTSTR, LPTSTR, DWORD);
+ PtrCreateSymbolicLink ptrCreateSymbolicLink =
+ (PtrCreateSymbolicLink)QLibrary::resolve(QLatin1String("kernel32"), "CreateSymbolicLinkW");
+
+ if (!ptrCreateSymbolicLink) {
+ QSKIP("Symbolic links aren't supported by FS", SkipAll);
+ } else {
+ // CreateSymbolicLink can return TRUE & still fail to create the link,
+ // the error code in that case is ERROR_PRIVILEGE_NOT_HELD (1314)
+ SetLastError(0);
+ BOOL ret = ptrCreateSymbolicLink((wchar_t*)QString("res").utf16(), (wchar_t*)QString("resources").utf16(), 1);
+ DWORD dwErr = GetLastError();
+ if (!ret)
+ QSKIP("Symbolic links aren't supported by FS", SkipAll);
+ QString currentPath = QDir::currentPath();
+ bool is_res_Current = QDir::setCurrent("res");
+ if (!is_res_Current && dwErr == 1314)
+ QSKIP("Not enough privilages to create Symbolic links", SkipAll);
+ QCOMPARE(is_res_Current, true);
+
+ QCOMPARE(QFileInfo("file1").canonicalFilePath(), currentPath + "/resources/file1");
+
+ QCOMPARE(QDir::setCurrent(currentPath), true);
+ QDir::current().rmdir("res");
+ }
+#endif
}
void tst_QFileInfo::fileName_data()
@@ -660,10 +723,19 @@ void tst_QFileInfo::dir()
QFETCH(QString, expected);
QFileInfo fi(file);
- if (absPath)
+ if (absPath) {
QCOMPARE(fi.absolutePath(), expected);
- else
+ QCOMPARE(fi.absoluteDir().path(), expected);
+#ifdef QT3_SUPPORT
+ QCOMPARE(fi.dir(true).path(), expected);
+#endif
+ } else {
QCOMPARE(fi.path(), expected);
+ QCOMPARE(fi.dir().path(), expected);
+#ifdef QT3_SUPPORT
+ QCOMPARE(fi.dir(false).path(), expected);
+#endif
+ }
}
@@ -1051,6 +1123,7 @@ void tst_QFileInfo::fileTimes_oldFile()
void tst_QFileInfo::isSymLink_data()
{
+#ifndef NO_SYMLINKS
QFile::remove("link.lnk");
QFile::remove("brokenlink.lnk");
QFile::remove("dummyfile");
@@ -1070,10 +1143,12 @@ void tst_QFileInfo::isSymLink_data()
QTest::newRow("existent file") << SRCDIR "tst_qfileinfo.cpp" << false << "";
QTest::newRow("link") << "link.lnk" << true << QFileInfo(SRCDIR "tst_qfileinfo.cpp").absoluteFilePath();
QTest::newRow("broken link") << "brokenlink.lnk" << true << QFileInfo("dummyfile").absoluteFilePath();
+#endif
}
void tst_QFileInfo::isSymLink()
{
+#ifndef NO_SYMLINKS
QFETCH(QString, path);
QFETCH(bool, isSymLink);
QFETCH(QString, linkTarget);
@@ -1081,6 +1156,9 @@ void tst_QFileInfo::isSymLink()
QFileInfo fi(path);
QCOMPARE(fi.isSymLink(), isSymLink);
QCOMPARE(fi.symLinkTarget(), linkTarget);
+#else
+ QSKIP("no symbolic link support on this platform", SkipAll);
+#endif
}
void tst_QFileInfo::isHidden_data()
@@ -1156,6 +1234,27 @@ void tst_QFileInfo::isHidden()
QCOMPARE(fi.isHidden(), isHidden);
}
+#if defined(Q_OS_MAC)
+void tst_QFileInfo::isHiddenFromFinder()
+{
+ const char *filename = "test_foobar.txt";
+
+ QFile testFile(filename);
+ testFile.open(QIODevice::WriteOnly | QIODevice::Append);
+ testFile.write(QByteArray("world"));
+ testFile.close();
+
+ struct stat buf;
+ stat(filename, &buf);
+ chflags(filename, buf.st_flags | UF_HIDDEN);
+
+ QFileInfo fi(filename);
+ QCOMPARE(fi.isHidden(), true);
+
+ testFile.remove();
+}
+#endif
+
void tst_QFileInfo::isBundle_data()
{
QTest::addColumn<QString>("path");
@@ -1193,9 +1292,10 @@ void tst_QFileInfo::isLocalFs()
QFileInfo info(path);
QFileInfoPrivate *privateInfo = getPrivate(info);
- QVERIFY(privateInfo->fileEngine);
- QCOMPARE(bool(privateInfo->fileEngine->fileFlags(QAbstractFileEngine::LocalDiskFlag)
- & QAbstractFileEngine::LocalDiskFlag), isLocalFs);
+ QCOMPARE((privateInfo->fileEngine == 0), isLocalFs);
+ if (privateInfo->fileEngine)
+ QCOMPARE(bool(privateInfo->fileEngine->fileFlags(QAbstractFileEngine::LocalDiskFlag)
+ & QAbstractFileEngine::LocalDiskFlag), isLocalFs);
}
void tst_QFileInfo::refresh()
@@ -1247,6 +1347,131 @@ void tst_QFileInfo::refresh()
}
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
+{
+ QTest::addColumn<QString>("path");
+ QTest::addColumn<bool>("isSymLink");
+ QTest::addColumn<QString>("linkTarget");
+ QTest::addColumn<QString>("canonicalFilePath");
+
+ QDir pwd;
+ pwd.mkdir("target");
+
+ QLibrary kernel32("kernel32");
+ typedef BOOLEAN (WINAPI *PtrCreateSymbolicLink)(LPCWSTR, LPCWSTR, DWORD);
+ PtrCreateSymbolicLink createSymbolicLinkW = 0;
+ createSymbolicLinkW = (PtrCreateSymbolicLink) kernel32.resolve("CreateSymbolicLinkW");
+ if (!createSymbolicLinkW) {
+ //we need at least one data set for the test not to fail when skipping _data function
+ QDir target("target");
+ QTest::newRow("dummy") << target.path() << false << "" << target.canonicalPath();
+ QSKIP("symbolic links not supported by operating system",SkipSingle);
+ }
+ {
+ //Directory symlinks
+ QDir target("target");
+ QVERIFY(target.exists());
+
+ QString absTarget = QDir::toNativeSeparators(target.absolutePath());
+ QString absSymlink = QDir::toNativeSeparators(pwd.absolutePath()).append("\\abs_symlink");
+ QString relTarget = "target";
+ QString relSymlink = "rel_symlink";
+ QString fileInTarget(absTarget);
+ fileInTarget.append("\\file");
+ QString fileInSymlink(absSymlink);
+ fileInSymlink.append("\\file");
+ QFile file(fileInTarget);
+ file.open(QIODevice::ReadWrite);
+ file.close();
+
+ DWORD err = ERROR_SUCCESS ;
+ if (!pwd.exists("abs_symlink"))
+ if (!createSymbolicLinkW((wchar_t*)absSymlink.utf16(),(wchar_t*)absTarget.utf16(),0x1))
+ err = GetLastError();
+ if (err == ERROR_SUCCESS && !pwd.exists(relSymlink))
+ if (!createSymbolicLinkW((wchar_t*)relSymlink.utf16(),(wchar_t*)relTarget.utf16(),0x1))
+ err = GetLastError();
+ if (err != ERROR_SUCCESS) {
+ wchar_t errstr[0x100];
+ DWORD count = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM,
+ 0, err, 0, errstr, 0x100, 0);
+ QString error(QString::fromUtf16(errstr, count));
+ qWarning() << error;
+ //we need at least one data set for the test not to assert fail when skipping _data function
+ QDir target("target");
+ QTest::newRow("dummy") << target.path() << false << "" << target.canonicalPath();
+ QSKIP("link not supported by FS or insufficient privilege", SkipSingle);
+ }
+ QVERIFY(file.exists());
+
+ QTest::newRow("absolute dir symlink") << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath();
+ QTest::newRow("relative dir symlink") << relSymlink << true << QDir::fromNativeSeparators(relTarget) << target.canonicalPath();
+ QTest::newRow("file in symlink dir") << fileInSymlink << false << "" << target.canonicalPath().append("/file");
+ }
+ {
+ //File symlinks
+ QFileInfo target(SRCDIR "tst_qfileinfo.cpp");
+ QString absTarget = QDir::toNativeSeparators(target.absoluteFilePath());
+ QString absSymlink = QDir::toNativeSeparators(pwd.absolutePath()).append("\\abs_symlink.cpp");
+ QString relTarget = QDir::toNativeSeparators(pwd.relativeFilePath(target.absoluteFilePath()));
+ QString relSymlink = "rel_symlink.cpp";
+ QVERIFY(pwd.exists("abs_symlink.cpp") || createSymbolicLinkW((wchar_t*)absSymlink.utf16(),(wchar_t*)absTarget.utf16(),0x0));
+ QVERIFY(pwd.exists(relSymlink) || createSymbolicLinkW((wchar_t*)relSymlink.utf16(),(wchar_t*)relTarget.utf16(),0x0));
+
+ QTest::newRow("absolute file symlink") << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath();
+ QTest::newRow("relative file symlink") << relSymlink << true << QDir::fromNativeSeparators(relTarget) << target.canonicalFilePath();
+ }
+
+ //Junctions
+ QString target = "target";
+ QString junction = "junction_pwd";
+ FileSystem::createNtfsJunction(target, junction);
+ QFileInfo targetInfo(target);
+ QTest::newRow("junction_pwd") << junction << true << targetInfo.absoluteFilePath() << targetInfo.canonicalFilePath();
+
+ QFileInfo fileInJunction(targetInfo.absoluteFilePath().append("/file"));
+ QFile file(fileInJunction.absoluteFilePath());
+ file.open(QIODevice::ReadWrite);
+ file.close();
+ QVERIFY(file.exists());
+ QTest::newRow("file in junction") << fileInJunction.absoluteFilePath() << false << "" << fileInJunction.canonicalFilePath();
+
+ target = QDir::rootPath();
+ junction = "junction_root";
+ FileSystem::createNtfsJunction(target, junction);
+ targetInfo.setFile(target);
+ QTest::newRow("junction_root") << junction << true << targetInfo.absoluteFilePath() << targetInfo.canonicalFilePath();
+
+ //Mountpoint
+ typedef BOOLEAN (WINAPI *PtrGetVolumeNameForVolumeMountPointW)(LPCWSTR, LPWSTR, DWORD);
+ PtrGetVolumeNameForVolumeMountPointW getVolumeNameForVolumeMountPointW = 0;
+ getVolumeNameForVolumeMountPointW = (PtrGetVolumeNameForVolumeMountPointW) kernel32.resolve("GetVolumeNameForVolumeMountPointW");
+ if(getVolumeNameForVolumeMountPointW)
+ {
+ wchar_t buffer[MAX_PATH];
+ QString rootPath = QDir::toNativeSeparators(QDir::rootPath());
+ QVERIFY(getVolumeNameForVolumeMountPointW((wchar_t*)rootPath.utf16(), buffer, MAX_PATH));
+ QString rootVolume = QString::fromWCharArray(buffer);
+ junction = "mountpoint";
+ rootVolume.replace("\\\\?\\","\\??\\");
+ FileSystem::createNtfsJunction(rootVolume, junction);
+ QTest::newRow("mountpoint") << junction << true << QDir::fromNativeSeparators(rootPath) << QDir::rootPath();
+ }
+}
+
+void tst_QFileInfo::ntfsJunctionPointsAndSymlinks()
+{
+ QFETCH(QString, path);
+ QFETCH(bool, isSymLink);
+ QFETCH(QString, linkTarget);
+ QFETCH(QString, canonicalFilePath);
+
+ QFileInfo fi(path);
+ QCOMPARE(fi.isSymLink(), isSymLink);
+ QCOMPARE(fi.symLinkTarget(), linkTarget);
+ QCOMPARE(fi.canonicalFilePath(), canonicalFilePath);
+}
+
void tst_QFileInfo::brokenShortcut()
{
QString linkName("borkenlink.lnk");
@@ -1265,10 +1490,6 @@ void tst_QFileInfo::brokenShortcut()
void tst_QFileInfo::isWritable()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("Currently skipped on Symbian OS, but surely there is a writeable file somewhere???", SkipAll);
-#endif
-
QFile tempfile("tempfile.txt");
tempfile.open(QIODevice::WriteOnly);
tempfile.write("This file is generated by the QFileInfo autotest.");
@@ -1286,7 +1507,7 @@ void tst_QFileInfo::isWritable()
QVERIFY(fi.exists());
QVERIFY(!fi.isWritable());
#endif
-#ifdef Q_OS_UNIX
+#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN)
if (::getuid() == 0)
QVERIFY(QFileInfo("/etc/passwd").isWritable());
else
@@ -1297,9 +1518,6 @@ void tst_QFileInfo::isWritable()
void tst_QFileInfo::isExecutable()
{
#ifdef Q_OS_SYMBIAN
-# if defined(Q_CC_NOKIAX86)
- QSKIP("Impossible to implement reading/touching of application binaries in Symbian emulator", SkipAll);
-# endif
QString appPath = "c:/sys/bin/tst_qfileinfo.exe";
#else
QString appPath = QCoreApplication::applicationDirPath();
@@ -1433,5 +1651,160 @@ void tst_QFileInfo::detachingOperations()
QVERIFY(!info1.caching());
}
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if defined (Q_OS_WIN)
+BOOL IsUserAdmin()
+{
+ BOOL b;
+ SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
+ PSID AdministratorsGroup;
+ b = AllocateAndInitializeSid(
+ &NtAuthority,
+ 2,
+ SECURITY_BUILTIN_DOMAIN_RID,
+ DOMAIN_ALIAS_RID_ADMINS,
+ 0, 0, 0, 0, 0, 0,
+ &AdministratorsGroup);
+ if (b) {
+ if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
+ b = FALSE;
+ FreeSid(AdministratorsGroup);
+ }
+
+ return(b);
+}
+#endif
+
+void tst_QFileInfo::owner()
+{
+ QString userName;
+#if defined(Q_OS_UNIX)
+ {
+ passwd *user = getpwuid(geteuid());
+ QVERIFY(user);
+ char *usernameBuf = user->pw_name;
+ userName = QString::fromLocal8Bit(usernameBuf);
+ }
+#endif
+#if defined(Q_OS_WIN)
+ wchar_t usernameBuf[1024];
+ DWORD bufSize = 1024;
+ if (GetUserNameW(usernameBuf, &bufSize)) {
+ userName = QString::fromWCharArray(usernameBuf);
+ if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && IsUserAdmin()) {
+ // Special case : If the user is a member of Administrators group, all files
+ // created by the current user are owned by the Administrators group.
+ LPLOCALGROUP_USERS_INFO_0 pBuf = NULL;
+ DWORD dwLevel = 0;
+ DWORD dwFlags = LG_INCLUDE_INDIRECT ;
+ DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH;
+ DWORD dwEntriesRead = 0;
+ DWORD dwTotalEntries = 0;
+ NET_API_STATUS nStatus;
+ nStatus = NetUserGetLocalGroups(0, usernameBuf, dwLevel, dwFlags, (LPBYTE *) &pBuf,
+ dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries);
+ // Check if the current user is a member of Administrators group
+ if (nStatus == NERR_Success && pBuf){
+ for (int i = 0; i < dwEntriesRead; i++) {
+ QString groupName = QString::fromWCharArray(pBuf[i].lgrui0_name);
+ if (!groupName.compare(QLatin1String("Administrators")))
+ userName = groupName;
+ }
+ }
+ if (pBuf != NULL)
+ NetApiBufferFree(pBuf);
+ }
+ }
+ extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
+ qt_ntfs_permission_lookup = 1;
+#endif
+ if (userName.isEmpty())
+ QSKIP("Can't retrieve the user name", SkipAll);
+ QString fileName("ownertest.txt");
+ QVERIFY(!QFile::exists(fileName) || QFile::remove(fileName));
+ {
+ QFile testFile(fileName);
+ QVERIFY(testFile.open(QIODevice::WriteOnly | QIODevice::Text));
+ QByteArray testData("testfile");
+ QVERIFY(testFile.write(testData) != -1);
+ }
+ QFileInfo fi(fileName);
+ QVERIFY(fi.exists());
+ QCOMPARE(fi.owner(), userName);
+
+ QFile::remove(fileName);
+#if defined(Q_OS_WIN)
+ qt_ntfs_permission_lookup = 0;
+#endif
+}
+#endif
+
+void tst_QFileInfo::group()
+{
+ QString expected;
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+ struct group *gr;
+ gid_t gid = getegid();
+ gr = getgrgid(gid);
+ expected = QString::fromLocal8Bit(gr->gr_name);
+#endif
+
+ QString fileName("ownertest.txt");
+ if (QFile::exists(fileName))
+ QFile::remove(fileName);
+ QFile testFile(fileName);
+ QVERIFY(testFile.open(QIODevice::WriteOnly | QIODevice::Text));
+ QByteArray testData("testfile");
+ QVERIFY(testFile.write(testData) != -1);
+ testFile.close();
+ QFileInfo fi(fileName);
+ QVERIFY(fi.exists());
+
+ QCOMPARE(fi.group(), expected);
+}
+
+void tst_QFileInfo::invalidState()
+{
+ // Shouldn't crash;
+
+ {
+ QFileInfo info;
+ QCOMPARE(info.size(), qint64(0));
+ QVERIFY(!info.exists());
+
+ info.setCaching(false);
+
+ info.created();
+ info.lastRead();
+ info.lastModified();
+ }
+
+ {
+ QFileInfo info("");
+ QCOMPARE(info.size(), qint64(0));
+ QVERIFY(!info.exists());
+
+ info.setCaching(false);
+
+ info.created();
+ info.lastRead();
+ info.lastModified();
+ }
+
+ {
+ QFileInfo info("file-doesn't-really-exist.txt");
+ QCOMPARE(info.size(), qint64(0));
+ QVERIFY(!info.exists());
+
+ info.setCaching(false);
+
+ info.created();
+ info.lastRead();
+ info.lastModified();
+ }
+
+ QVERIFY(true);
+}
+
QTEST_MAIN(tst_QFileInfo)
#include "tst_qfileinfo.moc"
diff --git a/tests/auto/qfilesystementry/qfilesystementry.pro b/tests/auto/qfilesystementry/qfilesystementry.pro
new file mode 100644
index 0000000000..b9b43e6a9f
--- /dev/null
+++ b/tests/auto/qfilesystementry/qfilesystementry.pro
@@ -0,0 +1,8 @@
+load(qttest_p4)
+
+SOURCES += tst_qfilesystementry.cpp \
+ ../../../src/corelib/io/qfilesystementry.cpp
+HEADERS += ../../../src/corelib/io/qfilesystementry_p.h
+QT = core
+
+CONFIG += parallel_test
diff --git a/tests/auto/qfilesystementry/tst_qfilesystementry.cpp b/tests/auto/qfilesystementry/tst_qfilesystementry.cpp
new file mode 100644
index 0000000000..4375f9950a
--- /dev/null
+++ b/tests/auto/qfilesystementry/tst_qfilesystementry.cpp
@@ -0,0 +1,387 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+#include <QtTest/QtTest>
+
+#include <QtCore/private/qfilesystementry_p.h>
+
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+# define WIN_STUFF
+#endif
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+class tst_QFileSystemEntry : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void getSetCheck_data();
+ void getSetCheck();
+ void suffix_data();
+ void suffix();
+ void completeSuffix_data();
+ void completeSuffix();
+ void baseName_data();
+ void baseName();
+ void completeBaseName_data();
+ void completeBaseName();
+#if defined(WIN_STUFF)
+ void absoluteOrRelative_data();
+ void absoluteOrRelative();
+#endif
+};
+
+#if defined(WIN_STUFF)
+void tst_QFileSystemEntry::getSetCheck_data()
+{
+ QTest::addColumn<QString>("nativeFilePath");
+ QTest::addColumn<QString>("internalnativeFilePath");
+ QTest::addColumn<QString>("filepath");
+ QTest::addColumn<QString>("filename");
+ QTest::addColumn<QString>("baseName");
+ QTest::addColumn<QString>("completeBasename");
+ QTest::addColumn<QString>("suffix");
+ QTest::addColumn<QString>("completeSuffix");
+ QTest::addColumn<bool>("absolute");
+ QTest::addColumn<bool>("relative");
+
+ QString absPrefix = QLatin1String("\\\\?\\");
+ QString relPrefix = absPrefix
+ + QDir::toNativeSeparators(QDir::currentPath())
+ + QLatin1String("\\");
+
+ QTest::newRow("simple")
+ << QString("A:\\home\\qt\\in\\a\\dir.tar.gz")
+ << absPrefix + QString("A:\\home\\qt\\in\\a\\dir.tar.gz")
+ << "A:/home/qt/in/a/dir.tar.gz"
+ << "dir.tar.gz" << "dir" << "dir.tar" << "gz" << "tar.gz" << true << false;
+
+ QTest::newRow("relative")
+ << QString("in\\a\\dir.tar.gz")
+ << relPrefix + QString("in\\a\\dir.tar.gz")
+ << "in/a/dir.tar.gz"
+ << "dir.tar.gz" << "dir" << "dir.tar" << "gz" << "tar.gz" << false <<true;
+
+ QTest::newRow("noSuffix")
+ << QString("myDir\\myfile")
+ << relPrefix + QString("myDir\\myfile")
+ << "myDir/myfile" << "myfile" << "myfile" << "myfile" << "" << "" << false <<true;
+
+ QTest::newRow("noLongSuffix")
+ << QString("myDir\\myfile.txt")
+ << relPrefix + QString("myDir\\myfile.txt")
+ << "myDir/myfile.txt" << "myfile.txt" << "myfile" << "myfile" << "txt" << "txt" << false << true;
+
+ QTest::newRow("endingSlash")
+ << QString("myDir\\myfile.bla\\")
+ << relPrefix + QString("myDir\\myfile.bla\\")
+ << "myDir/myfile.bla/" << "" << "" << "" << "" << "" << false << true;
+
+ QTest::newRow("absolutePath")
+ << QString("A:dir\\without\\leading\\backslash.bat")
+ << absPrefix + QString("A:\\dir\\without\\leading\\backslash.bat")
+ << "A:dir/without/leading/backslash.bat" << "backslash.bat" << "backslash" << "backslash" << "bat" << "bat" << false << false;
+}
+
+void tst_QFileSystemEntry::getSetCheck()
+{
+ QFETCH(QString, nativeFilePath);
+ QFETCH(QString, internalnativeFilePath);
+ QFETCH(QString, filepath);
+ QFETCH(QString, filename);
+ QFETCH(QString, baseName);
+ QFETCH(QString, completeBasename);
+ QFETCH(QString, suffix);
+ QFETCH(QString, completeSuffix);
+ QFETCH(bool, absolute);
+ QFETCH(bool, relative);
+
+ QFileSystemEntry entry1(filepath);
+ QCOMPARE(entry1.filePath(), filepath);
+ QCOMPARE(entry1.nativeFilePath().toLower(), internalnativeFilePath.toLower());
+ QCOMPARE(entry1.fileName(), filename);
+ QCOMPARE(entry1.suffix(), suffix);
+ QCOMPARE(entry1.completeSuffix(), completeSuffix);
+ QCOMPARE(entry1.isAbsolute(), absolute);
+ QCOMPARE(entry1.isRelative(), relative);
+ QCOMPARE(entry1.baseName(), baseName);
+ QCOMPARE(entry1.completeBaseName(), completeBasename);
+
+ QFileSystemEntry entry2(nativeFilePath, QFileSystemEntry::FromNativePath());
+ QCOMPARE(entry2.suffix(), suffix);
+ QCOMPARE(entry2.completeSuffix(), completeSuffix);
+ QCOMPARE(entry2.isAbsolute(), absolute);
+ QCOMPARE(entry2.isRelative(), relative);
+ QCOMPARE(entry2.filePath(), filepath);
+ // Since this entry was created using the native path,
+ // the object shouldnot change nativeFilePath.
+ QCOMPARE(entry2.nativeFilePath(), nativeFilePath);
+ QCOMPARE(entry2.fileName(), filename);
+ QCOMPARE(entry2.baseName(), baseName);
+ QCOMPARE(entry2.completeBaseName(), completeBasename);
+}
+
+#else
+
+void tst_QFileSystemEntry::getSetCheck_data()
+{
+ QTest::addColumn<QByteArray>("nativeFilePath");
+ QTest::addColumn<QString>("filepath");
+ QTest::addColumn<QString>("filename");
+ QTest::addColumn<QString>("basename");
+ QTest::addColumn<QString>("completeBasename");
+ QTest::addColumn<QString>("suffix");
+ QTest::addColumn<QString>("completeSuffix");
+ QTest::addColumn<bool>("absolute");
+
+ QTest::newRow("simple")
+ << QByteArray("/home/qt/in/a/dir.tar.gz")
+ << "/home/qt/in/a/dir.tar.gz"
+ << "dir.tar.gz" << "dir" << "dir.tar" << "gz" << "tar.gz" << true;
+ QTest::newRow("relative")
+ << QByteArray("in/a/dir.tar.gz")
+ << "in/a/dir.tar.gz"
+ << "dir.tar.gz" << "dir" << "dir.tar" << "gz" << "tar.gz" << false;
+
+ QTest::newRow("noSuffix")
+ << QByteArray("myDir/myfile")
+ << "myDir/myfile" << "myfile" << "myfile" << "myfile" << "" << "" << false;
+
+ QTest::newRow("noLongSuffix")
+ << QByteArray("myDir/myfile.txt")
+ << "myDir/myfile.txt" << "myfile.txt" << "myfile" << "myfile" << "txt" << "txt" << false;
+
+ QTest::newRow("endingSlash")
+ << QByteArray("myDir/myfile.bla/")
+ << "myDir/myfile.bla/" << "" << "" << "" << "" << "" << false;
+
+ QTest::newRow("relativePath")
+ << QByteArray("A:dir/without/leading/backslash.bat")
+ << "A:dir/without/leading/backslash.bat" << "backslash.bat" << "backslash" << "backslash" << "bat" << "bat" << false;
+}
+
+void tst_QFileSystemEntry::getSetCheck()
+{
+ QFETCH(QByteArray, nativeFilePath);
+ QFETCH(QString, filepath);
+ QFETCH(QString, filename);
+ QFETCH(QString, basename);
+ QFETCH(QString, completeBasename);
+ QFETCH(QString, suffix);
+ QFETCH(QString, completeSuffix);
+ QFETCH(bool, absolute);
+
+ QFileSystemEntry entry1(filepath);
+ QCOMPARE(entry1.filePath(), filepath);
+ QCOMPARE(entry1.nativeFilePath(), nativeFilePath);
+ QCOMPARE(entry1.fileName(), filename);
+ QCOMPARE(entry1.suffix(), suffix);
+ QCOMPARE(entry1.completeSuffix(), completeSuffix);
+ QCOMPARE(entry1.isAbsolute(), absolute);
+ QCOMPARE(entry1.isRelative(), !absolute);
+ QCOMPARE(entry1.baseName(), basename);
+ QCOMPARE(entry1.completeBaseName(), completeBasename);
+
+ QFileSystemEntry entry2(nativeFilePath, QFileSystemEntry::FromNativePath());
+ QCOMPARE(entry2.suffix(), suffix);
+ QCOMPARE(entry2.completeSuffix(), completeSuffix);
+ QCOMPARE(entry2.isAbsolute(), absolute);
+ QCOMPARE(entry2.isRelative(), !absolute);
+ QCOMPARE(entry2.filePath(), filepath);
+ QCOMPARE(entry2.nativeFilePath(), nativeFilePath);
+ QCOMPARE(entry2.fileName(), filename);
+ QCOMPARE(entry2.baseName(), basename);
+ QCOMPARE(entry2.completeBaseName(), completeBasename);
+}
+#endif
+
+void tst_QFileSystemEntry::suffix_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("expected");
+
+ QTest::newRow("noextension0") << "file" << "";
+ QTest::newRow("noextension1") << "/path/to/file" << "";
+ QTest::newRow("data0") << "file.tar" << "tar";
+ QTest::newRow("data1") << "file.tar.gz" << "gz";
+ QTest::newRow("data2") << "/path/file/file.tar.gz" << "gz";
+ QTest::newRow("data3") << "/path/file.tar" << "tar";
+ QTest::newRow("hidden1") << ".ext1" << "ext1";
+ QTest::newRow("hidden1") << ".ext" << "ext";
+ QTest::newRow("hidden1") << ".ex" << "ex";
+ QTest::newRow("hidden1") << ".e" << "e";
+ QTest::newRow("hidden2") << ".ext1.ext2" << "ext2";
+ QTest::newRow("hidden2") << ".ext.ext2" << "ext2";
+ QTest::newRow("hidden2") << ".ex.ext2" << "ext2";
+ QTest::newRow("hidden2") << ".e.ext2" << "ext2";
+ QTest::newRow("hidden2") << "..ext2" << "ext2";
+ QTest::newRow("dots") << "/path/file.with.dots/file..ext2" << "ext2";
+ QTest::newRow("dots2") << "/path/file.with.dots/.file..ext2" << "ext2";
+}
+
+void tst_QFileSystemEntry::suffix()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, expected);
+
+ QFileSystemEntry fe(file);
+ QCOMPARE(fe.suffix(), expected);
+
+ QFileSystemEntry fi2(file);
+ // first resolve the last slash
+ (void) fi2.path();
+ QCOMPARE(fi2.suffix(), expected);
+}
+
+void tst_QFileSystemEntry::completeSuffix_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("expected");
+
+ QTest::newRow("noextension0") << "file" << "";
+ QTest::newRow("noextension1") << "/path/to/file" << "";
+ QTest::newRow("data0") << "file.tar" << "tar";
+ QTest::newRow("data1") << "file.tar.gz" << "tar.gz";
+ QTest::newRow("data2") << "/path/file/file.tar.gz" << "tar.gz";
+ QTest::newRow("data3") << "/path/file.tar" << "tar";
+ QTest::newRow("dots") << "/path/file.with.dots/file..ext2" << ".ext2";
+ QTest::newRow("dots2") << "/path/file.with.dots/.file..ext2" << "file..ext2";
+}
+
+void tst_QFileSystemEntry::completeSuffix()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, expected);
+
+ QFileSystemEntry fi(file);
+ QCOMPARE(fi.completeSuffix(), expected);
+
+ QFileSystemEntry fi2(file);
+ // first resolve the last slash
+ (void) fi2.path();
+ QCOMPARE(fi2.completeSuffix(), expected);
+}
+
+void tst_QFileSystemEntry::baseName_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("expected");
+
+ QTest::newRow("data0") << "file.tar" << "file";
+ QTest::newRow("data1") << "file.tar.gz" << "file";
+ QTest::newRow("data2") << "/path/file/file.tar.gz" << "file";
+ QTest::newRow("data3") << "/path/file.tar" << "file";
+ QTest::newRow("data4") << "/path/file" << "file";
+ QTest::newRow("dots") << "/path/file.with.dots/file..ext2" << "file";
+ QTest::newRow("dots2") << "/path/file.with.dots/.file..ext2" << "";
+}
+
+void tst_QFileSystemEntry::baseName()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, expected);
+
+ QFileSystemEntry fi(file);
+ QCOMPARE(fi.baseName(), expected);
+
+ QFileSystemEntry fi2(file);
+ // first resolve the last slash
+ (void) fi2.path();
+ QCOMPARE(fi2.baseName(), expected);
+}
+
+void tst_QFileSystemEntry::completeBaseName_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("expected");
+
+ QTest::newRow("data0") << "file.tar" << "file";
+ QTest::newRow("data1") << "file.tar.gz" << "file.tar";
+ QTest::newRow("data2") << "/path/file/file.tar.gz" << "file.tar";
+ QTest::newRow("data3") << "/path/file.tar" << "file";
+ QTest::newRow("data4") << "/path/file" << "file";
+ QTest::newRow("dots") << "/path/file.with.dots/file..ext2" << "file.";
+ QTest::newRow("dots2") << "/path/file.with.dots/.file..ext2" << ".file.";
+}
+
+void tst_QFileSystemEntry::completeBaseName()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, expected);
+
+ QFileSystemEntry fi(file);
+ QCOMPARE(fi.completeBaseName(), expected);
+
+ QFileSystemEntry fi2(file);
+ // first resolve the last slash
+ (void) fi2.path();
+ QCOMPARE(fi2.completeBaseName(), expected);
+}
+
+#if defined(WIN_STUFF)
+void tst_QFileSystemEntry::absoluteOrRelative_data()
+{
+ QTest::addColumn<QString>("path");
+ QTest::addColumn<bool>("isAbsolute");
+ QTest::addColumn<bool>("isRelative");
+
+ QTest::newRow("data0") << "file.tar" << false << true;
+ QTest::newRow("data1") << "/path/file/file.tar.gz" << false << false;
+ QTest::newRow("data1") << "C:path/file/file.tar.gz" << false << false;
+ QTest::newRow("data3") << "C:/path/file" << true << false;
+ QTest::newRow("data3") << "//machine/share" << true << false;
+}
+
+void tst_QFileSystemEntry::absoluteOrRelative()
+{
+ QFETCH(QString, path);
+ QFETCH(bool, isAbsolute);
+ QFETCH(bool, isRelative);
+
+ QFileSystemEntry fi(path);
+ QCOMPARE(fi.isAbsolute(), isAbsolute);
+ QCOMPARE(fi.isRelative(), isRelative);
+}
+#endif
+
+QTEST_MAIN(tst_QFileSystemEntry)
+#include <tst_qfilesystementry.moc>
diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
index 070eb6aa56..04cea4805c 100644
--- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
+++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
@@ -9,7 +9,7 @@ symbian: {
HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
# need to deploy something to create the private directory
- dummyDeploy.sources = tst_qfilesystemmodel.cpp
+ dummyDeploy.files = tst_qfilesystemmodel.cpp
dummyDeploy.path = .
DEPLOYMENT += dummyDeploy
LIBS += -lefsrv
diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 12007cc7d2..cf0406cdc8 100644
--- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -41,7 +41,10 @@
#include <QtTest/QtTest>
+#ifdef QT_BUILD_INTERNAL
#include "../../../src/gui/dialogs/qfilesystemmodel_p.h"
+#endif
+#include <QFileSystemModel>
#include <QFileIconProvider>
#include <QTreeView>
#include <QHeaderView>
@@ -826,8 +829,10 @@ void tst_QFileSystemModel::sort()
MyFriendFileSystemModel *myModel = new MyFriendFileSystemModel();
QTreeView *tree = new QTreeView();
+#ifdef QT_BUILD_INTERNAL
if (fileDialogMode)
myModel->d_func()->disableRecursiveSort = true;
+#endif
QDir dir(QDir::tempPath());
//initialize the randomness
@@ -992,8 +997,8 @@ void tst_QFileSystemModel::dirsBeforeFiles()
}
dir.rmdir(dirPath);
}
- dir.mkpath(dirPath);
- QVERIFY(dir.exists());
+ QVERIFY(dir.mkpath(dirPath));
+ QVERIFY(QDir(dirPath).exists());
for (int i = 0; i < 3; ++i) {
QLatin1Char c('a' + i);
diff --git a/tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro b/tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro
index 8b8616acb8..75e85a04d4 100644
--- a/tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro
+++ b/tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro
@@ -1,3 +1,5 @@
load(qttest_p4)
SOURCES += tst_qfilesystemwatcher.cpp
QT = core
+
+CONFIG += parallel_test
diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index ac62c78316..dfca56ac61 100644
--- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -82,6 +82,8 @@ private slots:
void removeFileAndUnWatch();
void cleanup();
+
+ void QTBUG15255_deadlock();
private:
QStringList do_force_engines;
bool do_force_native;
@@ -550,5 +552,23 @@ void tst_QFileSystemWatcher::removeFileAndUnWatch()
watcher.addPath(filename);
}
+class SomeSingleton : public QObject
+{
+public:
+ SomeSingleton() : mFsWatcher(new QFileSystemWatcher(this)) { mFsWatcher->addPath(QLatin1String("/usr/lib"));}
+ void bla() const {}
+ QFileSystemWatcher* mFsWatcher;
+};
+
+Q_GLOBAL_STATIC(SomeSingleton, someSingleton)
+
+void tst_QFileSystemWatcher::QTBUG15255_deadlock()
+{
+ someSingleton()->bla();
+ //the test must still finish
+ QTest::qWait(30);
+}
+
+
QTEST_MAIN(tst_QFileSystemWatcher)
#include "tst_qfilesystemwatcher.moc"
diff --git a/tests/auto/qflags/qflags.pro b/tests/auto/qflags/qflags.pro
index cd7f759b8b..097a218a5a 100644
--- a/tests/auto/qflags/qflags.pro
+++ b/tests/auto/qflags/qflags.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qflags.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qfontdatabase/qfontdatabase.pro b/tests/auto/qfontdatabase/qfontdatabase.pro
index 35811f1a97..e7dfc3c73d 100644
--- a/tests/auto/qfontdatabase/qfontdatabase.pro
+++ b/tests/auto/qfontdatabase/qfontdatabase.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qfontdatabase.cpp
!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
wince*|symbian {
- additionalFiles.sources = FreeMono.ttf
+ additionalFiles.files = FreeMono.ttf
additionalFiles.path = .
DEPLOYMENT += additionalFiles
}
diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
index ead000cde0..fe216e71ab 100644
--- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
@@ -70,6 +70,11 @@ private slots:
void fixedPitch_data();
void fixedPitch();
+#ifdef Q_WS_MAC
+ void trickyFonts_data();
+ void trickyFonts();
+#endif
+
void widthTwoTimes_data();
void widthTwoTimes();
@@ -131,10 +136,16 @@ void tst_QFontDatabase::fixedPitch_data()
QTest::newRow( "Times New Roman" ) << QString( "Times New Roman" ) << false;
QTest::newRow( "Arial" ) << QString( "Arial" ) << false;
- QTest::newRow( "Script" ) << QString( "Script" ) << false;
+ QTest::newRow( "Andale Mono" ) << QString( "Andale Mono" ) << true;
QTest::newRow( "Courier" ) << QString( "Courier" ) << true;
QTest::newRow( "Courier New" ) << QString( "Courier New" ) << true;
+#ifndef Q_WS_MAC
+ QTest::newRow( "Script" ) << QString( "Script" ) << false;
QTest::newRow( "Lucida Console" ) << QString( "Lucida Console" ) << true;
+#else
+ QTest::newRow( "Menlo" ) << QString( "Menlo" ) << true;
+ QTest::newRow( "Monaco" ) << QString( "Monaco" ) << true;
+#endif
}
void tst_QFontDatabase::fixedPitch()
@@ -156,6 +167,28 @@ void tst_QFontDatabase::fixedPitch()
QCOMPARE(fi.fixedPitch(), fixedPitch);
}
+#ifdef Q_WS_MAC
+void tst_QFontDatabase::trickyFonts_data()
+{
+ QTest::addColumn<QString>("font");
+
+ QTest::newRow( "Geeza Pro" ) << QString( "Geeza Pro" );
+}
+
+void tst_QFontDatabase::trickyFonts()
+{
+ QFETCH(QString, font);
+
+ QFontDatabase fdb;
+ if (!fdb.families().contains(font))
+ QSKIP( "Font not installed", SkipSingle);
+
+ QFont qfont(font);
+ QFontInfo fi(qfont);
+ QCOMPARE(fi.family(), font);
+}
+#endif
+
void tst_QFontDatabase::widthTwoTimes_data()
{
QTest::addColumn<QString>("font");
diff --git a/tests/auto/qfontmetrics/qfontmetrics.pro b/tests/auto/qfontmetrics/qfontmetrics.pro
index 51a7057899..c0dc1abbe6 100644
--- a/tests/auto/qfontmetrics/qfontmetrics.pro
+++ b/tests/auto/qfontmetrics/qfontmetrics.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qfontmetrics.cpp
-
+RESOURCES += testfont.qrc
diff --git a/tests/auto/qfontmetrics/testfont.qrc b/tests/auto/qfontmetrics/testfont.qrc
new file mode 100644
index 0000000000..bc0c0b0959
--- /dev/null
+++ b/tests/auto/qfontmetrics/testfont.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/fonts">
+ <file>ucs4font.ttf</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index d937f8a67d..ad0fb56398 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -74,6 +74,7 @@ private slots:
void bypassShaping();
void elidedMultiLength();
void elidedMultiLengthF();
+ void inFontUcs4();
void lineWidth();
};
@@ -267,6 +268,27 @@ void tst_QFontMetrics::elidedMultiLengthF()
elidedMultiLength_helper<QFontMetricsF>();
}
+void tst_QFontMetrics::inFontUcs4()
+{
+ int id = QFontDatabase::addApplicationFont(":/fonts/ucs4font.ttf");
+ QVERIFY(id >= 0);
+
+ QFont font("QtTestUcs4");
+ {
+ QFontMetrics fm(font);
+
+ QVERIFY(fm.inFontUcs4(0x1D7FF));
+ }
+
+ {
+ QFontMetricsF fm(font);
+
+ QVERIFY(fm.inFontUcs4(0x1D7FF));
+ }
+
+ QFontDatabase::removeApplicationFont(id);
+}
+
void tst_QFontMetrics::lineWidth()
{
// QTBUG-13009, QTBUG-13011
diff --git a/tests/auto/qfontmetrics/ucs4font.ttf b/tests/auto/qfontmetrics/ucs4font.ttf
new file mode 100644
index 0000000000..31b6997779
--- /dev/null
+++ b/tests/auto/qfontmetrics/ucs4font.ttf
Binary files differ
diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro
index 9618962b44..ac1702e715 100644
--- a/tests/auto/qftp/qftp.pro
+++ b/tests/auto/qftp/qftp.pro
@@ -5,12 +5,12 @@ SOURCES += tst_qftp.cpp
QT = core network
wince*: {
- addFiles.sources = rfc3252.txt
+ addFiles.files = rfc3252.txt
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
} else:symbian {
- addFiles.sources = rfc3252.txt
+ addFiles.files = rfc3252.txt
addFiles.path = .
DEPLOYMENT += addFiles
TARGET.EPOCHEAPSIZE="0x100 0x1000000"
diff --git a/tests/auto/qfuture/qfuture.pro b/tests/auto/qfuture/qfuture.pro
index c2b16b7587..d6faae716c 100644
--- a/tests/auto/qfuture/qfuture.pro
+++ b/tests/auto/qfuture/qfuture.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
DEFINES += QT_STRICT_ITERATORS
SOURCES += tst_qfuture.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qfuturewatcher/qfuturewatcher.pro b/tests/auto/qfuturewatcher/qfuturewatcher.pro
index 79d8739b30..67f04ef0e5 100644
--- a/tests/auto/qfuturewatcher/qfuturewatcher.pro
+++ b/tests/auto/qfuturewatcher/qfuturewatcher.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qfuturewatcher.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
index 2ca1a47f1a..eb8677a780 100644
--- a/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
+++ b/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
@@ -47,6 +47,7 @@
#include <qfuturewatcher.h>
#include <qtconcurrentrun.h>
#include <qtconcurrentmap.h>
+#include "../../shared/util.h"
#ifndef QT_NO_CONCURRENT_TEST
#include <private/qfutureinterface_p.h>
@@ -81,6 +82,7 @@ private slots:
void incrementalMapResults();
void incrementalFilterResults();
void qfutureSynchornizer();
+ void warnRace();
};
QTEST_MAIN(tst_QFutureWatcher)
@@ -466,12 +468,12 @@ void tst_QFutureWatcher::toMuchProgress()
ProgressObject o;
QFutureWatcher<void> f;
- f.setFuture((new ProgressEmitterTask())->start());
QObject::connect(&f, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
#ifdef PRINT
QObject::connect(&f, SIGNAL(progressValueChanged(int)), &o, SLOT(printProgress(int)));
#endif
QObject::connect(&f, SIGNAL(progressValueChanged(int)), &o, SLOT(registerProgress(int)));
+ f.setFuture((new ProgressEmitterTask())->start());
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
@@ -886,6 +888,37 @@ void tst_QFutureWatcher::qfutureSynchornizer()
QVERIFY(t.elapsed() < taskCount * 10);
}
+class DummyObject : public QObject {
+ Q_OBJECT
+public slots:
+ void dummySlot() {}
+public:
+ static void function(QMutex *m)
+ {
+ QMutexLocker lock(m);
+ }
+};
+
+void tst_QFutureWatcher::warnRace()
+{
+#ifndef Q_OS_MAC //I don't know why it is not working on mac
+#ifndef QT_NO_DEBUG
+ QTest::ignoreMessage(QtWarningMsg, "QFutureWatcher::connect: connecting after calling setFuture() is likely to produce race");
+#endif
+#endif
+ QFutureWatcher<void> watcher;
+ DummyObject object;
+ QMutex mutex;
+ mutex.lock();
+
+ QFuture<void> future = QtConcurrent::run(DummyObject::function, &mutex);
+ watcher.setFuture(future);
+ QTRY_VERIFY(future.isStarted());
+ connect(&watcher, SIGNAL(finished()), &object, SLOT(dummySlot()));
+ mutex.unlock();
+ future.waitForFinished();
+}
+
#include "tst_qfuturewatcher.moc"
#else
diff --git a/tests/auto/qgetputenv/qgetputenv.pro b/tests/auto/qgetputenv/qgetputenv.pro
index cbde2727a5..df94f14473 100644
--- a/tests/auto/qgetputenv/qgetputenv.pro
+++ b/tests/auto/qgetputenv/qgetputenv.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qgetputenv.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 6719f4804c..9790cb7ef6 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -1874,11 +1874,10 @@ void tst_QGL::destroyFBOAfterContext()
#ifdef QT_BUILD_INTERNAL
-class tst_QGLResource : public QObject
+class tst_QGLResource
{
- Q_OBJECT
public:
- tst_QGLResource(QObject *parent = 0) : QObject(parent) {}
+ tst_QGLResource(const QGLContext * = 0) {}
~tst_QGLResource() { ++deletions; }
static int deletions;
@@ -1886,12 +1885,7 @@ public:
int tst_QGLResource::deletions = 0;
-static void qt_shared_test_free(void *data)
-{
- delete reinterpret_cast<tst_QGLResource *>(data);
-}
-
-Q_GLOBAL_STATIC_WITH_ARGS(QGLContextResource, qt_shared_test, (qt_shared_test_free))
+Q_GLOBAL_STATIC(QGLContextGroupResource<tst_QGLResource>, qt_shared_test)
#endif
@@ -1911,10 +1905,9 @@ void tst_QGL::shareRegister()
guard.setId(3);
QVERIFY(guard.id() == 3);
- // Add a resource to the first context.
- tst_QGLResource *res1 = new tst_QGLResource();
- QVERIFY(!qt_shared_test()->value(glw1->context()));
- qt_shared_test()->insert(glw1->context(), res1);
+ // Request a tst_QGLResource object for the first context.
+ tst_QGLResource *res1 = qt_shared_test()->value(glw1->context());
+ QVERIFY(res1);
QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
// Create another context that shares with the first.
@@ -1953,10 +1946,9 @@ void tst_QGL::shareRegister()
QGLSharedResourceGuard guard3(glw3->context());
guard3.setId(5);
- // Add a resource to the third context.
- tst_QGLResource *res3 = new tst_QGLResource();
- QVERIFY(!qt_shared_test()->value(glw3->context()));
- qt_shared_test()->insert(glw3->context(), res3);
+ // Request a resource to the third context.
+ tst_QGLResource *res3 = qt_shared_test()->value(glw3->context());
+ QVERIFY(res3);
QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
QVERIFY(qt_shared_test()->value(glw3->context()) == res3);
diff --git a/tests/auto/qglfunctions/qglfunctions.pro b/tests/auto/qglfunctions/qglfunctions.pro
new file mode 100644
index 0000000000..aa81547de5
--- /dev/null
+++ b/tests/auto/qglfunctions/qglfunctions.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+requires(contains(QT_CONFIG,opengl))
+QT += opengl
+
+win32:!wince*: DEFINES += QT_NO_EGL
+
+SOURCES += tst_qglfunctions.cpp
diff --git a/tests/auto/qglfunctions/tst_qglfunctions.cpp b/tests/auto/qglfunctions/tst_qglfunctions.cpp
new file mode 100644
index 0000000000..73e63b59a8
--- /dev/null
+++ b/tests/auto/qglfunctions/tst_qglfunctions.cpp
@@ -0,0 +1,244 @@
+/****************************************************************************
+**
+** 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 QtOpenGL 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 <QtTest/QtTest>
+#include <QtOpenGL/qglfunctions.h>
+
+class tst_QGLFunctions : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QGLFunctions() {}
+ ~tst_QGLFunctions() {}
+
+private slots:
+ void features();
+ void multitexture();
+ void blendColor();
+
+private:
+ static bool hasExtension(const char *name);
+};
+
+bool tst_QGLFunctions::hasExtension(const char *name)
+{
+ QString extensions =
+ QString::fromLatin1
+ (reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
+ return extensions.split(QLatin1Char(' ')).contains
+ (QString::fromLatin1(name));
+}
+
+// Check that the reported features are consistent with the platform.
+void tst_QGLFunctions::features()
+{
+ // Before being associated with a context, there should be
+ // no features enabled.
+ QGLFunctions funcs;
+ QVERIFY(!funcs.openGLFeatures());
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::Multitexture));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::Shaders));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::Buffers));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::Framebuffers));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::BlendColor));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::BlendEquation));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::BlendEquationSeparate));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::BlendFuncSeparate));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::BlendSubtract));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::CompressedTextures));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::Multisample));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::StencilSeparate));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures));
+
+ // Make a context current.
+ QGLWidget glw;
+ if (!glw.isValid())
+ QSKIP("Could not create a GL context", SkipAll);
+ glw.makeCurrent();
+ funcs.initializeGLFunctions();
+
+ // Validate the features against what we expect for this platform.
+#if defined(QT_OPENGL_ES_2)
+ QGLFunctions::OpenGLFeatures allFeatures =
+ (QGLFunctions::Multitexture |
+ QGLFunctions::Shaders |
+ QGLFunctions::Buffers |
+ QGLFunctions::Framebuffers |
+ QGLFunctions::BlendColor |
+ QGLFunctions::BlendEquation |
+ QGLFunctions::BlendEquationSeparate |
+ QGLFunctions::BlendFuncSeparate |
+ QGLFunctions::BlendSubtract |
+ QGLFunctions::CompressedTextures |
+ QGLFunctions::Multisample |
+ QGLFunctions::StencilSeparate |
+ QGLFunctions::NPOTTextures);
+ QVERIFY((funcs.openGLFeatures() & allFeatures) == allFeatures);
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::Multitexture));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::Shaders));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::Buffers));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::Framebuffers));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::BlendColor));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::BlendEquation));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::BlendEquationSeparate));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::BlendFuncSeparate));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::BlendSubtract));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::CompressedTextures));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::Multisample));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::StencilSeparate));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures));
+#elif defined(QT_OPENGL_ES)
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::Multitexture));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::Buffers));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::CompressedTextures));
+ QVERIFY(funcs.hasOpenGLFeature(QGLFunctions::Multisample));
+
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::Shaders));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::BlendColor));
+ QVERIFY(!funcs.hasOpenGLFeature(QGLFunctions::StencilSeparate));
+
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::Framebuffers),
+ hasExtension("GL_OES_framebuffer_object"));
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::BlendEquationSeparate),
+ hasExtension("GL_OES_blend_equation_separate"));
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::BlendFuncSeparate),
+ hasExtension("GL_OES_blend_func_separate"));
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::BlendSubtract),
+ hasExtension("GL_OES_blend_subtract"));
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures),
+ hasExtension("GL_OES_texture_npot"));
+#else
+ // We check for both the extension name and the minimum OpenGL version
+ // for the feature. This will help us catch situations where a platform
+ // doesn't list an extension by name but does have the feature by virtue
+ // of its version number.
+ QGLFormat::OpenGLVersionFlags versions = QGLFormat::openGLVersionFlags();
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::Multitexture),
+ hasExtension("GL_ARB_multitexture") ||
+ (versions & QGLFormat::OpenGL_Version_1_3) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::Shaders),
+ hasExtension("GL_ARB_shader_objects") ||
+ (versions & QGLFormat::OpenGL_Version_2_0) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::Buffers),
+ (versions & QGLFormat::OpenGL_Version_1_5) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::Framebuffers),
+ hasExtension("GL_EXT_framebuffer_object") ||
+ hasExtension("GL_ARB_framebuffer_object"));
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::BlendColor),
+ hasExtension("GL_EXT_blend_color") ||
+ (versions & QGLFormat::OpenGL_Version_1_2) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::BlendEquation),
+ (versions & QGLFormat::OpenGL_Version_1_2) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::BlendEquationSeparate),
+ hasExtension("GL_EXT_blend_equation_separate") ||
+ (versions & QGLFormat::OpenGL_Version_2_0) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::BlendFuncSeparate),
+ hasExtension("GL_EXT_blend_func_separate") ||
+ (versions & QGLFormat::OpenGL_Version_1_4) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::BlendSubtract),
+ hasExtension("GL_EXT_blend_subtract"));
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::CompressedTextures),
+ hasExtension("GL_ARB_texture_compression") ||
+ (versions & QGLFormat::OpenGL_Version_1_3) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::Multisample),
+ hasExtension("GL_ARB_multisample") ||
+ (versions & QGLFormat::OpenGL_Version_1_3) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::StencilSeparate),
+ (versions & QGLFormat::OpenGL_Version_2_0) != 0);
+ QCOMPARE(funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures),
+ hasExtension("GL_ARB_texture_non_power_of_two") ||
+ (versions & QGLFormat::OpenGL_Version_2_0) != 0);
+#endif
+}
+
+// Verify that the multitexture functions appear to resolve and work.
+void tst_QGLFunctions::multitexture()
+{
+ QGLFunctions funcs;
+ QGLWidget glw;
+ if (!glw.isValid())
+ QSKIP("Could not create a GL context", SkipAll);
+ glw.makeCurrent();
+ funcs.initializeGLFunctions();
+
+ if (!funcs.hasOpenGLFeature(QGLFunctions::Multitexture))
+ QSKIP("Multitexture functions are not supported", SkipSingle);
+
+ funcs.glActiveTexture(GL_TEXTURE1);
+
+ GLint active = 0;
+ glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
+ QVERIFY(active == GL_TEXTURE1);
+
+ funcs.glActiveTexture(GL_TEXTURE0);
+
+ active = 0;
+ glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
+ QVERIFY(active == GL_TEXTURE0);
+}
+
+// Verify that the glBlendColor() function appears to resolve and work.
+void tst_QGLFunctions::blendColor()
+{
+ QGLFunctions funcs;
+ QGLWidget glw;
+ if (!glw.isValid())
+ QSKIP("Could not create a GL context", SkipAll);
+ glw.makeCurrent();
+ funcs.initializeGLFunctions();
+
+ if (!funcs.hasOpenGLFeature(QGLFunctions::BlendColor))
+ QSKIP("glBlendColor() is not supported", SkipSingle);
+
+ funcs.glBlendColor(0.0f, 1.0f, 0.0f, 1.0f);
+
+ GLfloat colors[4] = {0.5f, 0.5f, 0.5f, 0.5f};
+ glGetFloatv(GL_BLEND_COLOR, colors);
+
+ QCOMPARE(colors[0], 0.0f);
+ QCOMPARE(colors[1], 1.0f);
+ QCOMPARE(colors[2], 0.0f);
+ QCOMPARE(colors[3], 1.0f);
+}
+
+QTEST_MAIN(tst_QGLFunctions)
+
+#include "tst_qglfunctions.moc"
diff --git a/tests/auto/qglobal/qglobal.pro b/tests/auto/qglobal/qglobal.pro
index 8f1e00a2cb..a4dffac815 100644
--- a/tests/auto/qglobal/qglobal.pro
+++ b/tests/auto/qglobal/qglobal.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qglobal.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qglthreads/tst_qglthreads.cpp b/tests/auto/qglthreads/tst_qglthreads.cpp
index 0bcc4f6e97..434fd9d161 100644
--- a/tests/auto/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/qglthreads/tst_qglthreads.cpp
@@ -45,10 +45,6 @@
#include <QtOpenGL/QtOpenGL>
#include "tst_qglthreads.h"
-#ifdef Q_WS_X11
-#include <private/qt_x11_p.h>
-#endif
-
#ifdef Q_OS_SYMBIAN
#include <unistd.h> // for usleep
#define RUNNING_TIME 2000 // save GPU mem by running shorter time.
@@ -64,8 +60,6 @@ tst_QGLThreads::tst_QGLThreads(QObject *parent)
{
}
-
-
/*
swapInThread
@@ -356,6 +350,7 @@ void renderAScene(int w, int h)
class ThreadSafeGLWidget : public QGLWidget
{
public:
+ ThreadSafeGLWidget(QWidget *parent = 0) : QGLWidget(parent) {}
void paintEvent(QPaintEvent *)
{
// ignored as we're anyway swapping as fast as we can
@@ -443,7 +438,7 @@ void tst_QGLThreads::renderInThread_data()
void tst_QGLThreads::renderInThread()
{
#ifdef Q_OS_MAC
- QSKIP("OpenGL threading tests are currently disabled on mac as they were causing reboots", SkipAll);
+ QSKIP("OpenGL threading tests are currently disabled on Mac as they were causing reboots", SkipAll);
#endif
#ifdef Q_OS_SYMBIAN
@@ -482,15 +477,301 @@ void tst_QGLThreads::renderInThread()
QVERIFY(!thread.failure);
}
+class Device
+{
+public:
+ virtual ~Device() {}
+ virtual QPaintDevice *realPaintDevice() = 0;
+ virtual void prepareDevice() {}
+};
+
+class GLWidgetWrapper : public Device
+{
+public:
+ GLWidgetWrapper() {
+ widget.resize(150, 150);
+ widget.show();
+ QTest::qWaitForWindowShown(&widget);
+ widget.doneCurrent();
+ }
+ QPaintDevice *realPaintDevice() { return &widget; }
+ ThreadSafeGLWidget widget;
+};
+class PixmapWrapper : public Device
+{
+public:
+ PixmapWrapper() { pixmap = new QPixmap(512, 512); }
+ ~PixmapWrapper() { delete pixmap; }
+ QPaintDevice *realPaintDevice() { return pixmap; }
-int main(int argc, char **argv)
+ QPixmap *pixmap;
+};
+
+class PixelBufferWrapper : public Device
+{
+public:
+ PixelBufferWrapper() { pbuffer = new QGLPixelBuffer(512, 512); }
+ ~PixelBufferWrapper() { delete pbuffer; }
+ QPaintDevice *realPaintDevice() { return pbuffer; }
+
+ QGLPixelBuffer *pbuffer;
+};
+
+
+class FrameBufferObjectWrapper : public Device
+{
+public:
+ FrameBufferObjectWrapper() {
+ widget.makeCurrent();
+ fbo = new QGLFramebufferObject(512, 512);
+ widget.doneCurrent();
+ }
+ ~FrameBufferObjectWrapper() { delete fbo; }
+ QPaintDevice *realPaintDevice() { return fbo; }
+ void prepareDevice() { widget.makeCurrent(); }
+
+ ThreadSafeGLWidget widget;
+ QGLFramebufferObject *fbo;
+};
+
+
+class ThreadPainter : public QObject
+{
+ Q_OBJECT
+public:
+ ThreadPainter(Device *pd) : device(pd), fail(true) {
+ pixmap = QPixmap(40, 40);
+ pixmap.fill(Qt::green);
+ QPainter p(&pixmap);
+ p.drawLine(0, 0, 40, 40);
+ p.drawLine(0, 40, 40, 0);
+ }
+
+public slots:
+ void draw() {
+ bool beginFailed = false;
+ QTime time;
+ time.start();
+ int rotAngle = 10;
+ device->prepareDevice();
+ QPaintDevice *paintDevice = device->realPaintDevice();
+ QSize s(paintDevice->width(), paintDevice->height());
+ while (time.elapsed() < RUNNING_TIME) {
+ QPainter p;
+ if (!p.begin(paintDevice)) {
+ beginFailed = true;
+ break;
+ }
+ p.translate(s.width()/2, s.height()/2);
+ p.rotate(rotAngle);
+ p.translate(-s.width()/2, -s.height()/2);
+ p.fillRect(0, 0, s.width(), s.height(), Qt::red);
+ QRect rect(QPoint(0, 0), s);
+ p.drawPixmap(10, 10, pixmap);
+ p.drawTiledPixmap(50, 50, 100, 100, pixmap);
+ p.drawText(rect.center(), "This is a piece of text");
+ p.end();
+ rotAngle += 2;
+#ifdef Q_WS_WIN
+ Sleep(20);
+#else
+ usleep(20 * 1000);
+#endif
+ }
+
+ fail = beginFailed;
+ QThread::currentThread()->quit();
+ }
+
+ bool failed() { return fail; }
+
+private:
+ QPixmap pixmap;
+ Device *device;
+ bool fail;
+};
+
+template <class T>
+class PaintThreadManager
+{
+public:
+ PaintThreadManager(int count) : numThreads(count)
+ {
+ for (int i=0; i<numThreads; ++i) {
+ devices.append(new T);
+ threads.append(new QThread);
+ painters.append(new ThreadPainter(devices.at(i)));
+ painters.at(i)->moveToThread(threads.at(i));
+ painters.at(i)->connect(threads.at(i), SIGNAL(started()), painters.at(i), SLOT(draw()));
+ }
+ }
+
+ ~PaintThreadManager() {
+ qDeleteAll(threads);
+ qDeleteAll(painters);
+ qDeleteAll(devices);
+ }
+
+
+ void start() {
+ for (int i=0; i<numThreads; ++i)
+ threads.at(i)->start();
+ }
+
+ bool areRunning() {
+ bool running = false;
+ for (int i=0; i<numThreads; ++i){
+ if (threads.at(i)->isRunning())
+ running = true;
+ }
+
+ return running;
+ }
+
+ bool failed() {
+ for (int i=0; i<numThreads; ++i) {
+ if (painters.at(i)->failed())
+ return true;
+ }
+
+ return false;
+ }
+
+private:
+ QList<QThread *> threads;
+ QList<Device *> devices;
+ QList<ThreadPainter *> painters;
+ int numThreads;
+};
+
+/*
+ This test uses QPainter to draw onto different QGLWidgets in
+ different threads at the same time. The ThreadSafeGLWidget is
+ necessary to handle paint and resize events that might come from
+ the main thread at any time while the test is running. The resize
+ and paint events would cause makeCurrent() calls to be issued from
+ within the QGLWidget while the widget's context was current in
+ another thread, which would cause errors.
+*/
+void tst_QGLThreads::painterOnGLWidgetInThread()
+{
+#ifdef Q_OS_MAC
+ QSKIP("OpenGL threading tests are currently disabled on Mac as they were causing reboots", SkipAll);
+#endif
+ if (!((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) ||
+ (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0))) {
+ QSKIP("The OpenGL based threaded QPainter tests requires OpenGL/ES 2.0.", SkipAll);
+ }
+
+ PaintThreadManager<GLWidgetWrapper> painterThreads(5);
+ painterThreads.start();
+
+ while (painterThreads.areRunning()) {
+ qApp->processEvents();
+#ifdef Q_WS_WIN
+ Sleep(100);
+#else
+ usleep(100 * 1000);
+#endif
+ }
+ QVERIFY(!painterThreads.failed());
+}
+
+/*
+ This test uses QPainter to draw onto different QPixmaps in
+ different threads at the same time.
+*/
+void tst_QGLThreads::painterOnPixmapInThread()
{
#ifdef Q_WS_X11
- XInitThreads();
+ QSKIP("Drawing text in threads onto X11 drawables currently crashes on some X11 servers.", SkipAll);
+#endif
+ PaintThreadManager<PixmapWrapper> painterThreads(5);
+ painterThreads.start();
+
+ while (painterThreads.areRunning()) {
+ qApp->processEvents();
+#ifdef Q_WS_WIN
+ Sleep(100);
+#else
+ usleep(100 * 1000);
+#endif
+ }
+ QVERIFY(!painterThreads.failed());
+}
+
+/* This test uses QPainter to draw onto different QGLPixelBuffer
+ objects in different threads at the same time.
+*/
+void tst_QGLThreads::painterOnPboInThread()
+{
+#ifdef Q_OS_MAC
+ QSKIP("OpenGL threading tests are currently disabled on Mac as they were causing reboots", SkipAll);
+#endif
+ if (!((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) ||
+ (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0))) {
+ QSKIP("The OpenGL based threaded QPainter tests requires OpenGL/ES 2.0.", SkipAll);
+ return;
+ }
+
+ if (!QGLPixelBuffer::hasOpenGLPbuffers()) {
+ QSKIP("This system doesn't support pbuffers.", SkipAll);
+ return;
+ }
+
+ PaintThreadManager<PixelBufferWrapper> painterThreads(5);
+ painterThreads.start();
+
+ while (painterThreads.areRunning()) {
+ qApp->processEvents();
+#ifdef Q_WS_WIN
+ Sleep(100);
+#else
+ usleep(100 * 1000);
#endif
+ }
+ QVERIFY(!painterThreads.failed());
+}
+/* This test uses QPainter to draw onto different
+ QGLFramebufferObjects (bound in a QGLWidget's context) in different
+ threads at the same time.
+*/
+void tst_QGLThreads::painterOnFboInThread()
+{
+#ifdef Q_OS_MAC
+ QSKIP("OpenGL threading tests are currently disabled on Mac as they were causing reboots", SkipAll);
+#endif
+ if (!((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) ||
+ (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0))) {
+ QSKIP("The OpenGL based threaded QPainter tests requires OpenGL/ES 2.0.", SkipAll);
+ return;
+ }
+
+ if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
+ QSKIP("This system doesn't support framebuffer objects.", SkipAll);
+ return;
+ }
+
+ PaintThreadManager<FrameBufferObjectWrapper> painterThreads(5);
+ painterThreads.start();
+
+ while (painterThreads.areRunning()) {
+ qApp->processEvents();
+#ifdef Q_WS_WIN
+ Sleep(100);
+#else
+ usleep(100 * 1000);
+#endif
+ }
+ QVERIFY(!painterThreads.failed());
+}
+
+int main(int argc, char **argv)
+{
+ QApplication::setAttribute(Qt::AA_X11InitThreads);
QApplication app(argc, argv);
QTEST_DISABLE_KEYPAD_NAVIGATION \
diff --git a/tests/auto/qglthreads/tst_qglthreads.h b/tests/auto/qglthreads/tst_qglthreads.h
index 1f75db99cf..0143689df0 100644
--- a/tests/auto/qglthreads/tst_qglthreads.h
+++ b/tests/auto/qglthreads/tst_qglthreads.h
@@ -56,6 +56,10 @@ private slots:
void renderInThread_data();
void renderInThread();
+ void painterOnGLWidgetInThread();
+ void painterOnPixmapInThread();
+ void painterOnPboInThread();
+ void painterOnFboInThread();
};
#endif // TST_QGLTHREADS_H
diff --git a/tests/auto/qglyphs/qglyphs.pro b/tests/auto/qglyphs/qglyphs.pro
new file mode 100644
index 0000000000..5084cf9908
--- /dev/null
+++ b/tests/auto/qglyphs/qglyphs.pro
@@ -0,0 +1,11 @@
+load(qttest_p4)
+QT = core gui
+
+SOURCES += \
+ tst_qglyphs.cpp
+
+wince*|symbian*: {
+ DEFINES += SRCDIR=\\\"\\\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+} \ No newline at end of file
diff --git a/tests/auto/qglyphs/test.ttf b/tests/auto/qglyphs/test.ttf
new file mode 100644
index 0000000000..9043a576ef
--- /dev/null
+++ b/tests/auto/qglyphs/test.ttf
Binary files differ
diff --git a/tests/auto/qglyphs/tst_qglyphs.cpp b/tests/auto/qglyphs/tst_qglyphs.cpp
new file mode 100644
index 0000000000..da91063d87
--- /dev/null
+++ b/tests/auto/qglyphs/tst_qglyphs.cpp
@@ -0,0 +1,573 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <qglyphs.h>
+#include <qpainter.h>
+#include <qtextlayout.h>
+#include <qfontdatabase.h>
+
+// #define DEBUG_SAVE_IMAGE
+
+class tst_QGlyphs: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+ void constructionAndDestruction();
+ void copyConstructor();
+ void assignment();
+ void equalsOperator_data();
+ void equalsOperator();
+ void textLayoutGlyphIndexes();
+ void drawExistingGlyphs();
+ void drawNonExistentGlyphs();
+ void drawMultiScriptText1();
+ void drawMultiScriptText2();
+ void drawStruckOutText();
+ void drawOverlinedText();
+ void drawUnderlinedText();
+ void drawRightToLeft();
+ void detach();
+
+private:
+ int m_testFontId;
+ QFont m_testFont;
+};
+
+Q_DECLARE_METATYPE(QGlyphs);
+
+void tst_QGlyphs::initTestCase()
+{
+ m_testFontId = QFontDatabase::addApplicationFont(SRCDIR "test.ttf");
+ QVERIFY(m_testFontId >= 0);
+
+ m_testFont = QFont("QtsSpecialTestFont");
+
+ QCOMPARE(QFontInfo(m_testFont).family(), QString::fromLatin1("QtsSpecialTestFont"));
+}
+
+void tst_QGlyphs::cleanupTestCase()
+{
+ QFontDatabase::removeApplicationFont(m_testFontId);
+}
+
+void tst_QGlyphs::constructionAndDestruction()
+{
+ QGlyphs glyphIndexes;
+}
+
+static QGlyphs make_dummy_indexes()
+{
+ QGlyphs glyphs;
+
+ QVector<quint32> glyphIndexes;
+ QVector<QPointF> positions;
+ QFont font;
+ font.setPointSize(18);
+
+ glyphIndexes.append(1);
+ glyphIndexes.append(2);
+ glyphIndexes.append(3);
+
+ positions.append(QPointF(1, 2));
+ positions.append(QPointF(3, 4));
+ positions.append(QPointF(5, 6));
+
+ glyphs.setFont(font);
+ glyphs.setGlyphIndexes(glyphIndexes);
+ glyphs.setPositions(positions);
+
+ return glyphs;
+}
+
+void tst_QGlyphs::copyConstructor()
+{
+ QGlyphs glyphs;
+
+ {
+ QVector<quint32> glyphIndexes;
+ QVector<QPointF> positions;
+ QFont font;
+ font.setPointSize(18);
+
+ glyphIndexes.append(1);
+ glyphIndexes.append(2);
+ glyphIndexes.append(3);
+
+ positions.append(QPointF(1, 2));
+ positions.append(QPointF(3, 4));
+ positions.append(QPointF(5, 6));
+
+ glyphs.setFont(font);
+ glyphs.setGlyphIndexes(glyphIndexes);
+ glyphs.setPositions(positions);
+ }
+
+ QGlyphs otherGlyphs(glyphs);
+ QCOMPARE(otherGlyphs.font(), glyphs.font());
+ QCOMPARE(glyphs.glyphIndexes(), otherGlyphs.glyphIndexes());
+ QCOMPARE(glyphs.positions(), otherGlyphs.positions());
+}
+
+void tst_QGlyphs::assignment()
+{
+ QGlyphs glyphs(make_dummy_indexes());
+
+ QGlyphs otherGlyphs = glyphs;
+ QCOMPARE(otherGlyphs.font(), glyphs.font());
+ QCOMPARE(glyphs.glyphIndexes(), otherGlyphs.glyphIndexes());
+ QCOMPARE(glyphs.positions(), otherGlyphs.positions());
+}
+
+void tst_QGlyphs::equalsOperator_data()
+{
+ QTest::addColumn<QGlyphs>("one");
+ QTest::addColumn<QGlyphs>("two");
+ QTest::addColumn<bool>("equals");
+
+ QGlyphs one(make_dummy_indexes());
+ QGlyphs two(make_dummy_indexes());
+
+ QTest::newRow("Identical") << one << two << true;
+
+ {
+ QGlyphs busted(two);
+
+ QVector<QPointF> positions = busted.positions();
+ positions[2] += QPointF(1, 1);
+ busted.setPositions(positions);
+
+ QTest::newRow("Different positions") << one << busted << false;
+ }
+
+ {
+ QGlyphs busted(two);
+ QFont font = busted.font();
+ font.setPointSize(font.pointSize() * 2);
+ busted.setFont(font);
+
+ QTest::newRow("Different fonts") << one << busted << false;
+ }
+
+ {
+ QGlyphs busted(two);
+
+ QVector<quint32> glyphIndexes = busted.glyphIndexes();
+ glyphIndexes[2] += 1;
+ busted.setGlyphIndexes(glyphIndexes);
+
+ QTest::newRow("Different glyph indexes") << one << busted << false;
+ }
+
+}
+
+void tst_QGlyphs::equalsOperator()
+{
+ QFETCH(QGlyphs, one);
+ QFETCH(QGlyphs, two);
+ QFETCH(bool, equals);
+
+ QCOMPARE(one == two, equals);
+ QCOMPARE(one != two, !equals);
+}
+
+
+void tst_QGlyphs::textLayoutGlyphIndexes()
+{
+ QString s;
+ s.append(QLatin1Char('A'));
+ s.append(QChar(0xe000));
+
+ QTextLayout layout(s);
+ layout.setFont(m_testFont);
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+
+ QList<QGlyphs> listOfGlyphs = layout.glyphs();
+ QCOMPARE(listOfGlyphs.size(), 1);
+
+ QGlyphs glyphs = listOfGlyphs.at(0);
+
+ QCOMPARE(glyphs.glyphIndexes().size(), 2);
+ QCOMPARE(glyphs.glyphIndexes().at(0), quint32(2));
+ QCOMPARE(glyphs.glyphIndexes().at(1), quint32(1));
+}
+
+void tst_QGlyphs::drawExistingGlyphs()
+{
+ QPixmap textLayoutDraw(1000, 1000);
+ QPixmap drawGlyphs(1000, 1000);
+
+ textLayoutDraw.fill(Qt::white);
+ drawGlyphs.fill(Qt::white);
+
+ QString s;
+ s.append(QLatin1Char('A'));
+ s.append(QChar(0xe000));
+
+ QTextLayout layout(s);
+ layout.setFont(m_testFont);
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+
+ {
+ QPainter p(&textLayoutDraw);
+ layout.draw(&p, QPointF(50, 50));
+ }
+
+ QGlyphs glyphs = layout.glyphs().size() > 0
+ ? layout.glyphs().at(0)
+ : QGlyphs();
+
+ {
+ QPainter p(&drawGlyphs);
+ p.drawGlyphs(QPointF(50, 50), glyphs);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ textLayoutDraw.save("drawExistingGlyphs_textLayoutDraw.png");
+ drawGlyphs.save("drawExistingGlyphs_drawGlyphIndexes.png");
+#endif
+
+ QCOMPARE(textLayoutDraw, drawGlyphs);
+}
+
+void tst_QGlyphs::drawNonExistentGlyphs()
+{
+ QVector<quint32> glyphIndexes;
+ glyphIndexes.append(3);
+
+ QVector<QPointF> glyphPositions;
+ glyphPositions.append(QPointF(0, 0));
+
+ QGlyphs glyphs;
+ glyphs.setGlyphIndexes(glyphIndexes);
+ glyphs.setPositions(glyphPositions);
+ glyphs.setFont(m_testFont);
+
+ QPixmap image(1000, 1000);
+ image.fill(Qt::white);
+
+ QPixmap imageBefore = image;
+ {
+ QPainter p(&image);
+ p.drawGlyphs(QPointF(50, 50), glyphs);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ image.save("drawNonExistentGlyphs.png");
+#endif
+
+ QCOMPARE(image, imageBefore); // Should be unchanged
+}
+
+void tst_QGlyphs::drawMultiScriptText1()
+{
+ QString text;
+ text += QChar(0x03D0); // Greek, beta
+
+ QTextLayout textLayout(text);
+ textLayout.beginLayout();
+ textLayout.createLine();
+ textLayout.endLayout();
+
+ QPixmap textLayoutDraw(1000, 1000);
+ textLayoutDraw.fill(Qt::white);
+
+ QPixmap drawGlyphs(1000, 1000);
+ drawGlyphs.fill(Qt::white);
+
+ QList<QGlyphs> glyphsList = textLayout.glyphs();
+ QCOMPARE(glyphsList.size(), 1);
+
+ {
+ QPainter p(&textLayoutDraw);
+ textLayout.draw(&p, QPointF(50, 50));
+ }
+
+ {
+ QPainter p(&drawGlyphs);
+ foreach (QGlyphs glyphs, glyphsList)
+ p.drawGlyphs(QPointF(50, 50), glyphs);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ textLayoutDraw.save("drawMultiScriptText1_textLayoutDraw.png");
+ drawGlyphs.save("drawMultiScriptText1_drawGlyphIndexes.png");
+#endif
+
+ QCOMPARE(drawGlyphs, textLayoutDraw);
+}
+
+
+void tst_QGlyphs::drawMultiScriptText2()
+{
+ QString text;
+ text += QChar(0x0621); // Arabic, Hamza
+ text += QChar(0x03D0); // Greek, beta
+
+ QTextLayout textLayout(text);
+ textLayout.beginLayout();
+ textLayout.createLine();
+ textLayout.endLayout();
+
+ QPixmap textLayoutDraw(1000, 1000);
+ textLayoutDraw.fill(Qt::white);
+
+ QPixmap drawGlyphs(1000, 1000);
+ drawGlyphs.fill(Qt::white);
+
+ QList<QGlyphs> glyphsList = textLayout.glyphs();
+ QCOMPARE(glyphsList.size(), 2);
+
+ {
+ QPainter p(&textLayoutDraw);
+ textLayout.draw(&p, QPointF(50, 50));
+ }
+
+ {
+ QPainter p(&drawGlyphs);
+ foreach (QGlyphs glyphs, glyphsList)
+ p.drawGlyphs(QPointF(50, 50), glyphs);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ textLayoutDraw.save("drawMultiScriptText2_textLayoutDraw.png");
+ drawGlyphs.save("drawMultiScriptText2_drawGlyphIndexes.png");
+#endif
+
+ QCOMPARE(drawGlyphs, textLayoutDraw);
+}
+
+void tst_QGlyphs::detach()
+{
+ QGlyphs glyphs;
+
+ glyphs.setGlyphIndexes(QVector<quint32>() << 1 << 2 << 3);
+
+ QGlyphs otherGlyphs;
+ otherGlyphs = glyphs;
+
+ QCOMPARE(otherGlyphs.glyphIndexes(), glyphs.glyphIndexes());
+
+ otherGlyphs.setGlyphIndexes(QVector<quint32>() << 4 << 5 << 6);
+
+ QCOMPARE(otherGlyphs.glyphIndexes(), QVector<quint32>() << 4 << 5 << 6);
+ QCOMPARE(glyphs.glyphIndexes(), QVector<quint32>() << 1 << 2 << 3);
+}
+
+void tst_QGlyphs::drawStruckOutText()
+{
+ QPixmap textLayoutDraw(1000, 1000);
+ QPixmap drawGlyphs(1000, 1000);
+
+ textLayoutDraw.fill(Qt::white);
+ drawGlyphs.fill(Qt::white);
+
+ QString s = QString::fromLatin1("Foobar");
+
+ QFont font;
+ font.setStrikeOut(true);
+
+ QTextLayout layout(s);
+ layout.setFont(font);
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+
+ {
+ QPainter p(&textLayoutDraw);
+ layout.draw(&p, QPointF(50, 50));
+ }
+
+ QGlyphs glyphs = layout.glyphs().size() > 0
+ ? layout.glyphs().at(0)
+ : QGlyphs();
+
+ {
+ QPainter p(&drawGlyphs);
+ p.drawGlyphs(QPointF(50, 50), glyphs);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ textLayoutDraw.save("drawStruckOutText_textLayoutDraw.png");
+ drawGlyphs.save("drawStruckOutText_drawGlyphIndexes.png");
+#endif
+
+ QCOMPARE(textLayoutDraw, drawGlyphs);
+}
+
+void tst_QGlyphs::drawOverlinedText()
+{
+ QPixmap textLayoutDraw(1000, 1000);
+ QPixmap drawGlyphs(1000, 1000);
+
+ textLayoutDraw.fill(Qt::white);
+ drawGlyphs.fill(Qt::white);
+
+ QString s = QString::fromLatin1("Foobar");
+
+ QFont font;
+ font.setOverline(true);
+
+ QTextLayout layout(s);
+ layout.setFont(font);
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+
+ {
+ QPainter p(&textLayoutDraw);
+ layout.draw(&p, QPointF(50, 50));
+ }
+
+ QGlyphs glyphs = layout.glyphs().size() > 0
+ ? layout.glyphs().at(0)
+ : QGlyphs();
+
+ {
+ QPainter p(&drawGlyphs);
+ p.drawGlyphs(QPointF(50, 50), glyphs);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ textLayoutDraw.save("drawOverlineText_textLayoutDraw.png");
+ drawGlyphs.save("drawOverlineText_drawGlyphIndexes.png");
+#endif
+
+ QCOMPARE(textLayoutDraw, drawGlyphs);
+}
+
+void tst_QGlyphs::drawUnderlinedText()
+{
+ QPixmap textLayoutDraw(1000, 1000);
+ QPixmap drawGlyphs(1000, 1000);
+
+ textLayoutDraw.fill(Qt::white);
+ drawGlyphs.fill(Qt::white);
+
+ QString s = QString::fromLatin1("Foobar");
+
+ QFont font;
+ font.setUnderline(true);
+
+ QTextLayout layout(s);
+ layout.setFont(font);
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+
+ {
+ QPainter p(&textLayoutDraw);
+ layout.draw(&p, QPointF(50, 50));
+ }
+
+ QGlyphs glyphs = layout.glyphs().size() > 0
+ ? layout.glyphs().at(0)
+ : QGlyphs();
+
+ {
+ QPainter p(&drawGlyphs);
+ p.drawGlyphs(QPointF(50, 50), glyphs);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ textLayoutDraw.save("drawUnderlineText_textLayoutDraw.png");
+ drawGlyphs.save("drawUnderlineText_drawGlyphIndexes.png");
+#endif
+
+ QCOMPARE(textLayoutDraw, drawGlyphs);
+}
+
+void tst_QGlyphs::drawRightToLeft()
+{
+ QString s;
+ s.append(QChar(1575));
+ s.append(QChar(1578));
+
+ QPixmap textLayoutDraw(1000, 1000);
+ QPixmap drawGlyphs(1000, 1000);
+
+ textLayoutDraw.fill(Qt::white);
+ drawGlyphs.fill(Qt::white);
+
+ QFont font;
+ font.setUnderline(true);
+
+ QTextLayout layout(s);
+ layout.setFont(font);
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+
+ {
+ QPainter p(&textLayoutDraw);
+ layout.draw(&p, QPointF(50, 50));
+ }
+
+ QGlyphs glyphs = layout.glyphs().size() > 0
+ ? layout.glyphs().at(0)
+ : QGlyphs();
+
+ {
+ QPainter p(&drawGlyphs);
+ p.drawGlyphs(QPointF(50, 50), glyphs);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ textLayoutDraw.save("drawRightToLeft_textLayoutDraw.png");
+ drawGlyphs.save("drawRightToLeft_drawGlyphIndexes.png");
+#endif
+
+ QCOMPARE(textLayoutDraw, drawGlyphs);
+
+}
+
+QTEST_MAIN(tst_QGlyphs)
+#include "tst_qglyphs.moc"
+
diff --git a/tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro b/tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro
index 4c065f4b6d..87684258ed 100644
--- a/tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro
+++ b/tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro
@@ -1,3 +1,3 @@
load(qttest_p4)
SOURCES += tst_qgraphicsanchorlayout.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro b/tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro
index 27f48e041f..90b78783d9 100644
--- a/tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro
+++ b/tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro
@@ -1,3 +1,3 @@
load(qttest_p4)
SOURCES += tst_qgraphicsanchorlayout1.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicseffect/qgraphicseffect.pro b/tests/auto/qgraphicseffect/qgraphicseffect.pro
index 7effacad4a..94b3ce619e 100644
--- a/tests/auto/qgraphicseffect/qgraphicseffect.pro
+++ b/tests/auto/qgraphicseffect/qgraphicseffect.pro
@@ -1,3 +1,3 @@
load(qttest_p4)
SOURCES += tst_qgraphicseffect.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro b/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro
index d506c6d89f..5658ad7851 100644
--- a/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro
+++ b/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro
@@ -1,3 +1,3 @@
load(qttest_p4)
SOURCES += tst_qgraphicseffectsource.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro b/tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro
index 97e68bc46f..d66d639cdd 100644
--- a/tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro
+++ b/tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qgraphicsgridlayout.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index 17cb7bf186..2fb445ec63 100644
--- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -84,6 +84,7 @@ private slots:
void horizontalSpacing();
void itemAt();
void removeAt();
+ void removeItem();
void rowAlignment_data();
void rowAlignment();
void rowCount_data();
@@ -121,6 +122,7 @@ private slots:
void styleInfoLeak();
void task236367_maxSizeHint();
void heightForWidth();
+ void widthForHeight();
void heightForWidthWithSpanning();
void stretchAndHeightForWidth();
void testDefaultAlignment();
@@ -240,9 +242,10 @@ struct ItemDesc
return (*this);
}
- ItemDesc &heightForWidth(QSizeF (*fnConstraint)(Qt::SizeHint, const QSizeF &)) {
+ ItemDesc &dynamicConstraint(QSizeF (*fnConstraint)(Qt::SizeHint, const QSizeF &),
+ Qt::Orientation orientation) {
m_fnConstraint = fnConstraint;
- m_constraintOrientation = Qt::Vertical;
+ m_constraintOrientation = orientation;
return (*this);
}
@@ -250,7 +253,7 @@ struct ItemDesc
QSizePolicy sp = m_sizePolicy;
if (m_fnConstraint) {
sp.setHeightForWidth(m_constraintOrientation == Qt::Vertical);
- //sp.setWidthForHeight(m_constraintOrientation == Qt::Horizontal);
+ sp.setWidthForHeight(m_constraintOrientation == Qt::Horizontal);
}
item->setSizePolicy(sp);
@@ -1145,6 +1148,32 @@ void tst_QGraphicsGridLayout::removeAt()
delete widget;
}
+void tst_QGraphicsGridLayout::removeItem()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+
+ QGraphicsWidget *widget = new QGraphicsWidget(0, Qt::Window);
+ scene.addItem(widget);
+ QGraphicsGridLayout *l = new QGraphicsGridLayout();
+ widget->setLayout(l);
+
+ populateLayout(l, 3, 2);
+ QCOMPARE(l->count(), 6);
+ l->removeItem(l->itemAt(5));
+ l->removeItem(l->itemAt(4));
+ QCOMPARE(l->count(), 4);
+
+ // Avoid crashing. Note that the warning message might change in the future.
+ QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QGraphicsGridLayout::removeAt: invalid index -1").toLatin1().constData());
+ l->removeItem(0);
+ QCOMPARE(l->count(), 4);
+
+ QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QGraphicsGridLayout::removeAt: invalid index -1").toLatin1().constData());
+ l->removeItem(new QGraphicsWidget);
+ QCOMPARE(l->count(), 4);
+}
+
void tst_QGraphicsGridLayout::rowAlignment_data()
{
QTest::addColumn<bool>("hasHeightForWidth");
@@ -2352,10 +2381,50 @@ void tst_QGraphicsGridLayout::alignment2()
static QSizeF hfw1(Qt::SizeHint, const QSizeF &constraint)
{
QSizeF result(constraint);
- if (constraint.width() < 0 && constraint.height() < 0) {
+ const qreal ch = constraint.height();
+ const qreal cw = constraint.width();
+ if (cw < 0 && ch < 0) {
return QSizeF(50, 400);
- } else if (constraint.width() >= 0) {
- result.setHeight(20000./constraint.width());
+ } else if (cw > 0) {
+ result.setHeight(20000./cw);
+ }
+ return result;
+}
+
+static QSizeF wfh1(Qt::SizeHint, const QSizeF &constraint)
+{
+ QSizeF result(constraint);
+ const qreal ch = constraint.height();
+ const qreal cw = constraint.width();
+ if (cw < 0 && ch < 0) {
+ return QSizeF(400, 50);
+ } else if (ch > 0) {
+ result.setWidth(20000./ch);
+ }
+ return result;
+}
+
+static QSizeF wfh2(Qt::SizeHint, const QSizeF &constraint)
+{
+ QSizeF result(constraint);
+ const qreal ch = constraint.height();
+ const qreal cw = constraint.width();
+ if (ch < 0 && cw < 0)
+ return QSizeF(50, 50);
+ if (ch >= 0)
+ result.setWidth(ch);
+ return result;
+}
+
+static QSizeF hfw3(Qt::SizeHint, const QSizeF &constraint)
+{
+ QSizeF result(constraint);
+ const qreal ch = constraint.height();
+ const qreal cw = constraint.width();
+ if (cw < 0 && ch < 0) {
+ return QSizeF(10, 10);
+ } else if (cw > 0) {
+ result.setHeight(100./cw);
}
return result;
}
@@ -2395,7 +2464,7 @@ void tst_QGraphicsGridLayout::geometries_data()
);
// change layout height and verify
- QTest::newRow("hfw-h401") << (ItemList()
+ QTest::newRow("hfw-100x401") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(1,1))
.preferredSize(QSizeF(50,10))
@@ -2412,15 +2481,13 @@ void tst_QGraphicsGridLayout::geometries_data()
.minSize(QSizeF(40,-1))
.preferredSize(QSizeF(50,-1))
.maxSize(QSizeF(500, -1))
- .heightForWidth(hfw1)
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 401)
<< (RectList()
<< QRectF(0, 0, 50, 1) << QRectF(50, 0, 50, 1)
<< QRectF(0, 1, 50,100) << QRectF(50, 1, 50,400)
);
-
-
QTest::newRow("hfw-h408") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(1,1))
@@ -2438,7 +2505,7 @@ void tst_QGraphicsGridLayout::geometries_data()
.sizeHint(Qt::MinimumSize, QSizeF(40,40))
.sizeHint(Qt::PreferredSize, QSizeF(50,400))
.sizeHint(Qt::MaximumSize, QSizeF(500, 500))
- .heightForWidth(hfw1)
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 408)
<< (RectList()
@@ -2462,13 +2529,250 @@ void tst_QGraphicsGridLayout::geometries_data()
.minSize(QSizeF(40,40))
.preferredSize(QSizeF(50,400))
.maxSize(QSizeF(500, 500))
- .heightForWidth(hfw1)
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 410)
<< (RectList()
<< QRectF(0, 0, 50,10) << QRectF(50, 0, 50,10)
<< QRectF(0, 10, 50,100) << QRectF(50, 10, 50,400)
);
+#if 0
+ QTest::newRow("hfw-100x470") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(40,40))
+ .preferredSize(QSizeF(50,400))
+ .maxSize(QSizeF(500, 500))
+ .dynamicConstraint(hfw1, Qt::Vertical)
+ )
+ << QSizeF(100, 470)
+ << (RectList()
+ << QRectF(0, 0, 50,70) << QRectF(50, 0, 50,70)
+ << QRectF(0, 70, 50,100) << QRectF(50, 70, 50,400)
+ );
+
+
+ // change layout width and verify
+ QTest::newRow("hfw-100x401") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(40,40))
+ .preferredSize(QSizeF(50,400))
+ .maxSize(QSizeF(5000, 5000))
+ .dynamicConstraint(hfw1, Qt::Vertical)
+ )
+ << QSizeF(100, 401)
+ << (RectList()
+ << QRectF( 0, 0, 50, 1) << QRectF( 50, 0, 50, 1)
+ << QRectF( 0, 1, 50, 100) << QRectF( 50, 1, 50, 400)
+ );
+
+ QTest::newRow("hfw-160x400") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(40,40))
+ .preferredSize(QSizeF(50,400))
+ .maxSize(QSizeF(5000, 5000))
+ .dynamicConstraint(hfw1, Qt::Vertical)
+ )
+ << QSizeF(160, 400)
+ << (RectList()
+ << QRectF( 0, 0, 80, 100) << QRectF( 80, 0, 80, 100)
+ << QRectF( 0, 100, 80, 100) << QRectF( 80, 100, 80, 250)
+ );
+
+
+ QTest::newRow("hfw-160x300") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,10))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(40,40))
+ .preferredSize(QSizeF(50,400))
+ .maxSize(QSizeF(5000, 5000))
+ .dynamicConstraint(hfw1, Qt::Vertical)
+ )
+ << QSizeF(160, 300)
+ << (RectList()
+ << QRectF( 0, 0, 80, 50) << QRectF( 80, 0, 80, 50)
+ << QRectF( 0, 50, 80, 100) << QRectF( 80, 50, 80, 250)
+ );
+
+ QTest::newRow("hfw-20x40") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,10))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ .dynamicConstraint(hfw3, Qt::Vertical)
+ )
+ << QSizeF(20, 40)
+ << (RectList()
+ << QRectF(0, 0, 10, 20) << QRectF(10, 0, 10, 20)
+ << QRectF(0, 20, 10, 20) << QRectF(10, 20, 10, 10)
+ );
+
+ QTest::newRow("wfh-300x160") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(10,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(10,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(10,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(10,10))
+ .preferredSize(QSizeF(400,50))
+ .maxSize(QSizeF(5000, 5000))
+ .dynamicConstraint(wfh1, Qt::Horizontal)
+ )
+ << QSizeF(300, 160)
+ << (RectList()
+ << QRectF( 0, 0, 50, 80) << QRectF( 50, 0, 100, 80)
+ << QRectF( 0, 80, 50, 80) << QRectF( 50, 80, 250, 80)
+ );
+
+ QTest::newRow("wfh-40x20") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ // Note, must be 10 in order to match stretching of wfh item
+ // below (the same stretch makes it easier to test)
+ .minSize(QSizeF(10,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ .dynamicConstraint(wfh2, Qt::Horizontal)
+ )
+ << QSizeF(40, 20)
+ << (RectList()
+ << QRectF(0, 0, 20, 10) << QRectF(20, 0, 20, 10)
+ << QRectF(0, 10, 20, 10) << QRectF(20, 10, 10, 10)
+ );
+
+ QTest::newRow("wfh-400x160") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ .dynamicConstraint(wfh2, Qt::Horizontal)
+ )
+
+ << QSizeF(400, 160)
+ << (RectList()
+ << QRectF(0, 0, 100, 80) << QRectF(100, 0, 100, 80)
+ << QRectF(0, 80, 100, 80) << QRectF(100, 80, 80, 80)
+ );
+
+ QTest::newRow("wfh-160x100") << (ItemList()
+ << ItemDesc(0,0)
+ .minSize(QSizeF(1,1))
+ // Note, preferred width must be 50 in order to match
+ // preferred width of wfh item below.
+ // (The same preferred size makes the stretch the same, and
+ // makes it easier to test) (The stretch algorithm is a
+ // blackbox)
+ .preferredSize(QSizeF(50,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(0,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(10,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,0)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(10,50))
+ .maxSize(QSizeF(100, 100))
+ << ItemDesc(1,1)
+ .minSize(QSizeF(1,1))
+ .preferredSize(QSizeF(10,50))
+ .maxSize(QSizeF(500, 500))
+ .dynamicConstraint(wfh2, Qt::Horizontal)
+ )
+ << QSizeF(160, 100)
+ << (RectList()
+ << QRectF(0, 0, 80, 50) << QRectF( 80, 0, 80, 50)
+ << QRectF(0, 50, 80, 50) << QRectF( 80, 50, 50, 50)
+ );
+#endif
QTest::newRow("hfw-h470") << (ItemList()
<< ItemDesc(0,0)
@@ -2487,7 +2791,7 @@ void tst_QGraphicsGridLayout::geometries_data()
.sizeHint(Qt::MinimumSize, QSizeF(40,40))
.sizeHint(Qt::PreferredSize, QSizeF(50,400))
.sizeHint(Qt::MaximumSize, QSizeF(500,500))
- .heightForWidth(hfw1)
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 470)
<< (RectList()
@@ -2514,7 +2818,7 @@ void tst_QGraphicsGridLayout::geometries_data()
.sizeHint(Qt::MinimumSize, QSizeF(40,40))
.sizeHint(Qt::PreferredSize, QSizeF(50,400))
.sizeHint(Qt::MaximumSize, QSizeF(5000,5000))
- .heightForWidth(hfw1)
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 401)
<< (RectList()
@@ -2539,7 +2843,7 @@ void tst_QGraphicsGridLayout::geometries_data()
.sizeHint(Qt::MinimumSize, QSizeF(40,40))
.sizeHint(Qt::PreferredSize, QSizeF(50,400))
.sizeHint(Qt::MaximumSize, QSizeF(5000,5000))
- .heightForWidth(hfw1)
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(160, 350)
<< (RectList()
@@ -2564,7 +2868,7 @@ void tst_QGraphicsGridLayout::geometries_data()
.sizeHint(Qt::MinimumSize, QSizeF(40,40))
.sizeHint(Qt::PreferredSize, QSizeF(50,400))
.sizeHint(Qt::MaximumSize, QSizeF(5000,5000))
- .heightForWidth(hfw1)
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(500, 200)
<< (RectList()
@@ -2576,11 +2880,11 @@ void tst_QGraphicsGridLayout::geometries_data()
<< ItemDesc(0,0)
.minSize(QSizeF(100, 100))
.maxSize(QSizeF(100, 100))
- .heightForWidth(hfw2)
+ .dynamicConstraint(hfw2, Qt::Vertical)
<< ItemDesc(1,0)
.minSize(QSizeF(200, 200))
.maxSize(QSizeF(200, 200))
- .heightForWidth(hfw2)
+ .dynamicConstraint(hfw2, Qt::Vertical)
<< ItemDesc(2,0)
.minSize(QSizeF(300, 300))
.maxSize(QSizeF(300, 300))
@@ -2596,12 +2900,12 @@ void tst_QGraphicsGridLayout::geometries_data()
<< ItemDesc(0,0)
.minSize(QSizeF(100, 100))
.maxSize(QSizeF(100, 100))
- .heightForWidth(hfw2)
+ .dynamicConstraint(hfw2, Qt::Vertical)
.alignment(Qt::AlignRight)
<< ItemDesc(1,0)
.minSize(QSizeF(200, 200))
.maxSize(QSizeF(200, 200))
- .heightForWidth(hfw2)
+ .dynamicConstraint(hfw2, Qt::Vertical)
.alignment(Qt::AlignHCenter)
<< ItemDesc(2,0)
.minSize(QSizeF(300, 300))
@@ -2684,14 +2988,6 @@ void tst_QGraphicsGridLayout::task236367_maxSizeHint()
QCOMPARE(widget->size(), QSizeF(w, h));
}
-/*
-static qreal hfw(qreal w)
-{
- if (w == 0)
- return 20000;
- return 20000/w;
-}
-*/
static QSizeF hfw(Qt::SizeHint /*which*/, const QSizeF &constraint)
{
QSizeF result(constraint);
@@ -2708,7 +3004,16 @@ static QSizeF hfw(Qt::SizeHint /*which*/, const QSizeF &constraint)
} else if (ch == 0) {
result.setWidth(20000);
}
+ return result;
+}
+static QSizeF wfh(Qt::SizeHint /*which*/, const QSizeF &constraint)
+{
+ QSizeF result(constraint);
+ const qreal ch = constraint.height();
+ if (ch >= 0) {
+ result.setWidth(ch);
+ }
return result;
}
@@ -2759,24 +3064,25 @@ void tst_QGraphicsGridLayout::heightForWidth()
layout->setSpacing(0);
RectWidget *w00 = new RectWidget;
w00->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w00->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
+ w00->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
w00->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w00, 0, 0);
RectWidget *w01 = new RectWidget;
w01->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w01->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
+ w01->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
w01->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w01, 0, 1);
RectWidget *w10 = new RectWidget;
w10->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w10->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
+ w10->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
w10->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w10, 1, 0);
RectWidget *w11 = new RectWidget;
w11->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
+ w11->setSizeHint(Qt::PreferredSize, QSizeF(50,400));
w11->setSizeHint(Qt::MaximumSize, QSizeF(30000,30000));
w11->setConstraintFunction(hfw);
QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -2785,43 +3091,109 @@ void tst_QGraphicsGridLayout::heightForWidth()
layout->addItem(w11, 1, 1);
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, -1)), QSizeF(2, 2));
+ QEXPECT_FAIL("", "QTBUG-14693", Continue);
QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, -1)), QSizeF(210, 110));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, -1)), QSizeF(30100, 30100));
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(2, -1)), QSizeF(2, 20001));
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(2, -1)), QSizeF(2, 20010));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(2, -1)), QSizeF(2, 20050));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(2, -1)), QSizeF(2, 20100));
- qreal width1;
- qreal width2;
- expectedWidth(1, 10, 1, 200, 20, &width1, &width2);
- QSizeF expectedSize = hfw(Qt::MinimumSize, QSizeF(width2, -1)) + QSizeF(width1, 1);
- QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(20, -1)), expectedSize);
- expectedSize.rheight()+=9;
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(20, -1)), expectedSize);
- expectedSize.rheight()+=90;
- QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(20, -1)), expectedSize);
-
- expectedWidth(1, 10, 1, 200, 300, &width1, &width2);
- expectedSize = hfw(Qt::MinimumSize, QSizeF(width2, -1)) + QSizeF(width1, 1);
- QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(300, -1)), expectedSize);
- expectedSize.rheight()+=9;
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(300, -1)), expectedSize);
- // the height of the hfw widget is shorter than the one to the left, which is 100, so
- // the total height of the last row is 100 (which leaves the layout height to be 200)
- QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(300, -1)), QSizeF(300, 200));
-
- // the hfw item is shorter than the item to the left
- expectedWidth(1, 10, 1, 200, 500, &width1, &width2);
- expectedSize = hfw(Qt::MinimumSize, QSizeF(width2, -1)) + QSizeF(width1, 1);
- QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(500, -1)), expectedSize);
- expectedSize.rheight()+=9;
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(500, -1)), expectedSize);
+
+ QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(20, -1)), QSizeF(20, 1 + 2000));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(20, -1)), QSizeF(20, 50 + 2000));
+ QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(20, -1)), QSizeF(20, 100 + 2000));
+
+ QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(300, -1)), QSizeF(300, 1 + 100));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(300, -1)), QSizeF(300, 50 + 100));
+ QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(300, -1)), QSizeF(300, 100 + 100));
+
// the height of the hfw widget is shorter than the one to the left, which is 100, so
// the total height of the last row is 100 (which leaves the layout height to be 200)
- QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(500, -1)), QSizeF(500, 200));
+ QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(500, -1)), QSizeF(500, 100 + 100));
+
+ // hfw item size: (500, 40) -> preferred size is maxed up to preferred size of item w10 (50)
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(600, -1)), QSizeF(600, 50 + 50));
}
+void tst_QGraphicsGridLayout::widthForHeight()
+{
+#if 0
+ QGraphicsWidget *widget = new QGraphicsWidget;
+ QGraphicsGridLayout *layout = new QGraphicsGridLayout;
+ widget->setLayout(layout);
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->setSpacing(0);
+
+ RectWidget *w00 = new RectWidget;
+ w00->setMinimumSize(1, 1);
+ w00->setPreferredSize(50, 50);
+ w00->setMaximumSize(100, 100);
+
+ layout->addItem(w00, 0, 0);
+
+ RectWidget *w01 = new RectWidget;
+ w01->setMinimumSize(1,1);
+ w01->setPreferredSize(50,50);
+ w01->setMaximumSize(100,100);
+ layout->addItem(w01, 0, 1);
+
+ RectWidget *w10 = new RectWidget;
+ w10->setMinimumSize(1,1);
+ w10->setPreferredSize(50,50);
+ w10->setMaximumSize(100,100);
+ layout->addItem(w10, 1, 0);
+
+ RectWidget *w11 = new RectWidget;
+ w11->setMinimumSize(1,1);
+ w11->setPreferredSize(50, 50);
+ w11->setMaximumSize(30000,30000);
+ // This will make sure its always square.
+ w11->setConstraintFunction(wfh);
+ QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::Preferred);
+ sp.setWidthForHeight(true);
+ w11->setSizePolicy(sp);
+ layout->addItem(w11, 1, 1);
+
+ /*
+ | 1, 50, 100 | 1, 50, 100 |
+ -----+--------------+--------------+
+ 1| | |
+ 50| | |
+ 100| | |
+ -----|--------------+--------------+
+ 1| | |
+ 50| | WFH |
+ 100| | |
+ -----------------------------------+
+ */
+
+
+ QSizeF prefSize = layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, -1));
+ QCOMPARE(prefSize, QSizeF(50+50, 50+50));
+
+ // wfh(1): = 1
+ QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, 2)), QSizeF(1 + 1, 2));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, 2)), QSizeF(50 + 50, 2));
+ QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, 2)), QSizeF(100 + 100, 2));
+
+ // wfh(40) = 40
+ QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, 80)), QSizeF(1 + 40, 80));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, 80)), QSizeF(50 + 50, 80));
+ QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, 80)), QSizeF(100 + 100, 80));
+
+ // wfh(80) = 80
+ QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, 160)), QSizeF(1 + 80, 160));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, 160)), QSizeF(50 + 80, 160));
+ QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, 160)), QSizeF(100 + 100, 160));
+
+ // wfh(200) = 200
+ QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, 300)), QSizeF(1 + 200, 300));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, 300)), QSizeF(50 + 200, 300));
+ QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, 300)), QSizeF(100 + 200, 300));
+#endif
+}
+
void tst_QGraphicsGridLayout::heightForWidthWithSpanning()
{
QGraphicsWidget *widget = new QGraphicsWidget;
diff --git a/tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro b/tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro
index 6be3bfe98e..01875c7b50 100644
--- a/tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro
+++ b/tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
SOURCES += tst_qgraphicsitemanimation.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicslayout/qgraphicslayout.pro b/tests/auto/qgraphicslayout/qgraphicslayout.pro
index 1dc916a695..eafd21310a 100644
--- a/tests/auto/qgraphicslayout/qgraphicslayout.pro
+++ b/tests/auto/qgraphicslayout/qgraphicslayout.pro
@@ -5,4 +5,4 @@
load(qttest_p4)
SOURCES += tst_qgraphicslayout.cpp
DEFINES += QT_USE_USING_NAMESPACE
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro b/tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro
index 6c8bf0ccf2..816224bd8b 100644
--- a/tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro
+++ b/tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qgraphicslayoutitem.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro b/tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro
index 114e5e9360..df5a827787 100644
--- a/tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro
+++ b/tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qgraphicslinearlayout.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicsobject/qgraphicsobject.pro b/tests/auto/qgraphicsobject/qgraphicsobject.pro
index 965b31967c..2418845b73 100644
--- a/tests/auto/qgraphicsobject/qgraphicsobject.pro
+++ b/tests/auto/qgraphicsobject/qgraphicsobject.pro
@@ -1,2 +1,3 @@
load(qttest_p4)
SOURCES += tst_qgraphicsobject.cpp
+CONFIG += parallel_test \ No newline at end of file
diff --git a/tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro b/tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro
index f6d6c8f704..6b4db95ebe 100644
--- a/tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro
+++ b/tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qgraphicspixmapitem.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro b/tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro
index d54b78b4ac..4da949b71a 100644
--- a/tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro
+++ b/tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qgraphicspolygonitem.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 06296d54fe..e38a275cd8 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -183,6 +183,7 @@ private slots:
void inputMethod();
void clickFocus();
void windowFrameMargins();
+ void QTBUG_6986_sendMouseEventToAlienWidget();
};
// Subclass that exposes the protected functions.
@@ -3583,6 +3584,70 @@ void tst_QGraphicsProxyWidget::windowFrameMargins()
QVERIFY(top > 0);
}
+class HoverButton : public QPushButton
+{
+public:
+ HoverButton(QWidget *parent = 0) : QPushButton(parent), hoverLeaveReceived(false)
+ {}
+
+ bool hoverLeaveReceived;
+
+ bool event(QEvent* e)
+ {
+ if(QEvent::HoverLeave == e->type())
+ hoverLeaveReceived = true;
+ return QPushButton::event(e);
+ }
+};
+
+class Scene : public QGraphicsScene
+{
+Q_OBJECT
+public:
+ Scene() {
+ QWidget *background = new QWidget;
+ background->setGeometry(0, 0, 500, 500);
+ hoverButton = new HoverButton;
+ hoverButton->setParent(background);
+ hoverButton->setText("Second button");
+ hoverButton->setGeometry(10, 10, 200, 50);
+ addWidget(background);
+
+ QPushButton *hideButton = new QPushButton("I'm a button with a very very long text");
+ hideButton->setGeometry(10, 10, 400, 50);
+ topButton = addWidget(hideButton);
+ connect(hideButton, SIGNAL(clicked()), this, SLOT(hideButton()));
+ topButton->setFocus();
+ }
+
+ QGraphicsProxyWidget *topButton;
+ HoverButton *hoverButton;
+
+public slots:
+ void hideButton() {
+ QCursor::setPos(600,600);
+ topButton->hide();
+ }
+};
+
+void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
+{
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(QT_NO_CURSOR)
+ QSKIP("Test case unstable on this platform", SkipAll);
+#endif
+ QGraphicsView view;
+ Scene scene;
+ view.setScene(&scene);
+ view.resize(600, 600);
+ QApplication::setActiveWindow(&view);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QCursor::setPos(view.mapToGlobal(view.mapFromScene(scene.topButton->boundingRect().center())));
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.topButton->scenePos()));
+ QTRY_COMPARE(scene.hoverButton->hoverLeaveReceived, true);
+}
+
QTEST_MAIN(tst_QGraphicsProxyWidget)
#include "tst_qgraphicsproxywidget.moc"
diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro
index cc6f585978..82fa423e66 100644
--- a/tests/auto/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro
@@ -7,9 +7,9 @@ win32:!wince*: LIBS += -lUser32
DEFINES += QT_NO_CAST_TO_ASCII
wince*|symbian: {
- rootFiles.sources = Ash_European.jpg graphicsScene_selection.data
+ rootFiles.files = Ash_European.jpg graphicsScene_selection.data
rootFiles.path = .
- renderFiles.sources = testData\\render\\*
+ renderFiles.files = testData\\render\\*
renderFiles.path = testData\\render
DEPLOYMENT += rootFiles renderFiles
}
diff --git a/tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro b/tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro
index d1bf3cc587..1fdd176b3b 100644
--- a/tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro
+++ b/tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
requires(contains(QT_CONFIG,private_tests))
SOURCES += tst_qgraphicssceneindex.cpp
-
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicstransform/qgraphicstransform.pro b/tests/auto/qgraphicstransform/qgraphicstransform.pro
index 709cff6901..67c939ed8b 100644
--- a/tests/auto/qgraphicstransform/qgraphicstransform.pro
+++ b/tests/auto/qgraphicstransform/qgraphicstransform.pro
@@ -1,2 +1,3 @@
load(qttest_p4)
SOURCES += tst_qgraphicstransform.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index dcd679fc75..cf697bb0fb 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -246,6 +246,7 @@ private slots:
void QTBUG_4151_clipAndIgnore();
void QTBUG_5859_exposedRect();
void QTBUG_7438_cursor();
+ void hoverLeave();
void QTBUG_16063_microFocusRect();
public slots:
@@ -4451,6 +4452,60 @@ void tst_QGraphicsView::QTBUG_7438_cursor()
#endif
}
+class GraphicsItemWithHover : public QGraphicsRectItem
+{
+public:
+ GraphicsItemWithHover()
+ : receivedEnterEvent(false), receivedLeaveEvent(false),
+ enterWidget(0), leaveWidget(0)
+ {
+ setRect(0, 0, 100, 100);
+ setAcceptHoverEvents(true);
+ }
+
+ bool sceneEvent(QEvent *event)
+ {
+ if (event->type() == QEvent::GraphicsSceneHoverEnter) {
+ receivedEnterEvent = true;
+ enterWidget = static_cast<QGraphicsSceneHoverEvent *>(event)->widget();
+ } else if (event->type() == QEvent::GraphicsSceneHoverLeave) {
+ receivedLeaveEvent = true;
+ leaveWidget = static_cast<QGraphicsSceneHoverEvent *>(event)->widget();
+ }
+ return QGraphicsRectItem::sceneEvent(event);
+ }
+
+ bool receivedEnterEvent;
+ bool receivedLeaveEvent;
+ QWidget *enterWidget;
+ QWidget *leaveWidget;
+};
+
+void tst_QGraphicsView::hoverLeave()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ GraphicsItemWithHover *item = new GraphicsItemWithHover;
+ scene.addItem(item);
+
+ // move the cursor out of the way
+ QCursor::setPos(1,1);
+
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ QPoint pos = view.viewport()->mapToGlobal(view.mapFromScene(item->mapToScene(10, 10)));
+ QCursor::setPos(pos);
+ QTest::qWait(200);
+ QVERIFY(item->receivedEnterEvent);
+ QCOMPARE(item->enterWidget, view.viewport());
+
+ QCursor::setPos(0,0);
+ QTest::qWait(200);
+ QVERIFY(item->receivedLeaveEvent);
+ QCOMPARE(item->leaveWidget, view.viewport());
+}
+
class IMItem : public QGraphicsRectItem
{
public:
diff --git a/tests/auto/qhash/qhash.pro b/tests/auto/qhash/qhash.pro
index 86b98a27e4..16c9eabecc 100644
--- a/tests/auto/qhash/qhash.pro
+++ b/tests/auto/qhash/qhash.pro
@@ -6,3 +6,4 @@ symbian: {
TARGET.EPOCSTACKSIZE =0x5000
TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
+CONFIG += parallel_test
diff --git a/tests/auto/qhash/tst_qhash.cpp b/tests/auto/qhash/tst_qhash.cpp
index fff9c678ac..92af95859a 100644
--- a/tests/auto/qhash/tst_qhash.cpp
+++ b/tests/auto/qhash/tst_qhash.cpp
@@ -60,6 +60,7 @@ private slots:
void erase();
void key();
+ void swap();
void count(); // copied from tst_QMap
void clear(); // copied from tst_QMap
void empty(); // copied from tst_QMap
@@ -553,6 +554,16 @@ void tst_QHash::key()
}
}
+void tst_QHash::swap()
+{
+ QHash<int,QString> h1, h2;
+ h1[0] = "h1[0]";
+ h2[1] = "h2[1]";
+ h1.swap(h2);
+ QCOMPARE(h1.value(1),QLatin1String("h2[1]"));
+ QCOMPARE(h2.value(0),QLatin1String("h1[0]"));
+}
+
// copied from tst_QMap
void tst_QHash::clear()
{
diff --git a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro
index 889aac9728..a9a8ed9449 100644
--- a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro
+++ b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro
@@ -9,9 +9,9 @@ DEFINES += QT_USE_USING_NAMESPACE
wince*: {
DEFINES += SRCDIR=\\\"./\\\"
QT += network
- addFiles.sources = $$PWD/data/*.*
+ addFiles.files = $$PWD/data/*.*
addFiles.path = data
- clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll
+ clucene.files = $$QT_BUILD_TREE/lib/QtCLucene*.dll
DEPLOYMENT += addFiles
DEPLOYMENT += clucene
diff --git a/tests/auto/qhelpenginecore/qhelpenginecore.pro b/tests/auto/qhelpenginecore/qhelpenginecore.pro
index 27ebd0fc45..4166fe2288 100644
--- a/tests/auto/qhelpenginecore/qhelpenginecore.pro
+++ b/tests/auto/qhelpenginecore/qhelpenginecore.pro
@@ -10,9 +10,9 @@ DEFINES += QT_USE_USING_NAMESPACE
wince*: {
DEFINES += SRCDIR=\\\"./\\\"
QT += network
- addFiles.sources = $$PWD/data/*.*
+ addFiles.files = $$PWD/data/*.*
addFiles.path = data
- clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll
+ clucene.files = $$QT_BUILD_TREE/lib/QtCLucene*.dll
DEPLOYMENT += addFiles
DEPLOYMENT += clucene
diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro
index c0be51810d..49eebd58b6 100644
--- a/tests/auto/qhttp/qhttp.pro
+++ b/tests/auto/qhttp/qhttp.pro
@@ -5,22 +5,22 @@ SOURCES += tst_qhttp.cpp
QT = core network
wince*: {
- webFiles.sources = webserver/*
+ webFiles.files = webserver/*
webFiles.path = webserver
- cgi.sources = webserver/cgi-bin/*
+ cgi.files = webserver/cgi-bin/*
cgi.path = webserver/cgi-bin
- addFiles.sources = rfc3252.txt trolltech
+ addFiles.files = rfc3252.txt trolltech
addFiles.path = .
- DEPLOYMENT = addFiles webFiles cgi
+ DEPLOYMENT += addFiles webFiles cgi
DEFINES += SRCDIR=\\\"\\\"
} else:symbian {
- webFiles.sources = webserver/*
+ webFiles.files = webserver/*
webFiles.path = webserver
- cgi.sources = webserver/cgi-bin/*
+ cgi.files = webserver/cgi-bin/*
cgi.path = webserver/cgi-bin
- addFiles.sources = rfc3252.txt trolltech
+ addFiles.files = rfc3252.txt trolltech
addFiles.path = .
- DEPLOYMENT = addFiles webFiles cgi
+ DEPLOYMENT += addFiles webFiles cgi
TARGET.CAPABILITY = NetworkServices
} else:vxworks*: {
DEFINES += SRCDIR=\\\"\\\"
diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index f562bc830d..0b7213916b 100644
--- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -110,6 +110,8 @@ private Q_SLOTS:
void getEmptyWithPipelining();
+ void getAndEverythingShouldBePipelined();
+
void getAndThenDeleteObject();
void getAndThenDeleteObject_data();
};
@@ -1020,6 +1022,52 @@ void tst_QHttpNetworkConnection::getEmptyWithPipelining()
qDeleteAll(replies);
}
+class GetAndEverythingShouldBePipelinedReceiver : public QObject
+{
+ Q_OBJECT
+public:
+ int receivedCount;
+ int requestCount;
+ GetAndEverythingShouldBePipelinedReceiver(int rq) : receivedCount(0),requestCount(rq) { }
+public Q_SLOTS:
+ void finishedSlot() {
+ QHttpNetworkReply *reply = (QHttpNetworkReply*) sender();
+ receivedCount++;
+
+ if (receivedCount == requestCount)
+ QTestEventLoop::instance().exitLoop();
+ }
+};
+
+void tst_QHttpNetworkConnection::getAndEverythingShouldBePipelined()
+{
+ quint16 requestCount = 100;
+ // use 1 connection.
+ QHttpNetworkConnection connection(1, QtNetworkSettings::serverName());
+ QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QList<QHttpNetworkRequest*> requests;
+ QList<QHttpNetworkReply*> replies;
+
+ GetAndEverythingShouldBePipelinedReceiver receiver(requestCount);
+
+ for (int i = 0; i < requestCount; i++) {
+ QHttpNetworkRequest *request = 0;
+ request = new QHttpNetworkRequest(url, QHttpNetworkRequest::Get);
+ request->setPipeliningAllowed(true);
+ requests.append(request);
+ QHttpNetworkReply *reply = connection.sendRequest(*request);
+ connect(reply, SIGNAL(finished()), &receiver, SLOT(finishedSlot()));
+ replies.append(reply);
+ }
+ QTestEventLoop::instance().enterLoop(40);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ qDeleteAll(requests);
+ qDeleteAll(replies);
+
+}
+
+
void tst_QHttpNetworkConnection::getAndThenDeleteObject_data()
{
QTest::addColumn<bool>("replyFirst");
diff --git a/tests/auto/qicoimageformat/qicoimageformat.pro b/tests/auto/qicoimageformat/qicoimageformat.pro
index cabab3f4a3..c150c9af9f 100644
--- a/tests/auto/qicoimageformat/qicoimageformat.pro
+++ b/tests/auto/qicoimageformat/qicoimageformat.pro
@@ -3,21 +3,21 @@ SOURCES+= tst_qicoimageformat.cpp
wince*: {
DEFINES += SRCDIR=\\\".\\\"
- addFiles.sources = icons
+ addFiles.files = icons
addFiles.path = .
CONFIG(debug, debug|release):{
- addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll
+ addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll
} else {
- addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qico4.dll
+ addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4.dll
}
addPlugins.path = imageformats
DEPLOYMENT += addFiles addPlugins
} else:symbian {
- addFiles.sources = icons
+ addFiles.files = icons
addFiles.path = .
DEPLOYMENT += addFiles
qt_not_deployed {
- addPlugins.sources = qico.dll
+ addPlugins.files = qico.dll
addPlugins.path = imageformats
DEPLOYMENT += addPlugins
}
diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro
index 68b888dab4..975aaf2973 100644
--- a/tests/auto/qicon/qicon.pro
+++ b/tests/auto/qicon/qicon.pro
@@ -5,10 +5,10 @@ RESOURCES = tst_qicon.qrc
wince* {
QT += xml svg
- addFiles.sources += $$_PRO_FILE_PWD_/*.png
- addFiles.sources += $$_PRO_FILE_PWD_/*.svg
- addFiles.sources += $$_PRO_FILE_PWD_/*.svgz
- addFiles.sources += $$_PRO_FILE_PWD_/tst_qicon.cpp
+ addFiles.files += $$_PRO_FILE_PWD_/*.png
+ addFiles.files += $$_PRO_FILE_PWD_/*.svg
+ addFiles.files += $$_PRO_FILE_PWD_/*.svgz
+ addFiles.files += $$_PRO_FILE_PWD_/tst_qicon.cpp
addFiles.path = .
DEPLOYMENT += addFiles
@@ -16,11 +16,11 @@ wince* {
DEFINES += SRCDIR=\\\".\\\"
} else:symbian {
QT += xml svg
- addFiles.sources = *.png tst_qicon.cpp *.svg *.svgz
+ addFiles.files = *.png tst_qicon.cpp *.svg *.svgz
addFiles.path = .
DEPLOYMENT += addFiles
qt_not_deployed {
- plugins.sources = qsvgicon.dll
+ plugins.files = qsvgicon.dll
plugins.path = iconengines
DEPLOYMENT += plugins
}
diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp
index 9cc8327955..21f8a4442e 100644
--- a/tests/auto/qicon/tst_qicon.cpp
+++ b/tests/auto/qicon/tst_qicon.cpp
@@ -70,6 +70,7 @@ private slots:
void actualSize2();
void svgActualSize();
void isNull();
+ void swap();
void bestMatch();
void cacheKey();
void detach();
@@ -259,6 +260,21 @@ void tst_QIcon::isNull() {
QVERIFY(iconSupportedFormat.actualSize(QSize(32, 32)).isValid());
}
+void tst_QIcon::swap()
+{
+ QPixmap p1(1, 1), p2(2, 2);
+ p1.fill(Qt::black);
+ p2.fill(Qt::black);
+
+ QIcon i1(p1), i2(p2);
+ const qint64 i1k = i1.cacheKey();
+ const qint64 i2k = i2.cacheKey();
+ QVERIFY(i1k != i2k);
+ i1.swap(i2);
+ QCOMPARE(i1.cacheKey(), i2k);
+ QCOMPARE(i2.cacheKey(), i1k);
+}
+
void tst_QIcon::bestMatch()
{
QPixmap p1(1, 1);
diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro
index 6469211872..798c82ea2d 100644
--- a/tests/auto/qimage/qimage.pro
+++ b/tests/auto/qimage/qimage.pro
@@ -2,17 +2,17 @@ load(qttest_p4)
SOURCES += tst_qimage.cpp
wince*: {
- addImages.sources = images/*
+ addImages.files = images/*
addImages.path = images
DEPLOYMENT += addImages
DEFINES += SRCDIR=\\\".\\\"
} else:symbian {
TARGET.EPOCHEAPSIZE = 0x200000 0x800000
- addImages.sources = images/*
+ addImages.files = images/*
addImages.path = images
DEPLOYMENT += addImages
qt_not_deployed {
- imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll
+ imagePlugins.files = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll
imagePlugins.path = imageformats
DEPLOYMENT += imagePlugins
}
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index 558dfaac79..c5ded0d158 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -59,6 +59,7 @@
#endif
Q_DECLARE_METATYPE(QImage::Format)
+Q_DECLARE_METATYPE(Qt::GlobalColor)
class tst_QImage : public QObject
{
@@ -68,6 +69,7 @@ public:
tst_QImage();
private slots:
+ void swap();
void create();
void createInvalidXPM();
void createFromUChar();
@@ -140,6 +142,11 @@ private slots:
void compareIndexed();
+ void fillColor_data();
+ void fillColor();
+
+ void fillColorWithAlpha();
+
void rgbSwapped_data();
void rgbSwapped();
@@ -151,6 +158,20 @@ tst_QImage::tst_QImage()
{
}
+void tst_QImage::swap()
+{
+ QImage i1( 16, 16, QImage::Format_RGB32 ), i2( 32, 32, QImage::Format_RGB32 );
+ i1.fill( Qt::white );
+ i2.fill( Qt::black );
+ const qint64 i1k = i1.cacheKey();
+ const qint64 i2k = i2.cacheKey();
+ i1.swap(i2);
+ QCOMPARE(i1.cacheKey(), i2k);
+ QCOMPARE(i1.size(), QSize(32,32));
+ QCOMPARE(i2.cacheKey(), i1k);
+ QCOMPARE(i2.size(), QSize(16,16));
+}
+
// Test if QImage (or any functions called from QImage) throws an
// exception when creating an extremely large image.
// QImage::create() should return "false" in this case.
@@ -1825,6 +1846,112 @@ void tst_QImage::compareIndexed()
QCOMPARE(img, imgInverted);
}
+void tst_QImage::fillColor_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+ QTest::addColumn<Qt::GlobalColor>("color");
+ QTest::addColumn<uint>("pixelValue");
+
+ QTest::newRow("Mono, color0") << QImage::Format_Mono << Qt::color0 << 0u;
+ QTest::newRow("Mono, color1") << QImage::Format_Mono << Qt::color1 << 1u;
+
+ QTest::newRow("MonoLSB, color0") << QImage::Format_MonoLSB << Qt::color0 << 0u;
+ QTest::newRow("MonoLSB, color1") << QImage::Format_MonoLSB << Qt::color1 << 1u;
+
+ const char *names[] = {
+ "Indexed8",
+ "RGB32",
+ "ARGB32",
+ "ARGB32pm",
+ "RGB16",
+ "ARGB8565pm",
+ "RGB666",
+ "ARGB6666pm",
+ "RGB555",
+ "ARGB8555pm",
+ "RGB888",
+ "RGB444",
+ "ARGB4444pm",
+ 0
+ };
+
+ QImage::Format formats[] = {
+ QImage::Format_Indexed8,
+ QImage::Format_RGB32,
+ QImage::Format_ARGB32,
+ QImage::Format_ARGB32_Premultiplied,
+ QImage::Format_RGB16,
+ QImage::Format_ARGB8565_Premultiplied,
+ QImage::Format_RGB666,
+ QImage::Format_ARGB6666_Premultiplied,
+ QImage::Format_RGB555,
+ QImage::Format_ARGB8555_Premultiplied,
+ QImage::Format_RGB888,
+ QImage::Format_RGB444,
+ QImage::Format_ARGB4444_Premultiplied
+ };
+
+ for (int i=0; names[i] != 0; ++i) {
+ QByteArray name;
+ name.append(names[i]).append(", ");
+
+ QTest::newRow(QByteArray(name).append("black").constData()) << formats[i] << Qt::black << 0xff000000;
+ QTest::newRow(QByteArray(name).append("white").constData()) << formats[i] << Qt::white << 0xffffffff;
+ QTest::newRow(QByteArray(name).append("red").constData()) << formats[i] << Qt::red << 0xffff0000;
+ QTest::newRow(QByteArray(name).append("green").constData()) << formats[i] << Qt::green << 0xff00ff00;
+ QTest::newRow(QByteArray(name).append("blue").constData()) << formats[i] << Qt::blue << 0xff0000ff;
+ }
+
+ QTest::newRow("RGB16, transparent") << QImage::Format_RGB16 << Qt::transparent << 0xff000000;
+ QTest::newRow("RGB32, transparent") << QImage::Format_RGB32 << Qt::transparent << 0xff000000;
+ QTest::newRow("ARGB32, transparent") << QImage::Format_ARGB32 << Qt::transparent << 0x00000000u;
+ QTest::newRow("ARGB32pm, transparent") << QImage::Format_ARGB32_Premultiplied << Qt::transparent << 0x00000000u;
+}
+
+void tst_QImage::fillColor()
+{
+ QFETCH(QImage::Format, format);
+ QFETCH(Qt::GlobalColor, color);
+ QFETCH(uint, pixelValue);
+
+ QImage image(1, 1, format);
+
+ if (image.depth() == 8) {
+ QVector<QRgb> table;
+ table << 0xff000000;
+ table << 0xffffffff;
+ table << 0xffff0000;
+ table << 0xff00ff00;
+ table << 0xff0000ff;
+ image.setColorTable(table);
+ }
+
+ image.fill(color);
+ if (image.depth() == 1) {
+ QCOMPARE(image.pixelIndex(0, 0), (int) pixelValue);
+ } else {
+ QCOMPARE(image.pixel(0, 0), pixelValue);
+ }
+
+ image.fill(QColor(color));
+ if (image.depth() == 1) {
+ QCOMPARE(image.pixelIndex(0, 0), (int) pixelValue);
+ } else {
+ QCOMPARE(image.pixel(0, 0), pixelValue);
+ }
+}
+
+void tst_QImage::fillColorWithAlpha()
+{
+ QImage argb32(1, 1, QImage::Format_ARGB32);
+ argb32.fill(QColor(255, 0, 0, 127));
+ QCOMPARE(argb32.pixel(0, 0), qRgba(255, 0, 0, 127));
+
+ QImage argb32pm(1, 1, QImage::Format_ARGB32_Premultiplied);
+ argb32pm.fill(QColor(255, 0, 0, 127));
+ QCOMPARE(argb32pm.pixel(0, 0), 0x7f7f0000u);
+}
+
void tst_QImage::rgbSwapped_data()
{
QTest::addColumn<QImage::Format>("format");
diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro
index f8fc7fa395..827819dea5 100644
--- a/tests/auto/qimagereader/qimagereader.pro
+++ b/tests/auto/qimagereader/qimagereader.pro
@@ -17,10 +17,10 @@ win32-msvc.net:QMAKE_CXXFLAGS -= -Zm300
win32-msvc.net:QMAKE_CXXFLAGS += -Zm1100
wince*: {
- images.sources = images
+ images.files = images
images.path = .
- imagePlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/*.dll
+ imagePlugins.files = $$QT_BUILD_TREE/plugins/imageformats/*.dll
imagePlugins.path = imageformats
DEPLOYMENT += images imagePlugins
@@ -28,13 +28,13 @@ wince*: {
}
symbian: {
- images.sources = images
+ images.files = images
images.path = .
DEPLOYMENT += images
qt_not_deployed {
- imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll
+ imagePlugins.files = qjpeg.dll qgif.dll qmng.dll
imagePlugins.path = imageformats
DEPLOYMENT += imagePlugins
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 69e8eadd39..7c2aee8922 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -182,6 +182,9 @@ private slots:
void saveFormat_data();
void saveFormat();
+
+ void preserveTexts_data();
+ void preserveTexts();
};
static const QLatin1String prefix(SRCDIR "/images/");
@@ -1104,6 +1107,11 @@ void tst_QImageReader::readFromDevice()
QCOMPARE(image1, expectedImage);
}
+#if defined (Q_OS_SYMBIAN) && defined (__WINS__)
+ //the emulator hangs in socket write (this is a test bug, it assumes the TCP stack can accept a whole image to its buffers)
+ if(imageData.size() > 16384)
+ QSKIP("image larger than socket buffer (test needs to be rewritten)", SkipSingle);
+#endif
Server server(imageData);
QEventLoop loop;
connect(&server, SIGNAL(ready()), &loop, SLOT(quit()));
@@ -1255,7 +1263,10 @@ void tst_QImageReader::devicePosition()
buf.seek(preLen);
QImageReader reader(&buf, format);
QCOMPARE(expected, reader.read());
- if (format != "ppm" && format != "gif") // Known not to work
+ if (format != "ppm" &&
+ format != "pgm" &&
+ format != "pbm" &&
+ format != "gif") // Known not to work
QCOMPARE(buf.pos(), qint64(preLen+imageDataSize));
}
@@ -1954,5 +1965,64 @@ void tst_QImageReader::saveFormat()
}
+void tst_QImageReader::preserveTexts_data()
+{
+ QTest::addColumn<QString>("text");
+
+ QTest::newRow("Simple") << "simpletext";
+ QTest::newRow("Whitespace") << " A text with whitespace ";
+ QTest::newRow("Newline") << "A text\nwith newlines\n";
+ QTest::newRow("Double newlines") << "A text\n\nwith double newlines\n\n";
+ QTest::newRow("Long") << QString("A rather long text, at least after many repetitions. ").repeated(100);
+ QString latin1set;
+ int c;
+ for(c = 0x20; c <= 0x7e; c++)
+ latin1set.append(QLatin1Char(c));
+ for(c = 0xa0; c <= 0xff; c++)
+ latin1set.append(QLatin1Char(c));
+ QTest::newRow("All Latin1 chars") << latin1set;
+
+#if 0
+ // Depends on iTXt support in libpng
+ QTest::newRow("Multibyte string") << QString::fromUtf8("\341\233\222\341\233\226\341\232\251\341\232\271\341\232\242\341\233\232\341\232\240");
+#endif
+}
+
+
+void tst_QImageReader::preserveTexts()
+{
+ QFETCH(QString, text);
+ QString key("testkey");
+ QString key2("testkey2");
+ QString text2("Some other text.");
+ QString key3("testkey3");
+ QString text3("Some more other text.");
+
+ QImage img(":/images/kollada.png");
+ img.setText(key, text);
+ img.setText(key2, text2);
+ QBuffer buf;
+ buf.open(QIODevice::WriteOnly);
+ QVERIFY(img.save(&buf, "png"));
+ buf.close();
+ QImage stored = QImage::fromData(buf.buffer(), "png");
+ QCOMPARE(stored.text(key), text);
+ QCOMPARE(stored.text(key2), text2);
+
+ QImage img2(":/images/kollada.png");
+ img2.setText(key3, text3);
+ QBuffer buf2;
+ QImageWriter w(&buf2, "png");
+ w.setText(key, text);
+ w.setText(key2, text2);
+ QVERIFY(w.write(img2));
+ buf2.close();
+ QImageReader r(&buf2, "png");
+ QCOMPARE(r.text(key), text.simplified());
+ QCOMPARE(r.text(key2), text2.simplified());
+ QCOMPARE(r.text(key3), text3.simplified());
+}
+
+
QTEST_MAIN(tst_QImageReader)
#include "tst_qimagereader.moc"
diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro
index f25472fe68..bab241977b 100644
--- a/tests/auto/qimagewriter/qimagewriter.pro
+++ b/tests/auto/qimagewriter/qimagewriter.pro
@@ -6,16 +6,16 @@ win32-msvc:QMAKE_CXXFLAGS -= -Zm200
win32-msvc:QMAKE_CXXFLAGS += -Zm800
wince*: {
- addFiles.sources = images\\*.*
+ addFiles.files = images\\*.*
addFiles.path = images
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
} else:symbian {
- addFiles.sources = images\\*.*
+ addFiles.files = images\\*.*
addFiles.path = images
DEPLOYMENT += addFiles
qt_not_deployed {
- imagePlugins.sources = qjpeg.dll qtiff.dll
+ imagePlugins.files = qjpeg.dll qtiff.dll
imagePlugins.path = imageformats
DEPLOYMENT += imagePlugins
}
diff --git a/tests/auto/qiodevice/qiodevice.pro b/tests/auto/qiodevice/qiodevice.pro
index 716cdcef10..29b0a05ddc 100644
--- a/tests/auto/qiodevice/qiodevice.pro
+++ b/tests/auto/qiodevice/qiodevice.pro
@@ -4,14 +4,14 @@ SOURCES += tst_qiodevice.cpp
QT = core network
wince*: {
- addFiles.sources = tst_qiodevice.cpp
+ addFiles.files = tst_qiodevice.cpp
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
!wince50standard-x86-msvc2005: DEFINES += WINCE_EMULATOR_TEST=1
} else:symbian {
# SRCDIR defined in code in symbian
- addFiles.sources = tst_qiodevice.cpp
+ addFiles.files = tst_qiodevice.cpp
addFiles.path = .
DEPLOYMENT += addFiles
TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp
index abb019981d..50abffe1f0 100644
--- a/tests/auto/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/qiodevice/tst_qiodevice.cpp
@@ -81,6 +81,8 @@ private slots:
void readLine2_data();
void readLine2();
+
+ void peekBug();
};
// Testing get/set functions
@@ -591,5 +593,62 @@ void tst_QIODevice::readLine2()
}
}
+
+class PeekBug : public QIODevice {
+ Q_OBJECT
+public:
+ char alphabet[27];
+ qint64 counter;
+ PeekBug() : QIODevice(), counter(0) {
+ memcpy(alphabet,"abcdefghijklmnopqrstuvqxyz",27);
+ };
+ qint64 readData(char *data, qint64 maxlen) {
+ qint64 pos = 0;
+ while (pos < maxlen) {
+ *(data + pos) = alphabet[counter];
+ pos++;
+ counter++;
+ if (counter == 26)
+ counter = 0;
+ }
+ return maxlen;
+ }
+ qint64 writeData(const char *data, qint64 maxlen) {
+ return -1;
+ }
+
+};
+
+// This is a testcase for the bug fixed with bd287865
+void tst_QIODevice::peekBug()
+{
+ PeekBug peekBug;
+ peekBug.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
+
+ char onetwo[2];
+ peekBug.peek(onetwo, 2);
+ QCOMPARE(onetwo[0], 'a');
+ QCOMPARE(onetwo[1], 'b');
+
+ peekBug.read(onetwo, 1);
+ QCOMPARE(onetwo[0], 'a');
+
+ peekBug.peek(onetwo, 2);
+ QCOMPARE(onetwo[0], 'b');
+ QCOMPARE(onetwo[1], 'c');
+
+ peekBug.read(onetwo, 1);
+ QCOMPARE(onetwo[0], 'b');
+ peekBug.read(onetwo, 1);
+ QCOMPARE(onetwo[0], 'c');
+ peekBug.read(onetwo, 1);
+ QCOMPARE(onetwo[0], 'd');
+
+ peekBug.peek(onetwo, 2);
+ QCOMPARE(onetwo[0], 'e');
+ QCOMPARE(onetwo[1], 'f');
+
+}
+
QTEST_MAIN(tst_QIODevice)
#include "tst_qiodevice.moc"
diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
index 834775433c..b3576a11ab 100644
--- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
@@ -235,6 +235,7 @@ private slots:
void enterKey();
void task257859_finalizeEdit();
+ void QTBUG4435_keepSelectionOnCheck();
};
@@ -1168,6 +1169,31 @@ void tst_QItemDelegate::task257859_finalizeEdit()
QTRY_VERIFY(!editor);
}
+void tst_QItemDelegate::QTBUG4435_keepSelectionOnCheck()
+{
+ QStandardItemModel model(3, 1);
+ for (int i = 0; i < 3; ++i) {
+ QStandardItem *item = new QStandardItem(QLatin1String("Item ") + QString::number(i));
+ item->setCheckable(true);
+ item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+ model.setItem(i, item);
+ }
+ QTableView view;
+ view.setModel(&model);
+ view.setItemDelegate(new TestItemDelegate);
+ view.show();
+ view.selectAll();
+ QTest::qWaitForWindowShown(&view);
+ QStyleOptionViewItem option;
+ option.rect = view.visualRect(model.index(0, 0));
+ const int checkMargin = qApp->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1;
+ QPoint pos = qApp->style()->subElementRect(QStyle::SE_ViewItemCheckIndicator, &option, 0).center()
+ + QPoint(checkMargin, 0);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, pos);
+ QTRY_VERIFY(view.selectionModel()->isColumnSelected(0, QModelIndex()));
+ QCOMPARE(model.item(0)->checkState(), Qt::Checked);
+}
+
// ### _not_ covered:
diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro
index 92709febae..b348a183f8 100644
--- a/tests/auto/qitemmodel/qitemmodel.pro
+++ b/tests/auto/qitemmodel/qitemmodel.pro
@@ -9,7 +9,7 @@ QT += sql
# memory on Windows Mobile 5.
#wince*: {
-# plugFiles.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*.dll
+# plugFiles.files = $$QT_BUILD_TREE/plugins/sqldrivers/*.dll
# plugFiles.path = sqldrivers
# DEPLOYMENT += plugFiles
#}
@@ -19,7 +19,7 @@ symbian {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
index ee544859fe..6e20fb23c4 100644
--- a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -94,6 +94,11 @@ private slots:
void task260134_layoutChangedWithAllSelected();
void QTBUG5671_layoutChangedWithAllSelected();
void QTBUG2804_layoutChangedTreeSelection();
+ void deselectRemovedMiddleRange();
+ void rangeOperatorLessThan_data();
+ void rangeOperatorLessThan();
+
+ void testDifferentModels();
void testValidRangesInSelectionsAfterReset();
@@ -2355,6 +2360,237 @@ void tst_QItemSelectionModel::QTBUG2804_layoutChangedTreeSelection()
QCOMPARE(selModel.selectedIndexes().count(), 4);
}
+class RemovalObserver : public QObject
+{
+ Q_OBJECT
+ QItemSelectionModel *m_itemSelectionModel;
+public:
+ RemovalObserver(QItemSelectionModel *selectionModel)
+ : m_itemSelectionModel(selectionModel)
+ {
+ connect(m_itemSelectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SLOT(selectionChanged(QItemSelection, QItemSelection)));
+ }
+
+public slots:
+ void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
+ {
+ foreach(const QModelIndex &index, deselected.indexes()) {
+ QVERIFY(!m_itemSelectionModel->selection().contains(index));
+ }
+ QVERIFY(m_itemSelectionModel->selection().size() == 2);
+ }
+
+};
+
+void tst_QItemSelectionModel::deselectRemovedMiddleRange()
+{
+ QStandardItemModel model(8, 0);
+
+ for (int row = 0; row < 8; ++row) {
+ static const int column = 0;
+ QStandardItem *item = new QStandardItem(QString::number(row));
+ model.setItem(row, column, item);
+ }
+
+ QItemSelectionModel selModel(&model);
+
+ selModel.select(QItemSelection(model.index(3, 0), model.index(6, 0)), QItemSelectionModel::Select);
+
+ QVERIFY(selModel.selection().size() == 1);
+
+ RemovalObserver ro(&selModel);
+
+ QSignalSpy spy(&selModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)));
+ bool ok = model.removeRows(4, 2);
+
+ QVERIFY(ok);
+ QVERIFY(spy.size() == 1);
+}
+
+static QStandardItemModel* getModel(QObject *parent)
+{
+ QStandardItemModel *model = new QStandardItemModel(parent);
+
+ for (int i = 0; i < 4; ++i) {
+ QStandardItem *parentItem = model->invisibleRootItem();
+ QList<QStandardItem*> list;
+ for (int j = 0; j < 4; ++j) {
+ list.append(new QStandardItem(QString("item %1, %2").arg(i).arg(j)));
+ }
+ parentItem->appendRow(list);
+ parentItem = list.first();
+ for (int j = 0; j < 4; ++j) {
+ QList<QStandardItem*> list;
+ for (int k = 0; k < 4; ++k) {
+ list.append(new QStandardItem(QString("item %1, %2").arg(i).arg(j)));
+ }
+ parentItem->appendRow(list);
+ }
+ }
+ return model;
+}
+
+enum Result {
+ LessThan,
+ NotLessThan,
+ NotEqual
+};
+
+Q_DECLARE_METATYPE(Result);
+
+void tst_QItemSelectionModel::rangeOperatorLessThan_data()
+{
+ QTest::addColumn<int>("parent1");
+ QTest::addColumn<int>("top1");
+ QTest::addColumn<int>("left1");
+ QTest::addColumn<int>("bottom1");
+ QTest::addColumn<int>("right1");
+ QTest::addColumn<int>("parent2");
+ QTest::addColumn<int>("top2");
+ QTest::addColumn<int>("left2");
+ QTest::addColumn<int>("bottom2");
+ QTest::addColumn<int>("right2");
+ QTest::addColumn<Result>("result");
+
+ QTest::newRow("lt01") << -1 << 0 << 0 << 3 << 3
+ << -1 << 0 << 0 << 3 << 3 << NotLessThan;
+
+ QTest::newRow("lt02") << -1 << 0 << 0 << 2 << 3
+ << -1 << 0 << 0 << 3 << 3 << LessThan;
+ QTest::newRow("lt03") << -1 << 0 << 0 << 3 << 2
+ << -1 << 0 << 0 << 3 << 3 << LessThan;
+ QTest::newRow("lt04") << -1 << 0 << 0 << 2 << 2
+ << -1 << 0 << 0 << 3 << 3 << LessThan;
+
+ QTest::newRow("lt05") << -1 << 0 << 0 << 3 << 3
+ << -1 << 0 << 0 << 2 << 3 << NotLessThan;
+ QTest::newRow("lt06") << -1 << 0 << 0 << 3 << 3
+ << -1 << 0 << 0 << 3 << 2 << NotLessThan;
+ QTest::newRow("lt07") << -1 << 0 << 0 << 3 << 3
+ << -1 << 0 << 0 << 2 << 2 << NotLessThan;
+
+ QTest::newRow("lt08") << -1 << 0 << 0 << 3 << 3
+ << 0 << 0 << 0 << 3 << 3 << NotEqual;
+ QTest::newRow("lt09") << 1 << 0 << 0 << 3 << 3
+ << 0 << 0 << 0 << 3 << 3 << NotEqual;
+ QTest::newRow("lt10") << 1 << 0 << 0 << 1 << 1
+ << 0 << 2 << 2 << 3 << 3 << NotEqual;
+ QTest::newRow("lt11") << 1 << 2 << 2 << 3 << 3
+ << 0 << 0 << 0 << 1 << 1 << NotEqual;
+
+ QTest::newRow("lt12") << -1 << 0 << 0 << 1 << 1
+ << -1 << 2 << 2 << 3 << 3 << LessThan;
+ QTest::newRow("lt13") << -1 << 2 << 2 << 3 << 3
+ << -1 << 0 << 0 << 1 << 1 << NotLessThan;
+ QTest::newRow("lt14") << 1 << 0 << 0 << 1 << 1
+ << 1 << 2 << 2 << 3 << 3 << LessThan;
+ QTest::newRow("lt15") << 1 << 2 << 2 << 3 << 3
+ << 1 << 0 << 0 << 1 << 1 << NotLessThan;
+
+ QTest::newRow("lt16") << -1 << 0 << 0 << 2 << 2
+ << -1 << 1 << 1 << 3 << 3 << LessThan;
+ QTest::newRow("lt17") << -1 << 1 << 1 << 3 << 3
+ << -1 << 0 << 0 << 2 << 2 << NotLessThan;
+ QTest::newRow("lt18") << 1 << 0 << 0 << 2 << 2
+ << 1 << 1 << 1 << 3 << 3 << LessThan;
+ QTest::newRow("lt19") << 1 << 1 << 1 << 3 << 3
+ << 1 << 0 << 0 << 2 << 2 << NotLessThan;
+}
+
+void tst_QItemSelectionModel::rangeOperatorLessThan()
+{
+ QStandardItemModel *model1 = getModel(this);
+ QStandardItemModel *model2 = getModel(this);
+
+ QFETCH(int, parent1);
+ QFETCH(int, top1);
+ QFETCH(int, left1);
+ QFETCH(int, bottom1);
+ QFETCH(int, right1);
+ QFETCH(int, parent2);
+ QFETCH(int, top2);
+ QFETCH(int, left2);
+ QFETCH(int, bottom2);
+ QFETCH(int, right2);
+ QFETCH(Result, result);
+
+ QModelIndex p1 = model1->index(parent1, 0);
+
+ QModelIndex tl1 = model1->index(top1, left1, p1);
+ QModelIndex br1 = model1->index(bottom1, right1, p1);
+
+ QItemSelectionRange r1(tl1, br1);
+
+ QModelIndex p2 = model1->index(parent2, 0);
+
+ QModelIndex tl2 = model1->index(top2, left2, p2);
+ QModelIndex br2 = model1->index(bottom2, right2, p2);
+
+ QItemSelectionRange r2(tl2, br2);
+
+ if (result == LessThan)
+ QVERIFY(r1 < r2);
+ else if (result == NotLessThan)
+ QVERIFY(!(r1 < r2));
+ else if (result == NotEqual)
+ if (!(r1 < r2))
+ QVERIFY(r2 < r1);
+
+ // Ranges in different models are always non-equal
+
+ QModelIndex p3 = model2->index(parent1, 0);
+
+ QModelIndex tl3 = model2->index(top1, left1, p3);
+ QModelIndex br3 = model2->index(bottom1, right1, p3);
+
+ QItemSelectionRange r3(tl3, br3);
+
+ if (!(r1 < r3))
+ QVERIFY(r3 < r1);
+
+ if (!(r2 < r3))
+ QVERIFY(r3 < r2);
+
+ QModelIndex p4 = model2->index(parent2, 0);
+
+ QModelIndex tl4 = model2->index(top2, left2, p4);
+ QModelIndex br4 = model2->index(bottom2, right2, p4);
+
+ QItemSelectionRange r4(tl4, br4);
+
+ if (!(r1 < r4))
+ QVERIFY(r4 < r1);
+
+ if (!(r2 < r4))
+ QVERIFY(r4 < r2);
+}
+
+void tst_QItemSelectionModel::testDifferentModels()
+{
+ QStandardItemModel model1;
+ QStandardItemModel model2;
+ QStandardItem top11("Child1"), top12("Child2"), top13("Child3");
+ QStandardItem top21("Child1"), top22("Child2"), top23("Child3");
+
+ model1.appendColumn(QList<QStandardItem*>() << &top11 << &top12 << &top13);
+ model2.appendColumn(QList<QStandardItem*>() << &top21 << &top22 << &top23);
+
+
+ QModelIndex topIndex1 = model1.index(0, 0);
+ QModelIndex bottomIndex1 = model1.index(2, 0);
+ QModelIndex topIndex2 = model2.index(0, 0);
+
+ QItemSelectionRange range(topIndex1, bottomIndex1);
+
+ QVERIFY(range.intersects(QItemSelectionRange(topIndex1, topIndex1)));
+ QVERIFY(!range.intersects(QItemSelectionRange(topIndex2, topIndex2)));
+
+ QItemSelection newSelection;
+ QItemSelection::split(range, QItemSelectionRange(topIndex2, topIndex2), &newSelection);
+
+ QVERIFY(newSelection.isEmpty());
+}
+
class SelectionObserver : public QObject
{
Q_OBJECT
@@ -2417,7 +2653,6 @@ void tst_QItemSelectionModel::testValidRangesInSelectionsAfterReset()
observer.setSelectionModel(&selectionModel);
model.setStringList(strings);
-
}
QTEST_MAIN(tst_QItemSelectionModel)
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index 9f45b9661e..f44645017c 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -112,6 +112,7 @@ public:
virtual ~tst_QKeySequence();
private slots:
+ void swap();
void operatorQString_data();
void operatorQString();
void compareConstructors_data();
@@ -176,6 +177,15 @@ void tst_QKeySequence::initTestCase()
qtTranslator->load(":/qt_de");
}
+void tst_QKeySequence::swap()
+{
+ QKeySequence ks1(Qt::CTRL+Qt::Key_O);
+ QKeySequence ks2(Qt::CTRL+Qt::Key_L);
+ ks1.swap(ks2);
+ QCOMPARE(ks1[0], int(Qt::CTRL+Qt::Key_L));
+ QCOMPARE(ks2[0], int(Qt::CTRL+Qt::Key_O));
+}
+
void tst_QKeySequence::operatorQString_data()
{
QTest::addColumn<int>("modifiers");
diff --git a/tests/auto/qlabel/qlabel.pro b/tests/auto/qlabel/qlabel.pro
index 297f868b3e..057a6f1509 100644
--- a/tests/auto/qlabel/qlabel.pro
+++ b/tests/auto/qlabel/qlabel.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qlabel.cpp
wince*::DEFINES += SRCDIR=\\\"\\\"
else:!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
wince*|symbian {
- addFiles.sources = *.png \
+ addFiles.files = *.png \
testdata
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro
index c99f1d9fcf..dfa8584653 100644
--- a/tests/auto/qlayout/qlayout.pro
+++ b/tests/auto/qlayout/qlayout.pro
@@ -7,7 +7,7 @@ load(qttest_p4)
SOURCES += tst_qlayout.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
wince*|symbian: {
- addFiles.sources = baseline
+ addFiles.files = baseline
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qlibrary/qlibrary.pro b/tests/auto/qlibrary/qlibrary.pro
index fd5790b209..5dc129fbf9 100644
--- a/tests/auto/qlibrary/qlibrary.pro
+++ b/tests/auto/qlibrary/qlibrary.pro
@@ -15,3 +15,4 @@ TARGET = tst_qlibrary
# no special install rule for subdir
INSTALLS =
+CONFIG += parallel_test
diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro
index 4c647c005d..28c40b0b42 100644
--- a/tests/auto/qlibrary/tst/tst.pro
+++ b/tests/auto/qlibrary/tst/tst.pro
@@ -12,18 +12,18 @@ win32 {
}
wince*: {
- addFiles.sources = ../*.dll ../*.dl2 ../mylib_noextension
+ addFiles.files = ../*.dll ../*.dl2 ../mylib_noextension
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
}else:symbian {
- binDep.sources = \
+ binDep.files = \
mylib.dll \
system.trolltech.test.mylib.dll
binDep.path = /sys/bin
#mylib.dl2 nonstandard binary deployment will cause warning in emulator,
#but it can be safely ignored.
- custBinDep.sources = mylib.dl2
+ custBinDep.files = mylib.dl2
custBinDep.path = /sys/bin
DEPLOYMENT += binDep custBinDep
diff --git a/tests/auto/qlibrary/tst_qlibrary.cpp b/tests/auto/qlibrary/tst_qlibrary.cpp
index 6d7d7e79ea..c79332d276 100644
--- a/tests/auto/qlibrary/tst_qlibrary.cpp
+++ b/tests/auto/qlibrary/tst_qlibrary.cpp
@@ -53,6 +53,7 @@
#define a_VALID false
#define so_VALID false
#define dll_VALID false
+#define DLL_VALID false
#if defined(Q_OS_DARWIN)
# undef bundle_VALID
@@ -88,6 +89,8 @@
#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
# undef dll_VALID
# define dll_VALID true
+# undef DLL_VALID
+# define DLL_VALID true
# define SUFFIX ".dll"
# define PREFIX ""
@@ -200,6 +203,7 @@ void tst_QLibrary::version()
VersionFunction fnVersion = (VersionFunction)library.resolve("mylibversion");
QVERIFY(fnVersion);
QCOMPARE(fnVersion(), resultversion);
+ QVERIFY(library.unload());
#else
Q_UNUSED(lib);
Q_UNUSED(loadversion);
@@ -246,6 +250,7 @@ void tst_QLibrary::load()
bool ok = library.load();
if ( result ) {
QVERIFY( ok );
+ QVERIFY(library.unload());
} else {
QVERIFY( !ok );
}
@@ -335,6 +340,7 @@ void tst_QLibrary::resolve()
} else {
QVERIFY( func == 0 );
}
+ library.unload();
}
void tst_QLibrary::library_data()
@@ -352,6 +358,7 @@ void tst_QLibrary::isLibrary_data()
QTest::newRow(".a") << QString("mylib.a") << a_VALID;
QTest::newRow(".bundle") << QString("mylib.bundle") << bundle_VALID;
QTest::newRow(".dll") << QString("mylib.dll") << dll_VALID;
+ QTest::newRow(".DLL") << QString("MYLIB.DLL") << DLL_VALID;
QTest::newRow(".dl2" ) << QString("mylib.dl2") << false;
QTest::newRow(".dylib") << QString("mylib.dylib") << dylib_VALID;
QTest::newRow(".sl") << QString("mylib.sl") << sl_VALID;
@@ -465,7 +472,9 @@ void tst_QLibrary::errorString()
break;
}
QRegExp re(errorString);
- QVERIFY2(re.exactMatch(lib.errorString()), qPrintable(lib.errorString()));
+ QString libErrorString = lib.errorString();
+ QVERIFY(!lib.isLoaded() || lib.unload());
+ QVERIFY2(re.exactMatch(libErrorString), qPrintable(libErrorString));
QCOMPARE(ok, success);
}
@@ -521,6 +530,7 @@ void tst_QLibrary::loadHints()
bool ok = library.load();
if ( result ) {
QVERIFY( ok );
+ QVERIFY(library.unload());
} else {
QVERIFY( !ok );
}
@@ -556,7 +566,12 @@ void tst_QLibrary::fileName()
}
QVERIFY(ok);
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(lib.fileName().toLower(), expectedFilename.toLower());
+#else
QCOMPARE(lib.fileName(), expectedFilename);
+#endif
+ QVERIFY(lib.unload());
}
@@ -568,29 +583,42 @@ void tst_QLibrary::multipleInstancesForOneLibrary()
QString lib = QDir::currentPath() + "/mylib";
#endif
- QLibrary lib1(lib);
- QLibrary lib2(lib);
- QCOMPARE(lib1.isLoaded(), false);
- QCOMPARE(lib2.isLoaded(), false);
- lib1.load();
- QCOMPARE(lib1.isLoaded(), true);
- QCOMPARE(lib2.isLoaded(), true);
- QCOMPARE(lib1.unload(), true);
- QCOMPARE(lib1.isLoaded(), false);
- QCOMPARE(lib2.isLoaded(), false);
- lib1.load();
- lib2.load();
- QCOMPARE(lib1.isLoaded(), true);
- QCOMPARE(lib2.isLoaded(), true);
- QCOMPARE(lib1.unload(), false);
- QCOMPARE(lib1.isLoaded(), true);
- QCOMPARE(lib2.isLoaded(), true);
- QCOMPARE(lib2.unload(), true);
- QCOMPARE(lib1.isLoaded(), false);
- QCOMPARE(lib2.isLoaded(), false);
+ {
+ QLibrary lib1(lib);
+ QLibrary lib2(lib);
+ QCOMPARE(lib1.isLoaded(), false);
+ QCOMPARE(lib2.isLoaded(), false);
+ lib1.load();
+ QCOMPARE(lib1.isLoaded(), true);
+ QCOMPARE(lib2.isLoaded(), true);
+ QCOMPARE(lib1.unload(), true);
+ QCOMPARE(lib1.isLoaded(), false);
+ QCOMPARE(lib2.isLoaded(), false);
+ lib1.load();
+ lib2.load();
+ QCOMPARE(lib1.isLoaded(), true);
+ QCOMPARE(lib2.isLoaded(), true);
+ QCOMPARE(lib1.unload(), false);
+ QCOMPARE(lib1.isLoaded(), true);
+ QCOMPARE(lib2.isLoaded(), true);
+ QCOMPARE(lib2.unload(), true);
+ QCOMPARE(lib1.isLoaded(), false);
+ QCOMPARE(lib2.isLoaded(), false);
+
+ // Finally; unload on that is already unloaded
+ QCOMPARE(lib1.unload(), false);
+ }
- // Finally; unload on that is already unloaded
- QCOMPARE(lib1.unload(), false);
+ //now let's try with a 3rd one that will go out of scope
+ {
+ QLibrary lib1(lib);
+ QCOMPARE(lib1.isLoaded(), false);
+ lib1.load();
+ QCOMPARE(lib1.isLoaded(), true);
+ }
+ QLibrary lib2(lib);
+ //lib2 should be loaded because lib1 was loaded and never unloaded
+ QCOMPARE(lib2.isLoaded(), true);
/*
lib1.setLoadHints(QLibrary::ResolveAllSymbolsHint);
diff --git a/tests/auto/qline/qline.pro b/tests/auto/qline/qline.pro
index 4651fd324f..6e9af24476 100644
--- a/tests/auto/qline/qline.pro
+++ b/tests/auto/qline/qline.pro
@@ -4,3 +4,4 @@ SOURCES += tst_qline.cpp
unix:!mac:!symbian:!vxworks:LIBS+=-lm
+CONFIG += parallel_test
diff --git a/tests/auto/qlist/tst_qlist.cpp b/tests/auto/qlist/tst_qlist.cpp
index 1d3004c494..155a70ec2b 100644
--- a/tests/auto/qlist/tst_qlist.cpp
+++ b/tests/auto/qlist/tst_qlist.cpp
@@ -89,6 +89,8 @@ private slots:
void testSTLIterators() const;
void testOperators() const;
+
+ void initializeList() const;
};
void tst_QList::length() const
@@ -497,6 +499,13 @@ void tst_QList::swap() const
// swap again
list.swap(1, 2);
QCOMPARE(list, QList<QString>() << "baz" << "foo" << "bar");
+
+ QList<QString> list2;
+ list2 << "alpha" << "beta";
+
+ list.swap(list2);
+ QCOMPARE(list, QList<QString>() << "alpha" << "beta");
+ QCOMPARE(list2, QList<QString>() << "baz" << "foo" << "bar");
}
void tst_QList::takeAt() const
@@ -662,5 +671,19 @@ void tst_QList::testSTLIterators() const
QCOMPARE(*it, QLatin1String("foo"));
}
+void tst_QList::initializeList() const
+{
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+ QList<int> v1{2,3,4};
+ QCOMPARE(v1, QList<int>() << 2 << 3 << 4);
+ QCOMPARE(v1, (QList<int>{2,3,4}));
+
+ QList<QList<int>> v2{ v1, {1}, QList<int>(), {2,3,4} };
+ QList<QList<int>> v3;
+ v3 << v1 << (QList<int>() << 1) << QList<int>() << v1;
+ QCOMPARE(v3, v2);
+#endif
+}
+
QTEST_APPLESS_MAIN(tst_QList)
#include "tst_qlist.moc"
diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp
index 85b83500a7..2538022fdf 100644
--- a/tests/auto/qlistwidget/tst_qlistwidget.cpp
+++ b/tests/auto/qlistwidget/tst_qlistwidget.cpp
@@ -133,6 +133,7 @@ private slots:
void task217070_scrollbarsAdjusted();
void task258949_keypressHangup();
void QTBUG8086_currentItemChangedOnClick();
+ void QTBUG14363_completerWithAnyKeyPressedEditTriggers();
protected slots:
@@ -1649,5 +1650,44 @@ void tst_QListWidget::QTBUG8086_currentItemChangedOnClick()
}
+class ItemDelegate : public QItemDelegate
+{
+public:
+ ItemDelegate(QObject *parent = 0) : QItemDelegate(parent)
+ {}
+ virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const
+ {
+ QLineEdit *lineEdit = new QLineEdit(parent);
+ lineEdit->setFrame(false);
+ QCompleter *completer = new QCompleter(QStringList() << "completer", lineEdit);
+ completer->setCompletionMode(QCompleter::InlineCompletion);
+ lineEdit->setCompleter(completer);
+ return lineEdit;
+ }
+};
+
+void tst_QListWidget::QTBUG14363_completerWithAnyKeyPressedEditTriggers()
+{
+ QListWidget listWidget;
+ listWidget.setEditTriggers(QAbstractItemView::AnyKeyPressed);
+ listWidget.setItemDelegate(new ItemDelegate);
+ QListWidgetItem *item = new QListWidgetItem(QLatin1String("select an item (don't start editing)"), &listWidget);
+ item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable|Qt::ItemIsEditable);
+ new QListWidgetItem(QLatin1String("try to type the letter 'c'"), &listWidget);
+ new QListWidgetItem(QLatin1String("completer"), &listWidget);
+ listWidget.show();
+ listWidget.setCurrentItem(item);
+ QTest::qWaitForWindowShown(&listWidget);
+
+ QTest::keyClick(listWidget.viewport(), Qt::Key_C);
+
+ QLineEdit *le = qobject_cast<QLineEdit*>(listWidget.itemWidget(item));
+ QVERIFY(le);
+ QCOMPARE(le->text(), QString("completer"));
+ QCOMPARE(le->completer()->currentCompletion(), QString("completer"));
+}
+
+
+
QTEST_MAIN(tst_QListWidget)
#include "tst_qlistwidget.moc"
diff --git a/tests/auto/qlocale/test/test.pro b/tests/auto/qlocale/test/test.pro
index 6512e19465..8117708c46 100644
--- a/tests/auto/qlocale/test/test.pro
+++ b/tests/auto/qlocale/test/test.pro
@@ -22,7 +22,7 @@ QT += network
embedded: QT += gui
wince*: {
- addFiles.sources = \
+ addFiles.files = \
../syslocaleapp
addFiles.path = "\\Program Files\\tst_qlocale"
diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro
index 687aae2b56..b2755b5411 100644
--- a/tests/auto/qlocalsocket/test/test.pro
+++ b/tests/auto/qlocalsocket/test/test.pro
@@ -28,21 +28,21 @@ CONFIG(debug_and_release) {
}
wince* {
- additionalFiles.sources = ../lackey/lackey.exe
+ additionalFiles.files = ../lackey/lackey.exe
additionalFiles.path = lackey
}
symbian {
- additionalFiles.sources = lackey.exe
+ additionalFiles.files = lackey.exe
additionalFiles.path = \\sys\\bin
TARGET.UID3 = 0xE0340005
DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
}
wince*|symbian {
- scriptFiles.sources = ../lackey/scripts/*.js
+ scriptFiles.files = ../lackey/scripts/*.js
scriptFiles.path = lackey/scripts
- DEPLOYMENT = additionalFiles scriptFiles
+ DEPLOYMENT += additionalFiles scriptFiles
QT += script # for easy deployment of QtScript
requires(contains(QT_CONFIG,script))
diff --git a/tests/auto/qmap/qmap.pro b/tests/auto/qmap/qmap.pro
index 00b84d133d..eaed926481 100644
--- a/tests/auto/qmap/qmap.pro
+++ b/tests/auto/qmap/qmap.pro
@@ -4,3 +4,4 @@ QT = core
SOURCES += tst_qmap.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qmap/tst_qmap.cpp b/tests/auto/qmap/tst_qmap.cpp
index 67122c3707..d252b57a80 100644
--- a/tests/auto/qmap/tst_qmap.cpp
+++ b/tests/auto/qmap/tst_qmap.cpp
@@ -65,6 +65,8 @@ private slots:
void beginEnd();
void key();
+ void swap();
+
void operator_eq();
void empty();
@@ -392,6 +394,16 @@ void tst_QMap::key()
}
}
+void tst_QMap::swap()
+{
+ QMap<int,QString> m1, m2;
+ m1[0] = "m1[0]";
+ m2[1] = "m2[1]";
+ m1.swap(m2);
+ QCOMPARE(m1.value(1),QLatin1String("m2[1]"));
+ QCOMPARE(m2.value(0),QLatin1String("m1[0]"));
+}
+
void tst_QMap::operator_eq()
{
{
diff --git a/tests/auto/qmargins/qmargins.pro b/tests/auto/qmargins/qmargins.pro
index 5a6aa4f26a..0404da0424 100644
--- a/tests/auto/qmargins/qmargins.pro
+++ b/tests/auto/qmargins/qmargins.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qmargins.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qmath/qmath.pro b/tests/auto/qmath/qmath.pro
index 03134ee4e1..e5784ce7aa 100644
--- a/tests/auto/qmath/qmath.pro
+++ b/tests/auto/qmath/qmath.pro
@@ -4,3 +4,4 @@ QT = core
SOURCES += tst_qmath.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp
index d94ebf8ef6..ecff71147e 100644
--- a/tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -2822,10 +2822,9 @@ void tst_QMatrixNxN::convertGeneric()
9.0f, 10.0f, 11.0f, 12.0f,
0.0f, 0.0f, 0.0f, 1.0f
};
-#if !defined(QT_NO_MEMBER_TEMPLATES)
QMatrix4x4 m4(m1);
QVERIFY(isSame(m4, unique4x4));
-#endif
+
QMatrix4x4 m5 = qGenericMatrixToMatrix4x4(m1);
QVERIFY(isSame(m5, unique4x4));
@@ -2835,10 +2834,9 @@ void tst_QMatrixNxN::convertGeneric()
9.0f, 10.0f, 11.0f, 12.0f
};
QMatrix4x4 m9(uniqueValues4);
-#if !defined(QT_NO_MEMBER_TEMPLATES)
+
QMatrix4x3 m10 = m9.toGenericMatrix<4, 3>();
QVERIFY(isSame(m10, conv4x4));
-#endif
QMatrix4x3 m11 = qGenericMatrixFromMatrix4x4<4, 3>(m9);
QVERIFY(isSame(m11, conv4x4));
diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp
index b3c8120ae9..c11e76c098 100644
--- a/tests/auto/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp
@@ -47,6 +47,7 @@
#include <QTimer>
#include <QApplication>
#include <QPushButton>
+#include <QDialogButtonBox>
#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
#include <QMacStyle>
#endif
@@ -54,6 +55,8 @@
#include <QCleanlooksStyle>
#endif
+#include "../../shared/util.h"
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -106,7 +109,7 @@ class tst_QMessageBox : public QObject
public:
tst_QMessageBox();
int exec(QMessageBox *msgBox, int key = -1);
- int sendReturn();
+ void sendKeySoon();
public slots:
void sendKey();
@@ -119,6 +122,7 @@ private slots:
void statics();
void about();
void detailsText();
+ void detailsButtonText();
void shortcut();
@@ -134,8 +138,12 @@ private slots:
void setInformativeText();
void iconPixmap();
+ void init();
+ void initTestCase();
+
private:
int keyToSend;
+ QTimer keySendTimer;
};
tst_QMessageBox::tst_QMessageBox() : keyToSend(-1)
@@ -150,22 +158,16 @@ int tst_QMessageBox::exec(QMessageBox *msgBox, int key)
QTimer::singleShot(1000, msgBox, SLOT(close()));
} else {
keyToSend = key;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
}
return msgBox->exec();
}
-int tst_QMessageBox::sendReturn()
-{
- keyToSend = Qt::Key_Return;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
- return 0;
-}
-
void tst_QMessageBox::sendKey()
{
if (keyToSend == -2) {
QApplication::activeModalWidget()->close();
+ keyToSend = -1;
return;
}
if (keyToSend == -1)
@@ -175,6 +177,24 @@ void tst_QMessageBox::sendKey()
keyToSend = -1;
}
+void tst_QMessageBox::sendKeySoon()
+{
+ keySendTimer.start();
+}
+
+void tst_QMessageBox::init()
+{
+ // if there is any pending key send from the last test, cancel it.
+ keySendTimer.stop();
+}
+
+void tst_QMessageBox::initTestCase()
+{
+ keySendTimer.setInterval(1000);
+ keySendTimer.setSingleShot(true);
+ QVERIFY(QObject::connect(&keySendTimer, SIGNAL(timeout()), this, SLOT(sendKey())));
+}
+
void tst_QMessageBox::sanityTest()
{
QMessageBox msgBox;
@@ -315,32 +335,36 @@ void tst_QMessageBox::statics()
for (int i = 0; i < 4; i++) {
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
QMessageBox::StandardButton sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel,
QMessageBox::NoButton);
QCOMPARE(sb, QMessageBox::Cancel);
+ QCOMPARE(keyToSend, -1);
keyToSend = -2; // close()
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel,
QMessageBox::NoButton);
QCOMPARE(sb, QMessageBox::Cancel);
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help,
QMessageBox::Yes);
QCOMPARE(sb, QMessageBox::Yes);
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help,
QMessageBox::No);
QCOMPARE(sb, QMessageBox::No);
+ QCOMPARE(keyToSend, -1);
}
}
@@ -359,16 +383,28 @@ void tst_QMessageBox::shortcut()
void tst_QMessageBox::about()
{
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
QMessageBox::about(0, "Caption", "This is an auto test");
+ // On Mac, about and aboutQt are not modal, so we need to
+ // explicitly run the event loop
+#ifdef Q_WS_MAC
+ QTRY_COMPARE(keyToSend, -1);
+#else
+ QCOMPARE(keyToSend, -1);
+#endif
#if !defined(Q_OS_WINCE)
keyToSend = Qt::Key_Enter;
#else
keyToSend = Qt::Key_Escape;
#endif
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
QMessageBox::aboutQt(0, "Caption");
+#ifdef Q_WS_MAC
+ QTRY_COMPARE(keyToSend, -1);
+#else
+ QCOMPARE(keyToSend, -1);
+#endif
}
// Old message box enums
@@ -390,7 +426,7 @@ void tst_QMessageBox::staticSourceCompat()
// source compat tests for < 4.2
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No);
int expectedButton = int(QMessageBox::Yes);
#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
@@ -401,43 +437,51 @@ void tst_QMessageBox::staticSourceCompat()
expectedButton = int(QMessageBox::No);
#endif
QCOMPARE(ret, expectedButton);
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No);
QCOMPARE(ret, int(QMessageBox::Yes));
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
QCOMPARE(ret, int(QMessageBox::No));
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape);
QCOMPARE(ret, int(QMessageBox::Yes));
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default);
QCOMPARE(ret, int(QMessageBox::No));
+ QCOMPARE(keyToSend, -1);
// the button text versions
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1);
QCOMPARE(ret, 1);
+ QCOMPARE(keyToSend, -1);
if (0) { // dont run these tests since the dialog wont close!
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1);
QCOMPARE(ret, -1);
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 0, 1);
QCOMPARE(ret, 1);
+ QCOMPARE(keyToSend, -1);
}
}
@@ -470,7 +514,7 @@ void tst_QMessageBox::staticBinaryCompat()
// binary compat tests for < 4.2
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", Old_Yes, Old_No, 0);
int expectedButton = int(Old_Yes);
#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
@@ -481,33 +525,39 @@ void tst_QMessageBox::staticBinaryCompat()
expectedButton = int(Old_No);
#endif
QCOMPARE(ret, expectedButton);
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", Old_Yes | Old_Escape, Old_No, 0);
QCOMPARE(ret, int(Old_Yes));
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Enter;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", Old_Yes | Old_Default, Old_No, 0);
QCOMPARE(ret, int(Old_Yes));
+ QCOMPARE(keyToSend, -1);
#if 0
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", Old_Yes, Old_No | Old_Default, 0);
QCOMPARE(ret, -1);
+ QCOMPARE(keyToSend, -1);
#endif
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", Old_Yes | Old_Escape, Old_No | Old_Default, 0);
QCOMPARE(ret, Old_Yes);
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
ret = QMessageBox::information(0, "title", "text", Old_Yes | Old_Default, Old_No | Old_Escape, 0);
QCOMPARE(ret, Old_No);
+ QCOMPARE(keyToSend, -1);
}
@@ -661,25 +711,49 @@ void tst_QMessageBox::detailsText()
QCOMPARE(box.detailedText(), text);
}
+void tst_QMessageBox::detailsButtonText()
+{
+ QMessageBox box;
+ box.setDetailedText("bla");
+ box.open();
+ QApplication::postEvent(&box, new QEvent(QEvent::LanguageChange));
+ QApplication::processEvents();
+ QDialogButtonBox* bb = box.findChild<QDialogButtonBox*>("qt_msgbox_buttonbox");
+ QVERIFY(bb); //get the detail button
+
+ QList<QAbstractButton *> list = bb->buttons();
+ QAbstractButton* btn = NULL;
+ foreach(btn, list) {
+ if (btn && (btn->inherits("QPushButton"))) {
+ if (btn->text() != QMessageBox::tr("OK") && btn->text() != QMessageBox::tr("Show Details...")) {
+ QFAIL(qPrintable(QString("Unexpected messagebox button text: %1").arg(btn->text())));
+ }
+ }
+ }
+}
+
void tst_QMessageBox::incorrectDefaultButton()
{
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
//Do not crash here
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save );
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QMessageBox::question( 0, "", "I've been hit!",QFlag(QMessageBox::Ok | QMessageBox::Cancel),QMessageBox::Save );
+ QCOMPARE(keyToSend, -1);
keyToSend = Qt::Key_Escape;
- QTimer::singleShot(1000, this, SLOT(sendKey()));
+ sendKeySoon();
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
//do not crash here -> call old function of QMessageBox in this case
QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save | QMessageBox::Cancel,QMessageBox::Ok);
+ QCOMPARE(keyToSend, -1);
}
void tst_QMessageBox::updateSize()
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index d127386fa4..d496c565ab 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -155,6 +155,7 @@ private slots:
void connectSlotsByName();
void invokeMetaMember();
void invokeQueuedMetaMember();
+ void invokeBlockingQueuedMetaMember();
void invokeCustomTypes();
void invokeMetaConstructor();
void invokeTypedefTypes();
@@ -336,6 +337,9 @@ public slots:
void testLongLong(qint64 ll1, quint64 ll2);
+ void moveToThread(QThread *t)
+ { QObject::moveToThread(t); }
+
signals:
void sig0();
QString sig1(QString s1);
@@ -583,6 +587,138 @@ void tst_QMetaObject::invokeQueuedMetaMember()
QCOMPARE(obj.slotResult, QString("testLongLong:-1,0"));
}
+void tst_QMetaObject::invokeBlockingQueuedMetaMember()
+{
+ QThread t;
+ t.start();
+ QtTestObject obj;
+ obj.moveToThread(&t);
+
+ QString t1("1"); QString t2("2"); QString t3("3"); QString t4("4"); QString t5("5");
+ QString t6("6"); QString t7("7"); QString t8("8"); QString t9("9"); QString t10("X");
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl1", Qt::BlockingQueuedConnection, Q_ARG(QString, t1)));
+ QCOMPARE(obj.slotResult, QString("sl1:1"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl2", Qt::BlockingQueuedConnection, Q_ARG(const QString, t1), Q_ARG(QString, t2)));
+ QCOMPARE(obj.slotResult, QString("sl2:12"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl3", Qt::BlockingQueuedConnection, Q_ARG(QString, t1), Q_ARG(QString, t2), Q_ARG(QString, t3)));
+ QCOMPARE(obj.slotResult, QString("sl3:123"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl4", Qt::BlockingQueuedConnection, Q_ARG(QString, t1), Q_ARG(QString, t2),
+ Q_ARG(QString, t3), Q_ARG(QString, t4)));
+ QCOMPARE(obj.slotResult, QString("sl4:1234"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl5", Qt::BlockingQueuedConnection, Q_ARG(QString, t1), Q_ARG(QString, t2),
+ Q_ARG(QString, t3), Q_ARG(QString, t4), Q_ARG(QString, "5")));
+ QCOMPARE(obj.slotResult, QString("sl5:12345"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl6", Qt::BlockingQueuedConnection, Q_ARG(QString, t1), Q_ARG(QString, t2),
+ Q_ARG(QString, t3), Q_ARG(QString, t4), Q_ARG(QString, t5), Q_ARG(QString, t6)));
+ QCOMPARE(obj.slotResult, QString("sl6:123456"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl7", Qt::BlockingQueuedConnection, Q_ARG(QString, t1), Q_ARG(QString, t2),
+ Q_ARG(QString, t3), Q_ARG(QString, t4), Q_ARG(QString, t5), Q_ARG(QString, t6),
+ Q_ARG(QString, t7)));
+ QCOMPARE(obj.slotResult, QString("sl7:1234567"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl8", Qt::BlockingQueuedConnection, Q_ARG(QString, t1), Q_ARG(QString, t2),
+ Q_ARG(QString, t3), Q_ARG(QString, t4), Q_ARG(QString, t5), Q_ARG(QString, t6),
+ Q_ARG(QString, t7), Q_ARG(QString, t8)));
+ QCOMPARE(obj.slotResult, QString("sl8:12345678"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl9", Qt::BlockingQueuedConnection, Q_ARG(QString, t1), Q_ARG(QString, t2),
+ Q_ARG(QString, t3), Q_ARG(QString, t4), Q_ARG(QString, t5), Q_ARG(QString, t6),
+ Q_ARG(QString, t7), Q_ARG(QString, t8), Q_ARG(QString, t9)));
+ QCOMPARE(obj.slotResult, QString("sl9:123456789"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl11", Qt::BlockingQueuedConnection));
+ QCOMPARE(obj.slotResult, QString("sl11"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "testSender", Qt::BlockingQueuedConnection));
+ QCOMPARE(obj.slotResult, QString("0x0"));
+
+ QString refStr("whatever");
+ QVERIFY(QMetaObject::invokeMethod(&obj, "testReference", Qt::BlockingQueuedConnection, QGenericArgument("QString&", &refStr)));
+ QCOMPARE(obj.slotResult, QString("testReference:whatever"));
+ QCOMPARE(refStr, QString("gotcha"));
+
+ qint64 ll1 = -1;
+ quint64 ll2 = 0;
+ QVERIFY(QMetaObject::invokeMethod(&obj,
+ "testLongLong",
+ Qt::BlockingQueuedConnection,
+ Q_ARG(qint64, ll1),
+ Q_ARG(quint64, ll2)));
+ QCOMPARE(obj.slotResult, QString("testLongLong:-1,0"));
+
+ QString exp;
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl1", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QString, exp), Q_ARG(QString, "bubu")));
+ QCOMPARE(exp, QString("yessir"));
+ QCOMPARE(obj.slotResult, QString("sl1:bubu"));
+
+ QObject *ptr = 0;
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl11", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QObject*,ptr)));
+ QCOMPARE(ptr, (QObject *)&obj);
+ QCOMPARE(obj.slotResult, QString("sl11"));
+ // try again with a space:
+ ptr = 0;
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl11", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QObject * , ptr)));
+ QCOMPARE(ptr, (QObject *)&obj);
+ QCOMPARE(obj.slotResult, QString("sl11"));
+
+ const char *ptr2 = 0;
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl12", Qt::BlockingQueuedConnection, Q_RETURN_ARG(const char*, ptr2)));
+ QVERIFY(ptr2 != 0);
+ QCOMPARE(obj.slotResult, QString("sl12"));
+ // try again with a space:
+ ptr2 = 0;
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl12", Qt::BlockingQueuedConnection, Q_RETURN_ARG(char const * , ptr2)));
+ QVERIFY(ptr2 != 0);
+ QCOMPARE(obj.slotResult, QString("sl12"));
+
+ // test w/ template args
+ QList<QString> returnValue, argument;
+ argument << QString("one") << QString("two") << QString("three");
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sl13", Qt::BlockingQueuedConnection,
+ Q_RETURN_ARG(QList<QString>, returnValue),
+ Q_ARG(QList<QString>, argument)));
+ QCOMPARE(returnValue, argument);
+ QCOMPARE(obj.slotResult, QString("sl13"));
+
+ //test signals
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sig0", Qt::BlockingQueuedConnection));
+ QCOMPARE(obj.slotResult, QString("sl0"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sig1", Qt::BlockingQueuedConnection, Q_ARG(QString, "baba")));
+ QCOMPARE(obj.slotResult, QString("sl1:baba"));
+
+ exp.clear();
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sig1", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QString, exp), Q_ARG(QString, "hehe")));
+ QCOMPARE(exp, QString("yessir"));
+ QCOMPARE(obj.slotResult, QString("sl1:hehe"));
+
+ QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::doesNotExist()");
+ QVERIFY(!QMetaObject::invokeMethod(&obj, "doesNotExist", Qt::BlockingQueuedConnection));
+ QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::sl1(QString)(QString)");
+ QVERIFY(!QMetaObject::invokeMethod(&obj, "sl1(QString)", Qt::BlockingQueuedConnection, Q_ARG(QString, "arg")));
+ QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::sl3(QString)");
+ QVERIFY(!QMetaObject::invokeMethod(&obj, "sl3", Qt::BlockingQueuedConnection, Q_ARG(QString, "arg")));
+ QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::sl1(QString,QString,QString)");
+ QVERIFY(!QMetaObject::invokeMethod(&obj, "sl1", Qt::BlockingQueuedConnection, Q_ARG(QString, "arg"), Q_ARG(QString, "arg"), Q_ARG(QString, "arg")));
+
+ //should not have changed since last test.
+ QCOMPARE(exp, QString("yessir"));
+ QCOMPARE(obj.slotResult, QString("sl1:hehe"));
+
+ QVERIFY(QMetaObject::invokeMethod(&obj, "moveToThread", Qt::BlockingQueuedConnection, Q_ARG(QThread*, QThread::currentThread())));
+ t.quit();
+ QVERIFY(t.wait());
+
+}
+
+
void tst_QMetaObject::qtMetaObjectInheritance()
{
diff --git a/tests/auto/qmetatype/qmetatype.pro b/tests/auto/qmetatype/qmetatype.pro
index a84d238aa4..ed1de83927 100644
--- a/tests/auto/qmetatype/qmetatype.pro
+++ b/tests/auto/qmetatype/qmetatype.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qmetatype.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qmetatype/tst_qmetatype.cpp b/tests/auto/qmetatype/tst_qmetatype.cpp
index 1585657dae..67bbac217a 100644
--- a/tests/auto/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/qmetatype/tst_qmetatype.cpp
@@ -160,6 +160,11 @@ void tst_QMetaType::qMetaTypeId()
QCOMPARE(::qMetaTypeId<QString>(), int(QMetaType::QString));
QCOMPARE(::qMetaTypeId<int>(), int(QMetaType::Int));
QCOMPARE(::qMetaTypeId<TestSpace::Foo>(), QMetaType::type("TestSpace::Foo"));
+
+ QCOMPARE(::qMetaTypeId<char>(), QMetaType::type("char"));
+ QCOMPARE(::qMetaTypeId<uchar>(), QMetaType::type("unsigned char"));
+ QCOMPARE(::qMetaTypeId<signed char>(), QMetaType::type("signed char"));
+ QCOMPARE(::qMetaTypeId<qint8>(), QMetaType::type("qint8"));
}
void tst_QMetaType::properties()
diff --git a/tests/auto/qmovie/animations/corrupt.gif b/tests/auto/qmovie/animations/corrupt.gif
new file mode 100644
index 0000000000..c1545eb0ed
--- /dev/null
+++ b/tests/auto/qmovie/animations/corrupt.gif
Binary files differ
diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro
index 510a70e31a..855eb9e17a 100644
--- a/tests/auto/qmovie/qmovie.pro
+++ b/tests/auto/qmovie/qmovie.pro
@@ -7,19 +7,20 @@ MOC_DIR=tmp
!contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG
wince*: {
- addFiles.sources = animations\\*
+ addFiles.files = animations\\*
addFiles.path = animations
DEPLOYMENT += addFiles
}
+RESOURCES += resources.qrc
symbian: {
- addFiles.sources = animations\\*
+ addFiles.files = animations\\*
addFiles.path = animations
DEPLOYMENT += addFiles
qt_not_deployed {
- imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll
+ imagePlugins.files = qjpeg.dll qgif.dll qmng.dll
imagePlugins.path = imageformats
DEPLOYMENT += imagePlugins
}
diff --git a/tests/auto/qmovie/resources.qrc b/tests/auto/qmovie/resources.qrc
new file mode 100644
index 0000000000..ce459a0e7e
--- /dev/null
+++ b/tests/auto/qmovie/resources.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>animations/corrupt.gif</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/qmovie/tst_qmovie.cpp b/tests/auto/qmovie/tst_qmovie.cpp
index 033a2ddc81..8278bbfac0 100644
--- a/tests/auto/qmovie/tst_qmovie.cpp
+++ b/tests/auto/qmovie/tst_qmovie.cpp
@@ -72,6 +72,7 @@ private slots:
void jumpToFrame_data();
void jumpToFrame();
void changeMovieFile();
+ void infiniteLoop();
};
// Testing get/set functions
@@ -208,5 +209,17 @@ void tst_QMovie::changeMovieFile()
QVERIFY(movie.currentFrameNumber() == -1);
}
+void tst_QMovie::infiniteLoop()
+{
+ QLabel label;
+ label.show();
+ QMovie *movie = new QMovie(QLatin1String(":animations/corrupt.gif"), QByteArray(), &label);
+ label.setMovie(movie);
+ movie->start();
+
+ QTestEventLoop::instance().enterLoop(1);
+ QTestEventLoop::instance().timeout();
+}
+
QTEST_MAIN(tst_QMovie)
#include "tst_qmovie.moc"
diff --git a/tests/auto/qmutex/qmutex.pro b/tests/auto/qmutex/qmutex.pro
index bd24dcb35f..760dcfd2d8 100644
--- a/tests/auto/qmutex/qmutex.pro
+++ b/tests/auto/qmutex/qmutex.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qmutex.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qmutexlocker/qmutexlocker.pro b/tests/auto/qmutexlocker/qmutexlocker.pro
index ff8a3da7eb..01c369101b 100644
--- a/tests/auto/qmutexlocker/qmutexlocker.pro
+++ b/tests/auto/qmutexlocker/qmutexlocker.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qmutexlocker.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro
index 6e1b1e3e14..7efc2fb24b 100644
--- a/tests/auto/qnetworkreply/test/test.pro
+++ b/tests/auto/qnetworkreply/test/test.pro
@@ -16,17 +16,17 @@ QT = core network
RESOURCES += ../qnetworkreply.qrc
wince*: {
- addFiles.sources = ../empty ../rfc3252.txt ../resource
+ addFiles.files = ../empty ../rfc3252.txt ../resource
addFiles.path = .
DEPLOYMENT += addFiles
}
symbian:{
- addFiles.sources = ../empty ../rfc3252.txt ../resource ../bigfile
+ addFiles.files = ../empty ../rfc3252.txt ../resource ../bigfile
addFiles.path = .
DEPLOYMENT += addFiles
- certFiles.sources = ../certs
+ certFiles.files = ../certs
certFiles.path = .
DEPLOYMENT += certFiles
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index bd228373c1..91eff6f9d1 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -75,6 +75,7 @@
#include "../network-settings.h"
+Q_DECLARE_METATYPE(QSharedPointer<char>)
Q_DECLARE_METATYPE(QNetworkReply*)
Q_DECLARE_METATYPE(QAuthenticator*)
Q_DECLARE_METATYPE(QNetworkProxy)
@@ -316,6 +317,14 @@ private Q_SLOTS:
void symbianOpenCDataUrlCrash();
+ void getFromHttpIntoBuffer_data();
+ void getFromHttpIntoBuffer();
+ void getFromHttpIntoBuffer2_data();
+ void getFromHttpIntoBuffer2();
+
+ void ioGetFromHttpWithoutContentLength();
+
+ void ioGetFromHttpBrokenChunkedEncoding();
void qtbug12908compressedHttpReply();
void getFromUnreachableIp();
@@ -1428,6 +1437,12 @@ void tst_QNetworkReply::getErrors_data()
QTest::addColumn<int>("httpStatusCode");
QTest::addColumn<bool>("dataIsEmpty");
+ // empties
+ QTest::newRow("empty-url") << QString() << int(QNetworkReply::ProtocolUnknownError) << 0 << true;
+ QTest::newRow("empty-scheme-host") << SRCDIR "/rfc3252.txt" << int(QNetworkReply::ProtocolUnknownError) << 0 << true;
+ QTest::newRow("empty-scheme") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri"
+ << int(QNetworkReply::ProtocolUnknownError) << 0 << true;
+
// file: errors
QTest::newRow("file-host") << "file://this-host-doesnt-exist.troll.no/foo.txt"
#if !defined Q_OS_WIN
@@ -4598,6 +4613,7 @@ void tst_QNetworkReply::authorizationError()
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), httpStatusCode);
QFETCH(QString, httpBody);
+ QCOMPARE(qint64(reply->size()), qint64(httpBody.size()));
QCOMPARE(QString(reply->readAll()), httpBody);
}
@@ -4942,6 +4958,263 @@ void tst_QNetworkReply::symbianOpenCDataUrlCrash()
QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), qint64(598));
}
+void tst_QNetworkReply::getFromHttpIntoBuffer_data()
+{
+ QTest::addColumn<QUrl>("url");
+
+ QTest::newRow("rfc-internal") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+}
+
+// Please note that the whole "zero copy" download buffer API is private right now. Do not use it.
+void tst_QNetworkReply::getFromHttpIntoBuffer()
+{
+ QFETCH(QUrl, url);
+ QNetworkRequest request(url);
+ request.setAttribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute, 1024*128); // 128 kB
+
+ QNetworkAccessManager manager;
+ QNetworkReply *reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QVERIFY(reply->isFinished());
+
+ QFile reference(SRCDIR "/rfc3252.txt");
+ QVERIFY(reference.open(QIODevice::ReadOnly));
+
+ QCOMPARE(reference.bytesAvailable(), reply->bytesAvailable());
+ QCOMPARE(reference.size(), reply->size());
+
+ // Compare the memory buffer
+ QVariant downloadBufferAttribute = reply->attribute(QNetworkRequest::DownloadBufferAttribute);
+ QVERIFY(downloadBufferAttribute.isValid());
+ QSharedPointer<char> sharedPointer = downloadBufferAttribute.value<QSharedPointer<char> >();
+ bool memoryComparison =
+ (0 == memcmp(static_cast<void*>(reference.readAll().data()),
+ sharedPointer.data(), reference.size()));
+ QVERIFY(memoryComparison);
+
+ // Make sure the normal reading works
+ reference.seek(0);
+ QCOMPARE(reply->read(42), reference.read(42));
+ QCOMPARE(reply->getChar(0), reference.getChar(0));
+ QCOMPARE(reply->peek(23), reference.peek(23));
+ QCOMPARE(reply->readLine(), reference.readLine());
+ QCOMPARE(reference.bytesAvailable(), reply->bytesAvailable());
+ QCOMPARE(reply->readAll(), reference.readAll());
+ QVERIFY(reply->atEnd());
+}
+
+// FIXME we really need to consolidate all those server implementations
+class GetFromHttpIntoBuffer2Server : QObject {
+ Q_OBJECT;
+ qint64 dataSize;
+ qint64 dataSent;
+ QTcpServer server;
+ QTcpSocket *client;
+ bool serverSendsContentLength;
+ bool chunkedEncoding;
+
+public:
+ GetFromHttpIntoBuffer2Server (qint64 ds, bool sscl, bool ce) : dataSize(ds), dataSent(0),
+ client(0), serverSendsContentLength(sscl), chunkedEncoding(ce) {
+ server.listen();
+ connect(&server, SIGNAL(newConnection()), this, SLOT(newConnectionSlot()));
+ }
+
+ int serverPort() {
+ return server.serverPort();
+ }
+
+public slots:
+
+ void newConnectionSlot() {
+ client = server.nextPendingConnection();
+ client->setParent(this);
+ connect(client, SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
+ connect(client, SIGNAL(bytesWritten(qint64)), this, SLOT(bytesWrittenSlot(qint64)));
+ }
+
+ void readyReadSlot() {
+ client->readAll();
+ client->write("HTTP/1.0 200 OK\n");
+ if (serverSendsContentLength)
+ client->write(QString("Content-Length: " + QString::number(dataSize) + "\n").toAscii());
+ if (chunkedEncoding)
+ client->write(QString("Transfer-Encoding: chunked\n").toAscii());
+ client->write("Connection: close\n\n");
+ }
+
+ void bytesWrittenSlot(qint64 amount) {
+ Q_UNUSED(amount);
+ if (dataSent == dataSize && client) {
+ // close eventually
+
+ // chunked encoding: we have to send a last "empty" chunk
+ if (chunkedEncoding)
+ client->write(QString("0\r\n\r\n").toAscii());
+
+ client->disconnectFromHost();
+ server.close();
+ client = 0;
+ return;
+ }
+
+ // send data
+ if (client && client->bytesToWrite() < 100*1024 && dataSent < dataSize) {
+ qint64 amount = qMin(qint64(16*1024), dataSize - dataSent);
+ QByteArray data(amount, '@');
+
+ if (chunkedEncoding) {
+ client->write(QString(QString("%1").arg(amount,0,16).toUpper() + "\r\n").toAscii());
+ client->write(data.constData(), amount);
+ client->write(QString("\r\n").toAscii());
+ } else {
+ client->write(data.constData(), amount);
+ }
+
+ dataSent += amount;
+ }
+ }
+};
+
+class GetFromHttpIntoBuffer2Client : QObject {
+ Q_OBJECT
+private:
+ bool useDownloadBuffer;
+ QNetworkReply *reply;
+ qint64 uploadSize;
+ QList<qint64> bytesAvailableList;
+public:
+ GetFromHttpIntoBuffer2Client (QNetworkReply *reply, bool useDownloadBuffer, qint64 uploadSize)
+ : useDownloadBuffer(useDownloadBuffer), reply(reply), uploadSize(uploadSize)
+ {
+ connect(reply, SIGNAL(metaDataChanged()), this, SLOT(metaDataChangedSlot()));
+ connect(reply, SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
+ connect(reply, SIGNAL(finished()), this, SLOT(finishedSlot()));
+ }
+
+ public slots:
+ void metaDataChangedSlot() {
+ if (useDownloadBuffer) {
+ QSharedPointer<char> sharedPointer = qvariant_cast<QSharedPointer<char> >(reply->attribute(QNetworkRequest::DownloadBufferAttribute));
+ QVERIFY(!sharedPointer.isNull()); // It will be 0 if it failed
+ }
+
+ // metaDataChanged needs to come before everything else
+ QVERIFY(bytesAvailableList.isEmpty());
+ }
+
+ void readyReadSlot() {
+ QVERIFY(!reply->isFinished());
+
+ qint64 bytesAvailable = reply->bytesAvailable();
+
+ // bytesAvailable must never be 0
+ QVERIFY(bytesAvailable != 0);
+
+ if (bytesAvailableList.length() < 5) {
+ // We assume that the first few times the bytes available must be less than the complete size, e.g.
+ // the bytesAvailable() function works correctly in case of a downloadBuffer.
+ QVERIFY(bytesAvailable < uploadSize);
+ }
+ if (!bytesAvailableList.isEmpty()) {
+ // Also check that the same bytesAvailable is not coming twice in a row
+ QVERIFY(bytesAvailableList.last() != bytesAvailable);
+ }
+
+ bytesAvailableList.append(bytesAvailable);
+ // Add bytesAvailable to a list an parse
+ }
+
+ void finishedSlot() {
+ // We should have already received all readyRead
+ QVERIFY(bytesAvailableList.last() == uploadSize);
+ }
+};
+
+void tst_QNetworkReply::getFromHttpIntoBuffer2_data()
+{
+ QTest::addColumn<bool>("useDownloadBuffer");
+
+ QTest::newRow("use-download-buffer") << true;
+ QTest::newRow("do-not-use-download-buffer") << false;
+}
+
+// This test checks mostly that signal emissions are in correct order
+// Please note that the whole "zero copy" download buffer API is private right now. Do not use it.
+void tst_QNetworkReply::getFromHttpIntoBuffer2()
+{
+ QFETCH(bool, useDownloadBuffer);
+
+ // On my Linux Desktop the results are already visible with 128 kB, however we use this to have good results.
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM)
+ // Show some mercy to non-desktop platform/s
+ enum {UploadSize = 4*1024*1024}; // 4 MB
+#else
+ enum {UploadSize = 32*1024*1024}; // 32 MB
+#endif
+
+ GetFromHttpIntoBuffer2Server server(UploadSize, true, false);
+
+ QNetworkRequest request(QUrl("http://127.0.0.1:" + QString::number(server.serverPort()) + "/?bare=1"));
+ if (useDownloadBuffer)
+ request.setAttribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute, 1024*1024*128); // 128 MB is max allowed
+
+ QNetworkAccessManager manager;
+ QNetworkReplyPtr reply = manager.get(request);
+
+ GetFromHttpIntoBuffer2Client client(reply, useDownloadBuffer, UploadSize);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(40);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+}
+
+
+// Is handled somewhere else too, introduced this special test to have it more accessible
+void tst_QNetworkReply::ioGetFromHttpWithoutContentLength()
+{
+ QByteArray dataToSend("HTTP/1.0 200 OK\r\n\r\nHALLO! 123!");
+ MiniHttpServer server(dataToSend);
+ server.doClose = true;
+
+ QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
+ QNetworkReplyPtr reply = manager.get(request);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->url(), request.url());
+ QVERIFY(reply->isFinished());
+ QVERIFY(reply->error() == QNetworkReply::NoError);
+}
+
+// Is handled somewhere else too, introduced this special test to have it more accessible
+void tst_QNetworkReply::ioGetFromHttpBrokenChunkedEncoding()
+{
+ // This is wrong chunked encoding because of the X. What actually has to follow is \r\n
+ // and then the declaration of the final 0 chunk
+ QByteArray dataToSend("HTTP/1.0 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n3\r\nABCX");
+ MiniHttpServer server(dataToSend);
+ server.doClose = false; // FIXME
+
+ QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
+ QNetworkReplyPtr reply = manager.get(request);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+
+ QEXPECT_FAIL(0, "We should close the socket and not just do nothing", Continue);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QEXPECT_FAIL(0, "We should close the socket and not just do nothing", Continue);
+ QVERIFY(reply->isFinished());
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+}
+
// TODO:
// Prepare a gzip that has one chunk that expands to the size mentioned in the bugreport.
// Then have a custom HTTP server that waits after this chunk so the returning gets
diff --git a/tests/auto/qnumeric/qnumeric.pro b/tests/auto/qnumeric/qnumeric.pro
index 162f980f9c..c0af962a79 100644
--- a/tests/auto/qnumeric/qnumeric.pro
+++ b/tests/auto/qnumeric/qnumeric.pro
@@ -4,3 +4,4 @@ QT = core
SOURCES += tst_qnumeric.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qobject/qobject.pro b/tests/auto/qobject/qobject.pro
index b6b3f20f22..113e14a61d 100644
--- a/tests/auto/qobject/qobject.pro
+++ b/tests/auto/qobject/qobject.pro
@@ -1,2 +1,3 @@
TEMPLATE = subdirs
SUBDIRS = tst_qobject.pro signalbug.pro
+CONFIG += parallel_test
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp
index ea730edefe..d2307ee94f 100644
--- a/tests/auto/qobject/tst_qobject.cpp
+++ b/tests/auto/qobject/tst_qobject.cpp
@@ -129,6 +129,13 @@ private slots:
void qMetaObjectConnect();
void qMetaObjectDisconnectOne();
void sameName();
+ void connectByMetaMethods();
+ void connectByMetaMethodSlotInsteadOfSignal();
+ void connectConstructorByMetaMethod();
+ void disconnectByMetaMethod();
+ void disconnectNotSignalMetaMethod();
+ void autoConnectionBehavior();
+
protected:
};
@@ -663,11 +670,9 @@ void tst_QObject::findChildren()
l = qFindChildren<QObject*>(&o, "unnamed");
QCOMPARE(l.size(), 0);
-#ifndef QT_NO_MEMBER_TEMPLATES
tl = o.findChildren<QTimer *>("t1");
QCOMPARE(tl.size(), 1);
QCOMPARE(tl.at(0), &t1);
-#endif
}
@@ -727,6 +732,24 @@ void tst_QObject::connectDisconnectNotify()
// Test disconnectNotify for a complete disconnect
((SenderObject*)s)->disconnect((ReceiverObject*)r);
+ // Obtaining meta methods
+ int signalIndx = ((SenderObject*)s)->metaObject()->indexOfSignal(
+ QMetaObject::normalizedSignature(a_signal.toLatin1().constData()+1).constData());
+ int methodIndx = ((ReceiverObject*)r)->metaObject()->indexOfMethod(
+ QMetaObject::normalizedSignature(a_slot.toLatin1().constData()+1).constData());
+ QMetaMethod signal = ((SenderObject*)s)->metaObject()->method(signalIndx);
+ QMetaMethod method = ((ReceiverObject*)r)->metaObject()->method(methodIndx);
+
+ // Test connectNotify when connecting by QMetaMethod
+ connect( (SenderObject*)s, signal, (ReceiverObject*)r, method );
+ QCOMPARE( s->org_signal, s->nw_signal );
+ QCOMPARE( s->org_signal.toLatin1(), QMetaObject::normalizedSignature(a_signal.toLatin1().constData()) );
+
+ // Test disconnectNotify when disconnecting by QMetaMethod
+ QObject::disconnect( (SenderObject*)s, signal, (ReceiverObject*)r, method );
+ QCOMPARE( s->org_signal, s->nw_signal );
+ QCOMPARE( s->org_signal.toLatin1(), QMetaObject::normalizedSignature(a_signal.toLatin1().constData()) );
+
delete s;
delete r;
}
@@ -1760,9 +1783,12 @@ class SuperObject : public QObject
Q_OBJECT
public:
QObject *theSender;
+ int theSignalId;
+
SuperObject()
{
theSender = 0;
+ theSignalId = 0;
}
friend class tst_QObject;
@@ -1773,16 +1799,17 @@ public slots:
void rememberSender()
{
theSender = sender();
+ theSignalId = senderSignalIndex();
}
void deleteAndRememberSender()
{
delete theSender;
- theSender = sender();
+ rememberSender();
}
signals:
+ void anotherSignal();
void theSignal();
-
};
void tst_QObject::sender()
@@ -1790,12 +1817,23 @@ void tst_QObject::sender()
{
SuperObject sender;
SuperObject receiver;
+ connect(&sender, SIGNAL(anotherSignal()),
+ &receiver, SLOT(rememberSender()));
connect(&sender, SIGNAL(theSignal()),
&receiver, SLOT(rememberSender()));
QCOMPARE(receiver.sender(), (QObject *)0);
+ QCOMPARE(receiver.senderSignalIndex(), -1);
emit sender.theSignal();
QCOMPARE(receiver.theSender, (QObject *)&sender);
QCOMPARE(receiver.sender(), (QObject *)0);
+ QCOMPARE(receiver.theSignalId,
+ sender.metaObject()->indexOfSignal("theSignal()"));
+ QCOMPARE(receiver.senderSignalIndex(), -1);
+
+ emit sender.anotherSignal();
+ QCOMPARE(receiver.theSignalId,
+ sender.metaObject()->indexOfSignal("anotherSignal()"));
+ QCOMPARE(receiver.senderSignalIndex(), -1);
}
{
@@ -1812,11 +1850,16 @@ void tst_QObject::sender()
Qt::DirectConnection);
QCOMPARE(receiver->sender(), (QObject *)0);
+ QCOMPARE(receiver->senderSignalIndex(), -1);
receiver->theSender = 0;
+ receiver->theSignalId = -1;
thread.start();
emit sender->theSignal();
QCOMPARE(receiver->theSender, (QObject *) sender);
QCOMPARE(receiver->sender(), (QObject *)0);
+ QCOMPARE(receiver->theSignalId,
+ sender->metaObject()->indexOfSignal("theSignal()"));
+ QCOMPARE(receiver->senderSignalIndex(), -1);
QVERIFY(thread.wait(10000));
delete receiver;
@@ -3610,5 +3653,277 @@ void tst_QObject::sameName()
QCOMPARE(c1.s, 4);
}
+void tst_QObject::connectByMetaMethods()
+{
+ SenderObject s;
+ ReceiverObject r;
+ const QMetaObject *smeta = s.metaObject();
+ const QMetaObject *rmeta = r.metaObject();
+ int sigIndx = smeta->indexOfSignal(QMetaObject::normalizedSignature("signal1()"));
+ int slotIndx = rmeta->indexOfSlot(QMetaObject::normalizedSignature("slot1()"));
+ QVERIFY( sigIndx != -1 );
+ QVERIFY( slotIndx != -1 );
+ QMetaMethod signal = smeta->method(sigIndx);
+ QMetaMethod slot = rmeta->method(slotIndx);
+
+ QVERIFY(connect(&s,signal, &r,slot));
+
+ QVERIFY(!r.called(1));
+ s.emitSignal1();
+ QVERIFY(r.called(1));
+}
+
+void tst_QObject::connectByMetaMethodSlotInsteadOfSignal()
+{
+ SenderObject s;
+ ReceiverObject r;
+ const QMetaObject *smeta = s.metaObject();
+ const QMetaObject *rmeta = r.metaObject();
+ int badIndx = smeta->indexOfSlot(QMetaObject::normalizedSignature("aPublicSlot()"));
+ int slotIndx = rmeta->indexOfSlot(QMetaObject::normalizedSignature("slot1()"));
+ QVERIFY( badIndx != -1 );
+ QVERIFY( slotIndx != -1 );
+ QMetaMethod badMethod = smeta->method(badIndx);
+ QMetaMethod slot = rmeta->method(slotIndx);
+
+ QTest::ignoreMessage(QtWarningMsg,"QObject::connect: Cannot connect SenderObject::aPublicSlot() to ReceiverObject::slot1()");
+ QVERIFY(!connect(&s,badMethod, &r,slot));
+}
+
+class Constructable: public QObject
+{
+ Q_OBJECT
+
+public:
+ Q_INVOKABLE Constructable(){}
+
+};
+
+void tst_QObject::connectConstructorByMetaMethod()
+{
+ Constructable sc;
+ Constructable rc;
+ SenderObject s;
+ ReceiverObject r;
+
+ const QMetaObject cmeta = Constructable::staticMetaObject;
+ const QMetaObject *smeta = s.metaObject();
+ const QMetaObject *rmeta = r.metaObject();
+ int constructorIndx = cmeta.indexOfConstructor(QMetaObject::normalizedSignature("Constructable()"));
+ int sigIndx = smeta->indexOfSignal(QMetaObject::normalizedSignature("signal1()"));
+ int slotIndx = rmeta->indexOfSlot(QMetaObject::normalizedSignature("slot1()"));
+ QVERIFY( constructorIndx != -1 );
+ QVERIFY( sigIndx != -1 );
+ QVERIFY( slotIndx != -1 );
+
+ QMetaMethod constructor = cmeta.constructor(constructorIndx);
+ QMetaMethod signal = smeta->method(sigIndx);
+ QMetaMethod slot = rmeta->method(slotIndx);
+
+ QTest::ignoreMessage(QtWarningMsg,"QObject::connect: Cannot connect Constructable::Constructable() to ReceiverObject::slot1()");
+ QVERIFY(!connect(&sc,constructor, &r,slot));
+ QTest::ignoreMessage(QtWarningMsg,"QObject::connect: Cannot connect SenderObject::signal1() to Constructable::Constructable()");
+ QVERIFY(!connect(&s,signal, &rc,constructor));
+ QTest::ignoreMessage(QtWarningMsg,"QObject::connect: Cannot connect Constructable::Constructable() to Constructable::Constructable()");
+ QVERIFY(!connect(&sc,constructor, &rc,constructor));
+}
+
+void tst_QObject::disconnectByMetaMethod()
+{
+ SenderObject *s = new SenderObject;
+ ReceiverObject *r1 = new ReceiverObject;
+ ReceiverObject *r2 = new ReceiverObject;
+
+ QMetaMethod signal1 = s->metaObject()->method(
+ s->metaObject()->indexOfMethod("signal1()"));
+ QMetaMethod signal2 = s->metaObject()->method(
+ s->metaObject()->indexOfMethod("signal2()"));
+ QMetaMethod signal3 = s->metaObject()->method(
+ s->metaObject()->indexOfMethod("signal3()"));
+ QMetaMethod signal4 = s->metaObject()->method(
+ s->metaObject()->indexOfMethod("signal4()"));
+
+ QMetaMethod slot1 = r1->metaObject()->method(
+ r1->metaObject()->indexOfMethod("slot1()"));
+ QMetaMethod slot2 = r1->metaObject()->method(
+ r1->metaObject()->indexOfMethod("slot2()"));
+ QMetaMethod slot3 = r1->metaObject()->method(
+ r1->metaObject()->indexOfMethod("slot3()"));
+ QMetaMethod slot4 = r1->metaObject()->method(
+ r1->metaObject()->indexOfMethod("slot4()"));
+
+ connect(s, signal1, r1, slot1);
+
+ s->emitSignal1();
+
+ QVERIFY(r1->called(1));
+ r1->reset();
+
+ // usual disconnect with all parameters given
+ bool ret = QObject::disconnect(s, signal1, r1, slot1);
+
+ s->emitSignal1();
+
+ QVERIFY(!r1->called(1));
+ r1->reset();
+
+ QVERIFY(ret);
+ ret = QObject::disconnect(s, signal1, r1, slot1);
+ QVERIFY(!ret);
+
+ r1->reset();
+
+ connect( s, signal1, r1, slot1 );
+ connect( s, signal1, r1, slot2 );
+ connect( s, signal1, r1, slot3 );
+ connect( s, signal2, r1, slot4 );
+
+ // disconnect s's signal1() from all slots of r1
+ QObject::disconnect(s, signal1, r1, QMetaMethod());
+
+ s->emitSignal1();
+ s->emitSignal2();
+
+ QVERIFY(!r1->called(1));
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r1->called(3));
+ QVERIFY(r1->called(4));
+ r1->reset();
+ // make sure all is disconnected again
+ QObject::disconnect(s, 0, r1, 0);
+
+ connect(s, signal1, r1, slot1);
+ connect(s, signal1, r2, slot1);
+ connect(s, signal2, r1, slot2);
+ connect(s, signal2, r2, slot2);
+ connect(s, signal3, r1, slot3);
+ connect(s, signal3, r2, slot3);
+
+ // disconnect signal1() from all receivers
+ QObject::disconnect(s, signal1, 0, QMetaMethod());
+ s->emitSignal1();
+ s->emitSignal2();
+ s->emitSignal3();
+
+ QVERIFY(!r1->called(1));
+ QVERIFY(!r2->called(1));
+ QVERIFY(r1->called(2));
+ QVERIFY(r2->called(2));
+ QVERIFY(r1->called(2));
+ QVERIFY(r2->called(2));
+
+ r1->reset();
+ r2->reset();
+
+ // disconnect all signals of s from all receivers
+ QObject::disconnect( s, 0, 0, 0 );
+
+ connect( s, signal1, r1, slot1 );
+ connect( s, signal1, r2, slot1 );
+
+ // disconnect all signals from slot1 of r1
+ QObject::disconnect(s, QMetaMethod(), r1, slot1);
+
+ s->emitSignal1();
+
+ QVERIFY(!r1->called(1));
+ QVERIFY(r2->called(1));
+
+ delete r2;
+ delete r1;
+ delete s;
+}
+
+void tst_QObject::disconnectNotSignalMetaMethod()
+{
+ SenderObject s;
+ ReceiverObject r;
+
+ connect(&s, SIGNAL(signal1()), &r, SLOT(slot1()));
+
+ QMetaMethod slot = s.metaObject()->method(
+ s.metaObject()->indexOfMethod("aPublicSlot()"));
+
+ QTest::ignoreMessage(QtWarningMsg,"Object::disconnect: Attempt to unbind non-signal SenderObject::aPublicSlot()");
+ QVERIFY(!QObject::disconnect(&s, slot, &r, QMetaMethod()));
+}
+
+class ThreadAffinityThread : public QThread
+{
+public:
+ SenderObject *sender;
+
+ ThreadAffinityThread(SenderObject *sender)
+ : sender(sender)
+ { }
+ void run()
+ {
+ sender->emitSignal1();
+ }
+};
+
+void tst_QObject::autoConnectionBehavior()
+{
+ SenderObject *sender = new SenderObject;
+ ReceiverObject *receiver = new ReceiverObject;
+ connect(sender, SIGNAL(signal1()), receiver, SLOT(slot1()));
+
+ // at emit, currentThread == sender->thread(), currentThread == receiver->thread(), sender->thread() == receiver->thread()
+ QVERIFY(!receiver->called(1));
+ sender->emitSignal1();
+ QVERIFY(receiver->called(1));
+ receiver->reset();
+
+ // at emit, currentThread != sender->thread(), currentThread != receiver->thread(), sender->thread() == receiver->thread()
+ ThreadAffinityThread emitThread1(sender);
+ QVERIFY(!receiver->called(1));
+ emitThread1.start();
+ QVERIFY(emitThread1.wait(30000));
+ QVERIFY(!receiver->called(1));
+ QCoreApplication::sendPostedEvents(receiver, QEvent::MetaCall);
+ QVERIFY(receiver->called(1));
+ receiver->reset();
+
+ // at emit, currentThread == sender->thread(), currentThread != receiver->thread(), sender->thread() != receiver->thread()
+ sender->moveToThread(&emitThread1);
+ QVERIFY(!receiver->called(1));
+ emitThread1.start();
+ QVERIFY(emitThread1.wait(30000));
+ QVERIFY(!receiver->called(1));
+ QCoreApplication::sendPostedEvents(receiver, QEvent::MetaCall);
+ QVERIFY(receiver->called(1));
+ receiver->reset();
+
+ // at emit, currentThread != sender->thread(), currentThread == receiver->thread(), sender->thread() != receiver->thread()
+ QVERIFY(!receiver->called(1));
+ sender->emitSignal1();
+ QVERIFY(receiver->called(1));
+ receiver->reset();
+
+ // at emit, currentThread != sender->thread(), currentThread != receiver->thread(), sender->thread() != receiver->thread()
+ ThreadAffinityThread emitThread2(sender);
+ QThread receiverThread;
+ QTimer *timer = new QTimer;
+ timer->setSingleShot(true);
+ timer->setInterval(100);
+ connect(&receiverThread, SIGNAL(started()), timer, SLOT(start()));
+ connect(timer, SIGNAL(timeout()), &receiverThread, SLOT(quit()), Qt::DirectConnection);
+ connect(&receiverThread, SIGNAL(finished()), timer, SLOT(deleteLater()));
+ timer->moveToThread(&receiverThread);
+
+ receiver->moveToThread(&receiverThread);
+ QVERIFY(!receiver->called(1));
+ emitThread2.start();
+ QVERIFY(emitThread2.wait(30000));
+ QVERIFY(!receiver->called(1));
+ receiverThread.start();
+ QVERIFY(receiverThread.wait(30000));
+ QVERIFY(receiver->called(1));
+ receiver->reset();
+
+ delete sender;
+ delete receiver;
+}
+
QTEST_MAIN(tst_QObject)
#include "tst_qobject.moc"
diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro
index 1d6993ab52..5745e671c2 100644
--- a/tests/auto/qobject/tst_qobject.pro
+++ b/tests/auto/qobject/tst_qobject.pro
@@ -10,12 +10,12 @@ QT = core \
gui
contains(QT_CONFIG, qt3support):DEFINES += QT_HAS_QT3SUPPORT
wince*: {
- addFiles.sources = signalbug.exe
+ addFiles.files = signalbug.exe
addFiles.path = .
DEPLOYMENT += addFiles
}
symbian: {
- addFiles.sources = signalbug.exe
+ addFiles.files = signalbug.exe
addFiles.path = \\sys\\bin
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qobjectrace/qobjectrace.pro b/tests/auto/qobjectrace/qobjectrace.pro
index 322adff6a0..526875b69d 100644
--- a/tests/auto/qobjectrace/qobjectrace.pro
+++ b/tests/auto/qobjectrace/qobjectrace.pro
@@ -3,3 +3,4 @@ SOURCES += tst_qobjectrace.cpp
QT = core
TARGET.EPOCHEAPSIZE = 20000000 40000000
+CONFIG += parallel_test
diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro
index 69dc98d6a9..ee624e1ef6 100644
--- a/tests/auto/qpainter/qpainter.pro
+++ b/tests/auto/qpainter/qpainter.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
contains(QT_CONFIG, qt3support): QT += qt3support
SOURCES += tst_qpainter.cpp
wince*|symbian: {
- addFiles.sources = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png
+ addFiles.files = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 4cf64f1e38..ce1ff777ab 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -169,6 +169,8 @@ private slots:
void clippedText();
+ void clipBoundingRect();
+
void setOpacity_data();
void setOpacity();
@@ -220,6 +222,8 @@ private slots:
void drawRect_task215378();
void drawRect_task247505();
+ void drawText_subPixelPositionsInRaster_qtbug5053();
+
void drawImage_data();
void drawImage();
@@ -1304,7 +1308,7 @@ void tst_QPainter::drawRect2()
p.end();
QRect stroke = getPaintedSize(image, Qt::white);
- QCOMPARE(stroke.adjusted(1, 1, 0, 0), fill.adjusted(0, 0, 1, 1));
+ QCOMPARE(stroke, fill.adjusted(0, 0, 1, 1));
}
}
@@ -1401,13 +1405,13 @@ void tst_QPainter::drawPath_data()
{
QPainterPath p;
p.addRect(2.25, 2.25, 10, 10);
- QTest::newRow("non-aligned rect") << p << QRect(3, 3, 10, 10) << 10 * 10;
+ QTest::newRow("non-aligned rect") << p << QRect(2, 2, 10, 10) << 10 * 10;
}
{
QPainterPath p;
p.addRect(2.25, 2.25, 10.5, 10.5);
- QTest::newRow("non-aligned rect 2") << p << QRect(3, 3, 10, 10) << 10 * 10;
+ QTest::newRow("non-aligned rect 2") << p << QRect(2, 2, 11, 11) << 11 * 11;
}
{
@@ -3511,6 +3515,9 @@ bool verifyOutlineFillConsistency(const QImage &img, QRgb outside, QRgb inside,
void tst_QPainter::outlineFillConsistency()
{
+ QSKIP("currently broken...", SkipAll);
+ return;
+
QImage dst(256, 256, QImage::Format_ARGB32_Premultiplied);
QPolygonF poly;
@@ -4527,6 +4534,82 @@ void tst_QPainter::QTBUG5939_attachPainterPrivate()
QCOMPARE(widget->deviceTransform, proxy->deviceTransform);
}
+void tst_QPainter::clipBoundingRect()
+{
+ QPixmap pix(500, 500);
+
+ QPainter p(&pix);
+
+ // Test a basic rectangle
+ p.setClipRect(100, 100, 200, 100);
+ QVERIFY(p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(50, 50, 300, 200)));
+ p.setClipRect(120, 120, 20, 20, Qt::IntersectClip);
+ QVERIFY(p.clipBoundingRect().contains(QRect(120, 120, 20, 20)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+
+ // Test a basic float rectangle
+ p.setClipRect(QRectF(100, 100, 200, 100));
+ QVERIFY(p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(50, 50, 300, 200)));
+ p.setClipRect(QRectF(120, 120, 20, 20), Qt::IntersectClip);
+ QVERIFY(p.clipBoundingRect().contains(QRect(120, 120, 20, 20)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+
+ // Test a basic path + region
+ QPainterPath path;
+ path.addRect(100, 100, 200, 100);
+ p.setClipPath(path);
+ QVERIFY(p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(50, 50, 300, 200)));
+ p.setClipRegion(QRegion(120, 120, 20, 20), Qt::IntersectClip);
+ QVERIFY(p.clipBoundingRect().contains(QRect(120, 120, 20, 20)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+
+ p.setClipRect(0, 0, 500, 500);
+ p.translate(250, 250);
+ for (int i=0; i<360; ++i) {
+ p.rotate(1);
+ p.setClipRect(-100, -100, 200, 200, Qt::IntersectClip);
+ }
+ QVERIFY(p.clipBoundingRect().contains(QRectF(-100, -100, 200, 200)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(-250, -250, 500, 500)));
+
+}
+
+void tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053()
+{
+#if !defined(Q_WS_MAC) || !defined(QT_MAC_USE_COCOA)
+ QSKIP("Only Mac/Cocoa supports sub pixel positions in raster engine currently", SkipAll);
+#endif
+ QFontMetricsF fm(qApp->font());
+
+ QImage baseLine(fm.width(QChar::fromLatin1('e')), fm.height(), QImage::Format_RGB32);
+ baseLine.fill(Qt::white);
+ {
+ QPainter p(&baseLine);
+ p.drawText(0, fm.ascent(), QString::fromLatin1("e"));
+ }
+
+ bool foundDifferentRasterization = false;
+ for (int i=1; i<12; ++i) {
+ QImage comparison(baseLine.size(), QImage::Format_RGB32);
+ comparison.fill(Qt::white);
+
+ {
+ QPainter p(&comparison);
+ p.drawText(QPointF(i / 12.0, fm.ascent()), QString::fromLatin1("e"));
+ }
+
+ if (comparison != baseLine) {
+ foundDifferentRasterization = true;
+ break;
+ }
+ }
+
+ QVERIFY(foundDifferentRasterization);
+}
+
void tst_QPainter::drawPointScaled()
{
QImage image(32, 32, QImage::Format_RGB32);
diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp
index 00f9b91d5d..f60e7827a4 100644
--- a/tests/auto/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp
@@ -60,6 +60,8 @@ public:
private slots:
void getSetCheck();
+ void swap();
+
void contains_QPointF_data();
void contains_QPointF();
@@ -140,6 +142,17 @@ void tst_QPainterPath::getSetCheck()
QCOMPARE(qreal(1.1), obj1.curveThreshold());
}
+void tst_QPainterPath::swap()
+{
+ QPainterPath p1;
+ p1.addRect( 0, 0,10,10);
+ QPainterPath p2;
+ p2.addRect(10,10,10,10);
+ p1.swap(p2);
+ QCOMPARE(p1.boundingRect().toRect(), QRect(10,10,10,10));
+ QCOMPARE(p2.boundingRect().toRect(), QRect( 0, 0,10,10));
+}
+
Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(QPointF)
Q_DECLARE_METATYPE(QRectF)
diff --git a/tests/auto/qpauseanimation/tst_qpauseanimation.cpp b/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
index ee91739e0c..c957f1b7f7 100644
--- a/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
+++ b/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
@@ -394,7 +394,10 @@ void tst_QPauseAnimation::multipleSequentialGroups()
QVERIFY(subgroup3.state() == QAbstractAnimation::Running);
QVERIFY(subgroup4.state() == QAbstractAnimation::Running);
- QTest::qWait(group.totalDuration() + 100);
+ // This is a pretty long animation so it tends to get rather out of sync
+ // when using the consistent timer, so run for an extra half second for good
+ // measure...
+ QTest::qWait(group.totalDuration() + 500);
#ifdef Q_OS_WIN
if (group.state() != QAbstractAnimation::Stopped)
diff --git a/tests/auto/qpen/tst_qpen.cpp b/tests/auto/qpen/tst_qpen.cpp
index 2e13f5bfab..3fc405cab3 100644
--- a/tests/auto/qpen/tst_qpen.cpp
+++ b/tests/auto/qpen/tst_qpen.cpp
@@ -59,6 +59,7 @@ public:
private slots:
void getSetCheck();
+ void swap();
void operator_eq_eq();
void operator_eq_eq_data();
@@ -95,6 +96,14 @@ void tst_QPen::getSetCheck()
}
}
+void tst_QPen::swap()
+{
+ QPen p1(Qt::black), p2(Qt::white);
+ p1.swap(p2);
+ QCOMPARE(p1.color(), QColor(Qt::white));
+ QCOMPARE(p2.color(), QColor(Qt::black));
+}
+
Q_DECLARE_METATYPE(QPen)
Q_DECLARE_METATYPE(QBrush)
diff --git a/tests/auto/qpicture/tst_qpicture.cpp b/tests/auto/qpicture/tst_qpicture.cpp
index c65d4b1de1..10a5a83aa1 100644
--- a/tests/auto/qpicture/tst_qpicture.cpp
+++ b/tests/auto/qpicture/tst_qpicture.cpp
@@ -64,6 +64,7 @@ private slots:
void devType();
void paintingActive();
void boundingRect();
+ void swap();
void operator_lt_lt();
void save_restore();
@@ -155,6 +156,18 @@ void tst_QPicture::boundingRect()
}
}
+void tst_QPicture::swap()
+{
+ QPicture p1, p2;
+ QPainter(&p1).drawLine(0, 0, 5, 5);
+ QPainter(&p2).drawLine(0, 3, 3, 0);
+ QCOMPARE(p1.boundingRect(), QRect(0,0,5,5));
+ QCOMPARE(p2.boundingRect(), QRect(0,0,3,3));
+ p1.swap(p2);
+ QCOMPARE(p1.boundingRect(), QRect(0,0,3,3));
+ QCOMPARE(p2.boundingRect(), QRect(0,0,5,5));
+}
+
// operator<< and operator>>
void tst_QPicture::operator_lt_lt()
{
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index ff8258f983..185ec1a02c 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -3,16 +3,16 @@ SOURCES += tst_qpixmap.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
wince*|symbian: {
- task31722_0.sources = convertFromImage/task31722_0/*.png
+ task31722_0.files = convertFromImage/task31722_0/*.png
task31722_0.path = convertFromImage/task31722_0
- task31722_1.sources = convertFromImage/task31722_1/*.png
+ task31722_1.files = convertFromImage/task31722_1/*.png
task31722_1.path = convertFromImage/task31722_1
- icons.sources = convertFromToHICON/*
+ icons.files = convertFromToHICON/*
icons.path = convertFromToHICON
- loadFromData.sources = loadFromData/*
+ loadFromData.files = loadFromData/*
loadFromData.path = loadFromData
DEPLOYMENT += task31722_0 task31722_1 icons loadFromData
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 62a6eb4abb..a8f8b7ba2c 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -95,6 +95,8 @@ public slots:
void cleanup();
private slots:
+ void swap();
+
void setAlphaChannel_data();
void setAlphaChannel();
@@ -246,6 +248,20 @@ void tst_QPixmap::cleanup()
{
}
+void tst_QPixmap::swap()
+{
+ QPixmap p1( 16, 16 ), p2( 32, 32 );
+ p1.fill( Qt::white );
+ p2.fill( Qt::black );
+ const qint64 p1k = p1.cacheKey();
+ const qint64 p2k = p2.cacheKey();
+ p1.swap(p2);
+ QCOMPARE(p1.cacheKey(), p2k);
+ QCOMPARE(p1.size(), QSize(32,32));
+ QCOMPARE(p2.cacheKey(), p1k);
+ QCOMPARE(p2.size(), QSize(16,16));
+}
+
void tst_QPixmap::setAlphaChannel_data()
{
QTest::addColumn<int>("red");
diff --git a/tests/auto/qpixmapfilter/qpixmapfilter.pro b/tests/auto/qpixmapfilter/qpixmapfilter.pro
index e64d68ddbf..964e56d6f3 100644
--- a/tests/auto/qpixmapfilter/qpixmapfilter.pro
+++ b/tests/auto/qpixmapfilter/qpixmapfilter.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qpixmapfilter.cpp
wince*: {
- addFiles.sources = noise.png
+ addFiles.files = noise.png
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qplugin/qplugin.pro b/tests/auto/qplugin/qplugin.pro
index aafcb36209..37a12da732 100644
--- a/tests/auto/qplugin/qplugin.pro
+++ b/tests/auto/qplugin/qplugin.pro
@@ -25,3 +25,4 @@ mac {
SUBDIRS += tst_qplugin.pro
+CONFIG += parallel_test
diff --git a/tests/auto/qplugin/tst_qplugin.pro b/tests/auto/qplugin/tst_qplugin.pro
index 0d9d809132..3629fb36a1 100644
--- a/tests/auto/qplugin/tst_qplugin.pro
+++ b/tests/auto/qplugin/tst_qplugin.pro
@@ -4,13 +4,13 @@ SOURCES = tst_qplugin.cpp
QT = core
wince*: {
- plugins.sources = plugins/*
+ plugins.files = plugins/*
plugins.path = plugins
DEPLOYMENT += plugins
}
symbian: {
- rpDep.sources = releaseplugin.dll debugplugin.dll
+ rpDep.files = releaseplugin.dll debugplugin.dll
rpDep.path = plugins
DEPLOYMENT += rpDep dpDep
}
diff --git a/tests/auto/qpluginloader/elftest/.gitattributes b/tests/auto/qpluginloader/elftest/.gitattributes
new file mode 100644
index 0000000000..891192ca94
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/.gitattributes
@@ -0,0 +1,10 @@
+corrupt1.elf64.so set -crlf -diff
+corrupt2.elf64.so set -crlf -diff
+corrupt3.elf64.so set -crlf -diff
+debugobj.so set -crlf -diff
+garbage1.so set -crlf -diff
+garbage2.so set -crlf -diff
+garbage3.so set -crlf -diff
+garbage4.so set -crlf -diff
+garbage5.so set -crlf -diff
+
diff --git a/tests/auto/qpluginloader/elftest/corrupt1.elf64.so b/tests/auto/qpluginloader/elftest/corrupt1.elf64.so
new file mode 100755
index 0000000000..12ce7362dc
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/corrupt1.elf64.so
Binary files differ
diff --git a/tests/auto/qpluginloader/elftest/corrupt2.elf64.so b/tests/auto/qpluginloader/elftest/corrupt2.elf64.so
new file mode 100755
index 0000000000..11fdc2c118
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/corrupt2.elf64.so
Binary files differ
diff --git a/tests/auto/qpluginloader/elftest/corrupt3.elf64.so b/tests/auto/qpluginloader/elftest/corrupt3.elf64.so
new file mode 100755
index 0000000000..94a2bc3560
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/corrupt3.elf64.so
Binary files differ
diff --git a/tests/auto/qpluginloader/elftest/debugobj.so b/tests/auto/qpluginloader/elftest/debugobj.so
new file mode 100644
index 0000000000..f0ee0569a3
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/debugobj.so
Binary files differ
diff --git a/tests/auto/qpluginloader/elftest/garbage1.so b/tests/auto/qpluginloader/elftest/garbage1.so
new file mode 100644
index 0000000000..0c7453077f
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/garbage1.so
@@ -0,0 +1,4 @@
+p¶¤Ðã¨ø±ÕÛcdL+ôúæî&‘¿&÷ýeü¥=კ²
+•o°Ã’ÊŽI› §ÙÏmgƒ]!ÀZ
+L'Ž)t±
+ÙN»¸(e©× P)Y8öG ˆ6ß-yÈÏÀ ñŸ§÷—“"ô–ZÖÿ›kõ4â?Ë^náÁÇß5$ž’ôY=£ð#y \ No newline at end of file
diff --git a/tests/auto/qpluginloader/elftest/garbage2.so b/tests/auto/qpluginloader/elftest/garbage2.so
new file mode 100644
index 0000000000..c06338e0c8
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/garbage2.so
@@ -0,0 +1 @@
+£Çv.³Y‹¨tKëW3 \ No newline at end of file
diff --git a/tests/auto/qpluginloader/elftest/garbage3.so b/tests/auto/qpluginloader/elftest/garbage3.so
new file mode 100644
index 0000000000..a24c523a77
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/garbage3.so
@@ -0,0 +1 @@
+£ÝÈÈ‚åžT-õ«´ÊôÚ¥ Àä¸ï¨ì¾œÀi8¼_ñxÓõª¾I±Ð×®ÝxÎ=úØ4@þñ[¨—úBàKS$ú \ No newline at end of file
diff --git a/tests/auto/qpluginloader/elftest/garbage4.so b/tests/auto/qpluginloader/elftest/garbage4.so
new file mode 100644
index 0000000000..4f45cf5157
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/garbage4.so
@@ -0,0 +1 @@
+¶ !¦\~çU­u³†:9©ˆ œ§T+91ˆQ¬EøåÇšx¨ng5Óã—zhŒ–…ÿÆ^t™ŠµŽ¦'ÆÎmm*ˈdXH;vw+ªG“²ÃàØ ¨9Lƒ0! \ No newline at end of file
diff --git a/tests/auto/qpluginloader/elftest/garbage5.so b/tests/auto/qpluginloader/elftest/garbage5.so
new file mode 100644
index 0000000000..f8c0a1d544
--- /dev/null
+++ b/tests/auto/qpluginloader/elftest/garbage5.so
@@ -0,0 +1,2 @@
+ïÌô’Q²
+ãµ-¢9Ò \ No newline at end of file
diff --git a/tests/auto/qpluginloader/qpluginloader.pro b/tests/auto/qpluginloader/qpluginloader.pro
index 382d6e4e91..6e41b4c96a 100644
--- a/tests/auto/qpluginloader/qpluginloader.pro
+++ b/tests/auto/qpluginloader/qpluginloader.pro
@@ -11,3 +11,4 @@ TARGET = tst_qpluginloader
INSTALLS =
+CONFIG += parallel_test
diff --git a/tests/auto/qpluginloader/tst/tst.pro b/tests/auto/qpluginloader/tst/tst.pro
index 2d757e7e5d..be243b812f 100644
--- a/tests/auto/qpluginloader/tst/tst.pro
+++ b/tests/auto/qpluginloader/tst/tst.pro
@@ -14,16 +14,18 @@ win32 {
wince*: {
- addFiles.sources = $$OUT_PWD/../bin/*.dll
+ addFiles.files = $$OUT_PWD/../bin/*.dll
addFiles.path = bin
DEPLOYMENT += addFiles
}
symbian: {
- libDep.sources = tst_qpluginloaderlib.dll
+ libDep.files = tst_qpluginloaderlib.dll
libDep.path = /sys/bin
- pluginDep.sources = theplugin.dll
+ pluginDep.files = theplugin.dll
pluginDep.path = bin
DEPLOYMENT += libDep pluginDep
}
+
+DEFINES += SRCDIR=\\\"$$PWD/../\\\"
diff --git a/tests/auto/qpluginloader/tst_qpluginloader.cpp b/tests/auto/qpluginloader/tst_qpluginloader.cpp
index 0771b6e9d5..591ef5ee52 100644
--- a/tests/auto/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/qpluginloader/tst_qpluginloader.cpp
@@ -123,6 +123,9 @@ private slots:
void loadHints();
void deleteinstanceOnUnload();
void checkingStubsFromDifferentDrives();
+ void loadDebugObj();
+ void loadCorruptElf();
+ void loadGarbage();
};
tst_QPluginLoader::tst_QPluginLoader()
@@ -287,12 +290,14 @@ void tst_QPluginLoader::deleteinstanceOnUnload()
QSignalSpy spy1(loader1.instance(), SIGNAL(destroyed()));
QSignalSpy spy2(loader2.instance(), SIGNAL(destroyed()));
- QCOMPARE(loader1.unload(), false); // refcount not reached 0, not really unloaded
- QCOMPARE(spy1.count(), 0);
- QCOMPARE(spy2.count(), 0);
+ if (pass == 0) {
+ QCOMPARE(loader2.unload(), false); // refcount not reached 0, not really unloaded
+ QCOMPARE(spy1.count(), 0);
+ QCOMPARE(spy2.count(), 0);
+ }
QCOMPARE(instance1->pluginName(), QLatin1String("Plugin ok"));
QCOMPARE(instance2->pluginName(), QLatin1String("Plugin ok"));
- QCOMPARE(loader2.unload(), true); // refcount reached 0, did really unload
+ QVERIFY(loader1.unload()); // refcount reached 0, did really unload
QCOMPARE(spy1.count(), 1);
QCOMPARE(spy2.count(), 1);
}
@@ -348,5 +353,54 @@ void tst_QPluginLoader::checkingStubsFromDifferentDrives()
#endif//Q_OS_SYMBIAN
}
+void tst_QPluginLoader::loadDebugObj()
+{
+#if defined (__ELF__)
+ QVERIFY(QFile::exists(SRCDIR "elftest/debugobj.so"));
+ QPluginLoader lib1(SRCDIR "elftest/debugobj.so");
+ QCOMPARE(lib1.load(), false);
+#endif
+}
+
+void tst_QPluginLoader::loadCorruptElf()
+{
+#if defined (__ELF__)
+if (sizeof(void*) == 8) {
+ QVERIFY(QFile::exists(SRCDIR "elftest/corrupt1.elf64.so"));
+
+ QPluginLoader lib1(SRCDIR "elftest/corrupt1.elf64.so");
+ QCOMPARE(lib1.load(), false);
+ QVERIFY(lib1.errorString().contains("not an ELF object"));
+
+ QPluginLoader lib2(SRCDIR "elftest/corrupt2.elf64.so");
+ QCOMPARE(lib2.load(), false);
+ QVERIFY(lib2.errorString().contains("invalid"));
+
+ QPluginLoader lib3(SRCDIR "elftest/corrupt3.elf64.so");
+ QCOMPARE(lib3.load(), false);
+ QVERIFY(lib3.errorString().contains("invalid"));
+} else if (sizeof(void*) == 4) {
+ QPluginLoader libW(SRCDIR "elftest/corrupt3.elf64.so");
+ QCOMPARE(libW.load(), false);
+ QVERIFY(libW.errorString().contains("architecture"));
+} else {
+ QFAIL("Please port QElfParser to this platform or blacklist this test.");
+}
+#endif
+}
+
+void tst_QPluginLoader::loadGarbage()
+{
+#if defined (Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+ for (int i=0; i<5; i++) {
+ QPluginLoader lib(QString(SRCDIR "elftest/garbage%1.so").arg(i));
+ QCOMPARE(lib.load(), false);
+#ifdef SHOW_ERRORS
+ qDebug() << lib.errorString();
+#endif
+ }
+#endif
+}
+
QTEST_APPLESS_MAIN(tst_QPluginLoader)
#include "tst_qpluginloader.moc"
diff --git a/tests/auto/qpoint/qpoint.pro b/tests/auto/qpoint/qpoint.pro
index 8b006c2412..fd240461e2 100644
--- a/tests/auto/qpoint/qpoint.pro
+++ b/tests/auto/qpoint/qpoint.pro
@@ -5,3 +5,4 @@
load(qttest_p4)
SOURCES += tst_qpoint.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qpointer/tst_qpointer.cpp b/tests/auto/qpointer/tst_qpointer.cpp
index 367078f642..0485a17c87 100644
--- a/tests/auto/qpointer/tst_qpointer.cpp
+++ b/tests/auto/qpointer/tst_qpointer.cpp
@@ -73,6 +73,7 @@ private slots:
void castDuringDestruction();
void data() const;
void dataSignature() const;
+ void threadSafety();
};
tst_QPointer::tst_QPointer()
@@ -345,5 +346,36 @@ void tst_QPointer::dataSignature() const
}
}
+class TestRunnable : public QObject, public QRunnable {
+ void run() {
+ QPointer<QObject> obj1 = new QObject;
+ QPointer<QObject> obj2 = new QObject;
+ obj1->moveToThread(thread()); // this is the owner thread
+ obj1->deleteLater(); // the delete will happen in the owner thread
+ obj2->moveToThread(thread()); // this is the owner thread
+ obj2->deleteLater(); // the delete will happen in the owner thread
+ }
+};
+
+void tst_QPointer::threadSafety()
+{
+
+ QThread owner;
+ owner.start();
+
+ QThreadPool pool;
+ for (int i = 0; i < 300; i++) {
+ QPointer<TestRunnable> task = new TestRunnable;
+ task->setAutoDelete(true);
+ task->moveToThread(&owner);
+ pool.start(task);
+ }
+ pool.waitForDone();
+
+ owner.quit();
+ owner.wait();
+}
+
+
QTEST_MAIN(tst_QPointer)
#include "tst_qpointer.moc"
diff --git a/tests/auto/qpolygon/tst_qpolygon.cpp b/tests/auto/qpolygon/tst_qpolygon.cpp
index 383d1a0efa..47a0e5803e 100644
--- a/tests/auto/qpolygon/tst_qpolygon.cpp
+++ b/tests/auto/qpolygon/tst_qpolygon.cpp
@@ -63,6 +63,7 @@ public:
private slots:
void makeEllipse();
+ void swap();
};
tst_QPolygon::tst_QPolygon()
@@ -91,5 +92,14 @@ void tst_QPolygon::makeEllipse()
QVERIFY( !err );
}
+void tst_QPolygon::swap()
+{
+ QPolygon p1(QVector<QPoint>() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10));
+ QPolygon p2(QVector<QPoint>() << QPoint(0,0) << QPoint( 0,10) << QPoint( 10,10) << QPoint(10,0));
+ p1.swap(p2);
+ QCOMPARE(p1.count(),4);
+ QCOMPARE(p2.count(),3);
+}
+
QTEST_APPLESS_MAIN(tst_QPolygon)
#include "tst_qpolygon.moc"
diff --git a/tests/auto/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/qprinterinfo/tst_qprinterinfo.cpp
index 3f7068599f..992c67a218 100644
--- a/tests/auto/qprinterinfo/tst_qprinterinfo.cpp
+++ b/tests/auto/qprinterinfo/tst_qprinterinfo.cpp
@@ -134,7 +134,7 @@ QStringList tst_QPrinterInfo::getPrintersFromSystem()
QString output = getOutputFromCommand(command);
QStringList list = output.split(QChar::fromLatin1('\n'));
- QRegExp reg("^[Pp]rinter ([.a-zA-Z0-9_-]+)");
+ QRegExp reg("^[Pp]rinter ([.a-zA-Z0-9-_@]+)");
for (int c = 0; c < list.size(); ++c) {
if (reg.indexIn(list[c]) >= 0) {
QString printer = reg.cap(1);
diff --git a/tests/auto/qprocess/test/test.pro b/tests/auto/qprocess/test/test.pro
index d555067f88..a91caddd2f 100644
--- a/tests/auto/qprocess/test/test.pro
+++ b/tests/auto/qprocess/test/test.pro
@@ -27,61 +27,61 @@ embedded: QT += gui
wince*: {
- addFile_fileWriterProcess.sources = $$OUT_PWD/../fileWriterProcess/fileWriterProcess.exe
+ addFile_fileWriterProcess.files = $$OUT_PWD/../fileWriterProcess/fileWriterProcess.exe
addFile_fileWriterProcess.path = fileWriterProcess
- addFile_testBatFiles.sources = $$PWD/../testBatFiles/*
+ addFile_testBatFiles.files = $$PWD/../testBatFiles/*
addFile_testBatFiles.path = testBatFiles
- addFile_testDetached.sources = $$OUT_PWD/../testDetached/testDetached.exe
+ addFile_testDetached.files = $$OUT_PWD/../testDetached/testDetached.exe
addFile_testDetached.path = testDetached
- addFile_testExitCodes.sources = $$OUT_PWD/../testExitCodes/testExitCodes.exe
+ addFile_testExitCodes.files = $$OUT_PWD/../testExitCodes/testExitCodes.exe
addFile_testExitCodes.path = testExitCodes
- addFile_testGuiProcess.sources = $$OUT_PWD/../testGuiProcess/testGuiProcess.exe
+ addFile_testGuiProcess.files = $$OUT_PWD/../testGuiProcess/testGuiProcess.exe
addFile_testGuiProcess.path = testGuiProcess
- addFile_testProcessCrash.sources = $$OUT_PWD/../testProcessCrash/testProcessCrash.exe
+ addFile_testProcessCrash.files = $$OUT_PWD/../testProcessCrash/testProcessCrash.exe
addFile_testProcessCrash.path = testProcessCrash
- addFile_testProcessDeadWhileReading.sources = $$OUT_PWD/../testProcessDeadWhileReading/testProcessDeadWhileReading.exe
+ addFile_testProcessDeadWhileReading.files = $$OUT_PWD/../testProcessDeadWhileReading/testProcessDeadWhileReading.exe
addFile_testProcessDeadWhileReading.path = testProcessDeadWhileReading
- addFile_testProcessEcho.sources = $$OUT_PWD/../testProcessEcho/testProcessEcho.exe
+ addFile_testProcessEcho.files = $$OUT_PWD/../testProcessEcho/testProcessEcho.exe
addFile_testProcessEcho.path = testProcessEcho
- addFile_testProcessEcho2.sources = $$OUT_PWD/../testProcessEcho2/testProcessEcho2.exe
+ addFile_testProcessEcho2.files = $$OUT_PWD/../testProcessEcho2/testProcessEcho2.exe
addFile_testProcessEcho2.path = testProcessEcho2
- addFile_testProcessEcho3.sources = $$OUT_PWD/../testProcessEcho3/testProcessEcho3.exe
+ addFile_testProcessEcho3.files = $$OUT_PWD/../testProcessEcho3/testProcessEcho3.exe
addFile_testProcessEcho3.path = testProcessEcho3
- addFile_testProcessEOF.sources = $$OUT_PWD/../testProcessEOF/testProcessEOF.exe
+ addFile_testProcessEOF.files = $$OUT_PWD/../testProcessEOF/testProcessEOF.exe
addFile_testProcessEOF.path = testProcessEOF
- addFile_testProcessLoopback.sources = $$OUT_PWD/../testProcessLoopback/testProcessLoopback.exe
+ addFile_testProcessLoopback.files = $$OUT_PWD/../testProcessLoopback/testProcessLoopback.exe
addFile_testProcessLoopback.path = testProcessLoopback
- addFile_testProcessNormal.sources = $$OUT_PWD/../testProcessNormal/testProcessNormal.exe
+ addFile_testProcessNormal.files = $$OUT_PWD/../testProcessNormal/testProcessNormal.exe
addFile_testProcessNormal.path = testProcessNormal
- addFile_testProcessOutput.sources = $$OUT_PWD/../testProcessOutput/testProcessOutput.exe
+ addFile_testProcessOutput.files = $$OUT_PWD/../testProcessOutput/testProcessOutput.exe
addFile_testProcessOutput.path = testProcessOutput
- addFile_testProcessNoSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/nospace.exe
+ addFile_testProcessNoSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/nospace.exe
addFile_testProcessNoSpacesArgs.path = testProcessSpacesArgs
- addFile_testProcessOneSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/"one space".exe
+ addFile_testProcessOneSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/"one space".exe
addFile_testProcessOneSpacesArgs.path = testProcessSpacesArgs
- addFile_testProcessTwoSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/"two space s".exe
+ addFile_testProcessTwoSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/"two space s".exe
addFile_testProcessTwoSpacesArgs.path = testProcessSpacesArgs
- addFile_testSoftExit.sources = $$OUT_PWD/../testSoftExit/testSoftExit.exe
+ addFile_testSoftExit.files = $$OUT_PWD/../testSoftExit/testSoftExit.exe
addFile_testSoftExit.path = testSoftExit
- addFile_testSpaceInName.sources = $$OUT_PWD/../"test Space In Name"/testSpaceInName.exe
+ addFile_testSpaceInName.files = $$OUT_PWD/../"test Space In Name"/testSpaceInName.exe
addFile_testSpaceInName.path = "test Space In Name"
@@ -108,7 +108,7 @@ wince*: {
}
symbian: {
- binDep.sources = \
+ binDep.files = \
fileWriterProcess.exe \
testDetached.exe \
testExitCodes.exe \
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp
index 4ee8957d2d..b697431bdb 100644
--- a/tests/auto/qprocess/tst_qprocess.cpp
+++ b/tests/auto/qprocess/tst_qprocess.cpp
@@ -1585,6 +1585,7 @@ void tst_QProcess::spaceArgsTest()
#if defined(Q_OS_SYMBIAN)
// Symbian test outputs to a file, so check that
FILE* file = fopen("c:\\logs\\qprocess_args_test.txt","r");
+ QVERIFY(file);
char buf[256];
fgets(buf, 256, file);
fclose(file);
@@ -1614,6 +1615,7 @@ void tst_QProcess::spaceArgsTest()
#if defined(Q_OS_SYMBIAN)
// Symbian test outputs to a file, so check that
file = fopen("c:\\logs\\qprocess_args_test.txt","r");
+ QVERIFY(file);
fgets(buf, 256, file);
fclose(file);
actual = QString::fromLatin1(buf).split("|");
@@ -1661,6 +1663,7 @@ void tst_QProcess::nativeArguments()
# else
FILE* file = fopen("\\temp\\qprocess_args_test.txt","r");
# endif
+ QVERIFY(file);
char buf[256];
fgets(buf, 256, file);
fclose(file);
@@ -2289,7 +2292,9 @@ void tst_QProcess::detachedWorkingDirectoryAndPid()
QFileInfo fi(infoFile);
fi.setCaching(false);
- while (fi.size() == 0) {
+ //The guard counter ensures the test does not hang if the sub process fails.
+ //Instead, the test will fail when trying to open & verify the sub process output file.
+ for (int guard = 0; guard < 100 && fi.size() == 0; guard++) {
QTest::qSleep(100);
}
@@ -2401,6 +2406,7 @@ void tst_QProcess::startFinishStartFinish()
#if defined(Q_OS_SYMBIAN)
// Symbian test outputs to a file, so check that
FILE* file = fopen("c:\\logs\\qprocess_output_test.txt","r");
+ QVERIFY(file);
char buf[30];
fgets(buf, 30, file);
QCOMPARE(QString::fromLatin1(buf),
diff --git a/tests/auto/qprocessenvironment/qprocessenvironment.pro b/tests/auto/qprocessenvironment/qprocessenvironment.pro
index 398facc842..60dba50813 100644
--- a/tests/auto/qprocessenvironment/qprocessenvironment.pro
+++ b/tests/auto/qprocessenvironment/qprocessenvironment.pro
@@ -3,3 +3,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qprocessenvironment.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp
index 92abbfe448..b35cd028db 100644
--- a/tests/auto/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp
@@ -179,10 +179,15 @@ void tst_QProgressBar::format()
bar.repainted = false;
bar.setFormat("%v of %m (%p%)");
qApp->processEvents();
+
#ifndef Q_WS_MAC
- // The Mac scroll bar is animated, which means we get paint events all the time.
+ // Animated scroll bars get paint events all the time
+#ifdef Q_OS_WIN
+ if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA)
+#endif
QVERIFY(!bar.repainted);
#endif
+
QCOMPARE(bar.text(), QString("1 of 10 (10%)"));
bar.setRange(5, 5);
bar.setValue(5);
diff --git a/tests/auto/qqueue/qqueue.pro b/tests/auto/qqueue/qqueue.pro
index ed489f9f81..ce0d8c30ca 100644
--- a/tests/auto/qqueue/qqueue.pro
+++ b/tests/auto/qqueue/qqueue.pro
@@ -4,3 +4,4 @@ QT = core
SOURCES += tst_qqueue.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qradiobutton/tst_qradiobutton.cpp b/tests/auto/qradiobutton/tst_qradiobutton.cpp
index bdeed5ff35..2d8b680cd8 100644
--- a/tests/auto/qradiobutton/tst_qradiobutton.cpp
+++ b/tests/auto/qradiobutton/tst_qradiobutton.cpp
@@ -58,6 +58,7 @@ public:
private slots:
void task190739_focus();
+ void minimumSizeHint();
private:
};
@@ -96,6 +97,11 @@ void tst_QRadioButton::task190739_focus()
}
+void tst_QRadioButton::minimumSizeHint()
+{
+ QRadioButton button(tr("QRadioButtons sizeHint is the same as it's minimumSizeHint"));
+ QCOMPARE(button.sizeHint(), button.minimumSizeHint());
+}
QTEST_MAIN(tst_QRadioButton)
diff --git a/tests/auto/qrand/qrand.pro b/tests/auto/qrand/qrand.pro
index c868ed40fa..0db8af821c 100644
--- a/tests/auto/qrand/qrand.pro
+++ b/tests/auto/qrand/qrand.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qrand.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qreadlocker/qreadlocker.pro b/tests/auto/qreadlocker/qreadlocker.pro
index 5919102170..ee533070a7 100644
--- a/tests/auto/qreadlocker/qreadlocker.pro
+++ b/tests/auto/qreadlocker/qreadlocker.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qreadlocker.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qreadwritelock/qreadwritelock.pro b/tests/auto/qreadwritelock/qreadwritelock.pro
index 4318b18178..93f7c68dc3 100644
--- a/tests/auto/qreadwritelock/qreadwritelock.pro
+++ b/tests/auto/qreadwritelock/qreadwritelock.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qreadwritelock.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qrect/qrect.pro b/tests/auto/qrect/qrect.pro
index 75940b3be7..f1ad046e34 100644
--- a/tests/auto/qrect/qrect.pro
+++ b/tests/auto/qrect/qrect.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qrect.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qregexp/qregexp.pro b/tests/auto/qregexp/qregexp.pro
index 80b6827101..e0fef12479 100644
--- a/tests/auto/qregexp/qregexp.pro
+++ b/tests/auto/qregexp/qregexp.pro
@@ -6,3 +6,4 @@ QT = core
QT = core
SOURCES += tst_qregexp.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qregexp/tst_qregexp.cpp b/tests/auto/qregexp/tst_qregexp.cpp
index 4337d9a567..eaca8766e1 100644
--- a/tests/auto/qregexp/tst_qregexp.cpp
+++ b/tests/auto/qregexp/tst_qregexp.cpp
@@ -77,6 +77,7 @@ private slots:
void caretAnchoredOptimization();
void isEmpty();
void prepareEngineOptimization();
+ void swap();
void operator_eq();
/*
@@ -1290,6 +1291,14 @@ void tst_QRegExp::prepareEngineOptimization()
QCOMPARE(rx11.matchedLength(), -1);
}
+void tst_QRegExp::swap()
+{
+ QRegExp r1(QLatin1String(".*")), r2(QLatin1String("a*"));
+ r1.swap(r2);
+ QCOMPARE(r1.pattern(),QLatin1String("a*"));
+ QCOMPARE(r2.pattern(),QLatin1String(".*"));
+}
+
void tst_QRegExp::operator_eq()
{
const int I = 2;
diff --git a/tests/auto/qregion/tst_qregion.cpp b/tests/auto/qregion/tst_qregion.cpp
index de3055d31c..6612f4fd6f 100644
--- a/tests/auto/qregion/tst_qregion.cpp
+++ b/tests/auto/qregion/tst_qregion.cpp
@@ -64,6 +64,7 @@ public:
private slots:
void boundingRect();
void rects();
+ void swap();
void setRects();
void ellipseRegion();
void polygonRegion();
@@ -168,6 +169,15 @@ void tst_QRegion::rects()
}
}
+void tst_QRegion::swap()
+{
+ QRegion r1(QRect( 0, 0,10,10));
+ QRegion r2(QRect(10,10,10,10));
+ r1.swap(r2);
+ QCOMPARE(r1.rects().front(), QRect(10,10,10,10));
+ QCOMPARE(r2.rects().front(), QRect( 0, 0,10,10));
+}
+
void tst_QRegion::setRects()
{
{
diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro
index 17e36af833..9ca6994716 100644
--- a/tests/auto/qresourceengine/qresourceengine.pro
+++ b/tests/auto/qresourceengine/qresourceengine.pro
@@ -21,25 +21,26 @@ PRE_TARGETDEPS += $${runtime_resource.target}
QT = core
wince*|symbian:{
- deploy.sources += runtime_resource.rcc parentdir.txt
- test.sources = testqrc/*
+ deploy.files += runtime_resource.rcc parentdir.txt
+ test.files = testqrc/*
test.path = testqrc
- alias.sources = testqrc/aliasdir/*
+ alias.files = testqrc/aliasdir/*
alias.path = testqrc/aliasdir
- other.sources = testqrc/otherdir/*
+ other.files = testqrc/otherdir/*
other.path = testqrc/otherdir
- search1.sources = testqrc/searchpath1/*
+ search1.files = testqrc/searchpath1/*
search1.path = testqrc/searchpath1
- search2.sources = testqrc/searchpath2/*
+ search2.files = testqrc/searchpath2/*
search2.path = testqrc/searchpath2
- sub.sources = testqrc/subdir/*
+ sub.files = testqrc/subdir/*
sub.path = testqrc/subdir
- testsub.sources = testqrc/test/*
+ testsub.files = testqrc/test/*
testsub.path = testqrc/test
- testsub2.sources = testqrc/test/test/*
+ testsub2.files = testqrc/test/test/*
testsub2.path = testqrc/test/test
- DEPLOYMENT = deploy test alias other search1 search2 sub testsub testsub2
+ DEPLOYMENT += deploy test alias other search1 search2 sub testsub testsub2
!symbian:DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+CONFIG += parallel_test
diff --git a/tests/auto/qringbuffer/qringbuffer.pro b/tests/auto/qringbuffer/qringbuffer.pro
index 91fb0a0dbb..2e4f166619 100644
--- a/tests/auto/qringbuffer/qringbuffer.pro
+++ b/tests/auto/qringbuffer/qringbuffer.pro
@@ -4,3 +4,4 @@ SOURCES += tst_qringbuffer.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qscopedpointer/qscopedpointer.pro b/tests/auto/qscopedpointer/qscopedpointer.pro
index 13d8425070..4a3d5b8de8 100644
--- a/tests/auto/qscopedpointer/qscopedpointer.pro
+++ b/tests/auto/qscopedpointer/qscopedpointer.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qscopedpointer.cpp
QT -= gui
+CONFIG += parallel_test
diff --git a/tests/auto/qscriptable/tst_qscriptable.cpp b/tests/auto/qscriptable/tst_qscriptable.cpp
index 18be803f64..f5d36ea05f 100644
--- a/tests/auto/qscriptable/tst_qscriptable.cpp
+++ b/tests/auto/qscriptable/tst_qscriptable.cpp
@@ -131,7 +131,7 @@ QScriptValue MyScriptable::getArguments()
int MyScriptable::getArgumentCount()
{
- return context()->argumentCount();
+ return argumentCount();
}
void MyScriptable::foo()
@@ -283,6 +283,8 @@ void tst_QScriptable::engine()
void tst_QScriptable::thisObject()
{
+ QVERIFY(!m_scriptable.thisObject().isValid());
+
m_engine.evaluate("o = { }");
{
QScriptValue ret = m_engine.evaluate("o.__proto__ = scriptable;"
diff --git a/tests/auto/qscriptclass/tst_qscriptclass.cpp b/tests/auto/qscriptclass/tst_qscriptclass.cpp
index 0645319df9..16f09b6468 100644
--- a/tests/auto/qscriptclass/tst_qscriptclass.cpp
+++ b/tests/auto/qscriptclass/tst_qscriptclass.cpp
@@ -69,6 +69,11 @@ private slots:
void getProperty_invalidValue();
void enumerate();
void extension();
+ void originalProperties1();
+ void originalProperties2();
+ void originalProperties3();
+ void originalProperties4();
+ void defaultImplementations();
};
tst_QScriptClass::tst_QScriptClass()
@@ -604,6 +609,8 @@ void tst_QScriptClass::newInstance()
QVERIFY(obj2.data().strictlyEquals(num));
QVERIFY(obj2.prototype().strictlyEquals(cls.prototype()));
QCOMPARE(obj2.scriptClass(), (QScriptClass*)&cls);
+ QVERIFY(!obj2.equals(obj1));
+ QVERIFY(!obj2.strictlyEquals(obj1));
QScriptValue obj3 = eng.newObject();
QCOMPARE(obj3.scriptClass(), (QScriptClass*)0);
@@ -731,6 +738,14 @@ void tst_QScriptClass::getAndSetProperty()
QCOMPARE(cls.lastPropertyId(), foo2Id);
}
+ // attempt to delete custom property
+ obj1.setProperty(foo2, QScriptValue());
+ // delete real property
+ obj1.setProperty(foo, QScriptValue());
+ QVERIFY(!obj1.property(foo).isValid());
+ obj1.setProperty(foo, num);
+ QVERIFY(obj1.property(foo).equals(num));
+
// remove script class; normal properties should remain
obj1.setScriptClass(0);
QCOMPARE(obj1.scriptClass(), (QScriptClass*)0);
@@ -826,6 +841,7 @@ void tst_QScriptClass::extension()
QCOMPARE((int)cls.lastExtensionType(), -1);
QVERIFY(!obj.instanceOf(obj));
QCOMPARE((int)cls.lastExtensionType(), -1);
+ QVERIFY(!obj.construct().isValid());
}
// Callable
{
@@ -1038,5 +1054,275 @@ void tst_QScriptClass::extension()
}
}
+// tests made to match Qt 4.7 (JSC) behaviour
+void tst_QScriptClass::originalProperties1()
+{
+ QScriptEngine eng;
+
+ QScriptString orig1 = eng.toStringHandle("orig1");
+ QScriptString orig2 = eng.toStringHandle("orig2");
+ QScriptString orig3 = eng.toStringHandle("orig3");
+ QScriptString new1 = eng.toStringHandle("new1");
+ QScriptString new2 = eng.toStringHandle("new2");
+
+ {
+ TestClass cls1(&eng);
+ cls1.addCustomProperty(orig2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, 89);
+ cls1.addCustomProperty(new1, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, "hello");
+
+ TestClass cls2(&eng);
+ cls2.addCustomProperty(orig2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, 59);
+ cls2.addCustomProperty(new2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, "world");
+
+ QScriptValue obj1 = eng.newObject();
+ obj1.setProperty(orig1 , 42);
+ obj1.setProperty(orig2 , "foo");
+ obj1.prototype().setProperty(orig3, "bar");
+
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+ QCOMPARE(obj1.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj1.property(orig3).toString(), QString::fromLatin1("bar"));
+ QVERIFY(!obj1.property(new1).isValid());
+ QVERIFY(!obj1.property(new2).isValid());
+
+ eng.globalObject().setProperty("obj" , obj1);
+
+ obj1.setScriptClass(&cls1);
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+ QCOMPARE(obj1.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj1.property(orig3).toString(), QString::fromLatin1("bar"));
+ QCOMPARE(obj1.property(new1).toString(), QString::fromLatin1("hello"));
+ QVERIFY(!obj1.property(new2).isValid());
+
+ QScriptValue obj2 = eng.evaluate("obj");
+ QCOMPARE(obj2.scriptClass(), &cls1);
+ QCOMPARE(obj2.property(orig1).toInt32(), 42);
+ QCOMPARE(obj2.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj2.property(orig3).toString(), QString::fromLatin1("bar"));
+ QCOMPARE(obj2.property(new1).toString(), QString::fromLatin1("hello"));
+ QVERIFY(!obj2.property(new2).isValid());
+
+ obj1.setScriptClass(&cls2);
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+ QCOMPARE(obj1.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj1.property(orig3).toString(), QString::fromLatin1("bar"));
+ QVERIFY(!obj1.property(new1).isValid());
+ QCOMPARE(obj1.property(new2).toString(), QString::fromLatin1("world"));
+
+ QCOMPARE(obj2.scriptClass(), &cls2);
+ QCOMPARE(obj2.property(orig1).toInt32(), 42);
+ QCOMPARE(obj2.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj2.property(orig3).toString(), QString::fromLatin1("bar"));
+ QVERIFY(!obj2.property(new1).isValid());
+ QCOMPARE(obj2.property(new2).toString(), QString::fromLatin1("world"));
+
+ obj1.setScriptClass(0);
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+ QCOMPARE(obj1.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj1.property(orig3).toString(), QString::fromLatin1("bar"));
+ QVERIFY(!obj1.property(new1).isValid());
+ QVERIFY(!obj1.property(new2).isValid());
+ }
+}
+
+void tst_QScriptClass::originalProperties2()
+{
+ QScriptEngine eng;
+
+ QScriptString orig1 = eng.toStringHandle("orig1");
+ QScriptString orig2 = eng.toStringHandle("orig2");
+ QScriptString orig3 = eng.toStringHandle("orig3");
+ QScriptString new1 = eng.toStringHandle("new1");
+ QScriptString new2 = eng.toStringHandle("new2");
+
+ {
+ TestClass cls1(&eng);
+ cls1.addCustomProperty(orig2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, 89);
+ cls1.addCustomProperty(new1, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, "hello");
+
+ TestClass cls2(&eng);
+ cls2.addCustomProperty(orig2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, 59);
+ cls2.addCustomProperty(new2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, "world");
+
+ QScriptValue obj1 = eng.newObject();
+ obj1.setProperty(orig1 , 42);
+ obj1.setProperty(orig2 , "foo");
+ obj1.prototype().setProperty(orig3, "bar");
+
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+ QCOMPARE(obj1.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj1.property(orig3).toString(), QString::fromLatin1("bar"));
+ QVERIFY(!obj1.property(new1).isValid());
+ QVERIFY(!obj1.property(new2).isValid());
+
+ obj1.setScriptClass(&cls1);
+ obj1.setProperty(orig1 , QScriptValue(&eng, 852));
+ obj1.setProperty(orig2 , "oli");
+ obj1.setProperty(orig3 , "fu*c");
+ obj1.setProperty(new1 , "moo");
+ obj1.setProperty(new2 , "allo?");
+ QCOMPARE(obj1.property(orig1).toInt32(), 852);
+ QCOMPARE(obj1.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj1.property(orig3).toString(), QString::fromLatin1("fu*c"));
+ QCOMPARE(obj1.property(new1).toString(), QString::fromLatin1("moo"));
+ QCOMPARE(obj1.property(new2).toString(), QString::fromLatin1("allo?"));
+
+ obj1.setScriptClass(&cls2);
+ QCOMPARE(obj1.property(orig1).toInt32(), 852);
+ QCOMPARE(obj1.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj1.property(orig3).toString(), QString::fromLatin1("fu*c"));
+ QVERIFY(!obj1.property(new1).isValid());
+ QCOMPARE(obj1.property(new2).toString(), QString::fromLatin1("allo?"));
+
+ obj1.setScriptClass(0);
+ QCOMPARE(obj1.property(orig1).toInt32(), 852);
+ QCOMPARE(obj1.property(orig2).toString(), QString::fromLatin1("foo"));
+ QCOMPARE(obj1.property(orig3).toString(), QString::fromLatin1("fu*c"));
+ QVERIFY(!obj1.property(new1).isValid());
+ QCOMPARE(obj1.property(new2).toString(), QString::fromLatin1("allo?"));
+ }
+}
+
+void tst_QScriptClass::originalProperties3()
+{
+ QScriptEngine eng;
+
+ QScriptString orig1 = eng.toStringHandle("orig1");
+ QScriptString orig2 = eng.toStringHandle("orig2");
+ QScriptString orig3 = eng.toStringHandle("orig3");
+ QScriptString new1 = eng.toStringHandle("new1");
+ QScriptString new2 = eng.toStringHandle("new2");
+
+ {
+ TestClass cls1(&eng);
+ cls1.addCustomProperty(orig2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, 89);
+ cls1.addCustomProperty(new1, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, "hello");
+
+ TestClass cls2(&eng);
+ cls2.addCustomProperty(orig2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, 59);
+ cls2.addCustomProperty(new2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, "world");
+
+ QScriptValue obj1 = eng.newObject(&cls1);
+ QVERIFY(!obj1.property(orig1).isValid());
+ QCOMPARE(obj1.property(orig2).toInt32(), 89);
+ QCOMPARE(obj1.property(new1).toString(), QString::fromLatin1("hello"));
+ QVERIFY(!obj1.property(new2).isValid());
+ obj1.setProperty(orig1, 42);
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+
+ eng.globalObject().setProperty("obj" , obj1);
+ obj1.setScriptClass(&cls2);
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+ QCOMPARE(obj1.property(orig2).toInt32(), 59);
+ QVERIFY(!obj1.property(new1).isValid());
+ QCOMPARE(obj1.property(new2).toString(), QString::fromLatin1("world"));
+
+ QScriptValue obj2 = eng.evaluate("obj");
+ QCOMPARE(obj2.scriptClass(), &cls2);
+ QCOMPARE(obj2.property(orig1).toInt32(), 42);
+ QCOMPARE(obj2.property(orig2).toInt32(), 59);
+ QVERIFY(!obj2.property(new1).isValid());
+ QCOMPARE(obj2.property(new2).toString(), QString::fromLatin1("world"));
+
+ obj1.setScriptClass(0);
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+ QVERIFY(!obj1.property(orig2).isValid());
+ QVERIFY(!obj1.property(new1).isValid());
+ QVERIFY(!obj1.property(new2).isValid());
+
+ QCOMPARE(obj2.scriptClass(), (QScriptClass *)0);
+ QCOMPARE(obj2.property(orig1).toInt32(), 42);
+ QVERIFY(!obj2.property(orig2).isValid());
+ QVERIFY(!obj2.property(new1).isValid());
+ QVERIFY(!obj2.property(new2).isValid());
+ }
+}
+
+void tst_QScriptClass::originalProperties4()
+{
+ QScriptEngine eng;
+
+ QScriptString orig1 = eng.toStringHandle("orig1");
+ QScriptString orig2 = eng.toStringHandle("orig2");
+ QScriptString orig3 = eng.toStringHandle("orig3");
+ QScriptString new1 = eng.toStringHandle("new1");
+ QScriptString new2 = eng.toStringHandle("new2");
+
+ {
+ TestClass cls1(&eng);
+ cls1.addCustomProperty(orig2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, 89);
+ cls1.addCustomProperty(new1, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, "hello");
+
+ TestClass cls2(&eng);
+ cls2.addCustomProperty(orig2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, 59);
+ cls2.addCustomProperty(new2, QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess, 1, 0, "world");
+
+ QScriptValue obj1 = eng.newObject(&cls1);
+ QVERIFY(!obj1.property(orig1).isValid());
+ QCOMPARE(obj1.property(orig2).toInt32(), 89);
+ QCOMPARE(obj1.property(new1).toString(), QString::fromLatin1("hello"));
+ QVERIFY(!obj1.property(new2).isValid());
+
+ eng.globalObject().setProperty("obj" , obj1);
+
+ obj1.setScriptClass(0);
+ QVERIFY(obj1.isObject());
+ QVERIFY(!obj1.property(orig1).isValid());
+ QVERIFY(!obj1.property(orig2).isValid());
+ QVERIFY(!obj1.property(new1).isValid());
+ QVERIFY(!obj1.property(new2).isValid());
+ obj1.setProperty(orig1, 42);
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+
+ QScriptValue obj2 = eng.evaluate("obj");
+ QCOMPARE(obj2.scriptClass(), (QScriptClass *)0);
+ QVERIFY(obj2.isObject());
+ QCOMPARE(obj2.property(orig1).toInt32(), 42);
+ QVERIFY(!obj2.property(orig2).isValid());
+ QVERIFY(!obj2.property(new1).isValid());
+ QVERIFY(!obj2.property(new2).isValid());
+
+ obj1.setScriptClass(&cls2);
+ QCOMPARE(obj1.property(orig1).toInt32(), 42);
+ QCOMPARE(obj1.property(orig2).toInt32(), 59);
+ QVERIFY(!obj1.property(new1).isValid());
+ QCOMPARE(obj1.property(new2).toString(), QString::fromLatin1("world"));
+
+ QCOMPARE(obj2.scriptClass(), (QScriptClass *)(&cls2));
+ QCOMPARE(obj2.property(orig1).toInt32(), 42);
+ QCOMPARE(obj2.property(orig2).toInt32(), 59);
+ QVERIFY(!obj2.property(new1).isValid());
+ QCOMPARE(obj2.property(new2).toString(), QString::fromLatin1("world"));
+ }
+}
+
+void tst_QScriptClass::defaultImplementations()
+{
+ QScriptEngine eng;
+
+ QScriptClass defaultClass(&eng);
+ QCOMPARE(defaultClass.engine(), &eng);
+ QVERIFY(!defaultClass.prototype().isValid());
+ QCOMPARE(defaultClass.name(), QString());
+
+ QScriptValue obj = eng.newObject(&defaultClass);
+ QCOMPARE(obj.scriptClass(), &defaultClass);
+
+ QScriptString name = eng.toStringHandle("foo");
+ uint id = -1;
+ QCOMPARE(defaultClass.queryProperty(obj, name, QScriptClass::HandlesReadAccess, &id), QScriptClass::QueryFlags(0));
+ QVERIFY(!defaultClass.property(obj, name, id).isValid());
+ QCOMPARE(defaultClass.propertyFlags(obj, name, id), QScriptValue::PropertyFlags(0));
+ defaultClass.setProperty(obj, name, id, 123);
+ QVERIFY(!obj.property(name).isValid());
+
+ QCOMPARE(defaultClass.newIterator(obj), (QScriptClassPropertyIterator*)0);
+
+ QVERIFY(!defaultClass.supportsExtension(QScriptClass::Callable));
+ QVERIFY(!defaultClass.supportsExtension(QScriptClass::HasInstance));
+ QVERIFY(!defaultClass.extension(QScriptClass::Callable).isValid());
+ QVERIFY(!defaultClass.extension(QScriptClass::HasInstance).isValid());
+}
+
QTEST_MAIN(tst_QScriptClass)
#include "tst_qscriptclass.moc"
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index 1a1576bf77..cb6311e6c8 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -44,11 +44,13 @@
#include <QtScript/qscriptcontext.h>
#include <QtScript/qscriptengine.h>
+#include <QtScript/qscriptvalueiterator.h>
//TESTED_CLASS=
//TESTED_FILES=
Q_DECLARE_METATYPE(QScriptValueList)
+Q_DECLARE_METATYPE(QScriptContext::Error)
QT_BEGIN_NAMESPACE
extern bool qt_script_isJITEnabled();
@@ -67,7 +69,11 @@ private slots:
void arguments();
void thisObject();
void returnValue();
- void throwError();
+ void throwError_data();
+ void throwError_fromEvaluate_data();
+ void throwError_fromEvaluate();
+ void throwError_fromCpp_data();
+ void throwError_fromCpp();
void throwValue();
void evaluateInFunction();
void pushAndPopContext();
@@ -77,6 +83,7 @@ private slots:
void scopeChain();
void pushAndPopScope();
void getSetActivationObject();
+ void getSetActivationObject_customContext();
void inheritActivationAndThisObject();
void toString();
void calledAsConstructor();
@@ -85,6 +92,10 @@ private slots:
void qobjectAsActivationObject();
void parentContextCallee_QT2270();
void popNativeContextScope();
+ void throwErrorInGlobalContext();
+ void throwErrorWithTypeInGlobalContext_data();
+ void throwErrorWithTypeInGlobalContext();
+ void throwValueInGlobalContext();
};
tst_QScriptContext::tst_QScriptContext()
@@ -360,73 +371,71 @@ static QScriptValue throw_ErrorAndReturnUndefined(QScriptContext *ctx, QScriptEn
return eng->undefinedValue();
}
-void tst_QScriptContext::throwError()
+static QScriptValue throw_ErrorAndReturnString(QScriptContext *ctx, QScriptEngine *)
{
- QScriptEngine eng;
+ return ctx->throwError(QScriptContext::UnknownError, "foo").toString();
+}
- {
- QScriptValue fun = eng.newFunction(throw_Error);
- eng.globalObject().setProperty("throw_Error", fun);
- QScriptValue result = eng.evaluate("throw_Error()");
- QCOMPARE(eng.hasUncaughtException(), true);
- QCOMPARE(result.isError(), true);
- QCOMPARE(result.toString(), QString("Error: foo"));
- }
+static QScriptValue throw_ErrorAndReturnObject(QScriptContext *ctx, QScriptEngine *eng)
+{
+ ctx->throwError(QScriptContext::UnknownError, "foo");
+ return eng->newObject();
+}
- {
- QScriptValue fun = eng.newFunction(throw_TypeError);
- eng.globalObject().setProperty("throw_TypeError", fun);
- QScriptValue result = eng.evaluate("throw_TypeError()");
- QCOMPARE(eng.hasUncaughtException(), true);
- QCOMPARE(result.isError(), true);
- QCOMPARE(result.toString(), QString("TypeError: foo"));
- }
+void tst_QScriptContext::throwError_data()
+{
+ QTest::addColumn<void*>("nativeFunctionPtr");
+ QTest::addColumn<QString>("stringRepresentation");
+
+ QTest::newRow("Error") << reinterpret_cast<void*>(throw_Error) << QString("Error: foo");
+ QTest::newRow("TypeError") << reinterpret_cast<void*>(throw_TypeError) << QString("TypeError: foo");
+ QTest::newRow("ReferenceError") << reinterpret_cast<void*>(throw_ReferenceError) << QString("ReferenceError: foo");
+ QTest::newRow("SyntaxError") << reinterpret_cast<void*>(throw_SyntaxError) << QString("SyntaxError: foo");
+ QTest::newRow("RangeError") << reinterpret_cast<void*>(throw_RangeError) << QString("RangeError: foo");
+ QTest::newRow("URIError") << reinterpret_cast<void*>(throw_URIError) << QString("URIError: foo");
+ QTest::newRow("ErrorAndReturnUndefined") << reinterpret_cast<void*>(throw_ErrorAndReturnUndefined) << QString("Error: foo");
+ QTest::newRow("ErrorAndReturnString") << reinterpret_cast<void*>(throw_ErrorAndReturnString) << QString("Error: foo");
+ QTest::newRow("ErrorAndReturnObject") << reinterpret_cast<void*>(throw_ErrorAndReturnObject) << QString("Error: foo");
+}
- {
- QScriptValue fun = eng.newFunction(throw_ReferenceError);
- eng.globalObject().setProperty("throw_ReferenceError", fun);
- QScriptValue result = eng.evaluate("throw_ReferenceError()");
- QCOMPARE(eng.hasUncaughtException(), true);
- QCOMPARE(result.isError(), true);
- QCOMPARE(result.toString(), QString("ReferenceError: foo"));
- }
+void tst_QScriptContext::throwError_fromEvaluate_data()
+{
+ throwError_data();
+}
- {
- QScriptValue fun = eng.newFunction(throw_SyntaxError);
- eng.globalObject().setProperty("throw_SyntaxError", fun);
- QScriptValue result = eng.evaluate("throw_SyntaxError()");
- QCOMPARE(eng.hasUncaughtException(), true);
- QCOMPARE(result.isError(), true);
- QCOMPARE(result.toString(), QString("SyntaxError: foo"));
- }
+void tst_QScriptContext::throwError_fromEvaluate()
+{
+ QFETCH(void*, nativeFunctionPtr);
+ QScriptEngine::FunctionSignature nativeFunction = reinterpret_cast<QScriptEngine::FunctionSignature>(nativeFunctionPtr);
+ QFETCH(QString, stringRepresentation);
+ QScriptEngine engine;
- {
- QScriptValue fun = eng.newFunction(throw_RangeError);
- eng.globalObject().setProperty("throw_RangeError", fun);
- QScriptValue result = eng.evaluate("throw_RangeError()");
- QCOMPARE(eng.hasUncaughtException(), true);
- QCOMPARE(result.isError(), true);
- QCOMPARE(result.toString(), QString("RangeError: foo"));
- }
+ QScriptValue fun = engine.newFunction(nativeFunction);
+ engine.globalObject().setProperty("throw_Error", fun);
+ QScriptValue result = engine.evaluate("throw_Error()");
+ QCOMPARE(engine.hasUncaughtException(), true);
+ QCOMPARE(result.isError(), true);
+ QCOMPARE(result.toString(), stringRepresentation);
+}
- {
- QScriptValue fun = eng.newFunction(throw_URIError);
- eng.globalObject().setProperty("throw_URIError", fun);
- QScriptValue result = eng.evaluate("throw_URIError()");
- QCOMPARE(eng.hasUncaughtException(), true);
- QCOMPARE(result.isError(), true);
- QCOMPARE(result.toString(), QString("URIError: foo"));
- }
+void tst_QScriptContext::throwError_fromCpp_data()
+{
+ throwError_data();
+}
- {
- QScriptValue fun = eng.newFunction(throw_ErrorAndReturnUndefined);
- eng.globalObject().setProperty("throw_ErrorAndReturnUndefined", fun);
- QScriptValue result = eng.evaluate("throw_ErrorAndReturnUndefined()");
- QVERIFY(eng.hasUncaughtException());
- QVERIFY(result.isError());
- QCOMPARE(result.toString(), QString("Error: foo"));
- }
+void tst_QScriptContext::throwError_fromCpp()
+{
+ QFETCH(void*, nativeFunctionPtr);
+ QScriptEngine::FunctionSignature nativeFunction = reinterpret_cast<QScriptEngine::FunctionSignature>(nativeFunctionPtr);
+ QFETCH(QString, stringRepresentation);
+ QScriptEngine engine;
+ QScriptValue fun = engine.newFunction(nativeFunction);
+ engine.globalObject().setProperty("throw_Error", fun);
+ QScriptValue result = fun.call();
+ QCOMPARE(engine.hasUncaughtException(), true);
+ QCOMPARE(result.isError(), true);
+ QCOMPARE(result.toString(), stringRepresentation);
}
static QScriptValue throw_value(QScriptContext *ctx, QScriptEngine *)
@@ -513,8 +522,30 @@ void tst_QScriptContext::pushAndPopContext()
QScriptContext *ctx3 = eng.pushContext();
ctx3->activationObject().setProperty("foo", QScriptValue(&eng, 123));
QVERIFY(eng.evaluate("foo").strictlyEquals(QScriptValue(&eng, 123)));
+ QCOMPARE(ctx3->activationObject().propertyFlags("foo"), QScriptValue::PropertyFlags(0));
+
+ ctx3->activationObject().setProperty(4, 456);
+ QVERIFY(ctx3->activationObject().property(4, QScriptValue::ResolveLocal).equals(456));
+
eng.evaluate("var bar = 'ciao'");
QVERIFY(ctx3->activationObject().property("bar", QScriptValue::ResolveLocal).strictlyEquals(QScriptValue(&eng, "ciao")));
+
+ ctx3->activationObject().setProperty("baz", 789, QScriptValue::ReadOnly);
+ QVERIFY(eng.evaluate("baz").equals(789));
+ QCOMPARE(ctx3->activationObject().propertyFlags("baz"), QScriptValue::ReadOnly);
+
+ QSet<QString> activationPropertyNames;
+ QScriptValueIterator it(ctx3->activationObject());
+ while (it.hasNext()) {
+ it.next();
+ activationPropertyNames.insert(it.name());
+ }
+ QCOMPARE(activationPropertyNames.size(), 4);
+ QVERIFY(activationPropertyNames.contains("foo"));
+ QVERIFY(activationPropertyNames.contains("4"));
+ QVERIFY(activationPropertyNames.contains("bar"));
+ QVERIFY(activationPropertyNames.contains("baz"));
+
eng.popContext();
}
@@ -1054,6 +1085,20 @@ void tst_QScriptContext::getSetActivationObject()
}
}
+void tst_QScriptContext::getSetActivationObject_customContext()
+{
+ QScriptEngine eng;
+ QScriptContext *ctx = eng.pushContext();
+ QVERIFY(ctx->activationObject().isObject());
+ QScriptValue act = eng.newObject();
+ ctx->setActivationObject(act);
+ QVERIFY(ctx->activationObject().equals(act));
+ eng.evaluate("var foo = 123");
+ QCOMPARE(act.property("foo").toInt32(), 123);
+ eng.popContext();
+ QCOMPARE(act.property("foo").toInt32(), 123);
+}
+
static QScriptValue myEval(QScriptContext *ctx, QScriptEngine *eng)
{
QString code = ctx->argument(0).toString();
@@ -1283,5 +1328,49 @@ void tst_QScriptContext::parentContextCallee_QT2270()
QVERIFY(callee.equals(fun));
}
+void tst_QScriptContext::throwErrorInGlobalContext()
+{
+ QScriptEngine eng;
+ QScriptValue ret = eng.currentContext()->throwError("foo");
+ QVERIFY(ret.isError());
+ QVERIFY(eng.hasUncaughtException());
+ QVERIFY(eng.uncaughtException().strictlyEquals(ret));
+ QCOMPARE(ret.toString(), QString::fromLatin1("Error: foo"));
+}
+
+void tst_QScriptContext::throwErrorWithTypeInGlobalContext_data()
+{
+ QTest::addColumn<QScriptContext::Error>("error");
+ QTest::addColumn<QString>("stringRepresentation");
+ QTest::newRow("ReferenceError") << QScriptContext::ReferenceError << QString::fromLatin1("ReferenceError: foo");
+ QTest::newRow("SyntaxError") << QScriptContext::SyntaxError << QString::fromLatin1("SyntaxError: foo");
+ QTest::newRow("TypeError") << QScriptContext::TypeError << QString::fromLatin1("TypeError: foo");
+ QTest::newRow("RangeError") << QScriptContext::RangeError << QString::fromLatin1("RangeError: foo");
+ QTest::newRow("URIError") << QScriptContext::URIError << QString::fromLatin1("URIError: foo");
+ QTest::newRow("UnknownError") << QScriptContext::UnknownError << QString::fromLatin1("Error: foo");
+}
+
+void tst_QScriptContext::throwErrorWithTypeInGlobalContext()
+{
+ QFETCH(QScriptContext::Error, error);
+ QFETCH(QString, stringRepresentation);
+ QScriptEngine eng;
+ QScriptValue ret = eng.currentContext()->throwError(error, "foo");
+ QVERIFY(ret.isError());
+ QVERIFY(eng.hasUncaughtException());
+ QVERIFY(eng.uncaughtException().strictlyEquals(ret));
+ QCOMPARE(ret.toString(), stringRepresentation);
+}
+
+void tst_QScriptContext::throwValueInGlobalContext()
+{
+ QScriptEngine eng;
+ QScriptValue val(&eng, 123);
+ QScriptValue ret = eng.currentContext()->throwValue(val);
+ QVERIFY(ret.strictlyEquals(val));
+ QVERIFY(eng.hasUncaughtException());
+ QVERIFY(eng.uncaughtException().strictlyEquals(val));
+}
+
QTEST_MAIN(tst_QScriptContext)
#include "tst_qscriptcontext.moc"
diff --git a/tests/auto/qscriptengine/idtranslatable-unicode.js b/tests/auto/qscriptengine/idtranslatable-unicode.js
new file mode 100644
index 0000000000..e17d6172bc
--- /dev/null
+++ b/tests/auto/qscriptengine/idtranslatable-unicode.js
@@ -0,0 +1,5 @@
+qsTrId('\u01F8\u01D2\u0199\u01D0\u01E1');
+
+QT_TRID_NOOP("\u0191\u01CE\u0211\u0229\u019C\u018E\u019A\u01D0");
+
+qsTrId("\u0181\u01A1\u0213\u018F\u018C", 10);
diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro
index fc35f66c92..c5c286167f 100644
--- a/tests/auto/qscriptengine/qscriptengine.pro
+++ b/tests/auto/qscriptengine/qscriptengine.pro
@@ -10,7 +10,7 @@ wince* {
}
wince*|symbian: {
- addFiles.sources = script
+ addFiles.files = script
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qscriptengine/qscriptengine.qrc b/tests/auto/qscriptengine/qscriptengine.qrc
index fa55a5b5b1..d05d115966 100644
--- a/tests/auto/qscriptengine/qscriptengine.qrc
+++ b/tests/auto/qscriptengine/qscriptengine.qrc
@@ -2,5 +2,7 @@
<qresource>
<file>translations/translatable_la.qm</file>
<file>translations/idtranslatable_la.qm</file>
+ <file>translations/translatable-unicode.qm</file>
+ <file>translations/idtranslatable-unicode.qm</file>
</qresource>
</RCC>
diff --git a/tests/auto/qscriptengine/translatable-unicode.js b/tests/auto/qscriptengine/translatable-unicode.js
new file mode 100644
index 0000000000..afe2aff21c
--- /dev/null
+++ b/tests/auto/qscriptengine/translatable-unicode.js
@@ -0,0 +1,9 @@
+qsTr("H\u2082O");
+qsTranslate("\u010C\u0101\u011F\u0115", "CO\u2082");
+
+var unicode_strings = [
+ QT_TR_NOOP("\u0391\u0392\u0393"),
+ QT_TRANSLATE_NOOP("\u010C\u0101\u011F\u0115", "\u0414\u0415\u0416")
+];
+
+qsTr("H\u2082O", "not the same H\u2082O");
diff --git a/tests/auto/qscriptengine/translatable.js b/tests/auto/qscriptengine/translatable.js
index 30e139a7d4..c0d7ed0456 100644
--- a/tests/auto/qscriptengine/translatable.js
+++ b/tests/auto/qscriptengine/translatable.js
@@ -7,3 +7,6 @@ var greeting_strings = [
];
qsTr("One", "not the same one");
+
+qsTr("%n message(s) saved", "", 10);
+qsTranslate("FooContext", "%n fooish bar(s) found", "", "UnicodeUTF8", 10);
diff --git a/tests/auto/qscriptengine/translations/idtranslatable-unicode.qm b/tests/auto/qscriptengine/translations/idtranslatable-unicode.qm
new file mode 100644
index 0000000000..8c5fb91b1d
--- /dev/null
+++ b/tests/auto/qscriptengine/translations/idtranslatable-unicode.qm
Binary files differ
diff --git a/tests/auto/qscriptengine/translations/idtranslatable-unicode.ts b/tests/auto/qscriptengine/translations/idtranslatable-unicode.ts
new file mode 100644
index 0000000000..74ebf43c47
--- /dev/null
+++ b/tests/auto/qscriptengine/translations/idtranslatable-unicode.ts
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="nb_NO">
+<defaultcodec>UTF-8</defaultcodec>
+<context>
+ <name></name>
+ <message id="ǸǒƙÇÇ¡">
+ <location filename="idtranslatable-unicode.js" line="1"/>
+ <source></source>
+ <translation>ƧưƈȼÈÈ¿È™</translation>
+ </message>
+ <message id="ƑǎȑȩƜƎƚÇ">
+ <location filename="idtranslatable-unicode.js" line="3"/>
+ <source></source>
+ <translation>Ç È¡È‹È…È•</translation>
+ </message>
+ <message id="ÆÆ¡È“ÆÆŒ" numerus="yes">
+ <location filename="idtranslatable-unicode.js" line="5"/>
+ <source></source>
+ <translation>
+ <numerusform>Ƒưǹ</numerusform>
+ <numerusform>%n Æ’Æ¡Ç’(È™)</numerusform>
+ </translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/qscriptengine/translations/translatable-unicode.qm b/tests/auto/qscriptengine/translations/translatable-unicode.qm
new file mode 100644
index 0000000000..aa75ce61df
--- /dev/null
+++ b/tests/auto/qscriptengine/translations/translatable-unicode.qm
Binary files differ
diff --git a/tests/auto/qscriptengine/translations/translatable-unicode.ts b/tests/auto/qscriptengine/translations/translatable-unicode.ts
new file mode 100644
index 0000000000..1b8b4d2309
--- /dev/null
+++ b/tests/auto/qscriptengine/translations/translatable-unicode.ts
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<defaultcodec>UTF-8</defaultcodec>
+<context>
+ <name>translatable-unicode</name>
+ <message>
+ <location filename="translatable-unicode.js" line="1"/>
+ <source>Hâ‚‚O</source>
+ <translation>ͻͼͽ</translation>
+ </message>
+ <message>
+ <location filename="translatable-unicode.js" line="5"/>
+ <source>ΑΒΓ</source>
+ <translation>ӜҴѼ</translation>
+ </message>
+ <message>
+ <location filename="translatable-unicode.js" line="9"/>
+ <source>Hâ‚‚O</source>
+ <comment>not the same Hâ‚‚O</comment>
+ <translation>Ô¶ÕŠÕ’</translation>
+ </message>
+</context>
+<context>
+ <name>ÄŒÄÄŸÄ•</name>
+ <message>
+ <location filename="translatable-unicode.js" line="2"/>
+ <source>COâ‚‚</source>
+ <translation>בךע</translation>
+ </message>
+ <message>
+ <location filename="translatable-unicode.js" line="6"/>
+ <source>ДЕЖ</source>
+ <translation>خسس</translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/qscriptengine/translations/translatable_la.qm b/tests/auto/qscriptengine/translations/translatable_la.qm
index 703d0f1edd..d76b1cad5f 100644
--- a/tests/auto/qscriptengine/translations/translatable_la.qm
+++ b/tests/auto/qscriptengine/translations/translatable_la.qm
Binary files differ
diff --git a/tests/auto/qscriptengine/translations/translatable_la.ts b/tests/auto/qscriptengine/translations/translatable_la.ts
index 1598f39608..36271c9cbe 100644
--- a/tests/auto/qscriptengine/translations/translatable_la.ts
+++ b/tests/auto/qscriptengine/translations/translatable_la.ts
@@ -26,6 +26,14 @@
<source>Goodbye</source>
<translation>Farvel</translation>
</message>
+ <message numerus="yes">
+ <location filename="translatable.js" line="12"/>
+ <source>%n fooish bar(s) found</source>
+ <translation>
+ <numerusform>%n fooaktig bar funnet</numerusform>
+ <numerusform>%n fooaktige barer funnet</numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>translatable</name>
@@ -45,6 +53,14 @@
<comment>not the same one</comment>
<translation>Enda en</translation>
</message>
+ <message numerus="yes">
+ <location filename="translatable.js" line="11"/>
+ <source>%n message(s) saved</source>
+ <translation>
+ <numerusform>%n melding lagret</numerusform>
+ <numerusform>%n meldinger lagret</numerusform>
+ </translation>
+ </message>
<message>
<source>Goodbye</source>
<translation type="obsolete">Farvel</translation>
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index c3a0ba1bfe..c4c53e9800 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -95,16 +95,33 @@ private slots:
void pushPopContext();
void getSetDefaultPrototype();
void newFunction();
+ void newFunctionWithArg();
+ void newFunctionWithProto();
void newObject();
void newArray();
+ void newArray_HooliganTask218092();
+ void newArray_HooliganTask233836();
void newVariant();
+ void newVariant_defaultPrototype();
+ void newVariant_promoteObject();
+ void newVariant_replaceValue();
+ void newVariant_valueOfToString();
+ void newVariant_promoteNonObject();
+ void newVariant_promoteNonQScriptObject();
void newRegExp();
void newDate();
void newQObject();
+ void newQObject_ownership();
+ void newQObject_promoteObject();
+ void newQObject_sameQObject();
+ void newQObject_defaultPrototype();
+ void newQObject_promoteNonObject();
+ void newQObject_promoteNonQScriptObject();
void newQMetaObject();
void newActivationObject();
void getSetGlobalObject();
void globalObjectProperties();
+ void createGlobalObjectProperty();
void globalObjectGetterSetterProperty();
void customGlobalObjectWithPrototype();
void globalObjectWithCustomPrototype();
@@ -120,6 +137,7 @@ private slots:
void uncaughtException();
void errorMessage_QT679();
void valueConversion();
+ void qScriptValueFromValue_noEngine();
void importExtension();
void infiniteRecursion();
void castWithPrototypeChain();
@@ -129,6 +147,7 @@ private slots:
void gcWithNestedDataStructure();
void processEventsWhileRunning();
void throwErrorFromProcessEvents();
+ void disableProcessEventsInterval();
void stacktrace();
void numberParsing_data();
void numberParsing();
@@ -144,7 +163,10 @@ private slots:
void forInStatement();
void functionExpression();
void stringObjects();
- void getterSetterThisObject();
+ void getterSetterThisObject_global();
+ void getterSetterThisObject_plain();
+ void getterSetterThisObject_prototypeChain();
+ void getterSetterThisObject_activation();
void continueInSwitch();
void readOnlyPrototypeProperty();
void toObject();
@@ -158,17 +180,32 @@ private slots:
void incDecNonObjectProperty();
void installTranslatorFunctions_data();
void installTranslatorFunctions();
+ void translateScript_data();
void translateScript();
+ void translateScript_crossScript();
+ void translateScript_callQsTrFromNative();
+ void translateScript_trNoOp();
+ void translateScript_callQsTrFromCpp();
void translateWithInvalidArgs_data();
void translateWithInvalidArgs();
void translationContext_data();
void translationContext();
void translateScriptIdBased();
+ void translateScriptUnicode_data();
+ void translateScriptUnicode();
+ void translateScriptUnicodeIdBased_data();
+ void translateScriptUnicodeIdBased();
void functionScopes();
void nativeFunctionScopes();
void evaluateProgram();
+ void evaluateProgram_customScope();
+ void evaluateProgram_closure();
+ void evaluateProgram_executeLater();
+ void evaluateProgram_multipleEngines();
+ void evaluateProgram_empty();
void collectGarbageAfterConnect();
void promoteThisObjectToQObjectInConstructor();
+ void scriptValueFromQMetaObject();
void qRegExpInport_data();
void qRegExpInport();
@@ -288,8 +325,11 @@ void tst_QScriptEngine::newFunction()
QCOMPARE(fun.call().isNull(), true);
QCOMPARE(fun.construct().isObject(), true);
}
+}
- // the overload that takes a void*
+void tst_QScriptEngine::newFunctionWithArg()
+{
+ QScriptEngine eng;
{
QScriptValue fun = eng.newFunction(myFunctionWithVoidArg, (void*)this);
QVERIFY(fun.isFunction());
@@ -310,8 +350,11 @@ void tst_QScriptEngine::newFunction()
QCOMPARE(fun.call().isNull(), true);
QCOMPARE(fun.construct().isObject(), true);
}
+}
- // the overload that takes a prototype
+void tst_QScriptEngine::newFunctionWithProto()
+{
+ QScriptEngine eng;
{
QScriptValue proto = eng.newObject();
QScriptValue fun = eng.newFunction(myFunction, proto);
@@ -361,8 +404,11 @@ void tst_QScriptEngine::newArray()
QCOMPARE(array.prototype().isValid(), true);
QCOMPARE(array.prototype().isArray(), true);
QCOMPARE(array.prototype().strictlyEquals(eng.evaluate("Array.prototype")), true);
+}
- // task 218092
+void tst_QScriptEngine::newArray_HooliganTask218092()
+{
+ QScriptEngine eng;
{
QScriptValue ret = eng.evaluate("[].splice(0, 0, 'a')");
QVERIFY(ret.isArray());
@@ -388,8 +434,11 @@ void tst_QScriptEngine::newArray()
QVERIFY(ret.isArray());
QCOMPARE(ret.property("length").toInt32(), 2);
}
+}
- // task 233836
+void tst_QScriptEngine::newArray_HooliganTask233836()
+{
+ QScriptEngine eng;
{
QScriptValue ret = eng.evaluate("a = new Array(4294967295); a.push('foo')");
QVERIFY(ret.isNumber());
@@ -423,7 +472,12 @@ void tst_QScriptEngine::newVariant()
QCOMPARE(opaque.prototype().isVariant(), true);
QVERIFY(opaque.property("valueOf").call(opaque).isUndefined());
}
+}
+
+void tst_QScriptEngine::newVariant_defaultPrototype()
+{
// default prototype should be set automatically
+ QScriptEngine eng;
{
QScriptValue proto = eng.newObject();
eng.setDefaultPrototype(qMetaTypeId<QString>(), proto);
@@ -436,7 +490,12 @@ void tst_QScriptEngine::newVariant()
QVERIFY(ret2.isVariant());
QVERIFY(!ret2.prototype().strictlyEquals(proto));
}
+}
+
+void tst_QScriptEngine::newVariant_promoteObject()
+{
// "promote" plain object to variant
+ QScriptEngine eng;
{
QScriptValue object = eng.newObject();
object.setProperty("foo", eng.newObject());
@@ -453,17 +512,28 @@ void tst_QScriptEngine::newVariant()
QCOMPARE(ret.toVariant(), QVariant(123));
QVERIFY(ret.prototype().strictlyEquals(originalProto));
}
+}
+
+void tst_QScriptEngine::newVariant_replaceValue()
+{
// replace value of existing object
+ QScriptEngine eng;
{
QScriptValue object = eng.newVariant(QVariant(123));
- QScriptValue ret = eng.newVariant(object, QVariant(456));
- QVERIFY(ret.isValid());
- QVERIFY(ret.strictlyEquals(object));
- QVERIFY(ret.isVariant());
- QCOMPARE(ret.toVariant(), QVariant(456));
+ for (int x = 0; x < 2; ++x) {
+ QScriptValue ret = eng.newVariant(object, QVariant(456));
+ QVERIFY(ret.isValid());
+ QVERIFY(ret.strictlyEquals(object));
+ QVERIFY(ret.isVariant());
+ QCOMPARE(ret.toVariant(), QVariant(456));
+ }
}
+}
+void tst_QScriptEngine::newVariant_valueOfToString()
+{
// valueOf() and toString()
+ QScriptEngine eng;
{
QScriptValue object = eng.newVariant(QVariant(123));
QScriptValue value = object.property("valueOf").call(object);
@@ -497,6 +567,27 @@ void tst_QScriptEngine::newVariant()
}
}
+void tst_QScriptEngine::newVariant_promoteNonObject()
+{
+ QScriptEngine eng;
+ {
+ QVariant var(456);
+ QScriptValue ret = eng.newVariant(123, var);
+ QVERIFY(ret.isVariant());
+ QCOMPARE(ret.toVariant(), var);
+ }
+}
+
+void tst_QScriptEngine::newVariant_promoteNonQScriptObject()
+{
+ QScriptEngine eng;
+ {
+ QTest::ignoreMessage(QtWarningMsg, "QScriptEngine::newVariant(): changing class of non-QScriptObject not supported");
+ QScriptValue ret = eng.newVariant(eng.newArray(), 123);
+ QVERIFY(!ret.isValid());
+ }
+}
+
void tst_QScriptEngine::newRegExp()
{
QScriptEngine eng;
@@ -645,8 +736,11 @@ void tst_QScriptEngine::newQObject()
QCOMPARE(qobject.prototype().isQObject(), true);
QCOMPARE(qobject.scriptClass(), (QScriptClass*)0);
}
+}
- // test ownership
+void tst_QScriptEngine::newQObject_ownership()
+{
+ QScriptEngine eng;
{
QPointer<QObject> ptr = new QObject();
QVERIFY(ptr != 0);
@@ -701,7 +795,11 @@ void tst_QScriptEngine::newQObject()
QVERIFY(child != 0);
delete parent;
}
+}
+void tst_QScriptEngine::newQObject_promoteObject()
+{
+ QScriptEngine eng;
// "promote" plain object to QObject
{
QScriptValue obj = eng.newObject();
@@ -733,14 +831,20 @@ void tst_QScriptEngine::newQObject()
QScriptValue object = eng.newVariant(123);
QScriptValue originalProto = object.prototype();
QObject otherQObject;
- QScriptValue ret = eng.newQObject(object, &otherQObject);
- QVERIFY(ret.isValid());
- QVERIFY(ret.isQObject());
- QVERIFY(ret.strictlyEquals(object));
- QCOMPARE(ret.toQObject(), (QObject *)&otherQObject);
- QVERIFY(ret.prototype().strictlyEquals(originalProto));
+ for (int x = 0; x < 2; ++x) {
+ QScriptValue ret = eng.newQObject(object, &otherQObject);
+ QVERIFY(ret.isValid());
+ QVERIFY(ret.isQObject());
+ QVERIFY(ret.strictlyEquals(object));
+ QCOMPARE(ret.toQObject(), (QObject *)&otherQObject);
+ QVERIFY(ret.prototype().strictlyEquals(originalProto));
+ }
}
+}
+void tst_QScriptEngine::newQObject_sameQObject()
+{
+ QScriptEngine eng;
// calling newQObject() several times with same object
for (int x = 0; x < 2; ++x) {
QObject qobj;
@@ -771,7 +875,11 @@ void tst_QScriptEngine::newQObject()
QScriptEngine::ExcludeSuperClassMethods | opt);
QCOMPARE(obj8.strictlyEquals(obj7), preferExisting);
}
+}
+void tst_QScriptEngine::newQObject_defaultPrototype()
+{
+ QScriptEngine eng;
// newQObject() should set the default prototype, if one has been registered
{
QScriptValue oldQObjectProto = eng.defaultPrototype(qMetaTypeId<QObject*>());
@@ -795,6 +903,26 @@ void tst_QScriptEngine::newQObject()
}
}
+void tst_QScriptEngine::newQObject_promoteNonObject()
+{
+ QScriptEngine eng;
+ {
+ QScriptValue ret = eng.newQObject(123, this);
+ QVERIFY(ret.isQObject());
+ QCOMPARE(ret.toQObject(), this);
+ }
+}
+
+void tst_QScriptEngine::newQObject_promoteNonQScriptObject()
+{
+ QScriptEngine eng;
+ {
+ QTest::ignoreMessage(QtWarningMsg, "QScriptEngine::newQObject(): changing class of non-QScriptObject not supported");
+ QScriptValue ret = eng.newQObject(eng.newArray(), this);
+ QVERIFY(!ret.isValid());
+ }
+}
+
QT_BEGIN_NAMESPACE
Q_SCRIPT_DECLARE_QMETAOBJECT(QObject, QObject*)
Q_SCRIPT_DECLARE_QMETAOBJECT(QWidget, QWidget*)
@@ -981,6 +1109,11 @@ void tst_QScriptEngine::getSetGlobalObject()
QCOMPARE(glob.prototype().isObject(), true);
QCOMPARE(glob.prototype().strictlyEquals(eng.evaluate("Object.prototype")), true);
+ eng.setGlobalObject(glob);
+ QVERIFY(eng.globalObject().equals(glob));
+ eng.setGlobalObject(123);
+ QVERIFY(eng.globalObject().equals(glob));
+
QScriptValue obj = eng.newObject();
eng.setGlobalObject(obj);
QVERIFY(eng.globalObject().strictlyEquals(obj));
@@ -1030,6 +1163,28 @@ void tst_QScriptEngine::getSetGlobalObject()
QScriptValue ret = eng.evaluate("(function() { return this; })()");
QVERIFY(ret.strictlyEquals(obj));
}
+
+ // Delete property.
+ {
+ QScriptValue ret = eng.evaluate("delete foo");
+ QVERIFY(ret.isBool());
+ QVERIFY(ret.toBool());
+ QVERIFY(!obj.property("foo").isValid());
+ }
+
+ // Getter/setter property.
+ QVERIFY(eng.evaluate("this.__defineGetter__('oof', function() { return this.bar; })").isUndefined());
+ QVERIFY(eng.evaluate("this.__defineSetter__('oof', function(v) { this.bar = v; })").isUndefined());
+ QVERIFY(eng.evaluate("this.__lookupGetter__('oof')").isFunction());
+ QVERIFY(eng.evaluate("this.__lookupSetter__('oof')").isFunction());
+ eng.evaluate("oof = 123");
+ QVERIFY(eng.evaluate("oof").equals(obj.property("bar")));
+
+ // Enumeration.
+ {
+ QScriptValue ret = eng.evaluate("a = []; for (var p in this) a.push(p); a");
+ QCOMPARE(ret.toString(), QString::fromLatin1("bar,baz,oof,p,a"));
+ }
}
static QScriptValue getSetFoo(QScriptContext *ctx, QScriptEngine *)
@@ -1176,7 +1331,12 @@ void tst_QScriptEngine::globalObjectProperties()
}
}
QVERIFY(remainingNames.isEmpty());
+}
+void tst_QScriptEngine::createGlobalObjectProperty()
+{
+ QScriptEngine eng;
+ QScriptValue global = eng.globalObject();
// create property with no attributes
{
QString name = QString::fromLatin1("foo");
@@ -1915,7 +2075,6 @@ void tst_QScriptEngine::valueConversion()
QString snum = qScriptValueToValue<QString>(num);
QCOMPARE(snum, QLatin1String("123"));
}
-#ifndef QT_NO_MEMBER_TEMPLATES
{
QScriptValue num = eng.toScriptValue(123);
QCOMPARE(num.isNumber(), true);
@@ -1927,7 +2086,6 @@ void tst_QScriptEngine::valueConversion()
QString snum = eng.fromScriptValue<QString>(num);
QCOMPARE(snum, QLatin1String("123"));
}
-#endif
{
QScriptValue num(&eng, 123);
QCOMPARE(qScriptValueToValue<char>(num), char(123));
@@ -2097,6 +2255,38 @@ void tst_QScriptEngine::valueConversion()
QVERIFY(!val.isVariant());
QVERIFY(val.isUndefined());
}
+ // Checking nested QVariants
+ {
+ QVariant tmp1;
+ QVariant tmp2(QMetaType::QVariant, &tmp1);
+ QVERIFY(QMetaType::Type(tmp2.type()) == QMetaType::QVariant);
+
+ QScriptValue val1 = qScriptValueFromValue(&eng, tmp1);
+ QScriptValue val2 = qScriptValueFromValue(&eng, tmp2);
+ QVERIFY(val1.isValid());
+ QVERIFY(val2.isValid());
+ QVERIFY(val1.isUndefined());
+ QVERIFY(!val2.isUndefined());
+ QVERIFY(!val1.isVariant());
+ QVERIFY(val2.isVariant());
+ }
+ {
+ QVariant tmp1(123);
+ QVariant tmp2(QMetaType::QVariant, &tmp1);
+ QVariant tmp3(QMetaType::QVariant, &tmp2);
+ QVERIFY(QMetaType::Type(tmp1.type()) == QMetaType::Int);
+ QVERIFY(QMetaType::Type(tmp2.type()) == QMetaType::QVariant);
+ QVERIFY(QMetaType::Type(tmp3.type()) == QMetaType::QVariant);
+
+ QScriptValue val1 = qScriptValueFromValue(&eng, tmp2);
+ QScriptValue val2 = qScriptValueFromValue(&eng, tmp3);
+ QVERIFY(val1.isValid());
+ QVERIFY(val2.isValid());
+ QVERIFY(val1.isVariant());
+ QVERIFY(val2.isVariant());
+ QVERIFY(val1.toVariant().toInt() == 123);
+ QVERIFY(qScriptValueFromValue(&eng, val2.toVariant()).toVariant().toInt() == 123);
+ }
{
QScriptValue val = qScriptValueFromValue(&eng, QVariant(true));
QVERIFY(!val.isVariant());
@@ -2226,6 +2416,14 @@ void tst_QScriptEngine::valueConversion()
QEXPECT_FAIL("", "QTBUG-6136: JSC-based back-end doesn't preserve QRegExp::minimal (always false)", Continue);
QCOMPARE(val.toRegExp().isMinimal(), in.isMinimal());
}
+
+ QCOMPARE(qscriptvalue_cast<QVariant>(QScriptValue(123)), QVariant(123));
+}
+
+void tst_QScriptEngine::qScriptValueFromValue_noEngine()
+{
+ QVERIFY(!qScriptValueFromValue(0, 123).isValid());
+ QVERIFY(!qScriptValueFromValue(0, QVariant(123)).isValid());
}
static QScriptValue __import__(QScriptContext *ctx, QScriptEngine *eng)
@@ -2664,6 +2862,19 @@ void tst_QScriptEngine::throwErrorFromProcessEvents()
QCOMPARE(ret.toString(), QString::fromLatin1("Error: Killed"));
}
+void tst_QScriptEngine::disableProcessEventsInterval()
+{
+ QScriptEngine eng;
+ eng.setProcessEventsInterval(100);
+ QCOMPARE(eng.processEventsInterval(), 100);
+ eng.setProcessEventsInterval(0);
+ QCOMPARE(eng.processEventsInterval(), 0);
+ eng.setProcessEventsInterval(-1);
+ QCOMPARE(eng.processEventsInterval(), -1);
+ eng.setProcessEventsInterval(-100);
+ QCOMPARE(eng.processEventsInterval(), -100);
+}
+
void tst_QScriptEngine::stacktrace()
{
QString script = QString::fromLatin1(
@@ -3700,9 +3911,8 @@ void tst_QScriptEngine::stringObjects()
}
}
-void tst_QScriptEngine::getterSetterThisObject()
+void tst_QScriptEngine::getterSetterThisObject_global()
{
- // Global Object
{
QScriptEngine eng;
// read
@@ -3760,8 +3970,10 @@ void tst_QScriptEngine::getterSetterThisObject()
QCOMPARE(ret.toString(), QString::fromLatin1("foo"));
}
}
+}
- // other object
+void tst_QScriptEngine::getterSetterThisObject_plain()
+{
{
QScriptEngine eng;
eng.evaluate("o = {}");
@@ -3778,8 +3990,10 @@ void tst_QScriptEngine::getterSetterThisObject()
QVERIFY(eng.evaluate("with (o) x = 'foo'").equals("foo"));
QVERIFY(eng.evaluate("with (o) with (q) x = 'foo'").equals("foo"));
}
+}
- // getter+setter in prototype chain
+void tst_QScriptEngine::getterSetterThisObject_prototypeChain()
+{
{
QScriptEngine eng;
eng.evaluate("o = {}; p = {}; o.__proto__ = p");
@@ -3797,8 +4011,10 @@ void tst_QScriptEngine::getterSetterThisObject()
QVERIFY(eng.evaluate("with (o) x = 'foo'").equals("foo"));
QVERIFY(eng.evaluate("with (o) with (q) x = 'foo'").equals("foo"));
}
+}
- // getter+setter in activation
+void tst_QScriptEngine::getterSetterThisObject_activation()
+{
{
QScriptEngine eng;
QScriptContext *ctx = eng.pushContext();
@@ -4492,6 +4708,17 @@ void tst_QScriptEngine::installTranslatorFunctions()
QVERIFY(ret.isString());
QCOMPARE(ret.toString(), QString::fromLatin1("foobar"));
}
+ {
+ QScriptValue ret = eng.evaluate("'foo%0'.arg(123)");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("foo123"));
+ }
+ {
+ // Maybe this should throw an error?
+ QScriptValue ret = eng.evaluate("'foo%0'.arg()");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString());
+ }
{
QScriptValue ret = eng.evaluate("qsTrId('foo')");
@@ -4503,75 +4730,137 @@ void tst_QScriptEngine::installTranslatorFunctions()
QVERIFY(ret.isString());
QCOMPARE(ret.toString(), QString::fromLatin1("foo"));
}
+ QVERIFY(eng.evaluate("QT_TRID_NOOP()").isUndefined());
}
-static QScriptValue callQsTr(QScriptContext *ctx, QScriptEngine *eng)
-{
- return eng->globalObject().property("qsTr").call(ctx->thisObject(), ctx->argumentsObject());
-}
-
-void tst_QScriptEngine::translateScript()
+class TranslationScope
{
- QScriptEngine engine;
+public:
+ TranslationScope(const QString &fileName)
+ {
+ translator.load(fileName);
+ QCoreApplication::instance()->installTranslator(&translator);
+ }
+ ~TranslationScope()
+ {
+ QCoreApplication::instance()->removeTranslator(&translator);
+ }
+private:
QTranslator translator;
- translator.load(":/translations/translatable_la");
- QCoreApplication::instance()->installTranslator(&translator);
- engine.installTranslatorFunctions();
+};
+
+void tst_QScriptEngine::translateScript_data()
+{
+ QTest::addColumn<QString>("expression");
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QString>("expectedTranslation");
QString fileName = QString::fromLatin1("translatable.js");
// Top-level
- QCOMPARE(engine.evaluate("qsTr('One')", fileName).toString(), QString::fromLatin1("En"));
- QCOMPARE(engine.evaluate("qsTr('Hello')", fileName).toString(), QString::fromLatin1("Hallo"));
+ QTest::newRow("qsTr('One')@translatable.js")
+ << QString::fromLatin1("qsTr('One')") << fileName << QString::fromLatin1("En");
+ QTest::newRow("qsTr('Hello')@translatable.js")
+ << QString::fromLatin1("qsTr('Hello')") << fileName << QString::fromLatin1("Hallo");
// From function
- QCOMPARE(engine.evaluate("(function() { return qsTr('One'); })()", fileName).toString(), QString::fromLatin1("En"));
- QCOMPARE(engine.evaluate("(function() { return qsTr('Hello'); })()", fileName).toString(), QString::fromLatin1("Hallo"));
+ QTest::newRow("(function() { return qsTr('One'); })()@translatable.js")
+ << QString::fromLatin1("(function() { return qsTr('One'); })()") << fileName << QString::fromLatin1("En");
+ QTest::newRow("(function() { return qsTr('Hello'); })()@translatable.js")
+ << QString::fromLatin1("(function() { return qsTr('Hello'); })()") << fileName << QString::fromLatin1("Hallo");
// From eval
- QCOMPARE(engine.evaluate("eval('qsTr(\\'One\\')')", fileName).toString(), QString::fromLatin1("En"));
- QCOMPARE(engine.evaluate("eval('qsTr(\\'Hello\\')')", fileName).toString(), QString::fromLatin1("Hallo"));
+ QTest::newRow("eval('qsTr(\\'One\\')')@translatable.js")
+ << QString::fromLatin1("eval('qsTr(\\'One\\')')") << fileName << QString::fromLatin1("En");
+ QTest::newRow("eval('qsTr(\\'Hello\\')')@translatable.js")
+ << QString::fromLatin1("eval('qsTr(\\'Hello\\')')") << fileName << QString::fromLatin1("Hallo");
+ // Plural
+ QTest::newRow("qsTr('%n message(s) saved', '', 1)@translatable.js")
+ << QString::fromLatin1("qsTr('%n message(s) saved', '', 1)") << fileName << QString::fromLatin1("1 melding lagret");
+ QTest::newRow("qsTr('%n message(s) saved', '', 3).arg@translatable.js")
+ << QString::fromLatin1("qsTr('%n message(s) saved', '', 3)") << fileName << QString::fromLatin1("3 meldinger lagret");
- QCOMPARE(engine.evaluate("qsTranslate('FooContext', 'Two')", fileName).toString(), QString::fromLatin1("To"));
- QCOMPARE(engine.evaluate("qsTranslate('FooContext', 'Goodbye')", fileName).toString(), QString::fromLatin1("Farvel"));
+ // Top-level
+ QTest::newRow("qsTranslate('FooContext', 'Two')@translatable.js")
+ << QString::fromLatin1("qsTranslate('FooContext', 'Two')") << fileName << QString::fromLatin1("To");
+ QTest::newRow("qsTranslate('FooContext', 'Goodbye')@translatable.js")
+ << QString::fromLatin1("qsTranslate('FooContext', 'Goodbye')") << fileName << QString::fromLatin1("Farvel");
// From eval
- QCOMPARE(engine.evaluate("eval('qsTranslate(\\'FooContext\\', \\'Two\\')')", fileName).toString(), QString::fromLatin1("To"));
- QCOMPARE(engine.evaluate("eval('qsTranslate(\\'FooContext\\', \\'Goodbye\\')')", fileName).toString(), QString::fromLatin1("Farvel"));
+ QTest::newRow("eval('qsTranslate(\\'FooContext\\', \\'Two\\')')@translatable.js")
+ << QString::fromLatin1("eval('qsTranslate(\\'FooContext\\', \\'Two\\')')") << fileName << QString::fromLatin1("To");
+ QTest::newRow("eval('qsTranslate(\\'FooContext\\', \\'Goodbye\\')')@translatable.js")
+ << QString::fromLatin1("eval('qsTranslate(\\'FooContext\\', \\'Goodbye\\')')") << fileName << QString::fromLatin1("Farvel");
- QCOMPARE(engine.evaluate("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8')", fileName).toString(), QString::fromLatin1("Farvel"));
+ QTest::newRow("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8')@translatable.js")
+ << QString::fromLatin1("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8')") << fileName << QString::fromLatin1("Farvel");
+ QTest::newRow("qsTranslate('FooContext', 'Goodbye', '', 'CodecForTr')@translatable.js")
+ << QString::fromLatin1("qsTranslate('FooContext', 'Goodbye', '', 'CodecForTr')") << fileName << QString::fromLatin1("Farvel");
- QCOMPARE(engine.evaluate("qsTr('One', 'not the same one')", fileName).toString(), QString::fromLatin1("Enda en"));
+ QTest::newRow("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8', 42)@translatable.js")
+ << QString::fromLatin1("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8', 42)") << fileName << QString::fromLatin1("Goodbye");
- QVERIFY(engine.evaluate("QT_TR_NOOP()").isUndefined());
- QCOMPARE(engine.evaluate("QT_TR_NOOP('One')").toString(), QString::fromLatin1("One"));
+ QTest::newRow("qsTr('One', 'not the same one')@translatable.js")
+ << QString::fromLatin1("qsTr('One', 'not the same one')") << fileName << QString::fromLatin1("Enda en");
- QVERIFY(engine.evaluate("QT_TRANSLATE_NOOP()").isUndefined());
- QVERIFY(engine.evaluate("QT_TRANSLATE_NOOP('FooContext')").isUndefined());
- QCOMPARE(engine.evaluate("QT_TRANSLATE_NOOP('FooContext', 'Two')").toString(), QString::fromLatin1("Two"));
+ QTest::newRow("qsTr('One', 'not the same one', 42)@translatable.js")
+ << QString::fromLatin1("qsTr('One', 'not the same one', 42)") << fileName << QString::fromLatin1("One");
- // Don't exist in translation
- QCOMPARE(engine.evaluate("qsTr('Three')", fileName).toString(), QString::fromLatin1("Three"));
- QCOMPARE(engine.evaluate("qsTranslate('FooContext', 'So long')", fileName).toString(), QString::fromLatin1("So long"));
- QCOMPARE(engine.evaluate("qsTranslate('BarContext', 'Goodbye')", fileName).toString(), QString::fromLatin1("Goodbye"));
+ // Plural
+ QTest::newRow("qsTranslate('FooContext', '%n fooish bar(s) found', '', 'UnicodeUTF8', 1)@translatable.js")
+ << QString::fromLatin1("qsTranslate('FooContext', '%n fooish bar(s) found', '', 'UnicodeUTF8', 1)") << fileName << QString::fromLatin1("1 fooaktig bar funnet");
+ QTest::newRow("qsTranslate('FooContext', '%n fooish bar(s) found', '', 'UnicodeUTF8', 2)@translatable.js")
+ << QString::fromLatin1("qsTranslate('FooContext', '%n fooish bar(s) found', '', 'UnicodeUTF8', 2)") << fileName << QString::fromLatin1("2 fooaktige barer funnet");
- // From C++
- // There is no context, but it shouldn't crash
- QCOMPARE(engine.globalObject().property("qsTr").call(
- QScriptValue(), QScriptValueList() << "One").toString(), QString::fromLatin1("One"));
+ // Don't exist in translation
+ QTest::newRow("qsTr('Three')@translatable.js")
+ << QString::fromLatin1("qsTr('Three')") << fileName << QString::fromLatin1("Three");
+ QTest::newRow("qsTranslate('FooContext', 'So long')@translatable.js")
+ << QString::fromLatin1("qsTranslate('FooContext', 'So long')") << fileName << QString::fromLatin1("So long");
+ QTest::newRow("qsTranslate('BarContext', 'Goodbye')@translatable.js")
+ << QString::fromLatin1("qsTranslate('BarContext', 'Goodbye')") << fileName << QString::fromLatin1("Goodbye");
// Translate strings from the second script (translatable2.js)
QString fileName2 = QString::fromLatin1("translatable2.js");
-
- QCOMPARE(engine.evaluate("qsTr('Three')", fileName2).toString(), QString::fromLatin1("Tre"));
- QCOMPARE(engine.evaluate("qsTr('Happy birthday!')", fileName2).toString(), QString::fromLatin1("Gratulerer med dagen!"));
+ QTest::newRow("qsTr('Three')@translatable2.js")
+ << QString::fromLatin1("qsTr('Three')") << fileName2 << QString::fromLatin1("Tre");
+ QTest::newRow("qsTr('Happy birthday!')@translatable2.js")
+ << QString::fromLatin1("qsTr('Happy birthday!')") << fileName2 << QString::fromLatin1("Gratulerer med dagen!");
// Not translated because translation is only in translatable.js
- QCOMPARE(engine.evaluate("qsTr('One')", fileName2).toString(), QString::fromLatin1("One"));
- QCOMPARE(engine.evaluate("(function() { return qsTr('One'); })()", fileName2).toString(), QString::fromLatin1("One"));
+ QTest::newRow("qsTr('One')@translatable2.js")
+ << QString::fromLatin1("qsTr('One')") << fileName2 << QString::fromLatin1("One");
+ QTest::newRow("(function() { return qsTr('One'); })()@translatable2.js")
+ << QString::fromLatin1("(function() { return qsTr('One'); })()") << fileName2 << QString::fromLatin1("One");
// For qsTranslate() the filename shouldn't matter
- QCOMPARE(engine.evaluate("qsTranslate('FooContext', 'Two')", fileName2).toString(), QString::fromLatin1("To"));
- QCOMPARE(engine.evaluate("qsTranslate('BarContext', 'Congratulations!')", fileName).toString(), QString::fromLatin1("Gratulerer!"));
+ QTest::newRow("qsTranslate('FooContext', 'Two')@translatable2.js")
+ << QString::fromLatin1("qsTranslate('FooContext', 'Two')") << fileName2 << QString::fromLatin1("To");
+ QTest::newRow("qsTranslate('BarContext', 'Congratulations!')@translatable.js")
+ << QString::fromLatin1("qsTranslate('BarContext', 'Congratulations!')") << fileName << QString::fromLatin1("Gratulerer!");
+}
+
+void tst_QScriptEngine::translateScript()
+{
+ QFETCH(QString, expression);
+ QFETCH(QString, fileName);
+ QFETCH(QString, expectedTranslation);
+
+ QScriptEngine engine;
+
+ TranslationScope tranScope(":/translations/translatable_la");
+ engine.installTranslatorFunctions();
+
+ QCOMPARE(engine.evaluate(expression, fileName).toString(), expectedTranslation);
+ QVERIFY(!engine.hasUncaughtException());
+}
+void tst_QScriptEngine::translateScript_crossScript()
+{
+ QScriptEngine engine;
+ TranslationScope tranScope(":/translations/translatable_la");
+ engine.installTranslatorFunctions();
+
+ QString fileName = QString::fromLatin1("translatable.js");
+ QString fileName2 = QString::fromLatin1("translatable2.js");
// qsTr() should use the innermost filename as context
engine.evaluate("function foo(s) { return bar(s); }", fileName);
engine.evaluate("function bar(s) { return qsTr(s); }", fileName2);
@@ -4584,15 +4873,52 @@ void tst_QScriptEngine::translateScript()
QCOMPARE(engine.evaluate("bar('Three')", fileName2).toString(), QString::fromLatin1("Three"));
QCOMPARE(engine.evaluate("bar('One')", fileName).toString(), QString::fromLatin1("En"));
QCOMPARE(engine.evaluate("bar('One')", fileName2).toString(), QString::fromLatin1("En"));
+}
+
+static QScriptValue callQsTr(QScriptContext *ctx, QScriptEngine *eng)
+{
+ return eng->globalObject().property("qsTr").call(ctx->thisObject(), ctx->argumentsObject());
+}
+
+void tst_QScriptEngine::translateScript_callQsTrFromNative()
+{
+ QScriptEngine engine;
+ TranslationScope tranScope(":/translations/translatable_la");
+ engine.installTranslatorFunctions();
+ QString fileName = QString::fromLatin1("translatable.js");
+ QString fileName2 = QString::fromLatin1("translatable2.js");
// Calling qsTr() from a native function
engine.globalObject().setProperty("qsTrProxy", engine.newFunction(callQsTr));
QCOMPARE(engine.evaluate("qsTrProxy('One')", fileName).toString(), QString::fromLatin1("En"));
QCOMPARE(engine.evaluate("qsTrProxy('One')", fileName2).toString(), QString::fromLatin1("One"));
QCOMPARE(engine.evaluate("qsTrProxy('Three')", fileName).toString(), QString::fromLatin1("Three"));
QCOMPARE(engine.evaluate("qsTrProxy('Three')", fileName2).toString(), QString::fromLatin1("Tre"));
+}
- QCoreApplication::instance()->removeTranslator(&translator);
+void tst_QScriptEngine::translateScript_trNoOp()
+{
+ QScriptEngine engine;
+ TranslationScope tranScope(":/translations/translatable_la");
+ engine.installTranslatorFunctions();
+
+ QVERIFY(engine.evaluate("QT_TR_NOOP()").isUndefined());
+ QCOMPARE(engine.evaluate("QT_TR_NOOP('One')").toString(), QString::fromLatin1("One"));
+
+ QVERIFY(engine.evaluate("QT_TRANSLATE_NOOP()").isUndefined());
+ QVERIFY(engine.evaluate("QT_TRANSLATE_NOOP('FooContext')").isUndefined());
+ QCOMPARE(engine.evaluate("QT_TRANSLATE_NOOP('FooContext', 'Two')").toString(), QString::fromLatin1("Two"));
+}
+
+void tst_QScriptEngine::translateScript_callQsTrFromCpp()
+{
+ QScriptEngine engine;
+ TranslationScope tranScope(":/translations/translatable_la");
+ engine.installTranslatorFunctions();
+
+ // There is no context, but it shouldn't crash
+ QCOMPARE(engine.globalObject().property("qsTr").call(
+ QScriptValue(), QScriptValueList() << "One").toString(), QString::fromLatin1("One"));
}
void tst_QScriptEngine::translateWithInvalidArgs_data()
@@ -4608,6 +4934,7 @@ void tst_QScriptEngine::translateWithInvalidArgs_data()
QTest::newRow("qsTranslate()") << "qsTranslate()" << "Error: qsTranslate() requires at least two arguments";
QTest::newRow("qsTranslate('foo')") << "qsTranslate('foo')" << "Error: qsTranslate() requires at least two arguments";
+ QTest::newRow("qsTranslate(123, 'foo')") << "qsTranslate(123, 'foo')" << "Error: qsTranslate(): first argument (context) must be a string";
QTest::newRow("qsTranslate('foo', 123)") << "qsTranslate('foo', 123)" << "Error: qsTranslate(): second argument (text) must be a string";
QTest::newRow("qsTranslate('foo', 'bar', 123)") << "qsTranslate('foo', 'bar', 123)" << "Error: qsTranslate(): third argument (comment) must be a string";
QTest::newRow("qsTranslate('foo', 'bar', 'baz', 123)") << "qsTranslate('foo', 'bar', 'baz', 123)" << "Error: qsTranslate(): fourth argument (encoding) must be a string";
@@ -4661,9 +4988,7 @@ void tst_QScriptEngine::translationContext_data()
void tst_QScriptEngine::translationContext()
{
- QTranslator translator;
- translator.load(":/translations/translatable_la");
- QCoreApplication::instance()->installTranslator(&translator);
+ TranslationScope tranScope(":/translations/translatable_la");
QScriptEngine engine;
engine.installTranslatorFunctions();
@@ -4674,17 +4999,13 @@ void tst_QScriptEngine::translationContext()
QScriptValue ret = engine.evaluate(QString::fromLatin1("qsTr('%0')").arg(text), path);
QVERIFY(ret.isString());
QCOMPARE(ret.toString(), expectedTranslation);
-
- QCoreApplication::instance()->removeTranslator(&translator);
}
void tst_QScriptEngine::translateScriptIdBased()
{
QScriptEngine engine;
- QTranslator translator;
- translator.load(":/translations/idtranslatable_la");
- QCoreApplication::instance()->installTranslator(&translator);
+ TranslationScope tranScope(":/translations/idtranslatable_la");
engine.installTranslatorFunctions();
QString fileName = QString::fromLatin1("idtranslatable.js");
@@ -4725,6 +5046,85 @@ void tst_QScriptEngine::translateScriptIdBased()
QString::fromLatin1("qtn_foo_bar")); // Doesn't have plural
}
+// How to add a new test row:
+// - Find a nice list of Unicode characters to choose from
+// - Write source string/context/comment in .js using Unicode escape sequences (\uABCD)
+// - Update corresponding .ts file (e.g. lupdate foo.js -ts foo.ts -codecfortr UTF-8)
+// - Enter translation in Linguist
+// - Update corresponding .qm file (e.g. lrelease foo.ts)
+// - Evaluate script that performs translation; make sure the correct result is returned
+// (e.g. by setting the resulting string as the text of a QLabel and visually verifying
+// that it looks the same as what you entered in Linguist :-) )
+// - Generate the expectedTranslation column data using toUtf8().toHex()
+void tst_QScriptEngine::translateScriptUnicode_data()
+{
+ QTest::addColumn<QString>("expression");
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QString>("expectedTranslation");
+
+ QString fileName = QString::fromLatin1("translatable-unicode.js");
+ QTest::newRow("qsTr('H\\u2082O')@translatable-unicode.js")
+ << QString::fromLatin1("qsTr('H\\u2082O')") << fileName << QString::fromUtf8("\xcd\xbb\xcd\xbc\xcd\xbd");
+ QTest::newRow("qsTranslate('\\u010C\\u0101\\u011F\\u0115', 'CO\\u2082')@translatable-unicode.js")
+ << QString::fromLatin1("qsTranslate('\\u010C\\u0101\\u011F\\u0115', 'CO\\u2082')") << fileName << QString::fromUtf8("\xd7\x91\xd7\x9a\xd7\xa2");
+ QTest::newRow("qsTr('\\u0391\\u0392\\u0393')@translatable-unicode.js")
+ << QString::fromLatin1("qsTr('\\u0391\\u0392\\u0393')") << fileName << QString::fromUtf8("\xd3\x9c\xd2\xb4\xd1\xbc");
+ QTest::newRow("qsTranslate('\\u010C\\u0101\\u011F\\u0115', '\\u0414\\u0415\\u0416')@translatable-unicode.js")
+ << QString::fromLatin1("qsTranslate('\\u010C\\u0101\\u011F\\u0115', '\\u0414\\u0415\\u0416')") << fileName << QString::fromUtf8("\xd8\xae\xd8\xb3\xd8\xb3");
+ QTest::newRow("qsTr('H\\u2082O', 'not the same H\\u2082O')@translatable-unicode.js")
+ << QString::fromLatin1("qsTr('H\\u2082O', 'not the same H\\u2082O')") << fileName << QString::fromUtf8("\xd4\xb6\xd5\x8a\xd5\x92");
+ QTest::newRow("qsTr('H\\u2082O')")
+ << QString::fromLatin1("qsTr('H\\u2082O')") << QString() << QString::fromUtf8("\x48\xe2\x82\x82\x4f");
+ QTest::newRow("qsTranslate('\\u010C\\u0101\\u011F\\u0115', 'CO\\u2082')")
+ << QString::fromLatin1("qsTranslate('\\u010C\\u0101\\u011F\\u0115', 'CO\\u2082')") << QString() << QString::fromUtf8("\xd7\x91\xd7\x9a\xd7\xa2");
+}
+
+void tst_QScriptEngine::translateScriptUnicode()
+{
+ QFETCH(QString, expression);
+ QFETCH(QString, fileName);
+ QFETCH(QString, expectedTranslation);
+
+ QScriptEngine engine;
+
+ TranslationScope tranScope(":/translations/translatable-unicode");
+ engine.installTranslatorFunctions();
+
+ QCOMPARE(engine.evaluate(expression, fileName).toString(), expectedTranslation);
+ QVERIFY(!engine.hasUncaughtException());
+}
+
+void tst_QScriptEngine::translateScriptUnicodeIdBased_data()
+{
+ QTest::addColumn<QString>("expression");
+ QTest::addColumn<QString>("expectedTranslation");
+
+ QTest::newRow("qsTrId('\\u01F8\\u01D2\\u0199\\u01D0\\u01E1'')")
+ << QString::fromLatin1("qsTrId('\\u01F8\\u01D2\\u0199\\u01D0\\u01E1')") << QString::fromUtf8("\xc6\xa7\xc6\xb0\xc6\x88\xc8\xbc\xc8\x9d\xc8\xbf\xc8\x99");
+ QTest::newRow("qsTrId('\\u0191\\u01CE\\u0211\\u0229\\u019C\\u018E\\u019A\\u01D0')")
+ << QString::fromLatin1("qsTrId('\\u0191\\u01CE\\u0211\\u0229\\u019C\\u018E\\u019A\\u01D0')") << QString::fromUtf8("\xc7\xa0\xc8\xa1\xc8\x8b\xc8\x85\xc8\x95");
+ QTest::newRow("qsTrId('\\u0181\\u01A1\\u0213\\u018F\\u018C', 10)")
+ << QString::fromLatin1("qsTrId('\\u0181\\u01A1\\u0213\\u018F\\u018C', 10)") << QString::fromUtf8("\x31\x30\x20\xc6\x92\xc6\xa1\xc7\x92\x28\xc8\x99\x29");
+ QTest::newRow("qsTrId('\\u0181\\u01A1\\u0213\\u018F\\u018C')")
+ << QString::fromLatin1("qsTrId('\\u0181\\u01A1\\u0213\\u018F\\u018C')") << QString::fromUtf8("\xc6\x91\xc6\xb0\xc7\xb9");
+ QTest::newRow("qsTrId('\\u01CD\\u0180\\u01A8\\u0190\\u019E\\u01AB')")
+ << QString::fromLatin1("qsTrId('\\u01CD\\u0180\\u01A8\\u0190\\u019E\\u01AB')") << QString::fromUtf8("\xc7\x8d\xc6\x80\xc6\xa8\xc6\x90\xc6\x9e\xc6\xab");
+}
+
+void tst_QScriptEngine::translateScriptUnicodeIdBased()
+{
+ QFETCH(QString, expression);
+ QFETCH(QString, expectedTranslation);
+
+ QScriptEngine engine;
+
+ TranslationScope tranScope(":/translations/idtranslatable-unicode");
+ engine.installTranslatorFunctions();
+
+ QCOMPARE(engine.evaluate(expression).toString(), expectedTranslation);
+ QVERIFY(!engine.hasUncaughtException());
+}
+
void tst_QScriptEngine::functionScopes()
{
QScriptEngine eng;
@@ -4902,8 +5302,11 @@ void tst_QScriptEngine::evaluateProgram()
QVERIFY(differentProgram != program);
QVERIFY(!eng.evaluate(differentProgram).equals(expected));
}
+}
- // Program that accesses variable in the scope
+void tst_QScriptEngine::evaluateProgram_customScope()
+{
+ QScriptEngine eng;
{
QScriptProgram program("a");
QVERIFY(!program.isNull());
@@ -4940,8 +5343,11 @@ void tst_QScriptEngine::evaluateProgram()
ctx->popScope();
}
+}
- // Program that creates closure
+void tst_QScriptEngine::evaluateProgram_closure()
+{
+ QScriptEngine eng;
{
QScriptProgram program("(function() { var count = 0; return function() { return count++; }; })");
QVERIFY(!program.isNull());
@@ -4961,7 +5367,11 @@ void tst_QScriptEngine::evaluateProgram()
QVERIFY(ret.isNumber());
}
}
+}
+void tst_QScriptEngine::evaluateProgram_executeLater()
+{
+ QScriptEngine eng;
// Program created in a function call, then executed later
{
QScriptValue fun = eng.newFunction(createProgram);
@@ -4982,8 +5392,11 @@ void tst_QScriptEngine::evaluateProgram()
QCOMPARE(ret.toInt32(), 123);
}
}
+}
- // Same program run in different engines
+void tst_QScriptEngine::evaluateProgram_multipleEngines()
+{
+ QScriptEngine eng;
{
QString code("1 + 2");
QScriptProgram program(code);
@@ -4997,8 +5410,11 @@ void tst_QScriptEngine::evaluateProgram()
}
}
}
+}
- // No program
+void tst_QScriptEngine::evaluateProgram_empty()
+{
+ QScriptEngine eng;
{
QScriptProgram program;
QVERIFY(program.isNull());
@@ -5071,6 +5487,10 @@ void tst_QScriptEngine::qRegExpInport_data()
QTest::newRow("aaa") << QRegExp("a{2,5}") << "aAaAaaaaaAa";
QTest::newRow("aaa minimal") << minimal(QRegExp("a{2,5}")) << "aAaAaaaaaAa";
QTest::newRow("minimal") << minimal(QRegExp(".*\\} [*8]")) << "}?} ?} *";
+ QTest::newRow(".? minimal") << minimal(QRegExp(".?")) << ".?";
+ QTest::newRow(".+ minimal") << minimal(QRegExp(".+")) << ".+";
+ QTest::newRow("[.?] minimal") << minimal(QRegExp("[.?]")) << ".?";
+ QTest::newRow("[.+] minimal") << minimal(QRegExp("[.+]")) << ".+";
}
void tst_QScriptEngine::qRegExpInport()
@@ -5415,5 +5835,31 @@ void tst_QScriptEngine::newGrowingStaticScopeObject()
eng.popContext();
}
+QT_BEGIN_NAMESPACE
+Q_SCRIPT_DECLARE_QMETAOBJECT(QStandardItemModel, QObject*)
+QT_END_NAMESPACE
+
+void tst_QScriptEngine::scriptValueFromQMetaObject()
+{
+ QScriptEngine eng;
+ {
+ QScriptValue meta = eng.scriptValueFromQMetaObject<QScriptEngine>();
+ QVERIFY(meta.isQMetaObject());
+ QCOMPARE(meta.toQMetaObject(), &QScriptEngine::staticMetaObject);
+ // Because of missing Q_SCRIPT_DECLARE_QMETAOBJECT() for QScriptEngine.
+ QVERIFY(!meta.construct().isValid());
+ }
+ {
+ QScriptValue meta = eng.scriptValueFromQMetaObject<QStandardItemModel>();
+ QVERIFY(meta.isQMetaObject());
+ QCOMPARE(meta.toQMetaObject(), &QStandardItemModel::staticMetaObject);
+ QScriptValue obj = meta.construct(QScriptValueList() << eng.newQObject(&eng));
+ QVERIFY(obj.isQObject());
+ QStandardItemModel *model = qobject_cast<QStandardItemModel*>(obj.toQObject());
+ QVERIFY(model != 0);
+ QCOMPARE(model->parent(), (QObject*)&eng);
+ }
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
index 5f7a23526f..70adb58507 100644
--- a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
+++ b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
@@ -50,24 +50,11 @@
#include <qmenu.h>
#include <qplaintextedit.h>
#include <qtoolbar.h>
+#include "../../shared/util.h"
//TESTED_CLASS=
//TESTED_FILES=
-// Will try to wait for the condition while allowing event processing
-#define QTRY_COMPARE(__expr, __expected) \
- do { \
- const int __step = 50; \
- const int __timeout = 5000; \
- if ((__expr) != (__expected)) { \
- QTest::qWait(0); \
- } \
- for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \
- QTest::qWait(__step); \
- } \
- QCOMPARE(__expr, __expected); \
- } while(0)
-
// Can't use QTest::qWait() because it causes event loop to hang on some platforms
static void qsWait(int ms)
{
@@ -89,6 +76,9 @@ public:
tst_QScriptEngineDebugger();
virtual ~tst_QScriptEngineDebugger();
+protected slots:
+ void recordDebuggerStateAndContinue();
+
private slots:
void attachAndDetach();
void action();
@@ -97,6 +87,11 @@ private slots:
void debuggerSignals();
void consoleCommands();
void multithreadedDebugging();
+ void autoShowStandardWindow();
+ void standardWindowOwnership();
+
+private:
+ QScriptEngineDebugger::DebuggerState m_recordedDebuggerState;
};
tst_QScriptEngineDebugger::tst_QScriptEngineDebugger()
@@ -107,6 +102,14 @@ tst_QScriptEngineDebugger::~tst_QScriptEngineDebugger()
{
}
+void tst_QScriptEngineDebugger::recordDebuggerStateAndContinue()
+{
+ QScriptEngineDebugger *debugger = qobject_cast<QScriptEngineDebugger*>(sender());
+ Q_ASSERT(debugger != 0);
+ m_recordedDebuggerState = debugger->state();
+ debugger->action(QScriptEngineDebugger::ContinueAction)->trigger();
+}
+
void tst_QScriptEngineDebugger::attachAndDetach()
{
#if defined(Q_OS_WINCE) && _WIN32_WCE < 0x600
@@ -784,5 +787,68 @@ void tst_QScriptEngineDebugger::multithreadedDebugging()
QTRY_COMPARE(threadFinishedSpy.count(), 1);
}
+void tst_QScriptEngineDebugger::autoShowStandardWindow()
+{
+ {
+ QScriptEngine engine;
+ QScriptEngineDebugger debugger;
+ QCOMPARE(debugger.autoShowStandardWindow(), true);
+ debugger.attachTo(&engine);
+ QObject::connect(&debugger, SIGNAL(evaluationSuspended()),
+ debugger.action(QScriptEngineDebugger::ContinueAction),
+ SLOT(trigger()));
+ engine.evaluate("debugger");
+ QTRY_VERIFY(debugger.standardWindow()->isVisible());
+
+ debugger.setAutoShowStandardWindow(true);
+ QCOMPARE(debugger.autoShowStandardWindow(), true);
+
+ debugger.setAutoShowStandardWindow(false);
+ QCOMPARE(debugger.autoShowStandardWindow(), false);
+
+ debugger.setAutoShowStandardWindow(true);
+ QCOMPARE(debugger.autoShowStandardWindow(), true);
+
+ debugger.standardWindow()->hide();
+
+ engine.evaluate("debugger");
+ QTRY_VERIFY(debugger.standardWindow()->isVisible());
+ }
+
+ {
+ QScriptEngine engine;
+ QScriptEngineDebugger debugger;
+ debugger.setAutoShowStandardWindow(false);
+ debugger.attachTo(&engine);
+ QObject::connect(&debugger, SIGNAL(evaluationSuspended()),
+ debugger.action(QScriptEngineDebugger::ContinueAction),
+ SLOT(trigger()));
+ QSignalSpy evaluationResumedSpy(&debugger, SIGNAL(evaluationResumed()));
+ engine.evaluate("debugger");
+ QTRY_COMPARE(evaluationResumedSpy.count(), 1);
+ QVERIFY(!debugger.standardWindow()->isVisible());
+ }
+}
+
+void tst_QScriptEngineDebugger::standardWindowOwnership()
+{
+ QScriptEngine engine;
+ QPointer<QMainWindow> win;
+ {
+ QScriptEngineDebugger debugger;
+ win = debugger.standardWindow();
+ }
+ QVERIFY(win == 0);
+
+ // Reparent the window.
+ QWidget widget;
+ {
+ QScriptEngineDebugger debugger;
+ win = debugger.standardWindow();
+ win->setParent(&widget);
+ }
+ QVERIFY(win != 0);
+}
+
QTEST_MAIN(tst_QScriptEngineDebugger)
#include "tst_qscriptenginedebugger.moc"
diff --git a/tests/auto/qscriptextensionplugin/qscriptextensionplugin.pro b/tests/auto/qscriptextensionplugin/qscriptextensionplugin.pro
new file mode 100644
index 0000000000..d4671c8731
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/qscriptextensionplugin.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+CONFIG -= app_bundle
+SUBDIRS = simpleplugin staticplugin test
diff --git a/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp b/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp
new file mode 100644
index 0000000000..1679512646
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <QtScript/qscriptextensionplugin.h>
+#include <QtScript/qscriptengine.h>
+#include <qdebug.h>
+
+class SimplePlugin : public QScriptExtensionPlugin
+{
+public:
+ SimplePlugin(QObject *parent = 0);
+ ~SimplePlugin();
+
+ virtual QStringList keys() const;
+ virtual void initialize(const QString &key, QScriptEngine *engine);
+};
+
+SimplePlugin::SimplePlugin(QObject *parent)
+ : QScriptExtensionPlugin(parent)
+{
+}
+
+SimplePlugin::~SimplePlugin()
+{
+}
+
+QStringList SimplePlugin::keys() const
+{
+ return QStringList() << "simple"
+ << "simple.foo"
+ << "simple.foo.bar";
+}
+
+void SimplePlugin::initialize(const QString &key, QScriptEngine *engine)
+{
+ engine->globalObject().setProperty("pluginKey", key);
+ QScriptValue package = setupPackage(key, engine);
+ engine->globalObject().setProperty("package", package);
+}
+
+Q_EXPORT_PLUGIN2(simpleplugin, SimplePlugin)
diff --git a/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.pro b/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.pro
new file mode 100644
index 0000000000..e184ca4ee5
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/simpleplugin/simpleplugin.pro
@@ -0,0 +1,10 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = simpleplugin.cpp
+QT = core script
+TARGET = simpleplugin
+DESTDIR = ../plugins/script
+
+symbian {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/qscriptextensionplugin/staticplugin/__init__.js b/tests/auto/qscriptextensionplugin/staticplugin/__init__.js
new file mode 100644
index 0000000000..4e462aea98
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/staticplugin/__init__.js
@@ -0,0 +1,6 @@
+spy = {
+ extension: __extension__,
+ setupPackage: __setupPackage__,
+ postInit: __postInit__
+};
+__postInit__ = function() { postInitWasCalled = true; };
diff --git a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp
new file mode 100644
index 0000000000..b13f723c1f
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <QtScript/qscriptextensionplugin.h>
+#include <QtScript/qscriptengine.h>
+#include <qdebug.h>
+
+class StaticPlugin : public QScriptExtensionPlugin
+{
+public:
+ StaticPlugin(QObject *parent = 0);
+ ~StaticPlugin();
+
+ virtual QStringList keys() const;
+ virtual void initialize(const QString &key, QScriptEngine *engine);
+};
+
+StaticPlugin::StaticPlugin(QObject *parent)
+ : QScriptExtensionPlugin(parent)
+{
+}
+
+StaticPlugin::~StaticPlugin()
+{
+}
+
+QStringList StaticPlugin::keys() const
+{
+ return QStringList() << "static";
+}
+
+void StaticPlugin::initialize(const QString &key, QScriptEngine *engine)
+{
+ engine->globalObject().setProperty("pluginKey", key);
+}
+
+Q_EXPORT_PLUGIN2(staticplugin, StaticPlugin)
diff --git a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro
new file mode 100644
index 0000000000..a003338583
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro
@@ -0,0 +1,7 @@
+TEMPLATE = lib
+CONFIG += static plugin
+SOURCES = staticplugin.cpp
+RESOURCES = staticplugin.qrc
+QT = core script
+TARGET = staticplugin
+DESTDIR = ../plugins/script
diff --git a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.qrc b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.qrc
new file mode 100644
index 0000000000..293bf0e6cb
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/qtscriptextension/static/">
+<file>__init__.js</file>
+</qresource>
+</RCC>
+
diff --git a/tests/auto/qscriptextensionplugin/test/test.pro b/tests/auto/qscriptextensionplugin/test/test.pro
new file mode 100644
index 0000000000..549bac266c
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/test/test.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+
+QT = core script
+SOURCES = ../tst_qscriptextensionplugin.cpp
+CONFIG -= app_bundle
+LIBS += -L../plugins/script -lstaticplugin
+
+TARGET = tst_qscriptextensionplugin
+CONFIG(debug_and_release) {
+ CONFIG(debug, debug|release) {
+ DESTDIR = ../debug
+ } else {
+ DESTDIR = ../release
+ }
+} else {
+ DESTDIR = ..
+}
+
diff --git a/tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp b/tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp
new file mode 100644
index 0000000000..e8b5e0a10c
--- /dev/null
+++ b/tests/auto/qscriptextensionplugin/tst_qscriptextensionplugin.cpp
@@ -0,0 +1,167 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+
+#include <QtTest/QtTest>
+
+#include <QtScript/qscriptengine.h>
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+class tst_QScriptExtensionPlugin : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QScriptExtensionPlugin();
+ virtual ~tst_QScriptExtensionPlugin();
+
+private slots:
+ void importSimplePlugin();
+ void importStaticPlugin();
+};
+
+tst_QScriptExtensionPlugin::tst_QScriptExtensionPlugin()
+{
+}
+
+tst_QScriptExtensionPlugin::~tst_QScriptExtensionPlugin()
+{
+}
+
+void tst_QScriptExtensionPlugin::importSimplePlugin()
+{
+ QScriptEngine eng;
+ QCoreApplication::addLibraryPath("plugins");
+
+ QVERIFY(eng.importedExtensions().isEmpty());
+
+ QStringList available = eng.availableExtensions();
+ QVERIFY(available.contains("simple"));
+ QVERIFY(available.contains("simple.foo"));
+ QVERIFY(available.contains("simple.foo.bar"));
+
+ QScriptValue extensionObject;
+ {
+ QVERIFY(eng.importExtension("simple").isUndefined());
+ QCOMPARE(eng.importedExtensions().size(), 1);
+ QCOMPARE(eng.importedExtensions().at(0), QString::fromLatin1("simple"));
+ QVERIFY(eng.availableExtensions().contains("simple"));
+ QVERIFY(eng.globalObject().property("pluginKey").equals("simple"));
+ QVERIFY(eng.globalObject().property("package").isObject());
+ extensionObject = eng.globalObject().property("simple");
+ QVERIFY(extensionObject.isObject());
+ QVERIFY(extensionObject.equals(eng.globalObject().property("package")));
+ }
+
+ {
+ QVERIFY(eng.importExtension("simple.foo").isUndefined());
+ QCOMPARE(eng.importedExtensions().size(), 2);
+ QCOMPARE(eng.importedExtensions().at(1), QString::fromLatin1("simple.foo"));
+ QVERIFY(eng.availableExtensions().contains("simple.foo"));
+ QVERIFY(eng.globalObject().property("pluginKey").equals("simple.foo"));
+ QVERIFY(eng.globalObject().property("package").isObject());
+ QVERIFY(!extensionObject.equals(eng.globalObject().property("package")));
+ QVERIFY(extensionObject.equals(eng.globalObject().property("simple")));
+ QVERIFY(extensionObject.property("foo").isObject());
+ QVERIFY(extensionObject.property("foo").equals(eng.globalObject().property("package")));
+ }
+
+ {
+ QVERIFY(eng.importExtension("simple.foo.bar").isUndefined());
+ QCOMPARE(eng.importedExtensions().size(), 3);
+ QCOMPARE(eng.importedExtensions().at(2), QString::fromLatin1("simple.foo.bar"));
+ QVERIFY(eng.availableExtensions().contains("simple.foo.bar"));
+ QVERIFY(eng.globalObject().property("pluginKey").equals("simple.foo.bar"));
+ QVERIFY(eng.globalObject().property("package").isObject());
+ QVERIFY(!extensionObject.equals(eng.globalObject().property("package")));
+ QVERIFY(extensionObject.equals(eng.globalObject().property("simple")));
+ QVERIFY(extensionObject.property("foo").property("bar").isObject());
+ QVERIFY(extensionObject.property("foo").property("bar").equals(eng.globalObject().property("package")));
+ }
+
+ // Extensions can't be imported multiple times.
+ eng.globalObject().setProperty("pluginKey", QScriptValue());
+ QVERIFY(eng.importExtension("simple").isUndefined());
+ QCOMPARE(eng.importedExtensions().size(), 3);
+ QVERIFY(!eng.globalObject().property("pluginKey").isValid());
+
+ QVERIFY(eng.importExtension("simple.foo").isUndefined());
+ QCOMPARE(eng.importedExtensions().size(), 3);
+ QVERIFY(!eng.globalObject().property("pluginKey").isValid());
+
+ QVERIFY(eng.importExtension("simple.foo.bar").isUndefined());
+ QCOMPARE(eng.importedExtensions().size(), 3);
+ QVERIFY(!eng.globalObject().property("pluginKey").isValid());
+}
+
+void tst_QScriptExtensionPlugin::importStaticPlugin()
+{
+ Q_INIT_RESOURCE(staticplugin);
+ QScriptEngine eng;
+ QVERIFY(eng.availableExtensions().contains("static"));
+ QVERIFY(eng.importExtension("static").isUndefined());
+ QCOMPARE(eng.importedExtensions().size(), 1);
+ QCOMPARE(eng.importedExtensions().at(0), QString::fromLatin1("static"));
+ QVERIFY(eng.availableExtensions().contains("static"));
+ QVERIFY(eng.globalObject().property("pluginKey").equals("static"));
+
+ // Verify that :/qtscriptextension/static/__init__.js was evaluated.
+ QVERIFY(eng.evaluate("spy").isObject());
+ QVERIFY(eng.evaluate("spy.extension").equals("static"));
+ QVERIFY(eng.evaluate("spy.setupPackage").isFunction());
+ QVERIFY(eng.evaluate("spy.postInit").isUndefined());
+
+ QVERIFY(eng.evaluate("postInitWasCalled").isBool());
+ QVERIFY(eng.evaluate("postInitWasCalled").toBool());
+
+ // Extensions can't be imported multiple times.
+ eng.globalObject().setProperty("pluginKey", QScriptValue());
+ QVERIFY(eng.importExtension("static").isUndefined());
+ QCOMPARE(eng.importedExtensions().size(), 1);
+ QVERIFY(!eng.globalObject().property("pluginKey").isValid());
+}
+
+Q_IMPORT_PLUGIN(staticplugin)
+
+QTEST_MAIN(tst_QScriptExtensionPlugin)
+#include "tst_qscriptextensionplugin.moc"
diff --git a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
index eedb295ca8..e9d2d1f8c5 100644
--- a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
+++ b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
@@ -329,6 +329,18 @@ public:
{ m_qtFunctionInvoked = 58; m_actuals << int(arg); return arg; }
Q_INVOKABLE MyQObject::Ability myInvokableWithQualifiedFlagsArg(MyQObject::Ability arg)
{ m_qtFunctionInvoked = 59; m_actuals << int(arg); return arg; }
+ Q_INVOKABLE QWidget *myInvokableWithQWidgetStarArg(QWidget *arg)
+ { m_qtFunctionInvoked = 63; m_actuals << qVariantFromValue((QWidget*)arg); return arg; }
+ Q_INVOKABLE short myInvokableWithShortArg(short arg)
+ { m_qtFunctionInvoked = 64; m_actuals << qVariantFromValue(arg); return arg; }
+ Q_INVOKABLE unsigned short myInvokableWithUShortArg(unsigned short arg)
+ { m_qtFunctionInvoked = 65; m_actuals << qVariantFromValue(arg); return arg; }
+ Q_INVOKABLE char myInvokableWithCharArg(char arg)
+ { m_qtFunctionInvoked = 66; m_actuals << qVariantFromValue(arg); return arg; }
+ Q_INVOKABLE unsigned char myInvokableWithUCharArg(unsigned char arg)
+ { m_qtFunctionInvoked = 67; m_actuals << qVariantFromValue(arg); return arg; }
+ Q_INVOKABLE qulonglong myInvokableWithULonglongArg(qulonglong arg)
+ { m_qtFunctionInvoked = 68; m_actuals << qVariantFromValue(arg); return arg; }
Q_INVOKABLE QObjectList findObjects() const
{ return findChildren<QObject *>(); }
@@ -394,6 +406,8 @@ public Q_SLOTS:
{ m_qtFunctionInvoked = 32; m_actuals << arg; }
void myOverloadedSlot(const QDate &arg)
{ m_qtFunctionInvoked = 33; m_actuals << arg; }
+ void myOverloadedSlot(const QTime &arg)
+ { m_qtFunctionInvoked = 69; m_actuals << arg; }
void myOverloadedSlot(const QRegExp &arg)
{ m_qtFunctionInvoked = 34; m_actuals << arg; }
void myOverloadedSlot(const QVariant &arg)
@@ -514,11 +528,26 @@ protected slots:
private slots:
void registeredTypes();
void getSetStaticProperty();
+ void getSetStaticProperty_propertyFlags();
+ void getSetStaticProperty_changeInCpp();
+ void getSetStaticProperty_changeInJS();
+ void getSetStaticProperty_compatibleVariantTypes();
+ void getSetStaticProperty_conversion();
+ void getSetStaticProperty_delete();
+ void getSetStaticProperty_nonScriptable();
+ void getSetStaticProperty_writeOnly();
+ void getSetStaticProperty_readOnly();
+ void getSetStaticProperty_enum();
+ void getSetStaticProperty_qflags();
+ void getSetStaticProperty_pointerDeref();
+ void getSetStaticProperty_customGetterSetter();
+ void getSetStaticProperty_methodPersistence();
void getSetDynamicProperty();
void getSetChildren();
void callQtInvokable();
void connectAndDisconnect();
void connectAndDisconnectWithBadArgs();
+ void connectAndDisconnect_senderDeleted();
void cppConnectAndDisconnect();
void classEnums();
void classConstructor();
@@ -640,7 +669,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
QCOMPARE(m_engine->evaluate("myObject.stringListProperty[1]").isString(), true);
QCOMPARE(m_engine->evaluate("myObject.stringListProperty[1]").toString(),
QLatin1String("zag"));
+}
+void tst_QScriptExtQObject::getSetStaticProperty_propertyFlags()
+{
// default flags for "normal" properties
{
QScriptValue mobj = m_engine->globalObject().property("myObject");
@@ -662,7 +694,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
QVERIFY(!(mobj.propertyFlags("mySlot()") & QScriptValue::SkipInEnumeration));
QVERIFY(mobj.propertyFlags("mySlot()") & QScriptValue::QObjectMember);
}
+}
+void tst_QScriptExtQObject::getSetStaticProperty_changeInCpp()
+{
// property change in C++ should be reflected in script
m_myObject->setIntProperty(456);
QCOMPARE(m_engine->evaluate("myObject.intProperty")
@@ -686,7 +721,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
m_myObject->setStringProperty(QLatin1String("zab"));
QCOMPARE(m_engine->evaluate("myObject.stringProperty")
.equals(QScriptValue(m_engine, QLatin1String("zab"))), true);
+}
+void tst_QScriptExtQObject::getSetStaticProperty_changeInJS()
+{
// property change in script should be reflected in C++
QCOMPARE(m_engine->evaluate("myObject.intProperty = 123")
.strictlyEquals(QScriptValue(m_engine, 123)), true);
@@ -769,7 +807,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
<< QLatin1String("two")
<< QLatin1String("true"));
}
+}
+void tst_QScriptExtQObject::getSetStaticProperty_compatibleVariantTypes()
+{
// test setting properties where we can't convert the type natively but where the
// types happen to be compatible variant types already
{
@@ -788,7 +829,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
mobj.setProperty("propWithCustomType", m_engine->newVariant(qVariantFromValue(t)));
QVERIFY(m_myObject->propWithCustomType().string == t.string);
}
+}
+void tst_QScriptExtQObject::getSetStaticProperty_conversion()
+{
// test that we do value conversion if necessary when setting properties
{
QScriptValue br = m_engine->evaluate("myObject.brushProperty");
@@ -808,28 +852,41 @@ void tst_QScriptExtQObject::getSetStaticProperty()
m_engine->globalObject().setProperty("myColor", QScriptValue());
}
+}
+void tst_QScriptExtQObject::getSetStaticProperty_delete()
+{
// try to delete
QCOMPARE(m_engine->evaluate("delete myObject.intProperty").toBoolean(), false);
QCOMPARE(m_engine->evaluate("myObject.intProperty").toNumber(), 123.0);
+ m_myObject->setVariantProperty(42);
QCOMPARE(m_engine->evaluate("delete myObject.variantProperty").toBoolean(), false);
QCOMPARE(m_engine->evaluate("myObject.variantProperty").toNumber(), 42.0);
+}
+void tst_QScriptExtQObject::getSetStaticProperty_nonScriptable()
+{
// non-scriptable property
QCOMPARE(m_myObject->hiddenProperty(), 456.0);
QCOMPARE(m_engine->evaluate("myObject.hiddenProperty").isUndefined(), true);
QCOMPARE(m_engine->evaluate("myObject.hiddenProperty = 123;"
"myObject.hiddenProperty").toInt32(), 123);
QCOMPARE(m_myObject->hiddenProperty(), 456.0);
+}
+void tst_QScriptExtQObject::getSetStaticProperty_writeOnly()
+{
// write-only property
QCOMPARE(m_myObject->writeOnlyProperty(), 789);
QCOMPARE(m_engine->evaluate("myObject.writeOnlyProperty").isUndefined(), true);
QCOMPARE(m_engine->evaluate("myObject.writeOnlyProperty = 123;"
"myObject.writeOnlyProperty").isUndefined(), true);
QCOMPARE(m_myObject->writeOnlyProperty(), 123);
+}
+void tst_QScriptExtQObject::getSetStaticProperty_readOnly()
+{
// read-only property
QCOMPARE(m_myObject->readOnlyProperty(), 987);
QCOMPARE(m_engine->evaluate("myObject.readOnlyProperty").toInt32(), 987);
@@ -841,7 +898,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
QCOMPARE(mobj.propertyFlags("readOnlyProperty") & QScriptValue::ReadOnly,
QScriptValue::ReadOnly);
}
+}
+void tst_QScriptExtQObject::getSetStaticProperty_enum()
+{
// enum property
QCOMPARE(m_myObject->enumProperty(), MyQObject::BarPolicy);
{
@@ -866,7 +926,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
QCOMPARE(m_myObject->enumProperty(), MyQObject::BazPolicy);
m_engine->evaluate("myObject.enumProperty = 'nada'");
QCOMPARE(m_myObject->enumProperty(), (MyQObject::Policy)-1);
+}
+void tst_QScriptExtQObject::getSetStaticProperty_qflags()
+{
// flags property
QCOMPARE(m_myObject->flagsProperty(), MyQObject::FooAbility);
{
@@ -885,7 +948,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
m_engine->evaluate("myObject.flagsProperty = 'ScoobyDoo'");
// ### ouch! Shouldn't QMetaProperty::write() rather not change the value...?
QCOMPARE(m_myObject->flagsProperty(), (MyQObject::Ability)-1);
+}
+void tst_QScriptExtQObject::getSetStaticProperty_pointerDeref()
+{
// auto-dereferencing of pointers
{
QBrush b = QColor(0xCA, 0xFE, 0xBA, 0xBE);
@@ -905,7 +971,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
}
m_engine->globalObject().setProperty("brushPointer", QScriptValue());
}
+}
+void tst_QScriptExtQObject::getSetStaticProperty_customGetterSetter()
+{
// install custom property getter+setter
{
QScriptValue mobj = m_engine->globalObject().property("myObject");
@@ -915,7 +984,10 @@ void tst_QScriptExtQObject::getSetStaticProperty()
mobj.setProperty("intProperty", 321);
QCOMPARE(mobj.property("intProperty").toInt32(), 321);
}
+}
+void tst_QScriptExtQObject::getSetStaticProperty_methodPersistence()
+{
// method properties are persistent
{
QScriptValue slot = m_engine->evaluate("myObject.mySlot");
@@ -1361,6 +1433,17 @@ void tst_QScriptExtQObject::callQtInvokable()
m_myObject->resetQtFunctionInvoked();
{
+ QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithQWidgetStarArg(null)");
+ QVERIFY(ret.isNull());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 63);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::QWidgetStar));
+ QCOMPARE(qvariant_cast<QWidget*>(v), (QObject *)0);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
// no implicit conversion from integer to QObject*
QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithQObjectStarArg(123)");
QCOMPARE(ret.isError(), true);
@@ -1368,6 +1451,61 @@ void tst_QScriptExtQObject::callQtInvokable()
m_myObject->resetQtFunctionInvoked();
{
+ QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithShortArg(123)");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 64);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::Short));
+ QCOMPARE(qvariant_cast<short>(v), short(123));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithUShortArg(123)");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 65);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::UShort));
+ QCOMPARE(qvariant_cast<ushort>(v), ushort(123));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithCharArg(123)");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 66);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::Char));
+ QCOMPARE(qvariant_cast<char>(v), char(123));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithUCharArg(123)");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 67);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::UChar));
+ QCOMPARE(qvariant_cast<uchar>(v), uchar(123));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithULonglongArg(123)");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 68);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::ULongLong));
+ QCOMPARE(qvariant_cast<qulonglong>(v), qulonglong(123));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
QScriptValue fun = m_engine->evaluate("myObject.myInvokableWithQBrushArg");
QVERIFY(fun.isFunction());
QColor color(10, 20, 30, 40);
@@ -1670,6 +1808,7 @@ void tst_QScriptExtQObject::connectAndDisconnect()
m_myObject->emitMySignalWithVariantArg(123);
QCOMPARE(m_engine->evaluate("gotSignal").toBoolean(), true);
QCOMPARE(m_engine->evaluate("signalArgs.length").toNumber(), 1.0);
+ QVERIFY(m_engine->evaluate("signalArgs[0]").isNumber());
QCOMPARE(m_engine->evaluate("signalArgs[0]").toNumber(), 123.0);
QVERIFY(m_engine->evaluate("myObject.mySignalWithVariantArg.disconnect(myHandler)").isUndefined());
@@ -1685,16 +1824,29 @@ void tst_QScriptExtQObject::connectAndDisconnect()
QVERIFY(m_engine->evaluate("signalArgs[0]").isUndefined());
QVERIFY(m_engine->evaluate("myObject.mySignalWithScriptEngineArg.disconnect(myHandler)").isUndefined());
- // signal with QVariant arg: argument conversion should work
+ // signal with QVariant arg: QVariant should be unwrapped only once
m_myObject->clearConnectedSignal();
QVERIFY(m_engine->evaluate("myObject.mySignalWithVariantArg.connect(myHandler)").isUndefined());
QCOMPARE(m_myObject->connectedSignal().constData(), SIGNAL(mySignalWithVariantArg(QVariant)));
m_engine->evaluate("gotSignal = false");
- m_myObject->emitMySignalWithVariantArg(123);
+ QVariant tmp(123);
+ QVariant signalArg(QMetaType::QVariant, &tmp);
+ m_myObject->emitMySignalWithVariantArg(signalArg);
QCOMPARE(m_engine->evaluate("gotSignal").toBoolean(), true);
QCOMPARE(m_engine->evaluate("signalArgs.length").toNumber(), 1.0);
- QVERIFY(m_engine->evaluate("signalArgs[0]").isNumber());
- QCOMPARE(m_engine->evaluate("signalArgs[0]").toNumber(), 123.0);
+ QVERIFY(m_engine->evaluate("signalArgs[0]").isVariant());
+ QCOMPARE(m_engine->evaluate("signalArgs[0]").toVariant().toDouble(), 123.0);
+ QVERIFY(m_engine->evaluate("myObject.mySignalWithVariantArg.disconnect(myHandler)").isUndefined());
+
+ // signal with QVariant arg: with an invalid QVariant
+ m_myObject->clearConnectedSignal();
+ QVERIFY(m_engine->evaluate("myObject.mySignalWithVariantArg.connect(myHandler)").isUndefined());
+ QCOMPARE(m_myObject->connectedSignal().constData(), SIGNAL(mySignalWithVariantArg(QVariant)));
+ m_engine->evaluate("gotSignal = false");
+ m_myObject->emitMySignalWithVariantArg(QVariant());
+ QCOMPARE(m_engine->evaluate("gotSignal").toBoolean(), true);
+ QCOMPARE(m_engine->evaluate("signalArgs.length").toNumber(), 1.0);
+ QVERIFY(m_engine->evaluate("signalArgs[0]").isUndefined());
QVERIFY(m_engine->evaluate("myObject.mySignalWithVariantArg.disconnect(myHandler)").isUndefined());
// signal with argument type that's unknown to the meta-type system
@@ -1902,6 +2054,25 @@ void tst_QScriptExtQObject::connectAndDisconnectWithBadArgs()
}
}
+void tst_QScriptExtQObject::connectAndDisconnect_senderDeleted()
+{
+ QScriptEngine eng;
+ QObject *obj = new QObject;
+ eng.globalObject().setProperty("obj", eng.newQObject(obj));
+ eng.evaluate("signal = obj.destroyed");
+ delete obj;
+ {
+ QScriptValue ret = eng.evaluate("signal.connect(function(){})");
+ QVERIFY(ret.isError());
+ QCOMPARE(ret.toString(), QString::fromLatin1("TypeError: Function.prototype.connect: cannot connect to deleted QObject"));
+ }
+ {
+ QScriptValue ret = eng.evaluate("signal.disconnect(function(){})");
+ QVERIFY(ret.isError());
+ QCOMPARE(ret.toString(), QString::fromLatin1("TypeError: Function.prototype.discconnect: cannot disconnect from deleted QObject"));
+ }
+}
+
void tst_QScriptExtQObject::cppConnectAndDisconnect()
{
QScriptEngine eng;
diff --git a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
index 07a4672d36..b1ddd64e08 100644
--- a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
+++ b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
@@ -5,7 +5,7 @@ SOURCES += tst_qscriptjstestsuite.cpp
!symbian: DEFINES += SRCDIR=\\\"$$PWD\\\"
wince*|symbian: {
-testFiles.sources = tests
+testFiles.files = tests
testFiles.path = .
DEPLOYMENT += testFiles
}
diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
index 03e26bd61d..00e2e01fc6 100644
--- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
+++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
@@ -1,10 +1,4 @@
load(qttest_p4)
QT = core script
SOURCES += tst_qscriptv8testsuite.cpp
-!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
-
-wince*|symbian: {
-testFiles.sources = tests
-testFiles.path = .
-DEPLOYMENT += testFiles
-}
+RESOURCES += qscriptv8testsuite.qrc
diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc
new file mode 100644
index 0000000000..a894ee5859
--- /dev/null
+++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>tests</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
index 71a3f30254..7d0858e49d 100644
--- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
+++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
@@ -45,10 +45,6 @@
#include <QtScript>
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
//TESTED_CLASS=
//TESTED_FILES=
@@ -217,9 +213,8 @@ int tst_Suite::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
tst_Suite::tst_Suite()
{
- testsDir = QDir(SRCDIR);
- bool testsFound = testsDir.cd("tests");
- if (!testsFound) {
+ testsDir = QDir(":/tests");
+ if (!testsDir.exists()) {
qWarning("*** no tests/ dir!");
} else {
if (!testsDir.exists("mjsunit.js"))
@@ -297,8 +292,7 @@ tst_Suite::tst_Suite()
appendCString(stringdata, "");
QFileInfoList testFileInfos;
- if (testsFound)
- testFileInfos = testsDir.entryInfoList(QStringList() << "*.js", QDir::Files);
+ testFileInfos = testsDir.entryInfoList(QStringList() << "*.js", QDir::Files);
foreach (QFileInfo tfi, testFileInfos) {
QString name = tfi.baseName();
// slot: signature, parameters, type, tag, flags
diff --git a/tests/auto/qscriptvalue/qscriptvalue.pro b/tests/auto/qscriptvalue/qscriptvalue.pro
index c3e9912f69..0474c3219a 100644
--- a/tests/auto/qscriptvalue/qscriptvalue.pro
+++ b/tests/auto/qscriptvalue/qscriptvalue.pro
@@ -3,14 +3,6 @@ QT = core gui script
SOURCES += tst_qscriptvalue.cpp
HEADERS += tst_qscriptvalue.h
-# Generated by testgen
-SOURCES += \
- tst_qscriptvalue_generated_init.cpp \
- tst_qscriptvalue_generated_cast.cpp \
- tst_qscriptvalue_generated_comparison.cpp \
- tst_qscriptvalue_generated_isXXX.cpp \
- tst_qscriptvalue_generated_toXXX.cpp
-
win32-msvc* {
# With -O2, MSVC takes up to 24 minutes to compile this test!
QMAKE_CXXFLAGS_RELEASE -= -O1 -O2
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index e484352661..b302eba7ed 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -56,64 +56,11 @@ tst_QScriptValue::tst_QScriptValue()
tst_QScriptValue::~tst_QScriptValue()
{
- delete engine;
+ if (engine)
+ delete engine;
}
-void tst_QScriptValue::dataHelper(InitDataFunction init, DefineDataFunction define)
-{
- QTest::addColumn<QString>("__expression__");
- (this->*init)();
- QHash<QString,QScriptValue>::const_iterator it;
- for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) {
- m_currentExpression = it.key();
- (this->*define)(it.key().toLatin1());
- }
- m_currentExpression = QString();
-}
-
-QTestData &tst_QScriptValue::newRow(const char *tag)
-{
- return QTest::newRow(tag) << m_currentExpression;
-}
-
-void tst_QScriptValue::testHelper(TestFunction fun)
-{
- QFETCH(QString, __expression__);
- QScriptValue value = m_values.value(__expression__);
- (this->*fun)(__expression__.toLatin1(), value);
-}
-
-void tst_QScriptValue::assignAndCopyConstruct_initData()
-{
- QTest::addColumn<int>("dummy");
- initScriptValues();
-}
-
-void tst_QScriptValue::assignAndCopyConstruct_makeData(const char *expr)
-{
- newRow(expr) << 0;
-}
-
-void tst_QScriptValue::assignAndCopyConstruct_test(const char *, const QScriptValue &value)
-{
- QScriptValue copy(value);
- QCOMPARE(copy.strictlyEquals(value), !value.isNumber() || !qIsNaN(value.toNumber()));
- QCOMPARE(copy.engine(), value.engine());
-
- QScriptValue assigned = copy;
- QCOMPARE(assigned.strictlyEquals(value), !copy.isNumber() || !qIsNaN(copy.toNumber()));
- QCOMPARE(assigned.engine(), assigned.engine());
-
- QScriptValue other(!value.toBool());
- assigned = other;
- QVERIFY(!assigned.strictlyEquals(copy));
- QVERIFY(assigned.strictlyEquals(other));
- QCOMPARE(assigned.engine(), other.engine());
-}
-
-DEFINE_TEST_FUNCTION(assignAndCopyConstruct)
-
-void tst_QScriptValue::ctor()
+void tst_QScriptValue::ctor_invalid()
{
QScriptEngine eng;
{
@@ -121,6 +68,11 @@ void tst_QScriptValue::ctor()
QCOMPARE(v.isValid(), false);
QCOMPARE(v.engine(), (QScriptEngine *)0);
}
+}
+
+void tst_QScriptValue::ctor_undefinedWithEngine()
+{
+ QScriptEngine eng;
{
QScriptValue v(&eng, QScriptValue::UndefinedValue);
QCOMPARE(v.isValid(), true);
@@ -128,6 +80,11 @@ void tst_QScriptValue::ctor()
QCOMPARE(v.isObject(), false);
QCOMPARE(v.engine(), &eng);
}
+}
+
+void tst_QScriptValue::ctor_nullWithEngine()
+{
+ QScriptEngine eng;
{
QScriptValue v(&eng, QScriptValue::NullValue);
QCOMPARE(v.isValid(), true);
@@ -135,6 +92,11 @@ void tst_QScriptValue::ctor()
QCOMPARE(v.isObject(), false);
QCOMPARE(v.engine(), &eng);
}
+}
+
+void tst_QScriptValue::ctor_boolWithEngine()
+{
+ QScriptEngine eng;
{
QScriptValue v(&eng, false);
QCOMPARE(v.isValid(), true);
@@ -144,6 +106,11 @@ void tst_QScriptValue::ctor()
QCOMPARE(v.toBoolean(), false);
QCOMPARE(v.engine(), &eng);
}
+}
+
+void tst_QScriptValue::ctor_intWithEngine()
+{
+ QScriptEngine eng;
{
QScriptValue v(&eng, int(1));
QCOMPARE(v.isValid(), true);
@@ -152,132 +119,102 @@ void tst_QScriptValue::ctor()
QCOMPARE(v.toNumber(), 1.0);
QCOMPARE(v.engine(), &eng);
}
+}
+
+void tst_QScriptValue::ctor_int()
+{
{
QScriptValue v(int(0x43211234));
QVERIFY(v.isNumber());
QCOMPARE(v.toInt32(), 0x43211234);
}
{
- QScriptValue v(&eng, uint(1));
+ QScriptValue v(int(1));
QCOMPARE(v.isValid(), true);
QCOMPARE(v.isNumber(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toNumber(), 1.0);
- QCOMPARE(v.engine(), &eng);
- }
- {
- QScriptValue v(uint(0x43211234));
- QVERIFY(v.isNumber());
- QCOMPARE(v.toUInt32(), uint(0x43211234));
+ QCOMPARE(v.engine(), (QScriptEngine *)0);
}
+}
+
+void tst_QScriptValue::ctor_uintWithEngine()
+{
+ QScriptEngine eng;
{
- QScriptValue v(&eng, 1.0);
+ QScriptValue v(&eng, uint(1));
QCOMPARE(v.isValid(), true);
QCOMPARE(v.isNumber(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toNumber(), 1.0);
QCOMPARE(v.engine(), &eng);
}
+}
+
+void tst_QScriptValue::ctor_uint()
+{
{
- QScriptValue v(12345678910.5);
+ QScriptValue v(uint(0x43211234));
QVERIFY(v.isNumber());
- QCOMPARE(v.toNumber(), 12345678910.5);
- }
- {
- QScriptValue v(&eng, "ciao");
- QCOMPARE(v.isValid(), true);
- QCOMPARE(v.isString(), true);
- QCOMPARE(v.isObject(), false);
- QCOMPARE(v.toString(), QLatin1String("ciao"));
- QCOMPARE(v.engine(), &eng);
+ QCOMPARE(v.toUInt32(), uint(0x43211234));
}
{
- QScriptValue v(&eng, QString("ciao"));
+ QScriptValue v(uint(1));
QCOMPARE(v.isValid(), true);
- QCOMPARE(v.isString(), true);
+ QCOMPARE(v.isNumber(), true);
QCOMPARE(v.isObject(), false);
- QCOMPARE(v.toString(), QLatin1String("ciao"));
- QCOMPARE(v.engine(), &eng);
- }
- // copy constructor, operator=
- {
- QScriptValue v(&eng, 1.0);
- QScriptValue v2(v);
- QCOMPARE(v2.strictlyEquals(v), true);
- QCOMPARE(v2.engine(), &eng);
-
- QScriptValue v3(v);
- QCOMPARE(v3.strictlyEquals(v), true);
- QCOMPARE(v3.strictlyEquals(v2), true);
- QCOMPARE(v3.engine(), &eng);
-
- QScriptValue v4(&eng, 2.0);
- QCOMPARE(v4.strictlyEquals(v), false);
- v3 = v4;
- QCOMPARE(v3.strictlyEquals(v), false);
- QCOMPARE(v3.strictlyEquals(v4), true);
-
- v2 = QScriptValue();
- QCOMPARE(v2.strictlyEquals(v), false);
QCOMPARE(v.toNumber(), 1.0);
-
- QScriptValue v5(v);
- QCOMPARE(v5.strictlyEquals(v), true);
- v = QScriptValue();
- QCOMPARE(v5.strictlyEquals(v), false);
- QCOMPARE(v5.toNumber(), 1.0);
- }
-
- // constructors that take no engine argument
- {
- QScriptValue v(QScriptValue::UndefinedValue);
- QCOMPARE(v.isValid(), true);
- QCOMPARE(v.isUndefined(), true);
- QCOMPARE(v.isObject(), false);
- QCOMPARE(v.engine(), (QScriptEngine *)0);
- }
- {
- QScriptValue v(QScriptValue::NullValue);
- QCOMPARE(v.isValid(), true);
- QCOMPARE(v.isNull(), true);
- QCOMPARE(v.isObject(), false);
- QCOMPARE(v.engine(), (QScriptEngine *)0);
- }
- {
- QScriptValue v(false);
- QCOMPARE(v.isValid(), true);
- QCOMPARE(v.isBoolean(), true);
- QCOMPARE(v.isBool(), true);
- QCOMPARE(v.isObject(), false);
- QCOMPARE(v.toBoolean(), false);
QCOMPARE(v.engine(), (QScriptEngine *)0);
}
+}
+
+void tst_QScriptValue::ctor_floatWithEngine()
+{
+ QScriptEngine eng;
{
- QScriptValue v(int(1));
+ QScriptValue v(&eng, 1.0);
QCOMPARE(v.isValid(), true);
QCOMPARE(v.isNumber(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toNumber(), 1.0);
- QCOMPARE(v.engine(), (QScriptEngine *)0);
+ QCOMPARE(v.engine(), &eng);
}
+}
+
+void tst_QScriptValue::ctor_float()
+{
{
- QScriptValue v(uint(1));
+ QScriptValue v(12345678910.5);
+ QVERIFY(v.isNumber());
+ QCOMPARE(v.toNumber(), 12345678910.5);
+ }
+ {
+ QScriptValue v(1.0);
QCOMPARE(v.isValid(), true);
QCOMPARE(v.isNumber(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toNumber(), 1.0);
QCOMPARE(v.engine(), (QScriptEngine *)0);
}
+}
+
+void tst_QScriptValue::ctor_stringWithEngine()
+{
+ QScriptEngine eng;
{
- QScriptValue v(1.0);
+ QScriptValue v(&eng, "ciao");
QCOMPARE(v.isValid(), true);
- QCOMPARE(v.isNumber(), true);
+ QCOMPARE(v.isString(), true);
QCOMPARE(v.isObject(), false);
- QCOMPARE(v.toNumber(), 1.0);
- QCOMPARE(v.engine(), (QScriptEngine *)0);
+ QCOMPARE(v.toString(), QLatin1String("ciao"));
+ QCOMPARE(v.engine(), &eng);
}
+}
+
+void tst_QScriptValue::ctor_string()
+{
{
- QScriptValue v("ciao");
+ QScriptValue v(QString("ciao"));
QCOMPARE(v.isValid(), true);
QCOMPARE(v.isString(), true);
QCOMPARE(v.isObject(), false);
@@ -285,26 +222,31 @@ void tst_QScriptValue::ctor()
QCOMPARE(v.engine(), (QScriptEngine *)0);
}
{
- QScriptValue v(QString("ciao"));
+ QScriptValue v("ciao");
QCOMPARE(v.isValid(), true);
QCOMPARE(v.isString(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toString(), QLatin1String("ciao"));
QCOMPARE(v.engine(), (QScriptEngine *)0);
}
+}
+
+void tst_QScriptValue::ctor_copyAndAssignWithEngine()
+{
+ QScriptEngine eng;
// copy constructor, operator=
{
- QScriptValue v(1.0);
+ QScriptValue v(&eng, 1.0);
QScriptValue v2(v);
QCOMPARE(v2.strictlyEquals(v), true);
- QCOMPARE(v2.engine(), (QScriptEngine *)0);
+ QCOMPARE(v2.engine(), &eng);
QScriptValue v3(v);
QCOMPARE(v3.strictlyEquals(v), true);
QCOMPARE(v3.strictlyEquals(v2), true);
- QCOMPARE(v3.engine(), (QScriptEngine *)0);
+ QCOMPARE(v3.engine(), &eng);
- QScriptValue v4(2.0);
+ QScriptValue v4(&eng, 2.0);
QCOMPARE(v4.strictlyEquals(v), false);
v3 = v4;
QCOMPARE(v3.strictlyEquals(v), false);
@@ -320,7 +262,68 @@ void tst_QScriptValue::ctor()
QCOMPARE(v5.strictlyEquals(v), false);
QCOMPARE(v5.toNumber(), 1.0);
}
+}
+
+void tst_QScriptValue::ctor_undefined()
+{
+ QScriptValue v(QScriptValue::UndefinedValue);
+ QCOMPARE(v.isValid(), true);
+ QCOMPARE(v.isUndefined(), true);
+ QCOMPARE(v.isObject(), false);
+ QCOMPARE(v.engine(), (QScriptEngine *)0);
+}
+
+void tst_QScriptValue::ctor_null()
+{
+ QScriptValue v(QScriptValue::NullValue);
+ QCOMPARE(v.isValid(), true);
+ QCOMPARE(v.isNull(), true);
+ QCOMPARE(v.isObject(), false);
+ QCOMPARE(v.engine(), (QScriptEngine *)0);
+}
+
+void tst_QScriptValue::ctor_bool()
+{
+ QScriptValue v(false);
+ QCOMPARE(v.isValid(), true);
+ QCOMPARE(v.isBoolean(), true);
+ QCOMPARE(v.isBool(), true);
+ QCOMPARE(v.isObject(), false);
+ QCOMPARE(v.toBoolean(), false);
+ QCOMPARE(v.engine(), (QScriptEngine *)0);
+}
+
+void tst_QScriptValue::ctor_copyAndAssign()
+{
+ QScriptValue v(1.0);
+ QScriptValue v2(v);
+ QCOMPARE(v2.strictlyEquals(v), true);
+ QCOMPARE(v2.engine(), (QScriptEngine *)0);
+
+ QScriptValue v3(v);
+ QCOMPARE(v3.strictlyEquals(v), true);
+ QCOMPARE(v3.strictlyEquals(v2), true);
+ QCOMPARE(v3.engine(), (QScriptEngine *)0);
+
+ QScriptValue v4(2.0);
+ QCOMPARE(v4.strictlyEquals(v), false);
+ v3 = v4;
+ QCOMPARE(v3.strictlyEquals(v), false);
+ QCOMPARE(v3.strictlyEquals(v4), true);
+
+ v2 = QScriptValue();
+ QCOMPARE(v2.strictlyEquals(v), false);
+ QCOMPARE(v.toNumber(), 1.0);
+
+ QScriptValue v5(v);
+ QCOMPARE(v5.strictlyEquals(v), true);
+ v = QScriptValue();
+ QCOMPARE(v5.strictlyEquals(v), false);
+ QCOMPARE(v5.toNumber(), 1.0);
+}
+void tst_QScriptValue::ctor_nullEngine()
+{
// 0 engine
QVERIFY(QScriptValue(0, QScriptValue::UndefinedValue).isUndefined());
QVERIFY(QScriptValue(0, QScriptValue::NullValue).isNull());
@@ -337,7 +340,7 @@ static QScriptValue myFunction(QScriptContext *, QScriptEngine *eng)
return eng->undefinedValue();
}
-void tst_QScriptValue::toString_old()
+void tst_QScriptValue::toString()
{
QScriptEngine eng;
@@ -451,7 +454,7 @@ void tst_QScriptValue::toString_old()
QVERIFY(variant.toString().isEmpty());
}
-void tst_QScriptValue::toNumber_old()
+void tst_QScriptValue::toNumber()
{
QScriptEngine eng;
@@ -524,7 +527,7 @@ void tst_QScriptValue::toNumber_old()
}
}
-void tst_QScriptValue::toBoolean_old() // deprecated
+void tst_QScriptValue::toBoolean() // deprecated
{
QScriptEngine eng;
@@ -621,7 +624,7 @@ void tst_QScriptValue::toBoolean_old() // deprecated
}
}
-void tst_QScriptValue::toBool_old()
+void tst_QScriptValue::toBool()
{
QScriptEngine eng;
@@ -718,7 +721,7 @@ void tst_QScriptValue::toBool_old()
}
}
-void tst_QScriptValue::toInteger_old()
+void tst_QScriptValue::toInteger()
{
QScriptEngine eng;
@@ -805,7 +808,7 @@ void tst_QScriptValue::toInteger_old()
QCOMPARE(inv.toInteger(), 0.0);
}
-void tst_QScriptValue::toInt32_old()
+void tst_QScriptValue::toInt32()
{
QScriptEngine eng;
@@ -941,7 +944,7 @@ void tst_QScriptValue::toInt32_old()
QCOMPARE(qscriptvalue_cast<qint32>(inv), 0);
}
-void tst_QScriptValue::toUInt32_old()
+void tst_QScriptValue::toUInt32()
{
QScriptEngine eng;
@@ -1073,7 +1076,7 @@ void tst_QScriptValue::toUInt32_old()
QCOMPARE(qscriptvalue_cast<quint32>(inv), quint32(0));
}
-void tst_QScriptValue::toUInt16_old()
+void tst_QScriptValue::toUInt16()
{
QScriptEngine eng;
@@ -1234,7 +1237,7 @@ void tst_QScriptValue::toUInt16_old()
Q_DECLARE_METATYPE(QVariant)
#endif
-void tst_QScriptValue::toVariant_old()
+void tst_QScriptValue::toVariant()
{
QScriptEngine eng;
@@ -1251,6 +1254,10 @@ void tst_QScriptValue::toVariant_old()
QCOMPARE(number.toVariant(), QVariant(123.0));
QCOMPARE(qscriptvalue_cast<QVariant>(number), QVariant(123.0));
+ QScriptValue intNumber = QScriptValue(&eng, (qint32)123);
+ QCOMPARE(intNumber.toVariant().type(), QVariant((qint32)123).type());
+ QCOMPARE((qscriptvalue_cast<QVariant>(number)).type(), QVariant((qint32)123).type());
+
QScriptValue falskt = QScriptValue(&eng, false);
QCOMPARE(falskt.toVariant(), QVariant(false));
QCOMPARE(qscriptvalue_cast<QVariant>(falskt), QVariant(false));
@@ -1338,52 +1345,53 @@ void tst_QScriptValue::toVariant_old()
}
}
-// unfortunately, this is necessary in order to do qscriptvalue_cast<QPushButton*>(...)
-Q_DECLARE_METATYPE(QPushButton*)
-
-void tst_QScriptValue::toQObject_old()
+void tst_QScriptValue::toQObject_nonQObject_data()
{
- QScriptEngine eng;
-
- QScriptValue undefined = eng.undefinedValue();
- QCOMPARE(undefined.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(undefined), (QObject *)0);
-
- QScriptValue null = eng.nullValue();
- QCOMPARE(null.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(null), (QObject *)0);
-
- {
- QScriptValue falskt = QScriptValue(&eng, false);
- QCOMPARE(falskt.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(falskt), (QObject *)0);
+ newEngine();
+ QTest::addColumn<QScriptValue>("value");
+
+ QTest::newRow("invalid") << QScriptValue();
+ QTest::newRow("bool(false)") << QScriptValue(false);
+ QTest::newRow("bool(true)") << QScriptValue(true);
+ QTest::newRow("int") << QScriptValue(123);
+ QTest::newRow("string") << QScriptValue(QString::fromLatin1("ciao"));
+ QTest::newRow("undefined") << QScriptValue(QScriptValue::UndefinedValue);
+ QTest::newRow("null") << QScriptValue(QScriptValue::NullValue);
+
+ QTest::newRow("bool bound(false)") << QScriptValue(engine, false);
+ QTest::newRow("bool bound(true)") << QScriptValue(engine, true);
+ QTest::newRow("int bound") << QScriptValue(engine, 123);
+ QTest::newRow("string bound") << QScriptValue(engine, QString::fromLatin1("ciao"));
+ QTest::newRow("undefined bound") << engine->undefinedValue();
+ QTest::newRow("null bound") << engine->nullValue();
+ QTest::newRow("object") << engine->newObject();
+ QTest::newRow("array") << engine->newArray();
+ QTest::newRow("date") << engine->newDate(124);
+ QTest::newRow("variant(12345)") << engine->newVariant(12345);
+ QTest::newRow("variant((QObject*)0)") << engine->newVariant(qVariantFromValue((QObject*)0));
+ QTest::newRow("newQObject(0)") << engine->newQObject(0);
+}
- QScriptValue sant = QScriptValue(&eng, true);
- QCOMPARE(sant.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(sant), (QObject *)0);
- QScriptValue number = QScriptValue(&eng, 123.0);
- QCOMPARE(number.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(number), (QObject *)0);
+void tst_QScriptValue::toQObject_nonQObject()
+{
+ QFETCH(QScriptValue, value);
+ QCOMPARE(value.toQObject(), (QObject *)0);
+ QCOMPARE(qscriptvalue_cast<QObject*>(value), (QObject *)0);
+}
- QScriptValue str = QScriptValue(&eng, QString("ciao"));
- QCOMPARE(str.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(str), (QObject *)0);
- }
+// unfortunately, this is necessary in order to do qscriptvalue_cast<QPushButton*>(...)
+Q_DECLARE_METATYPE(QPushButton*);
- QScriptValue object = eng.newObject();
- QCOMPARE(object.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(object), (QObject *)0);
+void tst_QScriptValue::toQObject()
+{
+ QScriptEngine eng;
QScriptValue qobject = eng.newQObject(this);
QCOMPARE(qobject.toQObject(), (QObject *)this);
QCOMPARE(qscriptvalue_cast<QObject*>(qobject), (QObject *)this);
QCOMPARE(qscriptvalue_cast<QWidget*>(qobject), (QWidget *)0);
- QScriptValue qobject2 = eng.newQObject(0);
- QCOMPARE(qobject2.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(qobject2), (QObject *)0);
-
QWidget widget;
QScriptValue qwidget = eng.newQObject(&widget);
QCOMPARE(qwidget.toQObject(), (QObject *)&widget);
@@ -1397,25 +1405,6 @@ void tst_QScriptValue::toQObject_old()
QCOMPARE(qscriptvalue_cast<QWidget*>(qbutton), (QWidget *)&button);
QCOMPARE(qscriptvalue_cast<QPushButton*>(qbutton), &button);
- // V2 constructors
- {
- QScriptValue falskt = QScriptValue(false);
- QCOMPARE(falskt.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(falskt), (QObject *)0);
-
- QScriptValue sant = QScriptValue(true);
- QCOMPARE(sant.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(sant), (QObject *)0);
-
- QScriptValue number = QScriptValue(123.0);
- QCOMPARE(number.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(number), (QObject *)0);
-
- QScriptValue str = QScriptValue(QString("ciao"));
- QCOMPARE(str.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(str), (QObject *)0);
- }
-
// wrapping a QObject* as variant
QScriptValue variant = eng.newVariant(qVariantFromValue((QObject*)&button));
QCOMPARE(variant.toQObject(), (QObject*)&button);
@@ -1434,10 +1423,6 @@ void tst_QScriptValue::toQObject_old()
QCOMPARE(qscriptvalue_cast<QObject*>(variant3), (QObject*)0);
QCOMPARE(qscriptvalue_cast<QWidget*>(variant3), (QWidget*)0);
QCOMPARE(qscriptvalue_cast<QPushButton*>(variant3), &button);
-
- QScriptValue inv;
- QCOMPARE(inv.toQObject(), (QObject *)0);
- QCOMPARE(qscriptvalue_cast<QObject*>(inv), (QObject *)0);
}
void tst_QScriptValue::toObject()
@@ -1548,7 +1533,7 @@ void tst_QScriptValue::toObject()
}
}
-void tst_QScriptValue::toDateTime_old()
+void tst_QScriptValue::toDateTime()
{
QScriptEngine eng;
QDateTime dt = eng.evaluate("new Date(0)").toDateTime();
@@ -1566,7 +1551,7 @@ void tst_QScriptValue::toDateTime_old()
QVERIFY(!eng.undefinedValue().toDateTime().isValid());
}
-void tst_QScriptValue::toRegExp_old()
+void tst_QScriptValue::toRegExp()
{
QScriptEngine eng;
{
@@ -1596,7 +1581,16 @@ void tst_QScriptValue::toRegExp_old()
QVERIFY(eng.undefinedValue().toRegExp().isEmpty());
}
-void tst_QScriptValue::instanceOf_old()
+void tst_QScriptValue::instanceOf_twoEngines()
+{
+ QScriptEngine eng;
+ QScriptValue obj = eng.newObject();
+ QScriptEngine otherEngine;
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::instanceof: cannot perform operation on a value created in a different engine");
+ QCOMPARE(obj.instanceOf(otherEngine.globalObject().property("Object")), false);
+}
+
+void tst_QScriptValue::instanceOf()
{
QScriptEngine eng;
QScriptValue obj = eng.newObject();
@@ -1626,40 +1620,60 @@ void tst_QScriptValue::instanceOf_old()
QCOMPARE(arr.instanceOf(eng.evaluate("QObject")), false);
QCOMPARE(QScriptValue().instanceOf(arr), false);
+}
- QScriptEngine otherEngine;
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::instanceof: cannot perform operation on a value created in a different engine");
- QCOMPARE(obj.instanceOf(otherEngine.globalObject().property("Object")), false);
+void tst_QScriptValue::isArray_data()
+{
+ newEngine();
+
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("array");
+
+ QTest::newRow("[]") << engine->evaluate("[]") << true;
+ QTest::newRow("{}") << engine->evaluate("{}") << false;
+ QTest::newRow("globalObject") << engine->globalObject() << false;
+ QTest::newRow("invalid") << QScriptValue() << false;
+ QTest::newRow("number") << QScriptValue(123) << false;
+ QTest::newRow("bool") << QScriptValue(false) << false;
+ QTest::newRow("null") << engine->nullValue() << false;
+ QTest::newRow("undefined") << engine->undefinedValue() << false;
}
-void tst_QScriptValue::isArray_old()
+void tst_QScriptValue::isArray()
{
- QScriptEngine eng;
- QVERIFY(eng.evaluate("[]").isArray());
- QVERIFY(!eng.evaluate("{}").isArray());
- QVERIFY(!eng.globalObject().isArray());
- QVERIFY(!QScriptValue().isArray());
- QVERIFY(!QScriptValue(123).isArray());
- QVERIFY(!QScriptValue(false).isArray());
- QVERIFY(!eng.nullValue().isArray());
- QVERIFY(!eng.undefinedValue().isArray());
+ QFETCH(QScriptValue, value);
+ QFETCH(bool, array);
+
+ QCOMPARE(value.isArray(), array);
}
-void tst_QScriptValue::isDate_old()
+void tst_QScriptValue::isDate_data()
{
- QScriptEngine eng;
- QVERIFY(eng.evaluate("new Date()").isDate());
- QVERIFY(!eng.evaluate("[]").isDate());
- QVERIFY(!eng.evaluate("{}").isDate());
- QVERIFY(!eng.globalObject().isDate());
- QVERIFY(!QScriptValue().isDate());
- QVERIFY(!QScriptValue(123).isDate());
- QVERIFY(!QScriptValue(false).isDate());
- QVERIFY(!eng.nullValue().isDate());
- QVERIFY(!eng.undefinedValue().isDate());
+ newEngine();
+
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("date");
+
+ QTest::newRow("date") << engine->evaluate("new Date()") << true;
+ QTest::newRow("[]") << engine->evaluate("[]") << false;
+ QTest::newRow("{}") << engine->evaluate("{}") << false;
+ QTest::newRow("globalObject") << engine->globalObject() << false;
+ QTest::newRow("invalid") << QScriptValue() << false;
+ QTest::newRow("number") << QScriptValue(123) << false;
+ QTest::newRow("bool") << QScriptValue(false) << false;
+ QTest::newRow("null") << engine->nullValue() << false;
+ QTest::newRow("undefined") << engine->undefinedValue() << false;
+}
+
+void tst_QScriptValue::isDate()
+{
+ QFETCH(QScriptValue, value);
+ QFETCH(bool, date);
+
+ QCOMPARE(value.isDate(), date);
}
-void tst_QScriptValue::isError_old()
+void tst_QScriptValue::isError_propertiesOfGlobalObject()
{
QStringList errors;
errors << "Error"
@@ -1675,27 +1689,60 @@ void tst_QScriptValue::isError_old()
QVERIFY(ctor.isFunction());
QVERIFY(ctor.property("prototype").isError());
}
- QVERIFY(!eng.globalObject().isError());
- QVERIFY(!QScriptValue().isError());
- QVERIFY(!QScriptValue(123).isError());
- QVERIFY(!QScriptValue(false).isError());
- QVERIFY(!eng.nullValue().isError());
- QVERIFY(!eng.undefinedValue().isError());
- QVERIFY(!eng.evaluate("new Object()").isError());
}
-void tst_QScriptValue::isRegExp_old()
+void tst_QScriptValue::isError_data()
{
- QScriptEngine eng;
- QVERIFY(eng.evaluate("/foo/").isRegExp());
- QVERIFY(!eng.evaluate("[]").isRegExp());
- QVERIFY(!eng.evaluate("{}").isRegExp());
- QVERIFY(!eng.globalObject().isRegExp());
- QVERIFY(!QScriptValue().isRegExp());
- QVERIFY(!QScriptValue(123).isRegExp());
- QVERIFY(!QScriptValue(false).isRegExp());
- QVERIFY(!eng.nullValue().isRegExp());
- QVERIFY(!eng.undefinedValue().isRegExp());
+ newEngine();
+
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("error");
+
+ QTest::newRow("syntax error") << engine->evaluate("%fsdg's") << true;
+ QTest::newRow("[]") << engine->evaluate("[]") << false;
+ QTest::newRow("{}") << engine->evaluate("{}") << false;
+ QTest::newRow("globalObject") << engine->globalObject() << false;
+ QTest::newRow("invalid") << QScriptValue() << false;
+ QTest::newRow("number") << QScriptValue(123) << false;
+ QTest::newRow("bool") << QScriptValue(false) << false;
+ QTest::newRow("null") << engine->nullValue() << false;
+ QTest::newRow("undefined") << engine->undefinedValue() << false;
+ QTest::newRow("newObject") << engine->newObject() << false;
+ QTest::newRow("new Object") << engine->evaluate("new Object()") << false;
+}
+
+void tst_QScriptValue::isError()
+{
+ QFETCH(QScriptValue, value);
+ QFETCH(bool, error);
+
+ QCOMPARE(value.isError(), error);
+}
+
+void tst_QScriptValue::isRegExp_data()
+{
+ newEngine();
+
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("regexp");
+
+ QTest::newRow("/foo/") << engine->evaluate("/foo/") << true;
+ QTest::newRow("[]") << engine->evaluate("[]") << false;
+ QTest::newRow("{}") << engine->evaluate("{}") << false;
+ QTest::newRow("globalObject") << engine->globalObject() << false;
+ QTest::newRow("invalid") << QScriptValue() << false;
+ QTest::newRow("number") << QScriptValue(123) << false;
+ QTest::newRow("bool") << QScriptValue(false) << false;
+ QTest::newRow("null") << engine->nullValue() << false;
+ QTest::newRow("undefined") << engine->undefinedValue() << false;
+}
+
+void tst_QScriptValue::isRegExp()
+{
+ QFETCH(QScriptValue, value);
+ QFETCH(bool, regexp);
+
+ QCOMPARE(value.isRegExp(), regexp);
}
static QScriptValue getter(QScriptContext *ctx, QScriptEngine *)
@@ -1731,48 +1778,9 @@ static QScriptValue getSet__proto__(QScriptContext *ctx, QScriptEngine *)
return ctx->callee().property("value");
}
-void tst_QScriptValue::getSetProperty()
+void tst_QScriptValue::getSetProperty_HooliganTask162051()
{
QScriptEngine eng;
-
- QScriptValue object = eng.newObject();
-
- QScriptValue str = QScriptValue(&eng, "bar");
- object.setProperty("foo", str);
- QCOMPARE(object.property("foo").toString(), str.toString());
-
- QScriptValue num = QScriptValue(&eng, 123.0);
- object.setProperty("baz", num);
- QCOMPARE(object.property("baz").toNumber(), num.toNumber());
-
- QScriptValue strstr = QScriptValue("bar");
- QCOMPARE(strstr.engine(), (QScriptEngine *)0);
- object.setProperty("foo", strstr);
- QCOMPARE(object.property("foo").toString(), strstr.toString());
- QCOMPARE(strstr.engine(), &eng); // the value has been bound to the engine
-
- QScriptValue numnum = QScriptValue(123.0);
- object.setProperty("baz", numnum);
- QCOMPARE(object.property("baz").toNumber(), numnum.toNumber());
-
- QScriptValue inv;
- inv.setProperty("foo", num);
- QCOMPARE(inv.property("foo").isValid(), false);
-
- QScriptValue array = eng.newArray();
- QVERIFY(array.isArray());
- array.setProperty(0, num);
- QCOMPARE(array.property(0).toNumber(), num.toNumber());
- QCOMPARE(array.property("0").toNumber(), num.toNumber());
- QCOMPARE(array.property("length").toUInt32(), quint32(1));
- array.setProperty(1, str);
- QCOMPARE(array.property(1).toString(), str.toString());
- QCOMPARE(array.property("1").toString(), str.toString());
- QCOMPARE(array.property("length").toUInt32(), quint32(2));
- array.setProperty("length", QScriptValue(&eng, 1));
- QCOMPARE(array.property("length").toUInt32(), quint32(1));
- QCOMPARE(array.property(1).isValid(), false);
-
// task 162051 -- detecting whether the property is an array index or not
QVERIFY(eng.evaluate("a = []; a['00'] = 123; a['00']").strictlyEquals(QScriptValue(&eng, 123)));
QVERIFY(eng.evaluate("a.length").strictlyEquals(QScriptValue(&eng, 0)));
@@ -1785,24 +1793,62 @@ void tst_QScriptValue::getSetProperty()
QVERIFY(eng.evaluate("a[0]").isUndefined());
QVERIFY(eng.evaluate("a[0] = 789; a[0]").strictlyEquals(QScriptValue(&eng, 789)));
QVERIFY(eng.evaluate("a.length").strictlyEquals(QScriptValue(&eng, 1)));
+}
+void tst_QScriptValue::getSetProperty_HooliganTask183072()
+{
+ QScriptEngine eng;
// task 183072 -- 0x800000000 is not an array index
eng.evaluate("a = []; a[0x800000000] = 123");
QVERIFY(eng.evaluate("a.length").strictlyEquals(QScriptValue(&eng, 0)));
QVERIFY(eng.evaluate("a[0]").isUndefined());
QVERIFY(eng.evaluate("a[0x800000000]").strictlyEquals(QScriptValue(&eng, 123)));
+}
- QScriptEngine otherEngine;
- QScriptValue otherNum = QScriptValue(&otherEngine, 123);
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setProperty(oof) failed: cannot set value created in a different engine");
- object.setProperty("oof", otherNum);
- QCOMPARE(object.property("oof").isValid(), false);
+void tst_QScriptValue::getSetProperty_propertyRemoval()
+{
+ // test property removal (setProperty(QScriptValue()))
+ QScriptEngine eng;
+ QScriptValue object = eng.newObject();
+ QScriptValue str = QScriptValue(&eng, "bar");
+ QScriptValue num = QScriptValue(&eng, 123.0);
+
+ object.setProperty("foo", num);
+ QCOMPARE(object.property("foo").strictlyEquals(num), true);
+ object.setProperty("bar", str);
+ QCOMPARE(object.property("bar").strictlyEquals(str), true);
+ object.setProperty("foo", QScriptValue());
+ QCOMPARE(object.property("foo").isValid(), false);
+ QCOMPARE(object.property("bar").strictlyEquals(str), true);
+ object.setProperty("foo", num);
+ QCOMPARE(object.property("foo").strictlyEquals(num), true);
+ QCOMPARE(object.property("bar").strictlyEquals(str), true);
+ object.setProperty("bar", QScriptValue());
+ QCOMPARE(object.property("bar").isValid(), false);
+ QCOMPARE(object.property("foo").strictlyEquals(num), true);
+ object.setProperty("foo", QScriptValue());
+ object.setProperty("foo", QScriptValue());
+
+ eng.globalObject().setProperty("object3", object);
+ QCOMPARE(eng.evaluate("object3.hasOwnProperty('foo')")
+ .strictlyEquals(QScriptValue(&eng, false)), true);
+ object.setProperty("foo", num);
+ QCOMPARE(eng.evaluate("object3.hasOwnProperty('foo')")
+ .strictlyEquals(QScriptValue(&eng, true)), true);
+ eng.globalObject().setProperty("object3", QScriptValue());
+ QCOMPARE(eng.evaluate("this.hasOwnProperty('object3')")
+ .strictlyEquals(QScriptValue(&eng, false)), true);
+}
+void tst_QScriptValue::getSetProperty_resolveMode()
+{
// test ResolveMode
- QScriptValue object2 = eng.newObject();
- object.setPrototype(object2);
+ QScriptEngine eng;
+ QScriptValue object = eng.newObject();
+ QScriptValue prototype = eng.newObject();
+ object.setPrototype(prototype);
QScriptValue num2 = QScriptValue(&eng, 456.0);
- object2.setProperty("propertyInPrototype", num2);
+ prototype.setProperty("propertyInPrototype", num2);
// default is ResolvePrototype
QCOMPARE(object.property("propertyInPrototype")
.strictlyEquals(num2), true);
@@ -1814,199 +1860,279 @@ void tst_QScriptValue::getSetProperty()
.strictlyEquals(num2), false);
QCOMPARE(object.property("propertyInPrototype", QScriptValue::ResolveFull)
.strictlyEquals(num2), true);
+}
- // test property removal (setProperty(QScriptValue()))
- QScriptValue object3 = eng.newObject();
- object3.setProperty("foo", num);
- QCOMPARE(object3.property("foo").strictlyEquals(num), true);
- object3.setProperty("bar", str);
- QCOMPARE(object3.property("bar").strictlyEquals(str), true);
- object3.setProperty("foo", QScriptValue());
- QCOMPARE(object3.property("foo").isValid(), false);
- QCOMPARE(object3.property("bar").strictlyEquals(str), true);
- object3.setProperty("foo", num);
- QCOMPARE(object3.property("foo").strictlyEquals(num), true);
- QCOMPARE(object3.property("bar").strictlyEquals(str), true);
- object3.setProperty("bar", QScriptValue());
- QCOMPARE(object3.property("bar").isValid(), false);
- QCOMPARE(object3.property("foo").strictlyEquals(num), true);
- object3.setProperty("foo", QScriptValue());
- object3.setProperty("foo", QScriptValue());
-
- eng.globalObject().setProperty("object3", object3);
- QCOMPARE(eng.evaluate("object3.hasOwnProperty('foo')")
- .strictlyEquals(QScriptValue(&eng, false)), true);
- object3.setProperty("foo", num);
- QCOMPARE(eng.evaluate("object3.hasOwnProperty('foo')")
- .strictlyEquals(QScriptValue(&eng, true)), true);
- eng.globalObject().setProperty("object3", QScriptValue());
- QCOMPARE(eng.evaluate("this.hasOwnProperty('object3')")
- .strictlyEquals(QScriptValue(&eng, false)), true);
+void tst_QScriptValue::getSetProperty_twoEngines()
+{
+ QScriptEngine engine;
+ QScriptValue object = engine.newObject();
- // getters and setters
- {
- QScriptValue object4 = eng.newObject();
- for (int x = 0; x < 2; ++x) {
- object4.setProperty("foo", QScriptValue());
- // getter() returns this.x
- object4.setProperty("foo", eng.newFunction(getter),
- QScriptValue::PropertyGetter | QScriptValue::UserRange);
- QCOMPARE(object4.propertyFlags("foo") & ~QScriptValue::UserRange,
- QScriptValue::PropertyGetter );
-
- QEXPECT_FAIL("", "User-range flags are not retained for getter/setter properties", Continue);
- QCOMPARE(object4.propertyFlags("foo"),
- QScriptValue::PropertyGetter | QScriptValue::UserRange);
- object4.setProperty("x", num);
- QCOMPARE(object4.property("foo").strictlyEquals(num), true);
-
- // setter() sets this.x
- object4.setProperty("foo", eng.newFunction(setter),
- QScriptValue::PropertySetter);
- QCOMPARE(object4.propertyFlags("foo") & ~QScriptValue::UserRange,
- QScriptValue::PropertySetter | QScriptValue::PropertyGetter);
-
- QCOMPARE(object4.propertyFlags("foo"),
- QScriptValue::PropertySetter | QScriptValue::PropertyGetter);
- object4.setProperty("foo", str);
- QCOMPARE(object4.property("x").strictlyEquals(str), true);
- QCOMPARE(object4.property("foo").strictlyEquals(str), true);
-
- // kill the getter
- object4.setProperty("foo", QScriptValue(), QScriptValue::PropertyGetter);
- QVERIFY(!(object4.propertyFlags("foo") & QScriptValue::PropertyGetter));
- QVERIFY(object4.propertyFlags("foo") & QScriptValue::PropertySetter);
- QCOMPARE(object4.property("foo").isUndefined(), true);
-
- // setter should still work
- object4.setProperty("foo", num);
- QCOMPARE(object4.property("x").strictlyEquals(num), true);
-
- // kill the setter too
- object4.setProperty("foo", QScriptValue(), QScriptValue::PropertySetter);
- QVERIFY(!(object4.propertyFlags("foo") & QScriptValue::PropertySetter));
- // now foo is just a regular property
- object4.setProperty("foo", str);
- QCOMPARE(object4.property("x").strictlyEquals(num), true);
- QCOMPARE(object4.property("foo").strictlyEquals(str), true);
- }
+ QScriptEngine otherEngine;
+ QScriptValue otherNum = QScriptValue(&otherEngine, 123);
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setProperty(oof) failed: cannot set value created in a different engine");
+ object.setProperty("oof", otherNum);
+ QCOMPARE(object.property("oof").isValid(), false);
+}
- for (int x = 0; x < 2; ++x) {
- object4.setProperty("foo", QScriptValue());
- // setter() sets this.x
- object4.setProperty("foo", eng.newFunction(setter), QScriptValue::PropertySetter);
- object4.setProperty("foo", str);
- QCOMPARE(object4.property("x").strictlyEquals(str), true);
- QCOMPARE(object4.property("foo").isUndefined(), true);
-
- // getter() returns this.x
- object4.setProperty("foo", eng.newFunction(getter), QScriptValue::PropertyGetter);
- object4.setProperty("x", num);
- QCOMPARE(object4.property("foo").strictlyEquals(num), true);
-
- // kill the setter
- object4.setProperty("foo", QScriptValue(), QScriptValue::PropertySetter);
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setProperty() failed: property 'foo' has a getter but no setter");
- object4.setProperty("foo", str);
-
- // getter should still work
- QCOMPARE(object4.property("foo").strictlyEquals(num), true);
-
- // kill the getter too
- object4.setProperty("foo", QScriptValue(), QScriptValue::PropertyGetter);
- // now foo is just a regular property
- object4.setProperty("foo", str);
- QCOMPARE(object4.property("x").strictlyEquals(num), true);
- QCOMPARE(object4.property("foo").strictlyEquals(str), true);
- }
- // use a single function as both getter and setter
- object4.setProperty("foo", QScriptValue());
- object4.setProperty("foo", eng.newFunction(getterSetter),
- QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
- QCOMPARE(object4.propertyFlags("foo"),
- QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
- object4.setProperty("x", num);
- QCOMPARE(object4.property("foo").strictlyEquals(num), true);
-
- // killing the getter will preserve the setter, even though they are the same function
- object4.setProperty("foo", QScriptValue(), QScriptValue::PropertyGetter);
- QVERIFY(object4.propertyFlags("foo") & QScriptValue::PropertySetter);
- QCOMPARE(object4.property("foo").isUndefined(), true);
-
- // getter/setter that throws an error
- {
- QScriptValue object5 = eng.newObject();
- object5.setProperty("foo", eng.newFunction(getterSetterThrowingError),
- QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
- QVERIFY(!eng.hasUncaughtException());
- QScriptValue ret = object5.property("foo");
- QVERIFY(ret.isError());
- QVERIFY(eng.hasUncaughtException());
- QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
- eng.evaluate("Object"); // clear exception state...
- QVERIFY(!eng.hasUncaughtException());
- object5.setProperty("foo", str);
- QVERIFY(eng.hasUncaughtException());
- QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: set foo"));
- }
+void tst_QScriptValue::getSetProperty_gettersAndSetters()
+{
+ QScriptEngine eng;
+ QScriptValue str = QScriptValue(&eng, "bar");
+ QScriptValue num = QScriptValue(&eng, 123.0);
+ QScriptValue object = eng.newObject();
+ for (int x = 0; x < 2; ++x) {
+ object.setProperty("foo", QScriptValue());
+ // getter() returns this.x
+ object.setProperty("foo", eng.newFunction(getter),
+ QScriptValue::PropertyGetter | QScriptValue::UserRange);
+ QCOMPARE(object.propertyFlags("foo") & ~QScriptValue::UserRange,
+ QScriptValue::PropertyGetter );
+
+ QEXPECT_FAIL("", "User-range flags are not retained for getter/setter properties", Continue);
+ QCOMPARE(object.propertyFlags("foo"),
+ QScriptValue::PropertyGetter | QScriptValue::UserRange);
+ object.setProperty("x", num);
+ QCOMPARE(object.property("foo").strictlyEquals(num), true);
+
+ // setter() sets this.x
+ object.setProperty("foo", eng.newFunction(setter),
+ QScriptValue::PropertySetter);
+ QCOMPARE(object.propertyFlags("foo") & ~QScriptValue::UserRange,
+ QScriptValue::PropertySetter | QScriptValue::PropertyGetter);
+
+ QCOMPARE(object.propertyFlags("foo"),
+ QScriptValue::PropertySetter | QScriptValue::PropertyGetter);
+ object.setProperty("foo", str);
+ QCOMPARE(object.property("x").strictlyEquals(str), true);
+ QCOMPARE(object.property("foo").strictlyEquals(str), true);
+
+ // kill the getter
+ object.setProperty("foo", QScriptValue(), QScriptValue::PropertyGetter);
+ QVERIFY(!(object.propertyFlags("foo") & QScriptValue::PropertyGetter));
+ QVERIFY(object.propertyFlags("foo") & QScriptValue::PropertySetter);
+ QCOMPARE(object.property("foo").isUndefined(), true);
+
+ // setter should still work
+ object.setProperty("foo", num);
+ QCOMPARE(object.property("x").strictlyEquals(num), true);
+
+ // kill the setter too
+ object.setProperty("foo", QScriptValue(), QScriptValue::PropertySetter);
+ QVERIFY(!(object.propertyFlags("foo") & QScriptValue::PropertySetter));
+ // now foo is just a regular property
+ object.setProperty("foo", str);
+ QCOMPARE(object.property("x").strictlyEquals(num), true);
+ QCOMPARE(object.property("foo").strictlyEquals(str), true);
+ }
+
+ for (int x = 0; x < 2; ++x) {
+ object.setProperty("foo", QScriptValue());
+ // setter() sets this.x
+ object.setProperty("foo", eng.newFunction(setter), QScriptValue::PropertySetter);
+ object.setProperty("foo", str);
+ QCOMPARE(object.property("x").strictlyEquals(str), true);
+ QCOMPARE(object.property("foo").isUndefined(), true);
+
+ // getter() returns this.x
+ object.setProperty("foo", eng.newFunction(getter), QScriptValue::PropertyGetter);
+ object.setProperty("x", num);
+ QCOMPARE(object.property("foo").strictlyEquals(num), true);
+
+ // kill the setter
+ object.setProperty("foo", QScriptValue(), QScriptValue::PropertySetter);
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setProperty() failed: property 'foo' has a getter but no setter");
+ object.setProperty("foo", str);
+
+ // getter should still work
+ QCOMPARE(object.property("foo").strictlyEquals(num), true);
+
+ // kill the getter too
+ object.setProperty("foo", QScriptValue(), QScriptValue::PropertyGetter);
+ // now foo is just a regular property
+ object.setProperty("foo", str);
+ QCOMPARE(object.property("x").strictlyEquals(num), true);
+ QCOMPARE(object.property("foo").strictlyEquals(str), true);
+ }
+
+ // use a single function as both getter and setter
+ object.setProperty("foo", QScriptValue());
+ object.setProperty("foo", eng.newFunction(getterSetter),
+ QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ QCOMPARE(object.propertyFlags("foo"),
+ QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ object.setProperty("x", num);
+ QCOMPARE(object.property("foo").strictlyEquals(num), true);
+
+ // killing the getter will preserve the setter, even though they are the same function
+ object.setProperty("foo", QScriptValue(), QScriptValue::PropertyGetter);
+ QVERIFY(object.propertyFlags("foo") & QScriptValue::PropertySetter);
+ QCOMPARE(object.property("foo").isUndefined(), true);
+}
- // attempt to install getter+setter on built-in (native) property
- {
- QScriptValue object6 = eng.newObject();
- QVERIFY(object6.property("__proto__").strictlyEquals(object6.prototype()));
-
- QScriptValue fun = eng.newFunction(getSet__proto__);
- fun.setProperty("value", QScriptValue(&eng, "boo"));
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setProperty() failed: "
- "cannot set getter or setter of native property "
- "`__proto__'");
- object6.setProperty("__proto__", fun,
- QScriptValue::PropertyGetter | QScriptValue::PropertySetter
- | QScriptValue::UserRange);
- QVERIFY(object6.property("__proto__").strictlyEquals(object6.prototype()));
-
- object6.setProperty("__proto__", QScriptValue(),
- QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
- QVERIFY(object6.property("__proto__").strictlyEquals(object6.prototype()));
- }
+void tst_QScriptValue::getSetProperty_gettersAndSettersThrowErrorNative()
+{
+ // getter/setter that throws an error
+ QScriptEngine eng;
+ QScriptValue str = QScriptValue(&eng, "bar");
+ QScriptValue object = eng.newObject();
- // global property that's a getter+setter
- {
- eng.globalObject().setProperty("globalGetterSetterProperty", eng.newFunction(getterSetter),
- QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
- eng.evaluate("globalGetterSetterProperty = 123");
- {
- QScriptValue ret = eng.evaluate("globalGetterSetterProperty");
- QVERIFY(ret.isNumber());
- QVERIFY(ret.strictlyEquals(QScriptValue(&eng, 123)));
- }
- QCOMPARE(eng.evaluate("typeof globalGetterSetterProperty").toString(),
- QString::fromLatin1("number"));
- {
- QScriptValue ret = eng.evaluate("this.globalGetterSetterProperty()");
- QVERIFY(ret.isError());
- QCOMPARE(ret.toString(), QString::fromLatin1("TypeError: Result of expression 'this.globalGetterSetterProperty' [123] is not a function."));
- }
- {
- QScriptValue ret = eng.evaluate("new this.globalGetterSetterProperty()");
- QVERIFY(ret.isError());
- QCOMPARE(ret.toString(), QString::fromLatin1("TypeError: Result of expression 'this.globalGetterSetterProperty' [123] is not a constructor."));
- }
- }
+ object.setProperty("foo", eng.newFunction(getterSetterThrowingError),
+ QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ QVERIFY(!eng.hasUncaughtException());
+ QScriptValue ret = object.property("foo");
+ QVERIFY(ret.isError());
+ QVERIFY(eng.hasUncaughtException());
+ QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
+ QCOMPARE(ret.toString(), QLatin1String("Error: get foo"));
+ eng.evaluate("Object"); // clear exception state...
+ QVERIFY(!eng.hasUncaughtException());
+ object.setProperty("foo", str);
+ QVERIFY(eng.hasUncaughtException());
+ QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: set foo"));
+}
- // "upgrading" an existing property to become a getter+setter
- {
- QScriptValue object7 = eng.newObject();
- QScriptValue num(&eng, 123);
- object7.setProperty("foo", num);
- object7.setProperty("foo", eng.newFunction(getterSetter),
- QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
- QVERIFY(!object7.property("x").isValid());
- object7.setProperty("foo", num);
- QVERIFY(object7.property("x").equals(num));
- }
+void tst_QScriptValue::getSetProperty_gettersAndSettersThrowErrorJS()
+{
+ // getter/setter that throws an error (from js function)
+ QScriptEngine eng;
+ QScriptValue str = QScriptValue(&eng, "bar");
+
+ eng.evaluate("o = new Object; "
+ "o.__defineGetter__('foo', function() { throw new Error('get foo') }); "
+ "o.__defineSetter__('foo', function() { throw new Error('set foo') }); ");
+ QScriptValue object = eng.evaluate("o");
+ QVERIFY(!eng.hasUncaughtException());
+ QScriptValue ret = object.property("foo");
+ QEXPECT_FAIL("", "Exception thrown from js function are not returned by the JSC port", Continue);
+ QVERIFY(ret.isError());
+ QVERIFY(eng.hasUncaughtException());
+ QEXPECT_FAIL("", "Exception thrown from js function are not returned by the JSC port", Continue);
+ QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
+ QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: get foo"));
+ eng.evaluate("Object"); // clear exception state...
+ QVERIFY(!eng.hasUncaughtException());
+ object.setProperty("foo", str);
+ QVERIFY(eng.hasUncaughtException());
+ QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: set foo"));
+}
+
+void tst_QScriptValue::getSetProperty_gettersAndSettersOnNative()
+{
+ // attempt to install getter+setter on built-in (native) property
+ QScriptEngine eng;
+ QScriptValue object = eng.newObject();
+ QVERIFY(object.property("__proto__").strictlyEquals(object.prototype()));
+
+ QScriptValue fun = eng.newFunction(getSet__proto__);
+ fun.setProperty("value", QScriptValue(&eng, "boo"));
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setProperty() failed: "
+ "cannot set getter or setter of native property "
+ "`__proto__'");
+ object.setProperty("__proto__", fun,
+ QScriptValue::PropertyGetter | QScriptValue::PropertySetter
+ | QScriptValue::UserRange);
+ QVERIFY(object.property("__proto__").strictlyEquals(object.prototype()));
+
+ object.setProperty("__proto__", QScriptValue(),
+ QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ QVERIFY(object.property("__proto__").strictlyEquals(object.prototype()));
+}
+
+void tst_QScriptValue::getSetProperty_gettersAndSettersOnGlobalObject()
+{
+ // global property that's a getter+setter
+ QScriptEngine eng;
+ eng.globalObject().setProperty("globalGetterSetterProperty", eng.newFunction(getterSetter),
+ QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ eng.evaluate("globalGetterSetterProperty = 123");
+ {
+ QScriptValue ret = eng.evaluate("globalGetterSetterProperty");
+ QVERIFY(ret.isNumber());
+ QVERIFY(ret.strictlyEquals(QScriptValue(&eng, 123)));
}
+ QCOMPARE(eng.evaluate("typeof globalGetterSetterProperty").toString(),
+ QString::fromLatin1("number"));
+ {
+ QScriptValue ret = eng.evaluate("this.globalGetterSetterProperty()");
+ QVERIFY(ret.isError());
+ QCOMPARE(ret.toString(), QString::fromLatin1("TypeError: Result of expression 'this.globalGetterSetterProperty' [123] is not a function."));
+ }
+ {
+ QScriptValue ret = eng.evaluate("new this.globalGetterSetterProperty()");
+ QVERIFY(ret.isError());
+ QCOMPARE(ret.toString(), QString::fromLatin1("TypeError: Result of expression 'this.globalGetterSetterProperty' [123] is not a constructor."));
+ }
+}
+
+void tst_QScriptValue::getSetProperty_gettersAndSettersChange()
+{
+ // "upgrading" an existing property to become a getter+setter
+ QScriptEngine eng;
+ QScriptValue object = eng.newObject();
+ QScriptValue num(&eng, 123);
+ object.setProperty("foo", num);
+ object.setProperty("foo", eng.newFunction(getterSetter),
+ QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ QVERIFY(!object.property("x").isValid());
+ object.setProperty("foo", num);
+ QVERIFY(object.property("x").equals(num));
+
+ eng.globalObject().setProperty("object", object);
+ QScriptValue res = eng.evaluate("object.x = 89; var a = object.foo; object.foo = 65; a");
+ QCOMPARE(res.toInt32(), 89);
+ QCOMPARE(object.property("x").toInt32(), 65);
+ QCOMPARE(object.property("foo").toInt32(), 65);
+}
+
+void tst_QScriptValue::getSetProperty_array()
+{
+ QScriptEngine eng;
+ QScriptValue str = QScriptValue(&eng, "bar");
+ QScriptValue num = QScriptValue(&eng, 123.0);
+ QScriptValue array = eng.newArray();
+
+ QVERIFY(array.isArray());
+ array.setProperty(0, num);
+ QCOMPARE(array.property(0).toNumber(), num.toNumber());
+ QCOMPARE(array.property("0").toNumber(), num.toNumber());
+ QCOMPARE(array.property("length").toUInt32(), quint32(1));
+ array.setProperty(1, str);
+ QCOMPARE(array.property(1).toString(), str.toString());
+ QCOMPARE(array.property("1").toString(), str.toString());
+ QCOMPARE(array.property("length").toUInt32(), quint32(2));
+ array.setProperty("length", QScriptValue(&eng, 1));
+ QCOMPARE(array.property("length").toUInt32(), quint32(1));
+ QCOMPARE(array.property(1).isValid(), false);
+}
+
+void tst_QScriptValue::getSetProperty()
+{
+ QScriptEngine eng;
+
+ QScriptValue object = eng.newObject();
+
+ QScriptValue str = QScriptValue(&eng, "bar");
+ object.setProperty("foo", str);
+ QCOMPARE(object.property("foo").toString(), str.toString());
+
+ QScriptValue num = QScriptValue(&eng, 123.0);
+ object.setProperty("baz", num);
+ QCOMPARE(object.property("baz").toNumber(), num.toNumber());
+
+ QScriptValue strstr = QScriptValue("bar");
+ QCOMPARE(strstr.engine(), (QScriptEngine *)0);
+ object.setProperty("foo", strstr);
+ QCOMPARE(object.property("foo").toString(), strstr.toString());
+ QCOMPARE(strstr.engine(), &eng); // the value has been bound to the engine
+
+ QScriptValue numnum = QScriptValue(123.0);
+ object.setProperty("baz", numnum);
+ QCOMPARE(object.property("baz").toNumber(), numnum.toNumber());
+
+ QScriptValue inv;
+ inv.setProperty("foo", num);
+ QCOMPARE(inv.property("foo").isValid(), false);
eng.globalObject().setProperty("object", object);
@@ -2155,50 +2281,126 @@ void tst_QScriptValue::arrayElementGetterSetter()
QVERIFY(obj.propertyFlags("1") == 0);
}
-void tst_QScriptValue::getSetPrototype()
+void tst_QScriptValue::getSetPrototype_cyclicPrototype()
{
QScriptEngine eng;
-
+ QScriptValue prototype = eng.newObject();
QScriptValue object = eng.newObject();
+ object.setPrototype(prototype);
- QScriptValue object2 = eng.newObject();
- object2.setPrototype(object);
+ QScriptValue previousPrototype = prototype.prototype();
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setPrototype() failed: cyclic prototype value");
+ prototype.setPrototype(prototype);
+ QCOMPARE(prototype.prototype().strictlyEquals(previousPrototype), true);
+
+ object.setPrototype(prototype);
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setPrototype() failed: cyclic prototype value");
+ prototype.setPrototype(object);
+ QCOMPARE(prototype.prototype().strictlyEquals(previousPrototype), true);
+
+}
- QCOMPARE(object2.prototype().strictlyEquals(object), true);
+void tst_QScriptValue::getSetPrototype_evalCyclicPrototype()
+{
+ QScriptEngine eng;
+ QScriptValue ret = eng.evaluate("o = { }; p = { }; o.__proto__ = p; p.__proto__ = o");
+ QCOMPARE(eng.hasUncaughtException(), true);
+ QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
+ QCOMPARE(ret.isError(), true);
+ QCOMPARE(ret.toString(), QLatin1String("Error: cyclic __proto__ value"));
+}
+void tst_QScriptValue::getSetPrototype_eval()
+{
+ QScriptEngine eng;
+ QScriptValue ret = eng.evaluate("p = { }; p.__proto__ = { }");
+ QCOMPARE(eng.hasUncaughtException(), false);
+ QCOMPARE(ret.isError(), false);
+}
+
+void tst_QScriptValue::getSetPrototype_invalidPrototype()
+{
+ QScriptEngine eng;
QScriptValue inv;
+ QScriptValue object = eng.newObject();
+ QScriptValue proto = object.prototype();
+ QVERIFY(object.prototype().strictlyEquals(proto));
inv.setPrototype(object);
QCOMPARE(inv.prototype().isValid(), false);
+ object.setPrototype(inv);
+ // FIXME should it be invalid or proto?
+ QVERIFY(object.prototype().strictlyEquals(inv));
+}
+void tst_QScriptValue::getSetPrototype_twoEngines()
+{
+ QScriptEngine eng;
+ QScriptValue prototype = eng.newObject();
+ QScriptValue object = eng.newObject();
+ object.setPrototype(prototype);
QScriptEngine otherEngine;
- QScriptValue object3 = otherEngine.newObject();
+ QScriptValue newPrototype = otherEngine.newObject();
QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setPrototype() failed: cannot set a prototype created in a different engine");
- object2.setPrototype(object3);
- QCOMPARE(object2.prototype().strictlyEquals(object), true);
+ object.setPrototype(newPrototype);
+ QCOMPARE(object.prototype().strictlyEquals(prototype), true);
- // cyclic prototypes
- QScriptValue old = object.prototype();
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setPrototype() failed: cyclic prototype value");
- object.setPrototype(object);
- QCOMPARE(object.prototype().strictlyEquals(old), true);
+}
- object2.setPrototype(object);
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setPrototype() failed: cyclic prototype value");
- object.setPrototype(object2);
- QCOMPARE(object.prototype().strictlyEquals(old), true);
+void tst_QScriptValue::getSetPrototype_null()
+{
+ QScriptEngine eng;
+ QScriptValue object = eng.newObject();
+ object.setPrototype(QScriptValue(QScriptValue::NullValue));
+ QVERIFY(object.prototype().isNull());
- {
- QScriptValue ret = eng.evaluate("o = { }; p = { }; o.__proto__ = p; p.__proto__ = o");
- QCOMPARE(eng.hasUncaughtException(), true);
- QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
- QCOMPARE(ret.isError(), true);
- QCOMPARE(ret.toString(), QLatin1String("Error: cyclic __proto__ value"));
- }
- {
- QScriptValue ret = eng.evaluate("p.__proto__ = { }");
- QCOMPARE(eng.hasUncaughtException(), false);
- QCOMPARE(ret.isError(), false);
- }
+ QScriptValue newProto = eng.newObject();
+ object.setPrototype(newProto);
+ QVERIFY(object.prototype().equals(newProto));
+
+ object.setPrototype(QScriptValue(&eng, QScriptValue::NullValue));
+ QVERIFY(object.prototype().isNull());
+}
+
+void tst_QScriptValue::getSetPrototype_notObjectOrNull()
+{
+ QScriptEngine eng;
+ QScriptValue object = eng.newObject();
+ QScriptValue originalProto = object.prototype();
+
+ QEXPECT_FAIL("", "QTBUG-15154: QScriptValue::setPrototype() allows a non-Object value to be set as prototype", Abort);
+
+ // bool
+ object.setPrototype(true);
+ QVERIFY(object.prototype().equals(originalProto));
+ object.setPrototype(QScriptValue(&eng, true));
+ QVERIFY(object.prototype().equals(originalProto));
+
+ // number
+ object.setPrototype(123);
+ QVERIFY(object.prototype().equals(originalProto));
+ object.setPrototype(QScriptValue(&eng, 123));
+ QVERIFY(object.prototype().equals(originalProto));
+
+ // string
+ object.setPrototype("foo");
+ QVERIFY(object.prototype().equals(originalProto));
+ object.setPrototype(QScriptValue(&eng, "foo"));
+ QVERIFY(object.prototype().equals(originalProto));
+
+ // undefined
+ object.setPrototype(QScriptValue(QScriptValue::UndefinedValue));
+ QVERIFY(object.prototype().equals(originalProto));
+ object.setPrototype(QScriptValue(&eng, QScriptValue::UndefinedValue));
+ QVERIFY(object.prototype().equals(originalProto));
+}
+
+void tst_QScriptValue::getSetPrototype()
+{
+ QScriptEngine eng;
+ QScriptValue prototype = eng.newObject();
+ QScriptValue object = eng.newObject();
+ object.setPrototype(prototype);
+ QCOMPARE(object.prototype().strictlyEquals(prototype), true);
}
void tst_QScriptValue::getSetScope()
@@ -2235,10 +2437,24 @@ void tst_QScriptValue::getSetScope()
QVERIFY(!object2.scope().isValid());
}
-void tst_QScriptValue::getSetData()
+void tst_QScriptValue::getSetData_objects_data()
{
- QScriptEngine eng;
- QScriptValue object = eng.newObject();
+ newEngine();
+
+ QTest::addColumn<QScriptValue>("object");
+
+ QTest::newRow("object from evaluate") << engine->evaluate("new Object()");
+ QTest::newRow("object from engine") << engine->newObject();
+ QTest::newRow("Array") << engine->newArray();
+ QTest::newRow("Date") << engine->newDate(12324);
+ QTest::newRow("QObject") << engine->newQObject(this);
+ QTest::newRow("RegExp") << engine->newRegExp(QRegExp());
+}
+
+void tst_QScriptValue::getSetData_objects()
+{
+ QFETCH(QScriptValue, object);
+
QVERIFY(!object.data().isValid());
QScriptValue v1(true);
object.setData(v1);
@@ -2246,13 +2462,48 @@ void tst_QScriptValue::getSetData()
QScriptValue v2(123);
object.setData(v2);
QVERIFY(object.data().strictlyEquals(v2));
- QScriptValue v3 = eng.newObject();
+ QScriptValue v3 = engine->newObject();
object.setData(v3);
QVERIFY(object.data().strictlyEquals(v3));
object.setData(QScriptValue());
QVERIFY(!object.data().isValid());
}
+void tst_QScriptValue::getSetData_nonObjects_data()
+{
+ newEngine();
+
+ QTest::addColumn<QScriptValue>("value");
+
+ QTest::newRow("undefined (bound)") << engine->undefinedValue();
+ QTest::newRow("null (bound)") << engine->nullValue();
+ QTest::newRow("string (bound)") << QScriptValue(engine, "Pong");
+ QTest::newRow("bool (bound)") << QScriptValue(engine, false);
+
+ QTest::newRow("undefined") << QScriptValue(QScriptValue::UndefinedValue);
+ QTest::newRow("null") << QScriptValue(QScriptValue::NullValue);
+ QTest::newRow("string") << QScriptValue("Pong");
+ QTest::newRow("bool") << QScriptValue(true);
+}
+
+void tst_QScriptValue::getSetData_nonObjects()
+{
+ QFETCH(QScriptValue, value);
+
+ QVERIFY(!value.data().isValid());
+ QScriptValue v1(true);
+ value.setData(v1);
+ QVERIFY(!value.data().isValid());
+ QScriptValue v2(123);
+ value.setData(v2);
+ QVERIFY(!value.data().isValid());
+ QScriptValue v3 = engine->newObject();
+ value.setData(v3);
+ QVERIFY(!value.data().isValid());
+ value.setData(QScriptValue());
+ QVERIFY(!value.data().isValid());
+}
+
void tst_QScriptValue::setData_QTBUG15144()
{
QScriptEngine eng;
@@ -2266,30 +2517,59 @@ void tst_QScriptValue::setData_QTBUG15144()
obj.setData("foodfight");
}
}
+
class TestScriptClass : public QScriptClass
{
public:
TestScriptClass(QScriptEngine *engine) : QScriptClass(engine) {}
};
-void tst_QScriptValue::getSetScriptClass()
+void tst_QScriptValue::getSetScriptClass_emptyClass_data()
{
- QScriptEngine eng;
- QScriptValue inv;
- QCOMPARE(inv.scriptClass(), (QScriptClass*)0);
- QScriptValue num(123);
- QCOMPARE(num.scriptClass(), (QScriptClass*)0);
+ newEngine();
+ QTest::addColumn<QScriptValue>("value");
+
+ QTest::newRow("invalid") << QScriptValue();
+ QTest::newRow("number") << QScriptValue(123);
+ QTest::newRow("string") << QScriptValue("pong");
+ QTest::newRow("bool") << QScriptValue(false);
+ QTest::newRow("null") << QScriptValue(QScriptValue::NullValue);
+ QTest::newRow("undefined") << QScriptValue(QScriptValue::UndefinedValue);
+
+ QTest::newRow("number") << QScriptValue(engine, 123);
+ QTest::newRow("string") << QScriptValue(engine, "pong");
+ QTest::newRow("bool") << QScriptValue(engine, true);
+ QTest::newRow("null") << QScriptValue(engine->nullValue());
+ QTest::newRow("undefined") << QScriptValue(engine->undefinedValue());
+ QTest::newRow("object") << QScriptValue(engine->newObject());
+ QTest::newRow("date") << QScriptValue(engine->evaluate("new Date()"));
+ QTest::newRow("qobject") << QScriptValue(engine->newQObject(this));
+}
+
+void tst_QScriptValue::getSetScriptClass_emptyClass()
+{
+ QFETCH(QScriptValue, value);
+ QCOMPARE(value.scriptClass(), (QScriptClass*)0);
+}
+void tst_QScriptValue::getSetScriptClass_JSObjectFromCpp()
+{
+ QScriptEngine eng;
TestScriptClass testClass(&eng);
// object created in C++ (newObject())
{
QScriptValue obj = eng.newObject();
- QCOMPARE(obj.scriptClass(), (QScriptClass*)0);
obj.setScriptClass(&testClass);
QCOMPARE(obj.scriptClass(), (QScriptClass*)&testClass);
obj.setScriptClass(0);
QCOMPARE(obj.scriptClass(), (QScriptClass*)0);
}
+}
+
+void tst_QScriptValue::getSetScriptClass_JSObjectFromJS()
+{
+ QScriptEngine eng;
+ TestScriptClass testClass(&eng);
// object created in JS
{
QScriptValue obj = eng.evaluate("new Object");
@@ -2304,6 +2584,12 @@ void tst_QScriptValue::getSetScriptClass()
obj.setScriptClass(0);
QCOMPARE(obj.scriptClass(), (QScriptClass*)0);
}
+}
+
+void tst_QScriptValue::getSetScriptClass_QVariant()
+{
+ QScriptEngine eng;
+ TestScriptClass testClass(&eng);
// object that already has a(n internal) class
{
QScriptValue obj = eng.newVariant(QUrl("http://example.com"));
@@ -2315,10 +2601,15 @@ void tst_QScriptValue::getSetScriptClass()
QVERIFY(!obj.isVariant());
QCOMPARE(obj.toVariant(), QVariant(QVariantMap()));
}
+}
+
+void tst_QScriptValue::getSetScriptClass_QObject()
+{
+ QScriptEngine eng;
+ TestScriptClass testClass(&eng);
{
QScriptValue obj = eng.newQObject(this);
QVERIFY(obj.isQObject());
- QCOMPARE(obj.scriptClass(), (QScriptClass*)0);
obj.setScriptClass(&testClass);
QCOMPARE(obj.scriptClass(), (QScriptClass*)&testClass);
QVERIFY(obj.isObject());
@@ -2347,83 +2638,89 @@ static QScriptValue returnInvalidValue(QScriptContext *, QScriptEngine *)
return QScriptValue();
}
-void tst_QScriptValue::call()
+void tst_QScriptValue::call_function()
{
QScriptEngine eng;
+ QScriptValue fun = eng.evaluate("(function() { return 1; })");
+ QVERIFY(fun.isFunction());
+ QScriptValue result = fun.call();
+ QVERIFY(result.isNumber());
+ QCOMPARE(result.toInt32(), 1);
+}
- {
- QScriptValue fun = eng.evaluate("(function() { return 1; })");
- QVERIFY(fun.isFunction());
- QScriptValue result = fun.call();
- QVERIFY(result.isNumber());
- QCOMPARE(result.toInt32(), 1);
- }
-
+void tst_QScriptValue::call_object()
+{
+ QScriptEngine eng;
QScriptValue Object = eng.evaluate("Object");
QCOMPARE(Object.isFunction(), true);
- {
- QScriptValue result = Object.call(Object);
- QCOMPARE(result.isObject(), true);
- }
+ QScriptValue result = Object.call(Object);
+ QCOMPARE(result.isObject(), true);
+}
+void tst_QScriptValue::call_newObjects()
+{
+ QScriptEngine eng;
// test that call() doesn't construct new objects
QScriptValue Number = eng.evaluate("Number");
+ QScriptValue Object = eng.evaluate("Object");
QCOMPARE(Object.isFunction(), true);
- {
- QScriptValueList args;
- args << QScriptValue(&eng, 123);
- QScriptValue result = Number.call(Object, args);
- QCOMPARE(result.strictlyEquals(args.at(0)), true);
- }
+ QScriptValueList args;
+ args << QScriptValue(&eng, 123);
+ QScriptValue result = Number.call(Object, args);
+ QCOMPARE(result.strictlyEquals(args.at(0)), true);
+}
+void tst_QScriptValue::call_this()
+{
+ QScriptEngine eng;
// test that correct "this" object is used
- {
- QScriptValue fun = eng.evaluate("(function() { return this; })");
- QCOMPARE(fun.isFunction(), true);
+ QScriptValue fun = eng.evaluate("(function() { return this; })");
+ QCOMPARE(fun.isFunction(), true);
- {
- QScriptValue numberObject = QScriptValue(&eng, 123.0).toObject();
- QScriptValue result = fun.call(numberObject);
- QCOMPARE(result.isObject(), true);
- QCOMPARE(result.toNumber(), 123.0);
- }
- }
+ QScriptValue numberObject = QScriptValue(&eng, 123.0).toObject();
+ QScriptValue result = fun.call(numberObject);
+ QCOMPARE(result.isObject(), true);
+ QCOMPARE(result.toNumber(), 123.0);
+}
+void tst_QScriptValue::call_arguments()
+{
+ QScriptEngine eng;
// test that correct arguments are passed
- {
- QScriptValue fun = eng.evaluate("(function() { return arguments[0]; })");
- QCOMPARE(fun.isFunction(), true);
-
- {
- QScriptValue result = fun.call(eng.undefinedValue());
- QCOMPARE(result.isUndefined(), true);
- }
-
- {
- QScriptValueList args;
- args << QScriptValue(&eng, 123.0);
- QScriptValue result = fun.call(eng.undefinedValue(), args);
- QCOMPARE(result.isNumber(), true);
- QCOMPARE(result.toNumber(), 123.0);
- }
- // V2 constructors
- {
- QScriptValueList args;
- args << QScriptValue(123.0);
- QScriptValue result = fun.call(eng.undefinedValue(), args);
- QCOMPARE(result.isNumber(), true);
- QCOMPARE(result.toNumber(), 123.0);
- }
- {
- QScriptValue args = eng.newArray();
- args.setProperty(0, 123);
- QScriptValue result = fun.call(eng.undefinedValue(), args);
- QVERIFY(result.isNumber());
- QCOMPARE(result.toNumber(), 123.0);
- }
+ QScriptValue fun = eng.evaluate("(function() { return arguments[0]; })");
+ QCOMPARE(fun.isFunction(), true);
+ {
+ QScriptValue result = fun.call(eng.undefinedValue());
+ QCOMPARE(result.isUndefined(), true);
}
+ {
+ QScriptValueList args;
+ args << QScriptValue(&eng, 123.0);
+ QScriptValue result = fun.call(eng.undefinedValue(), args);
+ QCOMPARE(result.isNumber(), true);
+ QCOMPARE(result.toNumber(), 123.0);
+ }
+ // V2 constructors
+ {
+ QScriptValueList args;
+ args << QScriptValue(123.0);
+ QScriptValue result = fun.call(eng.undefinedValue(), args);
+ QCOMPARE(result.isNumber(), true);
+ QCOMPARE(result.toNumber(), 123.0);
+ }
+ {
+ QScriptValue args = eng.newArray();
+ args.setProperty(0, 123);
+ QScriptValue result = fun.call(eng.undefinedValue(), args);
+ QVERIFY(result.isNumber());
+ QCOMPARE(result.toNumber(), 123.0);
+ }
+}
+void tst_QScriptValue::call()
+{
+ QScriptEngine eng;
{
QScriptValue fun = eng.evaluate("(function() { return arguments[1]; })");
QCOMPARE(fun.isFunction(), true);
@@ -2444,7 +2741,6 @@ void tst_QScriptValue::call()
QCOMPARE(result.toNumber(), 456.0);
}
}
-
{
QScriptValue fun = eng.evaluate("(function() { throw new Error('foo'); })");
QCOMPARE(fun.isFunction(), true);
@@ -2457,7 +2753,6 @@ void tst_QScriptValue::call()
QVERIFY(result.strictlyEquals(eng.uncaughtException()));
}
}
-
{
eng.clearExceptions();
QScriptValue fun = eng.newFunction(getArg);
@@ -2485,7 +2780,6 @@ void tst_QScriptValue::call()
QCOMPARE(result.toNumber(), 123.0);
}
}
-
{
QScriptValue fun = eng.newFunction(evaluateArg);
{
@@ -2497,11 +2791,12 @@ void tst_QScriptValue::call()
QCOMPARE(result.toNumber(), 123.0);
}
}
+}
- QScriptValue inv;
- QCOMPARE(inv.call().isValid(), false);
-
+void tst_QScriptValue::call_invalidArguments()
+{
// test that invalid arguments are handled gracefully
+ QScriptEngine eng;
{
QScriptValue fun = eng.newFunction(getArg);
{
@@ -2534,6 +2829,35 @@ void tst_QScriptValue::call()
QCOMPARE(qIsNaN(ret.toNumber()), true);
}
}
+}
+
+void tst_QScriptValue::call_invalidReturn()
+{
+ // test that invalid return value is handled gracefully
+ QScriptEngine eng;
+ QScriptValue fun = eng.newFunction(returnInvalidValue);
+ eng.globalObject().setProperty("returnInvalidValue", fun);
+ QScriptValue ret = eng.evaluate("returnInvalidValue() + returnInvalidValue()");
+ QCOMPARE(ret.isValid(), true);
+ QCOMPARE(ret.isNumber(), true);
+ QCOMPARE(qIsNaN(ret.toNumber()), true);
+}
+
+void tst_QScriptValue::call_twoEngines()
+{
+ QScriptEngine eng;
+ QScriptValue object = eng.evaluate("Object");
+ QScriptEngine otherEngine;
+ QScriptValue fun = otherEngine.evaluate("(function() { return 1; })");
+ QVERIFY(fun.isFunction());
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::call() failed: "
+ "cannot call function with thisObject created in "
+ "a different engine");
+ QCOMPARE(fun.call(object).isValid(), false);
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::call() failed: "
+ "cannot call function with argument created in "
+ "a different engine");
+ QCOMPARE(fun.call(QScriptValue(), QScriptValueList() << QScriptValue(&eng, 123)).isValid(), false);
{
QScriptValue fun = eng.evaluate("Object");
QVERIFY(fun.isFunction());
@@ -2544,76 +2868,74 @@ void tst_QScriptValue::call()
QTest::ignoreMessage(QtWarningMsg, "QScriptValue::call() failed: cannot call function with argument created in a different engine");
fun.call(QScriptValue(), args);
}
+}
- // test that invalid return value is handled gracefully
- {
- QScriptValue fun = eng.newFunction(returnInvalidValue);
- eng.globalObject().setProperty("returnInvalidValue", fun);
- QScriptValue ret = eng.evaluate("returnInvalidValue() + returnInvalidValue()");
- QCOMPARE(ret.isValid(), true);
- QCOMPARE(ret.isNumber(), true);
- QCOMPARE(qIsNaN(ret.toNumber()), true);
- }
+void tst_QScriptValue::call_array()
+{
+ QScriptEngine eng;
+ QScriptValue fun = eng.evaluate("(function() { return arguments; })");
+ QVERIFY(fun.isFunction());
+ QScriptValue array = eng.newArray(3);
+ array.setProperty(0, QScriptValue(&eng, 123.0));
+ array.setProperty(1, QScriptValue(&eng, 456.0));
+ array.setProperty(2, QScriptValue(&eng, 789.0));
+ // call with single array object as arguments
+ QScriptValue ret = fun.call(QScriptValue(), array);
+ QVERIFY(!eng.hasUncaughtException());
+ QCOMPARE(ret.isError(), false);
+ QCOMPARE(ret.property(0).strictlyEquals(array.property(0)), true);
+ QCOMPARE(ret.property(1).strictlyEquals(array.property(1)), true);
+ QCOMPARE(ret.property(2).strictlyEquals(array.property(2)), true);
+ // call with arguments object as arguments
+ QScriptValue ret2 = fun.call(QScriptValue(), ret);
+ QCOMPARE(ret2.isError(), false);
+ QCOMPARE(ret2.property(0).strictlyEquals(ret.property(0)), true);
+ QCOMPARE(ret2.property(1).strictlyEquals(ret.property(1)), true);
+ QCOMPARE(ret2.property(2).strictlyEquals(ret.property(2)), true);
+ // call with null as arguments
+ QScriptValue ret3 = fun.call(QScriptValue(), eng.nullValue());
+ QCOMPARE(ret3.isError(), false);
+ QCOMPARE(ret3.property("length").isNumber(), true);
+ QCOMPARE(ret3.property("length").toNumber(), 0.0);
+ // call with undefined as arguments
+ QScriptValue ret4 = fun.call(QScriptValue(), eng.undefinedValue());
+ QCOMPARE(ret4.isError(), false);
+ QCOMPARE(ret4.property("length").isNumber(), true);
+ QCOMPARE(ret4.property("length").toNumber(), 0.0);
+ // call with something else as arguments
+ QScriptValue ret5 = fun.call(QScriptValue(), QScriptValue(&eng, 123.0));
+ QCOMPARE(ret5.isError(), true);
+ // call with a non-array object as arguments
+ QScriptValue ret6 = fun.call(QScriptValue(), eng.globalObject());
+ QVERIFY(ret6.isError());
+ QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array"));
+}
- {
- QScriptEngine otherEngine;
- QScriptValue fun = otherEngine.evaluate("(function() { return 1; })");
- QVERIFY(fun.isFunction());
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::call() failed: "
- "cannot call function with thisObject created in "
- "a different engine");
- QCOMPARE(fun.call(Object).isValid(), false);
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::call() failed: "
- "cannot call function with argument created in "
- "a different engine");
- QCOMPARE(fun.call(QScriptValue(), QScriptValueList() << QScriptValue(&eng, 123)).isValid(), false);
- }
- {
- QScriptValue fun = eng.evaluate("(function() { return arguments; })");
- QVERIFY(fun.isFunction());
- QScriptValue array = eng.newArray(3);
- array.setProperty(0, QScriptValue(&eng, 123.0));
- array.setProperty(1, QScriptValue(&eng, 456.0));
- array.setProperty(2, QScriptValue(&eng, 789.0));
- // call with single array object as arguments
- QScriptValue ret = fun.call(QScriptValue(), array);
- QVERIFY(!eng.hasUncaughtException());
- QCOMPARE(ret.isError(), false);
- QCOMPARE(ret.property(0).strictlyEquals(array.property(0)), true);
- QCOMPARE(ret.property(1).strictlyEquals(array.property(1)), true);
- QCOMPARE(ret.property(2).strictlyEquals(array.property(2)), true);
- // call with arguments object as arguments
- QScriptValue ret2 = fun.call(QScriptValue(), ret);
- QCOMPARE(ret2.isError(), false);
- QCOMPARE(ret2.property(0).strictlyEquals(ret.property(0)), true);
- QCOMPARE(ret2.property(1).strictlyEquals(ret.property(1)), true);
- QCOMPARE(ret2.property(2).strictlyEquals(ret.property(2)), true);
- // call with null as arguments
- QScriptValue ret3 = fun.call(QScriptValue(), eng.nullValue());
- QCOMPARE(ret3.isError(), false);
- QCOMPARE(ret3.property("length").isNumber(), true);
- QCOMPARE(ret3.property("length").toNumber(), 0.0);
- // call with undefined as arguments
- QScriptValue ret4 = fun.call(QScriptValue(), eng.undefinedValue());
- QCOMPARE(ret4.isError(), false);
- QCOMPARE(ret4.property("length").isNumber(), true);
- QCOMPARE(ret4.property("length").toNumber(), 0.0);
- // call with something else as arguments
- QScriptValue ret5 = fun.call(QScriptValue(), QScriptValue(&eng, 123.0));
- QCOMPARE(ret5.isError(), true);
- // call with a non-array object as arguments
- QScriptValue ret6 = fun.call(QScriptValue(), eng.globalObject());
- QVERIFY(ret6.isError());
- QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array"));
- }
+void tst_QScriptValue::call_nonFunction_data()
+{
+ newEngine();
+ QTest::addColumn<QScriptValue>("value");
+
+ QTest::newRow("invalid") << QScriptValue();
+ QTest::newRow("bool") << QScriptValue(false);
+ QTest::newRow("int") << QScriptValue(123);
+ QTest::newRow("string") << QScriptValue(QString::fromLatin1("ciao"));
+ QTest::newRow("undefined") << QScriptValue(QScriptValue::UndefinedValue);
+ QTest::newRow("null") << QScriptValue(QScriptValue::NullValue);
+
+ QTest::newRow("bool bound") << QScriptValue(engine, false);
+ QTest::newRow("int bound") << QScriptValue(engine, 123);
+ QTest::newRow("string bound") << QScriptValue(engine, QString::fromLatin1("ciao"));
+ QTest::newRow("undefined bound") << engine->undefinedValue();
+ QTest::newRow("null bound") << engine->nullValue();
+}
+void tst_QScriptValue::call_nonFunction()
+{
// calling things that are not functions
- QVERIFY(!QScriptValue(false).call().isValid());
- QVERIFY(!QScriptValue(123).call().isValid());
- QVERIFY(!QScriptValue(QString::fromLatin1("ciao")).call().isValid());
- QVERIFY(!QScriptValue(QScriptValue::UndefinedValue).call().isValid());
- QVERIFY(!QScriptValue(QScriptValue::NullValue).call().isValid());
+ QFETCH(QScriptValue, value);
+ QVERIFY(!value.call().isValid());
}
static QScriptValue ctorReturningUndefined(QScriptContext *ctx, QScriptEngine *)
@@ -2629,127 +2951,169 @@ static QScriptValue ctorReturningNewObject(QScriptContext *, QScriptEngine *eng)
return result;
}
-void tst_QScriptValue::construct()
+void tst_QScriptValue::construct_nonFunction_data()
+{
+ newEngine();
+ QTest::addColumn<QScriptValue>("value");
+
+ QTest::newRow("invalid") << QScriptValue();
+ QTest::newRow("bool") << QScriptValue(false);
+ QTest::newRow("int") << QScriptValue(123);
+ QTest::newRow("string") << QScriptValue(QString::fromLatin1("ciao"));
+ QTest::newRow("undefined") << QScriptValue(QScriptValue::UndefinedValue);
+ QTest::newRow("null") << QScriptValue(QScriptValue::NullValue);
+
+ QTest::newRow("bool bound") << QScriptValue(engine, false);
+ QTest::newRow("int bound") << QScriptValue(engine, 123);
+ QTest::newRow("string bound") << QScriptValue(engine, QString::fromLatin1("ciao"));
+ QTest::newRow("undefined bound") << engine->undefinedValue();
+ QTest::newRow("null bound") << engine->nullValue();
+}
+
+void tst_QScriptValue::construct_nonFunction()
+{
+ QFETCH(QScriptValue, value);
+ QVERIFY(!value.construct().isValid());
+}
+
+void tst_QScriptValue::construct_simple()
{
QScriptEngine eng;
+ QScriptValue fun = eng.evaluate("(function () { this.foo = 123; })");
+ QVERIFY(fun.isFunction());
+ QScriptValue ret = fun.construct();
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.instanceOf(fun));
+ QCOMPARE(ret.property("foo").toInt32(), 123);
+}
- {
- QScriptValue fun = eng.evaluate("(function () { this.foo = 123; })");
- QVERIFY(fun.isFunction());
- QScriptValue ret = fun.construct();
- QVERIFY(ret.isObject());
- QVERIFY(ret.instanceOf(fun));
- QCOMPARE(ret.property("foo").toInt32(), 123);
- }
+void tst_QScriptValue::construct_newObjectJS()
+{
+ QScriptEngine eng;
// returning a different object overrides the default-constructed one
- {
- QScriptValue fun = eng.evaluate("(function () { return { bar: 456 }; })");
- QVERIFY(fun.isFunction());
- QScriptValue ret = fun.construct();
- QVERIFY(ret.isObject());
- QVERIFY(!ret.instanceOf(fun));
- QCOMPARE(ret.property("bar").toInt32(), 456);
- }
+ QScriptValue fun = eng.evaluate("(function () { return { bar: 456 }; })");
+ QVERIFY(fun.isFunction());
+ QScriptValue ret = fun.construct();
+ QVERIFY(ret.isObject());
+ QVERIFY(!ret.instanceOf(fun));
+ QCOMPARE(ret.property("bar").toInt32(), 456);
+}
- {
- QScriptValue fun = eng.newFunction(ctorReturningUndefined);
- QScriptValue ret = fun.construct();
- QVERIFY(ret.isObject());
- QVERIFY(ret.instanceOf(fun));
- QCOMPARE(ret.property("foo").toInt32(), 123);
- }
- {
- QScriptValue fun = eng.newFunction(ctorReturningNewObject);
- QScriptValue ret = fun.construct();
- QVERIFY(ret.isObject());
- QVERIFY(!ret.instanceOf(fun));
- QCOMPARE(ret.property("bar").toInt32(), 456);
- }
+void tst_QScriptValue::construct_undefined()
+{
+ QScriptEngine eng;
+ QScriptValue fun = eng.newFunction(ctorReturningUndefined);
+ QScriptValue ret = fun.construct();
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.instanceOf(fun));
+ QCOMPARE(ret.property("foo").toInt32(), 123);
+}
+void tst_QScriptValue::construct_newObjectCpp()
+{
+ QScriptEngine eng;
+ QScriptValue fun = eng.newFunction(ctorReturningNewObject);
+ QScriptValue ret = fun.construct();
+ QVERIFY(ret.isObject());
+ QVERIFY(!ret.instanceOf(fun));
+ QCOMPARE(ret.property("bar").toInt32(), 456);
+}
+
+void tst_QScriptValue::construct_arg()
+{
+ QScriptEngine eng;
QScriptValue Number = eng.evaluate("Number");
QCOMPARE(Number.isFunction(), true);
- {
- QScriptValueList args;
- args << QScriptValue(&eng, 123);
- QScriptValue ret = Number.construct(args);
- QCOMPARE(ret.isObject(), true);
- QCOMPARE(ret.toNumber(), args.at(0).toNumber());
- }
+ QScriptValueList args;
+ args << QScriptValue(&eng, 123);
+ QScriptValue ret = Number.construct(args);
+ QCOMPARE(ret.isObject(), true);
+ QCOMPARE(ret.toNumber(), args.at(0).toNumber());
+}
+void tst_QScriptValue::construct_proto()
+{
+ QScriptEngine eng;
// test that internal prototype is set correctly
- {
- QScriptValue fun = eng.evaluate("(function() { return this.__proto__; })");
- QCOMPARE(fun.isFunction(), true);
- QCOMPARE(fun.property("prototype").isObject(), true);
- QScriptValue ret = fun.construct();
- QCOMPARE(fun.property("prototype").strictlyEquals(ret), true);
- }
+ QScriptValue fun = eng.evaluate("(function() { return this.__proto__; })");
+ QCOMPARE(fun.isFunction(), true);
+ QCOMPARE(fun.property("prototype").isObject(), true);
+ QScriptValue ret = fun.construct();
+ QCOMPARE(fun.property("prototype").strictlyEquals(ret), true);
+}
+void tst_QScriptValue::construct_returnInt()
+{
+ QScriptEngine eng;
// test that we return the new object even if a non-object value is returned from the function
- {
- QScriptValue fun = eng.evaluate("(function() { return 123; })");
- QCOMPARE(fun.isFunction(), true);
- QScriptValue ret = fun.construct();
- QCOMPARE(ret.isObject(), true);
- }
+ QScriptValue fun = eng.evaluate("(function() { return 123; })");
+ QCOMPARE(fun.isFunction(), true);
+ QScriptValue ret = fun.construct();
+ QCOMPARE(ret.isObject(), true);
+}
- {
- QScriptValue fun = eng.evaluate("(function() { throw new Error('foo'); })");
- QCOMPARE(fun.isFunction(), true);
- QScriptValue ret = fun.construct();
- QCOMPARE(ret.isError(), true);
- QCOMPARE(eng.hasUncaughtException(), true);
- QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
- }
+void tst_QScriptValue::construct_throw()
+{
+ QScriptEngine eng;
+ QScriptValue fun = eng.evaluate("(function() { throw new Error('foo'); })");
+ QCOMPARE(fun.isFunction(), true);
+ QScriptValue ret = fun.construct();
+ QCOMPARE(ret.isError(), true);
+ QCOMPARE(eng.hasUncaughtException(), true);
+ QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
+}
- QScriptValue inv;
- QCOMPARE(inv.construct().isValid(), false);
+void tst_QScriptValue::construct()
+{
+ QScriptEngine eng;
+ QScriptValue fun = eng.evaluate("(function() { return arguments; })");
+ QVERIFY(fun.isFunction());
+ QScriptValue array = eng.newArray(3);
+ array.setProperty(0, QScriptValue(&eng, 123.0));
+ array.setProperty(1, QScriptValue(&eng, 456.0));
+ array.setProperty(2, QScriptValue(&eng, 789.0));
+ // construct with single array object as arguments
+ QScriptValue ret = fun.construct(array);
+ QVERIFY(!eng.hasUncaughtException());
+ QVERIFY(ret.isValid());
+ QVERIFY(ret.isObject());
+ QCOMPARE(ret.property(0).strictlyEquals(array.property(0)), true);
+ QCOMPARE(ret.property(1).strictlyEquals(array.property(1)), true);
+ QCOMPARE(ret.property(2).strictlyEquals(array.property(2)), true);
+ // construct with arguments object as arguments
+ QScriptValue ret2 = fun.construct(ret);
+ QCOMPARE(ret2.property(0).strictlyEquals(ret.property(0)), true);
+ QCOMPARE(ret2.property(1).strictlyEquals(ret.property(1)), true);
+ QCOMPARE(ret2.property(2).strictlyEquals(ret.property(2)), true);
+ // construct with null as arguments
+ QScriptValue ret3 = fun.construct(eng.nullValue());
+ QCOMPARE(ret3.isError(), false);
+ QCOMPARE(ret3.property("length").isNumber(), true);
+ QCOMPARE(ret3.property("length").toNumber(), 0.0);
+ // construct with undefined as arguments
+ QScriptValue ret4 = fun.construct(eng.undefinedValue());
+ QCOMPARE(ret4.isError(), false);
+ QCOMPARE(ret4.property("length").isNumber(), true);
+ QCOMPARE(ret4.property("length").toNumber(), 0.0);
+ // construct with something else as arguments
+ QScriptValue ret5 = fun.construct(QScriptValue(&eng, 123.0));
+ QCOMPARE(ret5.isError(), true);
+ // construct with a non-array object as arguments
+ QScriptValue ret6 = fun.construct(eng.globalObject());
+ QVERIFY(ret6.isError());
+ QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array"));
+}
- {
- QScriptValue fun = eng.evaluate("(function() { return arguments; })");
- QVERIFY(fun.isFunction());
- QScriptValue array = eng.newArray(3);
- array.setProperty(0, QScriptValue(&eng, 123.0));
- array.setProperty(1, QScriptValue(&eng, 456.0));
- array.setProperty(2, QScriptValue(&eng, 789.0));
- // construct with single array object as arguments
- QScriptValue ret = fun.construct(array);
- QVERIFY(!eng.hasUncaughtException());
- QVERIFY(ret.isValid());
- QVERIFY(ret.isObject());
- QCOMPARE(ret.property(0).strictlyEquals(array.property(0)), true);
- QCOMPARE(ret.property(1).strictlyEquals(array.property(1)), true);
- QCOMPARE(ret.property(2).strictlyEquals(array.property(2)), true);
- // construct with arguments object as arguments
- QScriptValue ret2 = fun.construct(ret);
- QCOMPARE(ret2.property(0).strictlyEquals(ret.property(0)), true);
- QCOMPARE(ret2.property(1).strictlyEquals(ret.property(1)), true);
- QCOMPARE(ret2.property(2).strictlyEquals(ret.property(2)), true);
- // construct with null as arguments
- QScriptValue ret3 = fun.construct(eng.nullValue());
- QCOMPARE(ret3.isError(), false);
- QCOMPARE(ret3.property("length").isNumber(), true);
- QCOMPARE(ret3.property("length").toNumber(), 0.0);
- // construct with undefined as arguments
- QScriptValue ret4 = fun.construct(eng.undefinedValue());
- QCOMPARE(ret4.isError(), false);
- QCOMPARE(ret4.property("length").isNumber(), true);
- QCOMPARE(ret4.property("length").toNumber(), 0.0);
- // construct with something else as arguments
- QScriptValue ret5 = fun.construct(QScriptValue(&eng, 123.0));
- QCOMPARE(ret5.isError(), true);
- // construct with a non-array object as arguments
- QScriptValue ret6 = fun.construct(eng.globalObject());
- QVERIFY(ret6.isError());
- QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array"));
- }
-
- // construct on things that are not functions
- QVERIFY(!QScriptValue(false).construct().isValid());
- QVERIFY(!QScriptValue(123).construct().isValid());
- QVERIFY(!QScriptValue(QString::fromLatin1("ciao")).construct().isValid());
- QVERIFY(!QScriptValue(QScriptValue::UndefinedValue).construct().isValid());
- QVERIFY(!QScriptValue(QScriptValue::NullValue).construct().isValid());
+void tst_QScriptValue::construct_twoEngines()
+{
+ QScriptEngine engine;
+ QScriptEngine otherEngine;
+ QScriptValue ctor = engine.evaluate("(function (a, b) { this.foo = 123; })");
+ QScriptValue arg(&otherEngine, 124567);
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::construct() failed: cannot construct function with argument created in a different engine");
+ QVERIFY(!ctor.construct(arg).isValid());
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::construct() failed: cannot construct function with argument created in a different engine");
+ QVERIFY(!ctor.construct(QScriptValueList() << arg << otherEngine.newObject()).isValid());
}
void tst_QScriptValue::construct_constructorThrowsPrimitive()
@@ -2777,7 +3141,7 @@ void tst_QScriptValue::construct_constructorThrowsPrimitive()
}
}
-void tst_QScriptValue::lessThan_old()
+void tst_QScriptValue::lessThan()
{
QScriptEngine eng;
@@ -2871,7 +3235,7 @@ void tst_QScriptValue::lessThan_old()
QCOMPARE(date1.lessThan(QScriptValue(&otherEngine, 123)), false);
}
-void tst_QScriptValue::equals_old()
+void tst_QScriptValue::equals()
{
QScriptEngine eng;
@@ -3064,7 +3428,7 @@ void tst_QScriptValue::equals_old()
QCOMPARE(date1.equals(QScriptValue(&otherEngine, 123)), false);
}
-void tst_QScriptValue::strictlyEquals_old()
+void tst_QScriptValue::strictlyEquals()
{
QScriptEngine eng;
@@ -3599,4 +3963,30 @@ void tst_QScriptValue::nestedObjectToVariant()
QCOMPARE(o.toVariant(), expected);
}
+void tst_QScriptValue::propertyFlags_data()
+{
+ QTest::addColumn<QString>("program");
+ QTest::addColumn<uint>("expected");
+
+ QTest::newRow("nothing") << "" << 0u;
+ QTest::newRow("getter") << "o.__defineGetter__('prop', function() { return 'blah' } );\n" << uint(QScriptValue::PropertyGetter);
+ QTest::newRow("setter") << "o.__defineSetter__('prop', function(a) { this.setted_prop2 = a; } );\n" << uint(QScriptValue::PropertySetter);
+ QTest::newRow("getterSetter") << "o.__defineGetter__('prop', function() { return 'ploup' } );\n"
+ "o.__defineSetter__('prop', function(a) { this.setted_prop3 = a; } );\n" << uint(QScriptValue::PropertySetter|QScriptValue::PropertyGetter);
+ QTest::newRow("nothing2") << "o.prop = 'nothing'" << 0u;
+}
+
+void tst_QScriptValue::propertyFlags()
+{
+ QFETCH(QString, program);
+ QFETCH(uint, expected);
+ QScriptEngine eng;
+ eng.evaluate("o = new Object;");
+ eng.evaluate(program);
+ QScriptValue o = eng.evaluate("o");
+
+ QCOMPARE(uint(o.propertyFlags("prop")), expected);
+}
+
+
QTEST_MAIN(tst_QScriptValue)
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.h b/tests/auto/qscriptvalue/tst_qscriptvalue.h
index a452b321d0..c8b72503fc 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.h
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.h
@@ -49,8 +49,6 @@
#include <QtScript/qscriptvalue.h>
#include <QtTest/QtTest>
-#define DEFINE_TEST_VALUE(expr) m_values.insert(QString::fromLatin1(#expr), expr)
-
Q_DECLARE_METATYPE(QVariant)
Q_DECLARE_METATYPE(QScriptValue)
@@ -63,163 +61,115 @@ public:
virtual ~tst_QScriptValue();
private slots:
- // Generated test functions
- void isArray_data();
- void isArray();
-
- void isBool_data();
- void isBool();
+ void toObject();
- void isBoolean_data();
- void isBoolean();
+ void ctor_invalid();
+ void ctor_undefinedWithEngine();
+ void ctor_undefined();
+ void ctor_nullWithEngine();
+ void ctor_null();
+ void ctor_boolWithEngine();
+ void ctor_bool();
+ void ctor_intWithEngine();
+ void ctor_int();
+ void ctor_uintWithEngine();
+ void ctor_uint();
+ void ctor_floatWithEngine();
+ void ctor_float();
+ void ctor_stringWithEngine();
+ void ctor_string();
+ void ctor_copyAndAssignWithEngine();
+ void ctor_copyAndAssign();
+ void ctor_nullEngine();
- void isDate_data();
+ void toString();
+ void toNumber();
+ void toBoolean();
+ void toBool();
+ void toInteger();
+ void toInt32();
+ void toUInt32();
+ void toUInt16();
+ void toVariant();
+ void toQObject_nonQObject_data();
+ void toQObject_nonQObject();
+ void toQObject();
+ void toDateTime();
+ void toRegExp();
+ void instanceOf_twoEngines();
+ void instanceOf();
+ void isArray_data();
+ void isArray();
void isDate();
-
+ void isDate_data();
+ void isError_propertiesOfGlobalObject();
void isError_data();
void isError();
-
- void isFunction_data();
- void isFunction();
-
- void isNull_data();
- void isNull();
-
- void isNumber_data();
- void isNumber();
-
- void isObject_data();
- void isObject();
-
- void isQMetaObject_data();
- void isQMetaObject();
-
- void isQObject_data();
- void isQObject();
-
void isRegExp_data();
void isRegExp();
- void isString_data();
- void isString();
-
- void isUndefined_data();
- void isUndefined();
-
- void isValid_data();
- void isValid();
-
- void isVariant_data();
- void isVariant();
-
- void toBool_data();
- void toBool();
-
- void toBoolean_data();
- void toBoolean();
-
-// void toDateTime_data();
-// void toDateTime();
-
- void toInt32_data();
- void toInt32();
-
- void toInteger_data();
- void toInteger();
-
- void toNumber_data();
- void toNumber();
-
-// void toQMetaObject_data();
-// void toQMetaObject();
-
-// void toQObject_data();
-// void toQObject();
-
-// void toRegExp_data();
-// void toRegExp();
-
- void toString_data();
- void toString();
-
- void toUInt16_data();
- void toUInt16();
-
- void toUInt32_data();
- void toUInt32();
-
-// void toVariant_data();
-// void toVariant();
-
- void equals_data();
+ void lessThan();
void equals();
-
- void strictlyEquals_data();
void strictlyEquals();
- void lessThan_data();
- void lessThan();
-
- void instanceOf_data();
- void instanceOf();
-
- void assignAndCopyConstruct_data();
- void assignAndCopyConstruct();
-
- void qscriptvalue_castQString_data();
- void qscriptvalue_castQString();
-
- void qscriptvalue_castqsreal_data();
- void qscriptvalue_castqsreal();
-
- void qscriptvalue_castbool_data();
- void qscriptvalue_castbool();
-
- void qscriptvalue_castqint32_data();
- void qscriptvalue_castqint32();
-
- void qscriptvalue_castquint32_data();
- void qscriptvalue_castquint32();
-
- void qscriptvalue_castquint16_data();
- void qscriptvalue_castquint16();
-
- // Non-generated test functions
-
- void toObject();
- void ctor();
-
- void toString_old();
- void toNumber_old();
- void toBoolean_old();
- void toBool_old();
- void toInteger_old();
- void toInt32_old();
- void toUInt32_old();
- void toUInt16_old();
- void toVariant_old();
- void toQObject_old();
- void toDateTime_old();
- void toRegExp_old();
- void instanceOf_old();
- void isArray_old();
- void isDate_old();
- void isError_old();
- void isRegExp_old();
-
- void lessThan_old();
- void equals_old();
- void strictlyEquals_old();
-
+ void getSetPrototype_cyclicPrototype();
+ void getSetPrototype_evalCyclicPrototype();
+ void getSetPrototype_eval();
+ void getSetPrototype_invalidPrototype();
+ void getSetPrototype_twoEngines();
+ void getSetPrototype_null();
+ void getSetPrototype_notObjectOrNull();
void getSetPrototype();
void getSetScope();
+ void getSetProperty_HooliganTask162051();
+ void getSetProperty_HooliganTask183072();
+ void getSetProperty_propertyRemoval();
+ void getSetProperty_resolveMode();
+ void getSetProperty_twoEngines();
+ void getSetProperty_gettersAndSetters();
+ void getSetProperty_gettersAndSettersThrowErrorNative();
+ void getSetProperty_gettersAndSettersThrowErrorJS();
+ void getSetProperty_gettersAndSettersOnNative();
+ void getSetProperty_gettersAndSettersOnGlobalObject();
+ void getSetProperty_gettersAndSettersChange();
+ void getSetProperty_array();
void getSetProperty();
void arrayElementGetterSetter();
- void getSetData();
+ void getSetData_objects_data();
+ void getSetData_objects();
+ void getSetData_nonObjects_data();
+ void getSetData_nonObjects();
void setData_QTBUG15144();
- void getSetScriptClass();
+ void getSetScriptClass_emptyClass_data();
+ void getSetScriptClass_emptyClass();
+ void getSetScriptClass_JSObjectFromCpp();
+ void getSetScriptClass_JSObjectFromJS();
+ void getSetScriptClass_QVariant();
+ void getSetScriptClass_QObject();
+ void call_function();
+ void call_object();
+ void call_newObjects();
+ void call_this();
+ void call_arguments();
void call();
+ void call_invalidArguments();
+ void call_invalidReturn();
+ void call_twoEngines();
+ void call_array();
+ void call_nonFunction_data();
+ void call_nonFunction();
+ void construct_nonFunction_data();
+ void construct_nonFunction();
+ void construct_simple();
+ void construct_newObjectJS();
+ void construct_undefined();
+ void construct_newObjectCpp();
+ void construct_arg();
+ void construct_proto();
+ void construct_returnInt();
+ void construct_throw();
void construct();
+ void construct_twoEngines();
void construct_constructorThrowsPrimitive();
void castToPointer();
void prettyPrinter_data();
@@ -229,188 +179,18 @@ private slots:
void objectId();
void nestedObjectToVariant_data();
void nestedObjectToVariant();
+ void propertyFlags_data();
+ void propertyFlags();
-private:
- typedef void (tst_QScriptValue::*InitDataFunction)();
- typedef void (tst_QScriptValue::*DefineDataFunction)(const char *);
- void dataHelper(InitDataFunction init, DefineDataFunction define);
- QTestData &newRow(const char *tag);
-
- typedef void (tst_QScriptValue::*TestFunction)(const char *, const QScriptValue &);
- void testHelper(TestFunction fun);
-
- // Generated functions
-
- void initScriptValues();
-
- void isArray_initData();
- void isArray_makeData(const char *expr);
- void isArray_test(const char *expr, const QScriptValue &value);
-
- void isBool_initData();
- void isBool_makeData(const char *expr);
- void isBool_test(const char *expr, const QScriptValue &value);
-
- void isBoolean_initData();
- void isBoolean_makeData(const char *expr);
- void isBoolean_test(const char *expr, const QScriptValue &value);
-
- void isDate_initData();
- void isDate_makeData(const char *expr);
- void isDate_test(const char *expr, const QScriptValue &value);
-
- void isError_initData();
- void isError_makeData(const char *expr);
- void isError_test(const char *expr, const QScriptValue &value);
-
- void isFunction_initData();
- void isFunction_makeData(const char *expr);
- void isFunction_test(const char *expr, const QScriptValue &value);
-
- void isNull_initData();
- void isNull_makeData(const char *expr);
- void isNull_test(const char *expr, const QScriptValue &value);
-
- void isNumber_initData();
- void isNumber_makeData(const char *expr);
- void isNumber_test(const char *expr, const QScriptValue &value);
-
- void isObject_initData();
- void isObject_makeData(const char *expr);
- void isObject_test(const char *expr, const QScriptValue &value);
-
- void isQMetaObject_initData();
- void isQMetaObject_makeData(const char *expr);
- void isQMetaObject_test(const char *expr, const QScriptValue &value);
-
- void isQObject_initData();
- void isQObject_makeData(const char *expr);
- void isQObject_test(const char *expr, const QScriptValue &value);
-
- void isRegExp_initData();
- void isRegExp_makeData(const char *expr);
- void isRegExp_test(const char *expr, const QScriptValue &value);
-
- void isString_initData();
- void isString_makeData(const char *expr);
- void isString_test(const char *expr, const QScriptValue &value);
-
- void isUndefined_initData();
- void isUndefined_makeData(const char *expr);
- void isUndefined_test(const char *expr, const QScriptValue &value);
-
- void isValid_initData();
- void isValid_makeData(const char *expr);
- void isValid_test(const char *expr, const QScriptValue &value);
-
- void isVariant_initData();
- void isVariant_makeData(const char *expr);
- void isVariant_test(const char *expr, const QScriptValue &value);
-
- void toBool_initData();
- void toBool_makeData(const char *);
- void toBool_test(const char *, const QScriptValue &value);
-
- void toBoolean_initData();
- void toBoolean_makeData(const char *);
- void toBoolean_test(const char *, const QScriptValue &value);
-
- void toDateTime_initData();
- void toDateTime_makeData(const char *);
- void toDateTime_test(const char *, const QScriptValue &value);
-
- void toInt32_initData();
- void toInt32_makeData(const char *);
- void toInt32_test(const char *, const QScriptValue &value);
-
- void toInteger_initData();
- void toInteger_makeData(const char *);
- void toInteger_test(const char *, const QScriptValue &value);
-
- void toNumber_initData();
- void toNumber_makeData(const char *);
- void toNumber_test(const char *, const QScriptValue &value);
-
- void toQMetaObject_initData();
- void toQMetaObject_makeData(const char *);
- void toQMetaObject_test(const char *, const QScriptValue &value);
-
- void toQObject_initData();
- void toQObject_makeData(const char *);
- void toQObject_test(const char *, const QScriptValue &value);
-
- void toRegExp_initData();
- void toRegExp_makeData(const char *);
- void toRegExp_test(const char *, const QScriptValue &value);
-
- void toString_initData();
- void toString_makeData(const char *);
- void toString_test(const char *, const QScriptValue &value);
-
- void toUInt16_initData();
- void toUInt16_makeData(const char *);
- void toUInt16_test(const char *, const QScriptValue &value);
-
- void toUInt32_initData();
- void toUInt32_makeData(const char *);
- void toUInt32_test(const char *, const QScriptValue &value);
-
- void toVariant_initData();
- void toVariant_makeData(const char *);
- void toVariant_test(const char *, const QScriptValue &value);
-
- void equals_initData();
- void equals_makeData(const char *);
- void equals_test(const char *, const QScriptValue &value);
-
- void strictlyEquals_initData();
- void strictlyEquals_makeData(const char *);
- void strictlyEquals_test(const char *, const QScriptValue &value);
-
- void lessThan_initData();
- void lessThan_makeData(const char *);
- void lessThan_test(const char *, const QScriptValue &value);
-
- void instanceOf_initData();
- void instanceOf_makeData(const char *);
- void instanceOf_test(const char *, const QScriptValue &value);
-
- void assignAndCopyConstruct_initData();
- void assignAndCopyConstruct_makeData(const char *);
- void assignAndCopyConstruct_test(const char *, const QScriptValue &value);
-
- void qscriptvalue_castQString_initData();
- void qscriptvalue_castQString_makeData(const char *);
- void qscriptvalue_castQString_test(const char *, const QScriptValue &value);
-
- void qscriptvalue_castqsreal_initData();
- void qscriptvalue_castqsreal_makeData(const char *);
- void qscriptvalue_castqsreal_test(const char *, const QScriptValue &value);
-
- void qscriptvalue_castbool_initData();
- void qscriptvalue_castbool_makeData(const char *);
- void qscriptvalue_castbool_test(const char *, const QScriptValue &value);
-
- void qscriptvalue_castqint32_initData();
- void qscriptvalue_castqint32_makeData(const char *);
- void qscriptvalue_castqint32_test(const char *, const QScriptValue &value);
-
- void qscriptvalue_castquint32_initData();
- void qscriptvalue_castquint32_makeData(const char *);
- void qscriptvalue_castquint32_test(const char *, const QScriptValue &value);
-
- void qscriptvalue_castquint16_initData();
- void qscriptvalue_castquint16_makeData(const char *);
- void qscriptvalue_castquint16_test(const char *, const QScriptValue &value);
private:
+ void newEngine()
+ {
+ if (engine)
+ delete engine;
+ engine = new QScriptEngine();
+ }
QScriptEngine *engine;
- QHash<QString, QScriptValue> m_values;
- QString m_currentExpression;
};
-#define DEFINE_TEST_FUNCTION(name) \
-void tst_QScriptValue::name##_data() { dataHelper(&tst_QScriptValue::name##_initData, &tst_QScriptValue::name##_makeData); } \
-void tst_QScriptValue::name() { testHelper(&tst_QScriptValue::name##_test); }
-
#endif
diff --git a/tests/auto/qscriptvaluegenerated/.gitignore b/tests/auto/qscriptvaluegenerated/.gitignore
new file mode 100644
index 0000000000..f724cb900f
--- /dev/null
+++ b/tests/auto/qscriptvaluegenerated/.gitignore
@@ -0,0 +1 @@
+tst_qscriptvalue
diff --git a/tests/auto/qscriptvaluegenerated/qscriptvaluegenerated.pro b/tests/auto/qscriptvaluegenerated/qscriptvaluegenerated.pro
new file mode 100644
index 0000000000..c3e9912f69
--- /dev/null
+++ b/tests/auto/qscriptvaluegenerated/qscriptvaluegenerated.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+QT = core gui script
+SOURCES += tst_qscriptvalue.cpp
+HEADERS += tst_qscriptvalue.h
+
+# Generated by testgen
+SOURCES += \
+ tst_qscriptvalue_generated_init.cpp \
+ tst_qscriptvalue_generated_cast.cpp \
+ tst_qscriptvalue_generated_comparison.cpp \
+ tst_qscriptvalue_generated_isXXX.cpp \
+ tst_qscriptvalue_generated_toXXX.cpp
+
+win32-msvc* {
+ # With -O2, MSVC takes up to 24 minutes to compile this test!
+ QMAKE_CXXFLAGS_RELEASE -= -O1 -O2
+ QMAKE_CXXFLAGS_RELEASE += -Od
+}
diff --git a/tests/auto/qscriptvalue/testgen/data.txt b/tests/auto/qscriptvaluegenerated/testgen/data.txt
index 73677ec0fb..2cc1229b3f 100644
--- a/tests/auto/qscriptvalue/testgen/data.txt
+++ b/tests/auto/qscriptvaluegenerated/testgen/data.txt
@@ -116,6 +116,11 @@ engine->evaluate("/foo/")
engine->evaluate("new Object()")
engine->evaluate("new Array()")
engine->evaluate("new Error()")
+engine->evaluate("new Boolean(true)")
+engine->evaluate("new Boolean(false)")
+engine->evaluate("new Number(123)")
+engine->evaluate("new RegExp('foo', 'gim')")
+engine->evaluate("new String('ciao')")
engine->evaluate("a = new Object(); a.foo = 22; a.foo")
engine->evaluate("Undefined")
engine->evaluate("Null")
@@ -154,8 +159,9 @@ engine->newArray()
engine->newArray(10)
engine->newDate(QDateTime())
engine->newQMetaObject(&QObject::staticMetaObject)
+engine->newRegExp("foo", "gim")
engine->newVariant(QVariant())
engine->newVariant(QVariant(123))
engine->newVariant(QVariant(false))
engine->newQObject(0)
-engine->newQObject(engine) \ No newline at end of file
+engine->newQObject(engine)
diff --git a/tests/auto/qscriptvalue/testgen/gen.py b/tests/auto/qscriptvaluegenerated/testgen/gen.py
index 7617dac66d..7617dac66d 100755
--- a/tests/auto/qscriptvalue/testgen/gen.py
+++ b/tests/auto/qscriptvaluegenerated/testgen/gen.py
diff --git a/tests/auto/qscriptvalue/testgen/main.cpp b/tests/auto/qscriptvaluegenerated/testgen/main.cpp
index f324c1e69e..f324c1e69e 100644
--- a/tests/auto/qscriptvalue/testgen/main.cpp
+++ b/tests/auto/qscriptvaluegenerated/testgen/main.cpp
diff --git a/tests/auto/qscriptvalue/testgen/testgen.pro b/tests/auto/qscriptvaluegenerated/testgen/testgen.pro
index 47709a811d..47709a811d 100644
--- a/tests/auto/qscriptvalue/testgen/testgen.pro
+++ b/tests/auto/qscriptvaluegenerated/testgen/testgen.pro
diff --git a/tests/auto/qscriptvalue/testgen/testgenerator.cpp b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp
index 2820377528..4d20f895ec 100644
--- a/tests/auto/qscriptvalue/testgen/testgenerator.cpp
+++ b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.cpp
@@ -156,14 +156,14 @@ static QString generateLicence()
static QString generateIsXXXDef(const QString& name, const QList<QString>& list)
{
- static const QString templ("void tst_QScriptValue::%1_initData()\n"\
+ static const QString templ("void tst_QScriptValueGenerated::%1_initData()\n"\
"{\n"\
" QTest::addColumn<bool>(\"expected\");\n"\
" initScriptValues();\n"\
"}\n"\
"\n"\
- "static QString %1_array [] = {%2};\n\n"\
- "void tst_QScriptValue::%1_makeData(const char* expr)\n"\
+ "static QString %1_array[] = {%2};\n\n"\
+ "void tst_QScriptValueGenerated::%1_makeData(const char* expr)\n"\
"{\n"\
" static QSet<QString> %1;\n"\
" if (%1.isEmpty()) {\n"\
@@ -174,7 +174,7 @@ static QString generateIsXXXDef(const QString& name, const QList<QString>& list)
" newRow(expr) << %1.contains(expr);\n"\
"}\n"\
"\n"\
- "void tst_QScriptValue::%1_test(const char*, const QScriptValue& value)\n"\
+ "void tst_QScriptValueGenerated::%1_test(const char*, const QScriptValue& value)\n"\
"{\n"\
" QFETCH(bool, expected);\n"\
" QCOMPARE(value.%1(), expected);\n"\
@@ -193,10 +193,13 @@ static QString generateIsXXXDef(const QString& name, const QList<QString>& list)
QStringList set;
set.reserve(3 * list.count());
foreach(const QString& t, list) {
+ if (!set.isEmpty())
+ set.append("\",");
set.append("\n \"");
set.append(escape(t));
- set.append("\",");
}
+ if (!list.isEmpty())
+ set.append("\"\n");
return result.arg(name, set.join(QString()), QString::number(list.count()));
}
@@ -205,15 +208,15 @@ template<typename T>
static QString generateToXXXDef(const QString& name, const QList<QPair<QString, T> >& list)
{
static const QString templ = "\n"\
- "void tst_QScriptValue::%1_initData()\n"\
+ "void tst_QScriptValueGenerated::%1_initData()\n"\
"{\n"\
" QTest::addColumn<%2>(\"expected\");\n"\
" initScriptValues();\n"\
"}\n"\
"\n"\
- "static QString %1_tagArray [] = {%4};\n\n"\
- "static %2 %1_valueArray [] = {%5};\n\n"\
- "void tst_QScriptValue::%1_makeData(const char* expr)\n"\
+ "static QString %1_tagArray[] = {%4};\n\n"\
+ "static %2 %1_valueArray[] = {%5};\n\n"\
+ "void tst_QScriptValueGenerated::%1_makeData(const char* expr)\n"\
"{\n"\
" static QHash<QString, %2> %1;\n"\
" if (%1.isEmpty()) {\n"\
@@ -224,7 +227,7 @@ static QString generateToXXXDef(const QString& name, const QList<QPair<QString,
" newRow(expr) << %1.value(expr);\n"\
"}\n"\
"\n"\
- "void tst_QScriptValue::%1_test(const char*, const QScriptValue& value)\n"\
+ "void tst_QScriptValueGenerated::%1_test(const char*, const QScriptValue& value)\n"\
"{\n"\
" QFETCH(%2, expected);\n"\
" QCOMPARE(value.%1(), expected);\n"\
@@ -236,19 +239,23 @@ static QString generateToXXXDef(const QString& name, const QList<QPair<QString,
typename QList<QPair<QString, T> >::const_iterator i = list.constBegin();
QStringList tagSet, valueSet;
- tagSet.reserve(list.count());
- valueSet.reserve(list.count());
- int tmp = -1;
- for(; i != list.constEnd(); ++i) {
+ tagSet.reserve(4 * list.count());
+ valueSet.reserve(3 * list.count());
+ for(int lineBreaker = 0; i != list.constEnd(); ++i) {
QPair<QString, T> t = *i;
t.first = escape(t.first);
+ if (!valueSet.isEmpty()) {
+ valueSet.append(QString(","));
+ tagSet.append(QString::fromAscii(","));
+ }
tagSet.append(QString("\n \""));
tagSet.append(t.first);
- tagSet.append(QString::fromAscii("\","));
- if (!((++tmp)%2))
+ tagSet.append(QString::fromAscii("\""));
+ if (!((lineBreaker++)%2))
valueSet.append(QString("\n "));
+ else
+ valueSet.append(QString::fromAscii(" "));
valueSet.append(prepareToInsert<T>(t.second));
- valueSet.append(QString::fromAscii(", "));
}
return result.arg(name,
typeName<T>(),
@@ -262,15 +269,15 @@ template<>
QString generateToXXXDef<qsreal>(const QString& name, const QList<QPair<QString, qsreal> >& list)
{
static const QString templ = "\n"\
- "void tst_QScriptValue::%1_initData()\n"\
+ "void tst_QScriptValueGenerated::%1_initData()\n"\
"{\n"\
" QTest::addColumn<%2>(\"expected\");\n"\
" initScriptValues();\n"\
"}\n"\
"\n"\
- "static QString %1_tagArray [] = {%3};\n"\
- "static %2 %1_valueArray [] = {%4};\n"\
- "void tst_QScriptValue::%1_makeData(const char* expr)\n"\
+ "static QString %1_tagArray[] = {%3};\n"\
+ "static %2 %1_valueArray[] = {%4};\n"\
+ "void tst_QScriptValueGenerated::%1_makeData(const char* expr)\n"\
"{\n"\
" static QHash<QString, %2> %1;\n"\
" if (%1.isEmpty()) {\n"\
@@ -281,7 +288,7 @@ QString generateToXXXDef<qsreal>(const QString& name, const QList<QPair<QString,
" newRow(expr) << %1.value(expr);\n"\
"}\n"\
"\n"\
- "void tst_QScriptValue::%1_test(const char*, const QScriptValue& value)\n"\
+ "void tst_QScriptValueGenerated::%1_test(const char*, const QScriptValue& value)\n"\
"{\n"\
" QFETCH(%2, expected);\n"\
"%666"
@@ -299,20 +306,25 @@ QString generateToXXXDef<qsreal>(const QString& name, const QList<QPair<QString,
QList<QPair<QString, qsreal> >::const_iterator i = list.constBegin();
QStringList tagSet, valueSet;
- tagSet.reserve(list.count());
- valueSet.reserve(list.count());
- int tmp = -1;
- for(; i != list.constEnd(); ++i) {
+ tagSet.reserve(4 * list.count());
+ valueSet.reserve(3 * list.count());
+ for(int lineBreaker = 0; i != list.constEnd(); ++i) {
QPair<QString, qsreal> t = *i;
t.first = escape(t.first);
+ if (!valueSet.isEmpty()) {
+ valueSet.append(QString(","));
+ tagSet.append(QString::fromAscii(","));
+ }
tagSet.append(QString("\n \""));
tagSet.append(t.first);
- tagSet.append(QString::fromAscii("\","));
- if (!((++tmp)%10))
+ tagSet.append(QString::fromAscii("\""));
+ if (!((lineBreaker++)%10))
valueSet.append(QString("\n "));
+ else
+ valueSet.append(QString::fromAscii(" "));
valueSet.append(prepareToInsert<qsreal>(t.second));
- valueSet.append(QString::fromAscii(", "));
}
+
// toInteger shouldn't return NaN, so it would be nice to catch the case.
QString hook;
if (name == "toNumber") {
@@ -334,15 +346,15 @@ template<typename T>
static QString generateCastDef(const QList<QPair<QString, T> >& list)
{
static const QString templ = "\n"\
- "void tst_QScriptValue::qscriptvalue_cast%1_initData()\n"\
+ "void tst_QScriptValueGenerated::qscriptvalue_cast%1_initData()\n"\
"{\n"\
" QTest::addColumn<%1>(\"expected\");\n"\
" initScriptValues();\n"\
"}\n"\
"\n"\
- "static QString qscriptvalue_cast%1_tagArray [] = {%2};\n"\
- "static %1 qscriptvalue_cast%1_valueArray [] = {%3};\n"\
- "void tst_QScriptValue::qscriptvalue_cast%1_makeData(const char* expr)\n"\
+ "static QString qscriptvalue_cast%1_tagArray[] = {%2};\n"\
+ "static %1 qscriptvalue_cast%1_valueArray[] = {%3};\n"\
+ "void tst_QScriptValueGenerated::qscriptvalue_cast%1_makeData(const char* expr)\n"\
"{\n"\
" static QHash<QString, %1> value;\n"\
" if (value.isEmpty()) {\n"\
@@ -353,7 +365,7 @@ static QString generateCastDef(const QList<QPair<QString, T> >& list)
" newRow(expr) << value.value(expr);\n"\
"}\n"\
"\n"\
- "void tst_QScriptValue::qscriptvalue_cast%1_test(const char*, const QScriptValue& value)\n"\
+ "void tst_QScriptValueGenerated::qscriptvalue_cast%1_test(const char*, const QScriptValue& value)\n"\
"{\n"\
" QFETCH(%1, expected);\n"\
" QCOMPARE(qscriptvalue_cast<%1>(value), expected);\n"\
@@ -365,19 +377,23 @@ static QString generateCastDef(const QList<QPair<QString, T> >& list)
typename QList<QPair<QString, T> >::const_iterator i = list.constBegin();
QStringList tagSet, valueSet;
- tagSet.reserve(list.count());
- valueSet.reserve(list.count());
- int tmp = -1;
- for(; i != list.constEnd(); ++i) {
+ tagSet.reserve(4 * list.count());
+ valueSet.reserve(3 * list.count());
+ for(int lineBreaker = 0; i != list.constEnd(); ++i) {
QPair<QString, T> t = *i;
t.first = escape(t.first);
+ if (!valueSet.isEmpty()) {
+ valueSet.append(QString(","));
+ tagSet.append(QString::fromAscii(","));
+ }
tagSet.append(QString("\n \""));
tagSet.append(t.first);
- tagSet.append(QString::fromAscii("\","));
- if (!((++tmp)%2))
+ tagSet.append(QString::fromAscii("\""));
+ if (!((lineBreaker++)%2))
valueSet.append(QString("\n "));
+ else
+ valueSet.append(QString::fromAscii(" "));
valueSet.append(prepareToInsert<T>(t.second));
- valueSet.append(QString::fromAscii(", "));
}
return result.arg(typeName<T>(), tagSet.join(QString()), valueSet.join(QString()), QString::number(list.count()));
}
@@ -386,15 +402,15 @@ template<>
QString generateCastDef<qsreal>(const QList<QPair<QString, qsreal> >& list)
{
static const QString templ = "\n"\
- "void tst_QScriptValue::qscriptvalue_cast%1_initData()\n"\
+ "void tst_QScriptValueGenerated::qscriptvalue_cast%1_initData()\n"\
"{\n"\
" QTest::addColumn<%1>(\"expected\");\n"\
" initScriptValues();\n"\
"}\n"\
"\n"\
- "static QString qscriptvalue_cast%1_tagArray [] = {%2};\n"\
- "static %1 qscriptvalue_cast%1_valueArray [] = {%3};\n"\
- "void tst_QScriptValue::qscriptvalue_cast%1_makeData(const char* expr)\n"\
+ "static QString qscriptvalue_cast%1_tagArray[] = {%2};\n"\
+ "static %1 qscriptvalue_cast%1_valueArray[] = {%3};\n"\
+ "void tst_QScriptValueGenerated::qscriptvalue_cast%1_makeData(const char* expr)\n"\
"{\n"\
" static QHash<QString, %1> value;\n"\
" if (value.isEmpty()) {\n"\
@@ -405,7 +421,7 @@ QString generateCastDef<qsreal>(const QList<QPair<QString, qsreal> >& list)
" newRow(expr) << value.value(expr);\n"\
"}\n"\
"\n"\
- "void tst_QScriptValue::qscriptvalue_cast%1_test(const char*, const QScriptValue& value)\n"\
+ "void tst_QScriptValueGenerated::qscriptvalue_cast%1_test(const char*, const QScriptValue& value)\n"\
"{\n"\
" QFETCH(%1, expected);\n"\
" if (qIsNaN(expected)) {\n"
@@ -427,19 +443,23 @@ QString generateCastDef<qsreal>(const QList<QPair<QString, qsreal> >& list)
QList<QPair<QString, qsreal> >::const_iterator i = list.constBegin();
QStringList tagSet, valueSet;
- tagSet.reserve(list.count());
- valueSet.reserve(list.count());
- int tmp = -1;
- for(; i != list.constEnd(); ++i) {
+ tagSet.reserve(4 * list.count());
+ valueSet.reserve(3 * list.count());
+ for(int lineBreaker = 0; i != list.constEnd(); ++i) {
QPair<QString, qsreal> t = *i;
t.first = escape(t.first);
+ if (!valueSet.isEmpty()) {
+ valueSet.append(QString(","));
+ tagSet.append(QString::fromAscii(","));
+ }
tagSet.append(QString("\n \""));
tagSet.append(t.first);
- tagSet.append(QString::fromAscii("\","));
- if (!((++tmp)%10))
+ tagSet.append(QString::fromAscii("\""));
+ if (!((lineBreaker++)%10))
valueSet.append(QString("\n "));
+ else
+ valueSet.append(QString::fromAscii(" "));
valueSet.append(prepareToInsert<qsreal>(t.second));
- valueSet.append(QString::fromAscii(", "));
}
return result.arg(typeName<qsreal>(),
tagSet.join(QString()),
@@ -450,15 +470,15 @@ QString generateCastDef<qsreal>(const QList<QPair<QString, qsreal> >& list)
static QString generateCompareDef(const QString& comparisionType, const QList<QString> tags)
{
static const QString templ = "\n"\
- "void tst_QScriptValue::%1_initData()\n"\
+ "void tst_QScriptValueGenerated::%1_initData()\n"\
"{\n"\
" QTest::addColumn<QScriptValue>(\"other\");\n"\
" QTest::addColumn<bool>(\"expected\");\n"\
" initScriptValues();\n"\
"}\n"\
"\n"\
- "static QString %1_array [] = {%2};\n\n"\
- "void tst_QScriptValue::%1_makeData(const char *expr)\n"\
+ "static QString %1_array[] = {%2};\n\n"\
+ "void tst_QScriptValueGenerated::%1_makeData(const char *expr)\n"\
"{\n"\
" static QSet<QString> equals;\n"\
" if (equals.isEmpty()) {\n"\
@@ -473,7 +493,7 @@ static QString generateCompareDef(const QString& comparisionType, const QList<QS
" }\n"\
"}\n"\
"\n"\
- "void tst_QScriptValue::%1_test(const char *, const QScriptValue& value)\n"\
+ "void tst_QScriptValueGenerated::%1_test(const char *, const QScriptValue& value)\n"\
"{\n"\
" QFETCH(QScriptValue, other);\n"\
" QFETCH(bool, expected);\n"\
@@ -488,19 +508,23 @@ static QString generateCompareDef(const QString& comparisionType, const QList<QS
QString result = templ;
QStringList set;
- set.reserve(tags.count());
+ set.reserve(4 * tags.count());
foreach(const QString& tmp, tags) {
- set.append("\n \"" + escape(tmp) + "\",");
+ if (!set.isEmpty())
+ set.append(",");
+ set.append("\n \"");
+ set.append(escape(tmp));
+ set.append("\"");
}
return result.arg(comparisionType, set.join(""), QString::number(tags.count()));
}
static QString generateInitDef(const QVector<QString>& allDataTags)
{
- static const QString templ = "void tst_QScriptValue::initScriptValues()\n"\
+ static const QString templ = "void tst_QScriptValueGenerated::initScriptValues()\n"\
"{\n"\
" m_values.clear();\n"\
- " if (engine) \n"\
+ " if (engine)\n"\
" delete engine;\n"\
" engine = new QScriptEngine;\n"\
"%1\n}\n\n";
diff --git a/tests/auto/qscriptvalue/testgen/testgenerator.h b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.h
index be4f79fe84..1c61fc55dd 100644
--- a/tests/auto/qscriptvalue/testgen/testgenerator.h
+++ b/tests/auto/qscriptvaluegenerated/testgen/testgenerator.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp
new file mode 100644
index 0000000000..962a2af14f
--- /dev/null
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.cpp
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include "tst_qscriptvalue.h"
+#include <QtGui/QPushButton>
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+QT_BEGIN_NAMESPACE
+extern bool qt_script_isJITEnabled();
+QT_END_NAMESPACE
+
+tst_QScriptValueGenerated::tst_QScriptValueGenerated()
+ : engine(0)
+{
+}
+
+tst_QScriptValueGenerated::~tst_QScriptValueGenerated()
+{
+ delete engine;
+}
+
+void tst_QScriptValueGenerated::dataHelper(InitDataFunction init, DefineDataFunction define)
+{
+ QTest::addColumn<QString>("__expression__");
+ (this->*init)();
+ QHash<QString,QScriptValue>::const_iterator it;
+ for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) {
+ m_currentExpression = it.key();
+ (this->*define)(it.key().toLatin1());
+ }
+ m_currentExpression = QString();
+}
+
+QTestData &tst_QScriptValueGenerated::newRow(const char *tag)
+{
+ return QTest::newRow(tag) << m_currentExpression;
+}
+
+void tst_QScriptValueGenerated::testHelper(TestFunction fun)
+{
+ QFETCH(QString, __expression__);
+ QScriptValue value = m_values.value(__expression__);
+ (this->*fun)(__expression__.toLatin1(), value);
+}
+
+void tst_QScriptValueGenerated::assignAndCopyConstruct_initData()
+{
+ QTest::addColumn<int>("dummy");
+ initScriptValues();
+}
+
+void tst_QScriptValueGenerated::assignAndCopyConstruct_makeData(const char *expr)
+{
+ newRow(expr) << 0;
+}
+
+void tst_QScriptValueGenerated::assignAndCopyConstruct_test(const char *, const QScriptValue &value)
+{
+ QScriptValue copy(value);
+ QCOMPARE(copy.strictlyEquals(value), !value.isNumber() || !qIsNaN(value.toNumber()));
+ QCOMPARE(copy.engine(), value.engine());
+
+ QScriptValue assigned = copy;
+ QCOMPARE(assigned.strictlyEquals(value), !copy.isNumber() || !qIsNaN(copy.toNumber()));
+ QCOMPARE(assigned.engine(), assigned.engine());
+
+ QScriptValue other(!value.toBool());
+ assigned = other;
+ QVERIFY(!assigned.strictlyEquals(copy));
+ QVERIFY(assigned.strictlyEquals(other));
+ QCOMPARE(assigned.engine(), other.engine());
+}
+
+DEFINE_TEST_FUNCTION(assignAndCopyConstruct)
+
+QTEST_MAIN(tst_QScriptValueGenerated)
diff --git a/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h
new file mode 100644
index 0000000000..8248ef3b42
--- /dev/null
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue.h
@@ -0,0 +1,370 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#ifndef TST_QSCRIPTVALUE_H
+#define TST_QSCRIPTVALUE_H
+
+#include <QtCore/qobject.h>
+#include <QtCore/qnumeric.h>
+#include <QtScript/qscriptclass.h>
+#include <QtScript/qscriptengine.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtTest/QtTest>
+
+#define DEFINE_TEST_VALUE(expr) m_values.insert(QString::fromLatin1(#expr), expr)
+
+Q_DECLARE_METATYPE(QVariant)
+Q_DECLARE_METATYPE(QScriptValue)
+
+class tst_QScriptValueGenerated : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QScriptValueGenerated();
+ virtual ~tst_QScriptValueGenerated();
+
+private slots:
+ // Generated test functions
+ void isArray_data();
+ void isArray();
+
+ void isBool_data();
+ void isBool();
+
+ void isBoolean_data();
+ void isBoolean();
+
+ void isDate_data();
+ void isDate();
+
+ void isError_data();
+ void isError();
+
+ void isFunction_data();
+ void isFunction();
+
+ void isNull_data();
+ void isNull();
+
+ void isNumber_data();
+ void isNumber();
+
+ void isObject_data();
+ void isObject();
+
+ void isQMetaObject_data();
+ void isQMetaObject();
+
+ void isQObject_data();
+ void isQObject();
+
+ void isRegExp_data();
+ void isRegExp();
+
+ void isString_data();
+ void isString();
+
+ void isUndefined_data();
+ void isUndefined();
+
+ void isValid_data();
+ void isValid();
+
+ void isVariant_data();
+ void isVariant();
+
+ void toBool_data();
+ void toBool();
+
+ void toBoolean_data();
+ void toBoolean();
+
+// void toDateTime_data();
+// void toDateTime();
+
+ void toInt32_data();
+ void toInt32();
+
+ void toInteger_data();
+ void toInteger();
+
+ void toNumber_data();
+ void toNumber();
+
+// void toQMetaObject_data();
+// void toQMetaObject();
+
+// void toQObject_data();
+// void toQObject();
+
+// void toRegExp_data();
+// void toRegExp();
+
+ void toString_data();
+ void toString();
+
+ void toUInt16_data();
+ void toUInt16();
+
+ void toUInt32_data();
+ void toUInt32();
+
+// void toVariant_data();
+// void toVariant();
+
+ void equals_data();
+ void equals();
+
+ void strictlyEquals_data();
+ void strictlyEquals();
+
+ void lessThan_data();
+ void lessThan();
+
+ void instanceOf_data();
+ void instanceOf();
+
+ void assignAndCopyConstruct_data();
+ void assignAndCopyConstruct();
+
+ void qscriptvalue_castQString_data();
+ void qscriptvalue_castQString();
+
+ void qscriptvalue_castqsreal_data();
+ void qscriptvalue_castqsreal();
+
+ void qscriptvalue_castbool_data();
+ void qscriptvalue_castbool();
+
+ void qscriptvalue_castqint32_data();
+ void qscriptvalue_castqint32();
+
+ void qscriptvalue_castquint32_data();
+ void qscriptvalue_castquint32();
+
+ void qscriptvalue_castquint16_data();
+ void qscriptvalue_castquint16();
+
+private:
+ typedef void (tst_QScriptValueGenerated::*InitDataFunction)();
+ typedef void (tst_QScriptValueGenerated::*DefineDataFunction)(const char *);
+ void dataHelper(InitDataFunction init, DefineDataFunction define);
+ QTestData &newRow(const char *tag);
+
+ typedef void (tst_QScriptValueGenerated::*TestFunction)(const char *, const QScriptValue &);
+ void testHelper(TestFunction fun);
+
+ // Generated functions
+
+ void initScriptValues();
+
+ void isArray_initData();
+ void isArray_makeData(const char *expr);
+ void isArray_test(const char *expr, const QScriptValue &value);
+
+ void isBool_initData();
+ void isBool_makeData(const char *expr);
+ void isBool_test(const char *expr, const QScriptValue &value);
+
+ void isBoolean_initData();
+ void isBoolean_makeData(const char *expr);
+ void isBoolean_test(const char *expr, const QScriptValue &value);
+
+ void isDate_initData();
+ void isDate_makeData(const char *expr);
+ void isDate_test(const char *expr, const QScriptValue &value);
+
+ void isError_initData();
+ void isError_makeData(const char *expr);
+ void isError_test(const char *expr, const QScriptValue &value);
+
+ void isFunction_initData();
+ void isFunction_makeData(const char *expr);
+ void isFunction_test(const char *expr, const QScriptValue &value);
+
+ void isNull_initData();
+ void isNull_makeData(const char *expr);
+ void isNull_test(const char *expr, const QScriptValue &value);
+
+ void isNumber_initData();
+ void isNumber_makeData(const char *expr);
+ void isNumber_test(const char *expr, const QScriptValue &value);
+
+ void isObject_initData();
+ void isObject_makeData(const char *expr);
+ void isObject_test(const char *expr, const QScriptValue &value);
+
+ void isQMetaObject_initData();
+ void isQMetaObject_makeData(const char *expr);
+ void isQMetaObject_test(const char *expr, const QScriptValue &value);
+
+ void isQObject_initData();
+ void isQObject_makeData(const char *expr);
+ void isQObject_test(const char *expr, const QScriptValue &value);
+
+ void isRegExp_initData();
+ void isRegExp_makeData(const char *expr);
+ void isRegExp_test(const char *expr, const QScriptValue &value);
+
+ void isString_initData();
+ void isString_makeData(const char *expr);
+ void isString_test(const char *expr, const QScriptValue &value);
+
+ void isUndefined_initData();
+ void isUndefined_makeData(const char *expr);
+ void isUndefined_test(const char *expr, const QScriptValue &value);
+
+ void isValid_initData();
+ void isValid_makeData(const char *expr);
+ void isValid_test(const char *expr, const QScriptValue &value);
+
+ void isVariant_initData();
+ void isVariant_makeData(const char *expr);
+ void isVariant_test(const char *expr, const QScriptValue &value);
+
+ void toBool_initData();
+ void toBool_makeData(const char *);
+ void toBool_test(const char *, const QScriptValue &value);
+
+ void toBoolean_initData();
+ void toBoolean_makeData(const char *);
+ void toBoolean_test(const char *, const QScriptValue &value);
+
+ void toDateTime_initData();
+ void toDateTime_makeData(const char *);
+ void toDateTime_test(const char *, const QScriptValue &value);
+
+ void toInt32_initData();
+ void toInt32_makeData(const char *);
+ void toInt32_test(const char *, const QScriptValue &value);
+
+ void toInteger_initData();
+ void toInteger_makeData(const char *);
+ void toInteger_test(const char *, const QScriptValue &value);
+
+ void toNumber_initData();
+ void toNumber_makeData(const char *);
+ void toNumber_test(const char *, const QScriptValue &value);
+
+ void toQMetaObject_initData();
+ void toQMetaObject_makeData(const char *);
+ void toQMetaObject_test(const char *, const QScriptValue &value);
+
+ void toQObject_initData();
+ void toQObject_makeData(const char *);
+ void toQObject_test(const char *, const QScriptValue &value);
+
+ void toRegExp_initData();
+ void toRegExp_makeData(const char *);
+ void toRegExp_test(const char *, const QScriptValue &value);
+
+ void toString_initData();
+ void toString_makeData(const char *);
+ void toString_test(const char *, const QScriptValue &value);
+
+ void toUInt16_initData();
+ void toUInt16_makeData(const char *);
+ void toUInt16_test(const char *, const QScriptValue &value);
+
+ void toUInt32_initData();
+ void toUInt32_makeData(const char *);
+ void toUInt32_test(const char *, const QScriptValue &value);
+
+ void toVariant_initData();
+ void toVariant_makeData(const char *);
+ void toVariant_test(const char *, const QScriptValue &value);
+
+ void equals_initData();
+ void equals_makeData(const char *);
+ void equals_test(const char *, const QScriptValue &value);
+
+ void strictlyEquals_initData();
+ void strictlyEquals_makeData(const char *);
+ void strictlyEquals_test(const char *, const QScriptValue &value);
+
+ void lessThan_initData();
+ void lessThan_makeData(const char *);
+ void lessThan_test(const char *, const QScriptValue &value);
+
+ void instanceOf_initData();
+ void instanceOf_makeData(const char *);
+ void instanceOf_test(const char *, const QScriptValue &value);
+
+ void assignAndCopyConstruct_initData();
+ void assignAndCopyConstruct_makeData(const char *);
+ void assignAndCopyConstruct_test(const char *, const QScriptValue &value);
+
+ void qscriptvalue_castQString_initData();
+ void qscriptvalue_castQString_makeData(const char *);
+ void qscriptvalue_castQString_test(const char *, const QScriptValue &value);
+
+ void qscriptvalue_castqsreal_initData();
+ void qscriptvalue_castqsreal_makeData(const char *);
+ void qscriptvalue_castqsreal_test(const char *, const QScriptValue &value);
+
+ void qscriptvalue_castbool_initData();
+ void qscriptvalue_castbool_makeData(const char *);
+ void qscriptvalue_castbool_test(const char *, const QScriptValue &value);
+
+ void qscriptvalue_castqint32_initData();
+ void qscriptvalue_castqint32_makeData(const char *);
+ void qscriptvalue_castqint32_test(const char *, const QScriptValue &value);
+
+ void qscriptvalue_castquint32_initData();
+ void qscriptvalue_castquint32_makeData(const char *);
+ void qscriptvalue_castquint32_test(const char *, const QScriptValue &value);
+
+ void qscriptvalue_castquint16_initData();
+ void qscriptvalue_castquint16_makeData(const char *);
+ void qscriptvalue_castquint16_test(const char *, const QScriptValue &value);
+
+private:
+ QScriptEngine *engine;
+ QHash<QString, QScriptValue> m_values;
+ QString m_currentExpression;
+};
+
+#define DEFINE_TEST_FUNCTION(name) \
+void tst_QScriptValueGenerated::name##_data() { dataHelper(&tst_QScriptValueGenerated::name##_initData, &tst_QScriptValueGenerated::name##_makeData); } \
+void tst_QScriptValueGenerated::name() { testHelper(&tst_QScriptValueGenerated::name##_test); }
+
+#endif
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_cast.cpp b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_cast.cpp
index 518fb8eb08..b05884ec4c 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_cast.cpp
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_cast.cpp
@@ -47,13 +47,13 @@
-void tst_QScriptValue::qscriptvalue_castQString_initData()
+void tst_QScriptValueGenerated::qscriptvalue_castQString_initData()
{
QTest::addColumn<QString>("expected");
initScriptValues();
}
-static QString qscriptvalue_castQString_tagArray [] = {
+static QString qscriptvalue_castQString_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -157,6 +157,11 @@ static QString qscriptvalue_castQString_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -191,95 +196,99 @@ static QString qscriptvalue_castQString_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
-static QString qscriptvalue_castQString_valueArray [] = {
- "", "",
- "", "true",
- "false", "122",
- "124", "0",
- "0", "123",
- "6.37e-8", "-6.37e-8",
- "1126240820", "65536",
- "65537", "NaN",
- "NaN", "Infinity",
- "-Infinity", "NaN",
- "Infinity", "-Infinity",
- "ciao", "ciao",
- "", "",
- "0", "123",
- "12.4", "",
- "", "true",
- "false", "122",
- "124", "0",
- "0", "123",
- "6.37e-8", "-6.37e-8",
- "1126240820", "65536",
- "65537", "NaN",
- "NaN", "Infinity",
- "-Infinity", "NaN",
- "Infinity", "-Infinity",
- "ciao", "ciao",
- "", "",
- "0", "123",
- "12.3", "",
- "", "true",
- "false", "122",
- "124", "0",
- "0", "123",
- "6.37e-8", "-6.37e-8",
- "1126240820", "65536",
- "65537", "NaN",
- "NaN", "Infinity",
- "-Infinity", "NaN",
- "Infinity", "-Infinity",
- "ciao", "ciao",
- "", "",
- "0", "123",
- "1.23", "",
- "", "[object Object]",
- "Invalid Date", "",
- "function () {\n [native code]\n}", "Error: Unknown error",
- "function Object() {\n [native code]\n}", "function Array() {\n [native code]\n}",
- "function Number() {\n [native code]\n}", "function Function() {\n [native code]\n}",
- "function () { return 1; }", "function () { return 'ciao'; }",
- "function () { throw new Error('foo'); }", "/foo/",
- "[object Object]", "",
- "Error: Unknown error", "22",
- "ReferenceError: Can't find variable: Undefined", "ReferenceError: Can't find variable: Null",
- "ReferenceError: Can't find variable: True", "ReferenceError: Can't find variable: False",
- "", "",
- "true", "false",
- "122", "124",
- "0", "0",
- "123", "6.37e-8",
- "-6.37e-8", "1126240820",
- "65536", "65537",
- "NaN", "Infinity",
- "-Infinity", "ciao",
- "", "0",
- "123", "12.4",
- "", "",
- "[object Object]", "",
- ",,,,,,,,,", "Invalid Date",
- "[object QMetaObject]", "undefined",
- "123", "false",
- "", "QScriptEngine(name = \"\")", };
-void tst_QScriptValue::qscriptvalue_castQString_makeData(const char* expr)
+ "engine->newQObject(engine)"};
+static QString qscriptvalue_castQString_valueArray[] = {
+ "", "",
+ "", "true",
+ "false", "122",
+ "124", "0",
+ "0", "123",
+ "6.37e-8", "-6.37e-8",
+ "1126240820", "65536",
+ "65537", "NaN",
+ "NaN", "Infinity",
+ "-Infinity", "NaN",
+ "Infinity", "-Infinity",
+ "ciao", "ciao",
+ "", "",
+ "0", "123",
+ "12.4", "",
+ "", "true",
+ "false", "122",
+ "124", "0",
+ "0", "123",
+ "6.37e-8", "-6.37e-8",
+ "1126240820", "65536",
+ "65537", "NaN",
+ "NaN", "Infinity",
+ "-Infinity", "NaN",
+ "Infinity", "-Infinity",
+ "ciao", "ciao",
+ "", "",
+ "0", "123",
+ "12.3", "",
+ "", "true",
+ "false", "122",
+ "124", "0",
+ "0", "123",
+ "6.37e-8", "-6.37e-8",
+ "1126240820", "65536",
+ "65537", "NaN",
+ "NaN", "Infinity",
+ "-Infinity", "NaN",
+ "Infinity", "-Infinity",
+ "ciao", "ciao",
+ "", "",
+ "0", "123",
+ "1.23", "",
+ "", "[object Object]",
+ "Invalid Date", "",
+ "function () {\n [native code]\n}", "Error: Unknown error",
+ "function Object() {\n [native code]\n}", "function Array() {\n [native code]\n}",
+ "function Number() {\n [native code]\n}", "function Function() {\n [native code]\n}",
+ "function () { return 1; }", "function () { return 'ciao'; }",
+ "function () { throw new Error('foo'); }", "/foo/",
+ "[object Object]", "",
+ "Error: Unknown error", "true",
+ "false", "123",
+ "/foo/gim", "ciao",
+ "22", "ReferenceError: Can't find variable: Undefined",
+ "ReferenceError: Can't find variable: Null", "ReferenceError: Can't find variable: True",
+ "ReferenceError: Can't find variable: False", "",
+ "", "true",
+ "false", "122",
+ "124", "0",
+ "0", "123",
+ "6.37e-8", "-6.37e-8",
+ "1126240820", "65536",
+ "65537", "NaN",
+ "Infinity", "-Infinity",
+ "ciao", "",
+ "0", "123",
+ "12.4", "",
+ "", "[object Object]",
+ "", ",,,,,,,,,",
+ "Invalid Date", "[object QMetaObject]",
+ "/foo/gim", "undefined",
+ "123", "false",
+ "", "QScriptEngine(name = \"\")"};
+void tst_QScriptValueGenerated::qscriptvalue_castQString_makeData(const char* expr)
{
static QHash<QString, QString> value;
if (value.isEmpty()) {
- value.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ value.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
value.insert(qscriptvalue_castQString_tagArray[i], qscriptvalue_castQString_valueArray[i]);
}
newRow(expr) << value.value(expr);
}
-void tst_QScriptValue::qscriptvalue_castQString_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::qscriptvalue_castQString_test(const char*, const QScriptValue& value)
{
QFETCH(QString, expected);
QCOMPARE(qscriptvalue_cast<QString>(value), expected);
@@ -289,13 +298,13 @@ void tst_QScriptValue::qscriptvalue_castQString_test(const char*, const QScriptV
DEFINE_TEST_FUNCTION(qscriptvalue_castQString)
-void tst_QScriptValue::qscriptvalue_castqsreal_initData()
+void tst_QScriptValueGenerated::qscriptvalue_castqsreal_initData()
{
QTest::addColumn<qsreal>("expected");
initScriptValues();
}
-static QString qscriptvalue_castqsreal_tagArray [] = {
+static QString qscriptvalue_castqsreal_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -399,6 +408,11 @@ static QString qscriptvalue_castqsreal_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -433,39 +447,40 @@ static QString qscriptvalue_castqsreal_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
-static qsreal qscriptvalue_castqsreal_valueArray [] = {
- 0, qQNaN(), 0, 1, 0, 122, 124, 0, 0, 123,
- 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(),
- qInf(), qInf(), qQNaN(), qQNaN(), 0, 0, 0, 123, 12.4, qQNaN(),
- 0, 1, 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08,
- 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(),
- qQNaN(), qQNaN(), 0, 0, 0, 123, 12.3, qQNaN(), 0, 1,
- 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536,
- 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(), qQNaN(), qQNaN(),
- 0, 0, 0, 123, 1.23, 0, qQNaN(), qQNaN(), qQNaN(), 0,
- qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(),
- qQNaN(), 0, qQNaN(), 22, qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), 0,
- 1, 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820,
- 65536, 65537, qQNaN(), qInf(), qInf(), qQNaN(), 0, 0, 123, 12.4,
- 0, qQNaN(), qQNaN(), 0, qQNaN(), qQNaN(), qQNaN(), qQNaN(), 123, 0,
- 0, qQNaN(), };
-void tst_QScriptValue::qscriptvalue_castqsreal_makeData(const char* expr)
+ "engine->newQObject(engine)"};
+static qsreal qscriptvalue_castqsreal_valueArray[] = {
+ 0, qQNaN(), 0, 1, 0, 122, 124, 0, 0, 123,
+ 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(),
+ qInf(), qInf(), qQNaN(), qQNaN(), 0, 0, 0, 123, 12.4, qQNaN(),
+ 0, 1, 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08,
+ 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(),
+ qQNaN(), qQNaN(), 0, 0, 0, 123, 12.3, qQNaN(), 0, 1,
+ 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536,
+ 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(), qQNaN(), qQNaN(),
+ 0, 0, 0, 123, 1.23, 0, qQNaN(), qQNaN(), qQNaN(), 0,
+ qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(),
+ qQNaN(), 0, qQNaN(), 1, 0, 123, qQNaN(), qQNaN(), 22, qQNaN(),
+ qQNaN(), qQNaN(), qQNaN(), qQNaN(), 0, 1, 0, 122, 124, 0,
+ 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536, 65537, qQNaN(), qInf(), qInf(),
+ qQNaN(), 0, 0, 123, 12.4, 0, qQNaN(), qQNaN(), 0, qQNaN(),
+ qQNaN(), qQNaN(), qQNaN(), qQNaN(), 123, 0, 0, qQNaN()};
+void tst_QScriptValueGenerated::qscriptvalue_castqsreal_makeData(const char* expr)
{
static QHash<QString, qsreal> value;
if (value.isEmpty()) {
- value.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ value.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
value.insert(qscriptvalue_castqsreal_tagArray[i], qscriptvalue_castqsreal_valueArray[i]);
}
newRow(expr) << value.value(expr);
}
-void tst_QScriptValue::qscriptvalue_castqsreal_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::qscriptvalue_castqsreal_test(const char*, const QScriptValue& value)
{
QFETCH(qsreal, expected);
if (qIsNaN(expected)) {
@@ -485,13 +500,13 @@ void tst_QScriptValue::qscriptvalue_castqsreal_test(const char*, const QScriptVa
DEFINE_TEST_FUNCTION(qscriptvalue_castqsreal)
-void tst_QScriptValue::qscriptvalue_castbool_initData()
+void tst_QScriptValueGenerated::qscriptvalue_castbool_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString qscriptvalue_castbool_tagArray [] = {
+static QString qscriptvalue_castbool_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -595,6 +610,11 @@ static QString qscriptvalue_castbool_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -629,95 +649,99 @@ static QString qscriptvalue_castbool_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
-static bool qscriptvalue_castbool_valueArray [] = {
- false, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, true,
- false, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, false,
- true, true,
- false, false,
- true, true,
- true, true,
- true, true,
- false, true,
- true, true,
- false, true,
- true, true,
- false, false,
- true, true,
- true, true,
- true, true,
- true, true,
- false, true, };
-void tst_QScriptValue::qscriptvalue_castbool_makeData(const char* expr)
+ "engine->newQObject(engine)"};
+static bool qscriptvalue_castbool_valueArray[] = {
+ false, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, true,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ true, true,
+ true, false,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ false, true};
+void tst_QScriptValueGenerated::qscriptvalue_castbool_makeData(const char* expr)
{
static QHash<QString, bool> value;
if (value.isEmpty()) {
- value.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ value.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
value.insert(qscriptvalue_castbool_tagArray[i], qscriptvalue_castbool_valueArray[i]);
}
newRow(expr) << value.value(expr);
}
-void tst_QScriptValue::qscriptvalue_castbool_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::qscriptvalue_castbool_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(qscriptvalue_cast<bool>(value), expected);
@@ -727,13 +751,13 @@ void tst_QScriptValue::qscriptvalue_castbool_test(const char*, const QScriptValu
DEFINE_TEST_FUNCTION(qscriptvalue_castbool)
-void tst_QScriptValue::qscriptvalue_castqint32_initData()
+void tst_QScriptValueGenerated::qscriptvalue_castqint32_initData()
{
QTest::addColumn<qint32>("expected");
initScriptValues();
}
-static QString qscriptvalue_castqint32_tagArray [] = {
+static QString qscriptvalue_castqint32_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -837,6 +861,11 @@ static QString qscriptvalue_castqint32_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -871,95 +900,99 @@ static QString qscriptvalue_castqint32_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
-static qint32 qscriptvalue_castqint32_valueArray [] = {
- 0, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 22,
- 0, 0,
- 0, 0,
- 0, 0,
- 1, 0,
- 122, 124,
- 0, 0,
- 123, 0,
- 0, 1126240820,
- 65536, 65537,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 12,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 0,
- 0, 0, };
-void tst_QScriptValue::qscriptvalue_castqint32_makeData(const char* expr)
+ "engine->newQObject(engine)"};
+static qint32 qscriptvalue_castqint32_valueArray[] = {
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 123,
+ 0, 0,
+ 22, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 123, 0,
+ 0, 0};
+void tst_QScriptValueGenerated::qscriptvalue_castqint32_makeData(const char* expr)
{
static QHash<QString, qint32> value;
if (value.isEmpty()) {
- value.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ value.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
value.insert(qscriptvalue_castqint32_tagArray[i], qscriptvalue_castqint32_valueArray[i]);
}
newRow(expr) << value.value(expr);
}
-void tst_QScriptValue::qscriptvalue_castqint32_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::qscriptvalue_castqint32_test(const char*, const QScriptValue& value)
{
QFETCH(qint32, expected);
QCOMPARE(qscriptvalue_cast<qint32>(value), expected);
@@ -969,13 +1002,13 @@ void tst_QScriptValue::qscriptvalue_castqint32_test(const char*, const QScriptVa
DEFINE_TEST_FUNCTION(qscriptvalue_castqint32)
-void tst_QScriptValue::qscriptvalue_castquint32_initData()
+void tst_QScriptValueGenerated::qscriptvalue_castquint32_initData()
{
QTest::addColumn<quint32>("expected");
initScriptValues();
}
-static QString qscriptvalue_castquint32_tagArray [] = {
+static QString qscriptvalue_castquint32_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1079,6 +1112,11 @@ static QString qscriptvalue_castquint32_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -1113,95 +1151,99 @@ static QString qscriptvalue_castquint32_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
-static quint32 qscriptvalue_castquint32_valueArray [] = {
- 0, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 22,
- 0, 0,
- 0, 0,
- 0, 0,
- 1, 0,
- 122, 124,
- 0, 0,
- 123, 0,
- 0, 1126240820,
- 65536, 65537,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 12,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 0,
- 0, 0, };
-void tst_QScriptValue::qscriptvalue_castquint32_makeData(const char* expr)
+ "engine->newQObject(engine)"};
+static quint32 qscriptvalue_castquint32_valueArray[] = {
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 123,
+ 0, 0,
+ 22, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 123, 0,
+ 0, 0};
+void tst_QScriptValueGenerated::qscriptvalue_castquint32_makeData(const char* expr)
{
static QHash<QString, quint32> value;
if (value.isEmpty()) {
- value.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ value.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
value.insert(qscriptvalue_castquint32_tagArray[i], qscriptvalue_castquint32_valueArray[i]);
}
newRow(expr) << value.value(expr);
}
-void tst_QScriptValue::qscriptvalue_castquint32_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::qscriptvalue_castquint32_test(const char*, const QScriptValue& value)
{
QFETCH(quint32, expected);
QCOMPARE(qscriptvalue_cast<quint32>(value), expected);
@@ -1211,13 +1253,13 @@ void tst_QScriptValue::qscriptvalue_castquint32_test(const char*, const QScriptV
DEFINE_TEST_FUNCTION(qscriptvalue_castquint32)
-void tst_QScriptValue::qscriptvalue_castquint16_initData()
+void tst_QScriptValueGenerated::qscriptvalue_castquint16_initData()
{
QTest::addColumn<quint16>("expected");
initScriptValues();
}
-static QString qscriptvalue_castquint16_tagArray [] = {
+static QString qscriptvalue_castquint16_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1321,6 +1363,11 @@ static QString qscriptvalue_castquint16_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -1355,95 +1402,99 @@ static QString qscriptvalue_castquint16_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
-static quint16 qscriptvalue_castquint16_valueArray [] = {
- 0, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 4660, 0,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 4660, 0,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 4660, 0,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 22,
- 0, 0,
- 0, 0,
- 0, 0,
- 1, 0,
- 122, 124,
- 0, 0,
- 123, 0,
- 0, 4660,
- 0, 1,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 12,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 0,
- 0, 0, };
-void tst_QScriptValue::qscriptvalue_castquint16_makeData(const char* expr)
+ "engine->newQObject(engine)"};
+static quint16 qscriptvalue_castquint16_valueArray[] = {
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 4660, 0,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 4660, 0,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 4660, 0,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 123,
+ 0, 0,
+ 22, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 4660, 0,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 123, 0,
+ 0, 0};
+void tst_QScriptValueGenerated::qscriptvalue_castquint16_makeData(const char* expr)
{
static QHash<QString, quint16> value;
if (value.isEmpty()) {
- value.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ value.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
value.insert(qscriptvalue_castquint16_tagArray[i], qscriptvalue_castquint16_valueArray[i]);
}
newRow(expr) << value.value(expr);
}
-void tst_QScriptValue::qscriptvalue_castquint16_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::qscriptvalue_castquint16_test(const char*, const QScriptValue& value)
{
QFETCH(quint16, expected);
QCOMPARE(qscriptvalue_cast<quint16>(value), expected);
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_comparison.cpp
index 6e47f97117..c2759b8c61 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_comparison.cpp
@@ -47,14 +47,14 @@
-void tst_QScriptValue::equals_initData()
+void tst_QScriptValueGenerated::equals_initData()
{
QTest::addColumn<QScriptValue>("other");
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString equals_array [] = {
+static QString equals_array[] = {
"QScriptValue() <=> QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::NullValue)",
@@ -83,6 +83,7 @@ static QString equals_array [] = {
"QScriptValue(true) <=> QScriptValue(true)",
"QScriptValue(true) <=> QScriptValue(0, true)",
"QScriptValue(true) <=> QScriptValue(engine, true)",
+ "QScriptValue(true) <=> engine->evaluate(\"new Boolean(true)\")",
"QScriptValue(true) <=> engine->evaluate(\"true\")",
"QScriptValue(false) <=> QScriptValue(false)",
"QScriptValue(false) <=> QScriptValue(0)",
@@ -105,6 +106,7 @@ static QString equals_array [] = {
"QScriptValue(false) <=> engine->evaluate(\"[]\")",
"QScriptValue(false) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(false) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(false) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(false) <=> engine->evaluate(\"false\")",
"QScriptValue(false) <=> engine->evaluate(\"0\")",
"QScriptValue(false) <=> engine->evaluate(\"0.0\")",
@@ -141,6 +143,7 @@ static QString equals_array [] = {
"QScriptValue(0) <=> engine->evaluate(\"[]\")",
"QScriptValue(0) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(0) <=> engine->evaluate(\"false\")",
"QScriptValue(0) <=> engine->evaluate(\"0\")",
"QScriptValue(0) <=> engine->evaluate(\"0.0\")",
@@ -169,6 +172,7 @@ static QString equals_array [] = {
"QScriptValue(0.0) <=> engine->evaluate(\"[]\")",
"QScriptValue(0.0) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0.0) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0.0) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(0.0) <=> engine->evaluate(\"false\")",
"QScriptValue(0.0) <=> engine->evaluate(\"0\")",
"QScriptValue(0.0) <=> engine->evaluate(\"0.0\")",
@@ -182,6 +186,7 @@ static QString equals_array [] = {
"QScriptValue(123.0) <=> QScriptValue(0, QString(\"123\"))",
"QScriptValue(123.0) <=> QScriptValue(engine, 123.0)",
"QScriptValue(123.0) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(123.0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(123.0) <=> engine->evaluate(\"123.0\")",
"QScriptValue(123.0) <=> engine->evaluate(\"'123'\")",
"QScriptValue(123.0) <=> engine->newVariant(QVariant(123))",
@@ -242,6 +247,7 @@ static QString equals_array [] = {
"QScriptValue(\"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
"QScriptValue(\"ciao\") <=> QScriptValue(engine, \"ciao\")",
"QScriptValue(\"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "QScriptValue(\"ciao\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(\"ciao\") <=> engine->evaluate(\"'ciao'\")",
"QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")",
"QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))",
@@ -249,6 +255,7 @@ static QString equals_array [] = {
"QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
"QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")",
"QScriptValue(QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "QScriptValue(QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")",
"QScriptValue(QString(\"\")) <=> QScriptValue(false)",
"QScriptValue(QString(\"\")) <=> QScriptValue(0)",
@@ -268,6 +275,7 @@ static QString equals_array [] = {
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"[]\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"false\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"0\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"0.0\")",
@@ -292,6 +300,7 @@ static QString equals_array [] = {
"QScriptValue(QString()) <=> engine->evaluate(\"[]\")",
"QScriptValue(QString()) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(QString()) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(QString()) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(QString()) <=> engine->evaluate(\"false\")",
"QScriptValue(QString()) <=> engine->evaluate(\"0\")",
"QScriptValue(QString()) <=> engine->evaluate(\"0.0\")",
@@ -310,6 +319,7 @@ static QString equals_array [] = {
"QScriptValue(QString(\"0\")) <=> QScriptValue(engine, 0)",
"QScriptValue(QString(\"0\")) <=> QScriptValue(engine, 0.0)",
"QScriptValue(QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))",
+ "QScriptValue(QString(\"0\")) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"false\")",
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"0\")",
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"0.0\")",
@@ -321,6 +331,7 @@ static QString equals_array [] = {
"QScriptValue(QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))",
"QScriptValue(QString(\"123\")) <=> QScriptValue(engine, 123.0)",
"QScriptValue(QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(QString(\"123\")) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(QString(\"123\")) <=> engine->evaluate(\"123.0\")",
"QScriptValue(QString(\"123\")) <=> engine->evaluate(\"'123'\")",
"QScriptValue(QString(\"123\")) <=> engine->newVariant(QVariant(123))",
@@ -353,6 +364,7 @@ static QString equals_array [] = {
"QScriptValue(0, true) <=> QScriptValue(true)",
"QScriptValue(0, true) <=> QScriptValue(0, true)",
"QScriptValue(0, true) <=> QScriptValue(engine, true)",
+ "QScriptValue(0, true) <=> engine->evaluate(\"new Boolean(true)\")",
"QScriptValue(0, true) <=> engine->evaluate(\"true\")",
"QScriptValue(0, false) <=> QScriptValue(false)",
"QScriptValue(0, false) <=> QScriptValue(0)",
@@ -375,6 +387,7 @@ static QString equals_array [] = {
"QScriptValue(0, false) <=> engine->evaluate(\"[]\")",
"QScriptValue(0, false) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0, false) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0, false) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(0, false) <=> engine->evaluate(\"false\")",
"QScriptValue(0, false) <=> engine->evaluate(\"0\")",
"QScriptValue(0, false) <=> engine->evaluate(\"0.0\")",
@@ -411,6 +424,7 @@ static QString equals_array [] = {
"QScriptValue(0, 0) <=> engine->evaluate(\"[]\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0, 0) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"false\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"0\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"0.0\")",
@@ -439,6 +453,7 @@ static QString equals_array [] = {
"QScriptValue(0, 0.0) <=> engine->evaluate(\"[]\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0, 0.0) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"false\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"0\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"0.0\")",
@@ -452,6 +467,7 @@ static QString equals_array [] = {
"QScriptValue(0, 123.0) <=> QScriptValue(0, QString(\"123\"))",
"QScriptValue(0, 123.0) <=> QScriptValue(engine, 123.0)",
"QScriptValue(0, 123.0) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(0, 123.0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, 123.0) <=> engine->evaluate(\"123.0\")",
"QScriptValue(0, 123.0) <=> engine->evaluate(\"'123'\")",
"QScriptValue(0, 123.0) <=> engine->newVariant(QVariant(123))",
@@ -512,6 +528,7 @@ static QString equals_array [] = {
"QScriptValue(0, \"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
"QScriptValue(0, \"ciao\") <=> QScriptValue(engine, \"ciao\")",
"QScriptValue(0, \"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "QScriptValue(0, \"ciao\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, \"ciao\") <=> engine->evaluate(\"'ciao'\")",
"QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")",
"QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))",
@@ -519,6 +536,7 @@ static QString equals_array [] = {
"QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
"QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")",
"QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")",
"QScriptValue(0, QString(\"\")) <=> QScriptValue(false)",
"QScriptValue(0, QString(\"\")) <=> QScriptValue(0)",
@@ -538,6 +556,7 @@ static QString equals_array [] = {
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"[]\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"false\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0.0\")",
@@ -562,6 +581,7 @@ static QString equals_array [] = {
"QScriptValue(0, QString()) <=> engine->evaluate(\"[]\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0, QString()) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"false\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"0\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"0.0\")",
@@ -580,6 +600,7 @@ static QString equals_array [] = {
"QScriptValue(0, QString(\"0\")) <=> QScriptValue(engine, 0)",
"QScriptValue(0, QString(\"0\")) <=> QScriptValue(engine, 0.0)",
"QScriptValue(0, QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))",
+ "QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"false\")",
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"0\")",
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"0.0\")",
@@ -591,6 +612,7 @@ static QString equals_array [] = {
"QScriptValue(0, QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))",
"QScriptValue(0, QString(\"123\")) <=> QScriptValue(engine, 123.0)",
"QScriptValue(0, QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"123.0\")",
"QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"'123'\")",
"QScriptValue(0, QString(\"123\")) <=> engine->newVariant(QVariant(123))",
@@ -622,6 +644,7 @@ static QString equals_array [] = {
"QScriptValue(engine, true) <=> QScriptValue(true)",
"QScriptValue(engine, true) <=> QScriptValue(0, true)",
"QScriptValue(engine, true) <=> QScriptValue(engine, true)",
+ "QScriptValue(engine, true) <=> engine->evaluate(\"new Boolean(true)\")",
"QScriptValue(engine, true) <=> engine->evaluate(\"true\")",
"QScriptValue(engine, false) <=> QScriptValue(false)",
"QScriptValue(engine, false) <=> QScriptValue(0)",
@@ -644,6 +667,7 @@ static QString equals_array [] = {
"QScriptValue(engine, false) <=> engine->evaluate(\"[]\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(engine, false) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"false\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"0\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"0.0\")",
@@ -680,6 +704,7 @@ static QString equals_array [] = {
"QScriptValue(engine, 0) <=> engine->evaluate(\"[]\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(engine, 0) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"false\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"0\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"0.0\")",
@@ -708,6 +733,7 @@ static QString equals_array [] = {
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"[]\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(engine, 0.0) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"false\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"0\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"0.0\")",
@@ -721,6 +747,7 @@ static QString equals_array [] = {
"QScriptValue(engine, 123.0) <=> QScriptValue(0, QString(\"123\"))",
"QScriptValue(engine, 123.0) <=> QScriptValue(engine, 123.0)",
"QScriptValue(engine, 123.0) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(engine, 123.0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, 123.0) <=> engine->evaluate(\"123.0\")",
"QScriptValue(engine, 123.0) <=> engine->evaluate(\"'123'\")",
"QScriptValue(engine, 123.0) <=> engine->newVariant(QVariant(123))",
@@ -781,6 +808,7 @@ static QString equals_array [] = {
"QScriptValue(engine, \"ciao\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
"QScriptValue(engine, \"ciao\") <=> QScriptValue(engine, \"ciao\")",
"QScriptValue(engine, \"ciao\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"'ciao'\")",
"QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(\"ciao\")",
"QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(QString::fromLatin1(\"ciao\"))",
@@ -788,6 +816,7 @@ static QString equals_array [] = {
"QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
"QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, \"ciao\")",
"QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, QString::fromLatin1(\"ciao\")) <=> engine->evaluate(\"'ciao'\")",
"QScriptValue(engine, QString(\"\")) <=> QScriptValue(false)",
"QScriptValue(engine, QString(\"\")) <=> QScriptValue(0)",
@@ -807,6 +836,7 @@ static QString equals_array [] = {
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"[]\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"false\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0.0\")",
@@ -831,6 +861,7 @@ static QString equals_array [] = {
"QScriptValue(engine, QString()) <=> engine->evaluate(\"[]\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(engine, QString()) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"false\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"0\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"0.0\")",
@@ -849,6 +880,7 @@ static QString equals_array [] = {
"QScriptValue(engine, QString(\"0\")) <=> QScriptValue(engine, 0)",
"QScriptValue(engine, QString(\"0\")) <=> QScriptValue(engine, 0.0)",
"QScriptValue(engine, QString(\"0\")) <=> QScriptValue(engine, QString(\"0\"))",
+ "QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"new Boolean(false)\")",
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"false\")",
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"0\")",
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"0.0\")",
@@ -860,6 +892,7 @@ static QString equals_array [] = {
"QScriptValue(engine, QString(\"123\")) <=> QScriptValue(0, QString(\"123\"))",
"QScriptValue(engine, QString(\"123\")) <=> QScriptValue(engine, 123.0)",
"QScriptValue(engine, QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"123.0\")",
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"'123'\")",
"QScriptValue(engine, QString(\"123\")) <=> engine->newVariant(QVariant(123))",
@@ -950,6 +983,53 @@ static QString equals_array [] = {
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"0.0\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"''\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(true)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, true)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, true)",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"true\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(false)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0.0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(QString(\"\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(QString())",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(QString(\"0\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, false)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, 0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, 0.0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, QString(\"\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, QString())",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, QString(\"0\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, false)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, 0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, 0.0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, QString(\"\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, QString())",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, QString(\"0\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"false\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"0\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"0.0\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"''\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"'0'\")",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(123.0)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(QString(\"123\"))",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0, 123.0)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0, QString(\"123\"))",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(engine, 123.0)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"123.0\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"'123'\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\") <=> QScriptValue(\"ciao\")",
+ "engine->evaluate(\"new String('ciao')\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))",
+ "engine->evaluate(\"new String('ciao')\") <=> QScriptValue(0, \"ciao\")",
+ "engine->evaluate(\"new String('ciao')\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
+ "engine->evaluate(\"new String('ciao')\") <=> QScriptValue(engine, \"ciao\")",
+ "engine->evaluate(\"new String('ciao')\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"new String('ciao')\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"'ciao'\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"Null\")",
@@ -982,6 +1062,7 @@ static QString equals_array [] = {
"engine->evaluate(\"true\") <=> QScriptValue(true)",
"engine->evaluate(\"true\") <=> QScriptValue(0, true)",
"engine->evaluate(\"true\") <=> QScriptValue(engine, true)",
+ "engine->evaluate(\"true\") <=> engine->evaluate(\"new Boolean(true)\")",
"engine->evaluate(\"true\") <=> engine->evaluate(\"true\")",
"engine->evaluate(\"false\") <=> QScriptValue(false)",
"engine->evaluate(\"false\") <=> QScriptValue(0)",
@@ -1004,6 +1085,7 @@ static QString equals_array [] = {
"engine->evaluate(\"false\") <=> engine->evaluate(\"[]\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"Array.prototype\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"new Array()\")",
+ "engine->evaluate(\"false\") <=> engine->evaluate(\"new Boolean(false)\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"false\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"0\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"0.0\")",
@@ -1040,6 +1122,7 @@ static QString equals_array [] = {
"engine->evaluate(\"0\") <=> engine->evaluate(\"[]\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"Array.prototype\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"new Array()\")",
+ "engine->evaluate(\"0\") <=> engine->evaluate(\"new Boolean(false)\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"false\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"0\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"0.0\")",
@@ -1068,6 +1151,7 @@ static QString equals_array [] = {
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"[]\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"Array.prototype\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"new Array()\")",
+ "engine->evaluate(\"0.0\") <=> engine->evaluate(\"new Boolean(false)\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"false\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"0\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"0.0\")",
@@ -1081,6 +1165,7 @@ static QString equals_array [] = {
"engine->evaluate(\"123.0\") <=> QScriptValue(0, QString(\"123\"))",
"engine->evaluate(\"123.0\") <=> QScriptValue(engine, 123.0)",
"engine->evaluate(\"123.0\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->evaluate(\"123.0\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"123.0\") <=> engine->evaluate(\"123.0\")",
"engine->evaluate(\"123.0\") <=> engine->evaluate(\"'123'\")",
"engine->evaluate(\"123.0\") <=> engine->newVariant(QVariant(123))",
@@ -1124,6 +1209,7 @@ static QString equals_array [] = {
"engine->evaluate(\"'ciao'\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
"engine->evaluate(\"'ciao'\") <=> QScriptValue(engine, \"ciao\")",
"engine->evaluate(\"'ciao'\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"'ciao'\") <=> engine->evaluate(\"'ciao'\")",
"engine->evaluate(\"''\") <=> QScriptValue(false)",
"engine->evaluate(\"''\") <=> QScriptValue(0)",
@@ -1143,6 +1229,7 @@ static QString equals_array [] = {
"engine->evaluate(\"''\") <=> engine->evaluate(\"[]\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"Array.prototype\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"new Array()\")",
+ "engine->evaluate(\"''\") <=> engine->evaluate(\"new Boolean(false)\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"false\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"0\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"0.0\")",
@@ -1161,6 +1248,7 @@ static QString equals_array [] = {
"engine->evaluate(\"'0'\") <=> QScriptValue(engine, 0)",
"engine->evaluate(\"'0'\") <=> QScriptValue(engine, 0.0)",
"engine->evaluate(\"'0'\") <=> QScriptValue(engine, QString(\"0\"))",
+ "engine->evaluate(\"'0'\") <=> engine->evaluate(\"new Boolean(false)\")",
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"false\")",
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"0\")",
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"0.0\")",
@@ -1172,6 +1260,7 @@ static QString equals_array [] = {
"engine->evaluate(\"'123'\") <=> QScriptValue(0, QString(\"123\"))",
"engine->evaluate(\"'123'\") <=> QScriptValue(engine, 123.0)",
"engine->evaluate(\"'123'\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->evaluate(\"'123'\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"'123'\") <=> engine->evaluate(\"123.0\")",
"engine->evaluate(\"'123'\") <=> engine->evaluate(\"'123'\")",
"engine->evaluate(\"'123'\") <=> engine->newVariant(QVariant(123))",
@@ -1225,6 +1314,7 @@ static QString equals_array [] = {
"engine->newArray(10) <=> engine->newArray(10)",
"engine->newDate(QDateTime()) <=> engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant()) <=> engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123)) <=> QScriptValue(123.0)",
"engine->newVariant(QVariant(123)) <=> QScriptValue(QString(\"123\"))",
@@ -1271,14 +1361,14 @@ static QString equals_array [] = {
"engine->newQObject(0) <=> engine->nullValue()",
"engine->newQObject(0) <=> engine->undefinedValue()",
"engine->newQObject(0) <=> engine->newQObject(0)",
- "engine->newQObject(engine) <=> engine->newQObject(engine)",};
+ "engine->newQObject(engine) <=> engine->newQObject(engine)"};
-void tst_QScriptValue::equals_makeData(const char *expr)
+void tst_QScriptValueGenerated::equals_makeData(const char *expr)
{
static QSet<QString> equals;
if (equals.isEmpty()) {
- equals.reserve(1217);
- for (unsigned i = 0; i < 1217; ++i)
+ equals.reserve(1307);
+ for (unsigned i = 0; i < 1307; ++i)
equals.insert(equals_array[i]);
}
QHash<QString, QScriptValue>::const_iterator it;
@@ -1288,7 +1378,7 @@ void tst_QScriptValue::equals_makeData(const char *expr)
}
}
-void tst_QScriptValue::equals_test(const char *, const QScriptValue& value)
+void tst_QScriptValueGenerated::equals_test(const char *, const QScriptValue& value)
{
QFETCH(QScriptValue, other);
QFETCH(bool, expected);
@@ -1298,14 +1388,14 @@ void tst_QScriptValue::equals_test(const char *, const QScriptValue& value)
DEFINE_TEST_FUNCTION(equals)
-void tst_QScriptValue::strictlyEquals_initData()
+void tst_QScriptValueGenerated::strictlyEquals_initData()
{
QTest::addColumn<QScriptValue>("other");
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString strictlyEquals_array [] = {
+static QString strictlyEquals_array[] = {
"QScriptValue() <=> QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)",
@@ -1697,6 +1787,11 @@ static QString strictlyEquals_array [] = {
"engine->evaluate(\"new Object()\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"Null\")",
@@ -1819,6 +1914,7 @@ static QString strictlyEquals_array [] = {
"engine->newArray(10) <=> engine->newArray(10)",
"engine->newDate(QDateTime()) <=> engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant()) <=> engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123)) <=> engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false)) <=> engine->newVariant(QVariant(false))",
@@ -1828,14 +1924,14 @@ static QString strictlyEquals_array [] = {
"engine->newQObject(0) <=> engine->evaluate(\"null\")",
"engine->newQObject(0) <=> engine->nullValue()",
"engine->newQObject(0) <=> engine->newQObject(0)",
- "engine->newQObject(engine) <=> engine->newQObject(engine)",};
+ "engine->newQObject(engine) <=> engine->newQObject(engine)"};
-void tst_QScriptValue::strictlyEquals_makeData(const char *expr)
+void tst_QScriptValueGenerated::strictlyEquals_makeData(const char *expr)
{
static QSet<QString> equals;
if (equals.isEmpty()) {
- equals.reserve(523);
- for (unsigned i = 0; i < 523; ++i)
+ equals.reserve(529);
+ for (unsigned i = 0; i < 529; ++i)
equals.insert(strictlyEquals_array[i]);
}
QHash<QString, QScriptValue>::const_iterator it;
@@ -1845,7 +1941,7 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr)
}
}
-void tst_QScriptValue::strictlyEquals_test(const char *, const QScriptValue& value)
+void tst_QScriptValueGenerated::strictlyEquals_test(const char *, const QScriptValue& value)
{
QFETCH(QScriptValue, other);
QFETCH(bool, expected);
@@ -1855,14 +1951,14 @@ void tst_QScriptValue::strictlyEquals_test(const char *, const QScriptValue& val
DEFINE_TEST_FUNCTION(strictlyEquals)
-void tst_QScriptValue::lessThan_initData()
+void tst_QScriptValueGenerated::lessThan_initData()
{
QTest::addColumn<QScriptValue>("other");
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString lessThan_array [] = {
+static QString lessThan_array[] = {
"QScriptValue(QScriptValue::NullValue) <=> QScriptValue(true)",
"QScriptValue(QScriptValue::NullValue) <=> QScriptValue(int(122))",
"QScriptValue(QScriptValue::NullValue) <=> QScriptValue(uint(124))",
@@ -1899,6 +1995,8 @@ static QString lessThan_array [] = {
"QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"true\")",
"QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"122\")",
@@ -1942,6 +2040,7 @@ static QString lessThan_array [] = {
"QScriptValue(true) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(true) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(true) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(true) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(true) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(true) <=> engine->evaluate(\"122\")",
"QScriptValue(true) <=> engine->evaluate(\"124\")",
@@ -1989,6 +2088,8 @@ static QString lessThan_array [] = {
"QScriptValue(false) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(false) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(false) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(false) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(false) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(false) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(false) <=> engine->evaluate(\"true\")",
"QScriptValue(false) <=> engine->evaluate(\"122\")",
@@ -2026,6 +2127,7 @@ static QString lessThan_array [] = {
"QScriptValue(int(122)) <=> QScriptValue(engine, qInf())",
"QScriptValue(int(122)) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(int(122)) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(int(122)) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(int(122)) <=> engine->evaluate(\"124\")",
"QScriptValue(int(122)) <=> engine->evaluate(\"123.0\")",
"QScriptValue(int(122)) <=> engine->evaluate(\"0x43211234\")",
@@ -2089,6 +2191,8 @@ static QString lessThan_array [] = {
"QScriptValue(0) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(0) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(0) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0) <=> engine->evaluate(\"true\")",
"QScriptValue(0) <=> engine->evaluate(\"122\")",
@@ -2138,6 +2242,8 @@ static QString lessThan_array [] = {
"QScriptValue(0.0) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0.0) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(0.0) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(0.0) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0.0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0.0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0.0) <=> engine->evaluate(\"true\")",
"QScriptValue(0.0) <=> engine->evaluate(\"122\")",
@@ -2207,6 +2313,8 @@ static QString lessThan_array [] = {
"QScriptValue(6.37e-8) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(6.37e-8) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(6.37e-8) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(6.37e-8) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(6.37e-8) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(6.37e-8) <=> engine->evaluate(\"true\")",
"QScriptValue(6.37e-8) <=> engine->evaluate(\"122\")",
@@ -2279,6 +2387,9 @@ static QString lessThan_array [] = {
"QScriptValue(-6.37e-8) <=> engine->evaluate(\"[]\")",
"QScriptValue(-6.37e-8) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(-6.37e-8) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(-6.37e-8) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(-6.37e-8) <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(-6.37e-8) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(-6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(-6.37e-8) <=> engine->evaluate(\"null\")",
"QScriptValue(-6.37e-8) <=> engine->evaluate(\"true\")",
@@ -2398,6 +2509,9 @@ static QString lessThan_array [] = {
"QScriptValue(-qInf()) <=> engine->evaluate(\"[]\")",
"QScriptValue(-qInf()) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(-qInf()) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(-qInf()) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(-qInf()) <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(-qInf()) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(-qInf()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(-qInf()) <=> engine->evaluate(\"null\")",
"QScriptValue(-qInf()) <=> engine->evaluate(\"true\")",
@@ -2438,6 +2552,7 @@ static QString lessThan_array [] = {
"QScriptValue(\"NaN\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"QScriptValue(\"NaN\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(\"NaN\") <=> engine->evaluate(\"new Object()\")",
+ "QScriptValue(\"NaN\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(\"NaN\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(\"NaN\") <=> engine->evaluate(\"Null\")",
"QScriptValue(\"NaN\") <=> engine->evaluate(\"True\")",
@@ -2465,6 +2580,7 @@ static QString lessThan_array [] = {
"QScriptValue(\"Infinity\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"QScriptValue(\"Infinity\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(\"Infinity\") <=> engine->evaluate(\"new Object()\")",
+ "QScriptValue(\"Infinity\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(\"Infinity\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(\"Infinity\") <=> engine->evaluate(\"Null\")",
"QScriptValue(\"Infinity\") <=> engine->evaluate(\"True\")",
@@ -2549,6 +2665,11 @@ static QString lessThan_array [] = {
"QScriptValue(\"-Infinity\") <=> engine->evaluate(\"/foo/\")",
"QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Object()\")",
"QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(\"-Infinity\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(\"-Infinity\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(\"-Infinity\") <=> engine->evaluate(\"Null\")",
@@ -2575,6 +2696,7 @@ static QString lessThan_array [] = {
"QScriptValue(\"-Infinity\") <=> engine->nullValue()",
"QScriptValue(\"-Infinity\") <=> engine->newObject()",
"QScriptValue(\"-Infinity\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(\"-Infinity\") <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(\"-Infinity\") <=> engine->newVariant(QVariant(123))",
"QScriptValue(\"-Infinity\") <=> engine->newVariant(QVariant(false))",
"QScriptValue(\"-Infinity\") <=> engine->newQObject(0)",
@@ -2659,6 +2781,10 @@ static QString lessThan_array [] = {
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"/foo/\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(QString(\"\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(QString(\"\")) <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(QString(\"\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"Null\")",
@@ -2680,6 +2806,7 @@ static QString lessThan_array [] = {
"QScriptValue(QString(\"\")) <=> engine->newObject()",
"QScriptValue(QString(\"\")) <=> engine->newArray(10)",
"QScriptValue(QString(\"\")) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(QString(\"\")) <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(QString(\"\")) <=> engine->newVariant(QVariant(123))",
"QScriptValue(QString(\"\")) <=> engine->newQObject(engine)",
"QScriptValue(QString()) <=> QScriptValue(true)",
@@ -2746,6 +2873,10 @@ static QString lessThan_array [] = {
"QScriptValue(QString()) <=> engine->evaluate(\"/foo/\")",
"QScriptValue(QString()) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(QString()) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(QString()) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(QString()) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(QString()) <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(QString()) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(QString()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(QString()) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(QString()) <=> engine->evaluate(\"Null\")",
@@ -2767,6 +2898,7 @@ static QString lessThan_array [] = {
"QScriptValue(QString()) <=> engine->newObject()",
"QScriptValue(QString()) <=> engine->newArray(10)",
"QScriptValue(QString()) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(QString()) <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(QString()) <=> engine->newVariant(QVariant(123))",
"QScriptValue(QString()) <=> engine->newQObject(engine)",
"QScriptValue(QString(\"0\")) <=> QScriptValue(true)",
@@ -2826,6 +2958,9 @@ static QString lessThan_array [] = {
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(QString(\"0\")) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(QString(\"0\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(QString(\"0\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(QString(\"0\")) <=> engine->evaluate(\"Null\")",
@@ -2886,6 +3021,7 @@ static QString lessThan_array [] = {
"QScriptValue(QString(\"123\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(QString(\"123\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(QString(\"123\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(QString(\"123\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(QString(\"123\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(QString(\"123\")) <=> engine->evaluate(\"Null\")",
"QScriptValue(QString(\"123\")) <=> engine->evaluate(\"True\")",
@@ -2947,6 +3083,8 @@ static QString lessThan_array [] = {
"QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(QString(\"12.4\")) <=> engine->evaluate(\"Null\")",
@@ -3001,6 +3139,8 @@ static QString lessThan_array [] = {
"QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"true\")",
"QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"122\")",
@@ -3044,6 +3184,7 @@ static QString lessThan_array [] = {
"QScriptValue(0, true) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0, true) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(0, true) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(0, true) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, true) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, true) <=> engine->evaluate(\"122\")",
"QScriptValue(0, true) <=> engine->evaluate(\"124\")",
@@ -3091,6 +3232,8 @@ static QString lessThan_array [] = {
"QScriptValue(0, false) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0, false) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(0, false) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(0, false) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, false) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, false) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, false) <=> engine->evaluate(\"true\")",
"QScriptValue(0, false) <=> engine->evaluate(\"122\")",
@@ -3128,6 +3271,7 @@ static QString lessThan_array [] = {
"QScriptValue(0, int(122)) <=> QScriptValue(engine, qInf())",
"QScriptValue(0, int(122)) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0, int(122)) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(0, int(122)) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, int(122)) <=> engine->evaluate(\"124\")",
"QScriptValue(0, int(122)) <=> engine->evaluate(\"123.0\")",
"QScriptValue(0, int(122)) <=> engine->evaluate(\"0x43211234\")",
@@ -3191,6 +3335,8 @@ static QString lessThan_array [] = {
"QScriptValue(0, 0) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0, 0) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(0, 0) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(0, 0) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, 0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"true\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"122\")",
@@ -3240,6 +3386,8 @@ static QString lessThan_array [] = {
"QScriptValue(0, 0.0) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0, 0.0) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(0, 0.0) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(0, 0.0) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, 0.0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"true\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"122\")",
@@ -3309,6 +3457,8 @@ static QString lessThan_array [] = {
"QScriptValue(0, 6.37e-8) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(0, 6.37e-8) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(0, 6.37e-8) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"true\")",
"QScriptValue(0, 6.37e-8) <=> engine->evaluate(\"122\")",
@@ -3381,6 +3531,9 @@ static QString lessThan_array [] = {
"QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"[]\")",
"QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"null\")",
"QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"true\")",
@@ -3500,6 +3653,9 @@ static QString lessThan_array [] = {
"QScriptValue(0, -qInf()) <=> engine->evaluate(\"[]\")",
"QScriptValue(0, -qInf()) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(0, -qInf()) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(0, -qInf()) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, -qInf()) <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(0, -qInf()) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(0, -qInf()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, -qInf()) <=> engine->evaluate(\"null\")",
"QScriptValue(0, -qInf()) <=> engine->evaluate(\"true\")",
@@ -3540,6 +3696,7 @@ static QString lessThan_array [] = {
"QScriptValue(0, \"NaN\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"QScriptValue(0, \"NaN\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(0, \"NaN\") <=> engine->evaluate(\"new Object()\")",
+ "QScriptValue(0, \"NaN\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, \"NaN\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(0, \"NaN\") <=> engine->evaluate(\"Null\")",
"QScriptValue(0, \"NaN\") <=> engine->evaluate(\"True\")",
@@ -3567,6 +3724,7 @@ static QString lessThan_array [] = {
"QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"new Object()\")",
+ "QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"Null\")",
"QScriptValue(0, \"Infinity\") <=> engine->evaluate(\"True\")",
@@ -3651,6 +3809,11 @@ static QString lessThan_array [] = {
"QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"/foo/\")",
"QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Object()\")",
"QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"Null\")",
@@ -3677,6 +3840,7 @@ static QString lessThan_array [] = {
"QScriptValue(0, \"-Infinity\") <=> engine->nullValue()",
"QScriptValue(0, \"-Infinity\") <=> engine->newObject()",
"QScriptValue(0, \"-Infinity\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(0, \"-Infinity\") <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(0, \"-Infinity\") <=> engine->newVariant(QVariant(123))",
"QScriptValue(0, \"-Infinity\") <=> engine->newVariant(QVariant(false))",
"QScriptValue(0, \"-Infinity\") <=> engine->newQObject(0)",
@@ -3761,6 +3925,10 @@ static QString lessThan_array [] = {
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"/foo/\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"Null\")",
@@ -3782,6 +3950,7 @@ static QString lessThan_array [] = {
"QScriptValue(0, QString(\"\")) <=> engine->newObject()",
"QScriptValue(0, QString(\"\")) <=> engine->newArray(10)",
"QScriptValue(0, QString(\"\")) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(0, QString(\"\")) <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(0, QString(\"\")) <=> engine->newVariant(QVariant(123))",
"QScriptValue(0, QString(\"\")) <=> engine->newQObject(engine)",
"QScriptValue(0, QString()) <=> QScriptValue(true)",
@@ -3848,6 +4017,10 @@ static QString lessThan_array [] = {
"QScriptValue(0, QString()) <=> engine->evaluate(\"/foo/\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(0, QString()) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, QString()) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(0, QString()) <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(0, QString()) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"Null\")",
@@ -3869,6 +4042,7 @@ static QString lessThan_array [] = {
"QScriptValue(0, QString()) <=> engine->newObject()",
"QScriptValue(0, QString()) <=> engine->newArray(10)",
"QScriptValue(0, QString()) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(0, QString()) <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(0, QString()) <=> engine->newVariant(QVariant(123))",
"QScriptValue(0, QString()) <=> engine->newQObject(engine)",
"QScriptValue(0, QString(\"0\")) <=> QScriptValue(true)",
@@ -3928,6 +4102,9 @@ static QString lessThan_array [] = {
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(0, QString(\"0\")) <=> engine->evaluate(\"Null\")",
@@ -3988,6 +4165,7 @@ static QString lessThan_array [] = {
"QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"Null\")",
"QScriptValue(0, QString(\"123\")) <=> engine->evaluate(\"True\")",
@@ -4050,6 +4228,8 @@ static QString lessThan_array [] = {
"QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(0, QString(\"12.3\")) <=> engine->evaluate(\"Null\")",
@@ -4105,6 +4285,8 @@ static QString lessThan_array [] = {
"QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"true\")",
"QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"122\")",
@@ -4148,6 +4330,7 @@ static QString lessThan_array [] = {
"QScriptValue(engine, true) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(engine, true) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(engine, true) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(engine, true) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, true) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, true) <=> engine->evaluate(\"122\")",
"QScriptValue(engine, true) <=> engine->evaluate(\"124\")",
@@ -4195,6 +4378,8 @@ static QString lessThan_array [] = {
"QScriptValue(engine, false) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(engine, false) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(engine, false) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(engine, false) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, false) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"true\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"122\")",
@@ -4232,6 +4417,7 @@ static QString lessThan_array [] = {
"QScriptValue(engine, int(122)) <=> QScriptValue(engine, qInf())",
"QScriptValue(engine, int(122)) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(engine, int(122)) <=> QScriptValue(engine, QString(\"123\"))",
+ "QScriptValue(engine, int(122)) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, int(122)) <=> engine->evaluate(\"124\")",
"QScriptValue(engine, int(122)) <=> engine->evaluate(\"123.0\")",
"QScriptValue(engine, int(122)) <=> engine->evaluate(\"0x43211234\")",
@@ -4295,6 +4481,8 @@ static QString lessThan_array [] = {
"QScriptValue(engine, 0) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(engine, 0) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(engine, 0) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(engine, 0) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, 0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"true\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"122\")",
@@ -4344,6 +4532,8 @@ static QString lessThan_array [] = {
"QScriptValue(engine, 0.0) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(engine, 0.0) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(engine, 0.0) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(engine, 0.0) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, 0.0) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"true\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"122\")",
@@ -4413,6 +4603,8 @@ static QString lessThan_array [] = {
"QScriptValue(engine, 6.37e-8) <=> QScriptValue(engine, \"Infinity\")",
"QScriptValue(engine, 6.37e-8) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(engine, 6.37e-8) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"true\")",
"QScriptValue(engine, 6.37e-8) <=> engine->evaluate(\"122\")",
@@ -4485,6 +4677,9 @@ static QString lessThan_array [] = {
"QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"[]\")",
"QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"null\")",
"QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"true\")",
@@ -4604,6 +4799,9 @@ static QString lessThan_array [] = {
"QScriptValue(engine, -qInf()) <=> engine->evaluate(\"[]\")",
"QScriptValue(engine, -qInf()) <=> engine->evaluate(\"Array.prototype\")",
"QScriptValue(engine, -qInf()) <=> engine->evaluate(\"new Array()\")",
+ "QScriptValue(engine, -qInf()) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, -qInf()) <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(engine, -qInf()) <=> engine->evaluate(\"new Number(123)\")",
"QScriptValue(engine, -qInf()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, -qInf()) <=> engine->evaluate(\"null\")",
"QScriptValue(engine, -qInf()) <=> engine->evaluate(\"true\")",
@@ -4644,6 +4842,7 @@ static QString lessThan_array [] = {
"QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"new Object()\")",
+ "QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"Null\")",
"QScriptValue(engine, \"NaN\") <=> engine->evaluate(\"True\")",
@@ -4671,6 +4870,7 @@ static QString lessThan_array [] = {
"QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"new Object()\")",
+ "QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"Null\")",
"QScriptValue(engine, \"Infinity\") <=> engine->evaluate(\"True\")",
@@ -4755,6 +4955,11 @@ static QString lessThan_array [] = {
"QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"/foo/\")",
"QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Object()\")",
"QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Boolean(false)\")",
+ "QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"Undefined\")",
"QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"Null\")",
@@ -4781,6 +4986,7 @@ static QString lessThan_array [] = {
"QScriptValue(engine, \"-Infinity\") <=> engine->nullValue()",
"QScriptValue(engine, \"-Infinity\") <=> engine->newObject()",
"QScriptValue(engine, \"-Infinity\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(engine, \"-Infinity\") <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(engine, \"-Infinity\") <=> engine->newVariant(QVariant(123))",
"QScriptValue(engine, \"-Infinity\") <=> engine->newVariant(QVariant(false))",
"QScriptValue(engine, \"-Infinity\") <=> engine->newQObject(0)",
@@ -4865,6 +5071,10 @@ static QString lessThan_array [] = {
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"/foo/\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"Null\")",
@@ -4886,6 +5096,7 @@ static QString lessThan_array [] = {
"QScriptValue(engine, QString(\"\")) <=> engine->newObject()",
"QScriptValue(engine, QString(\"\")) <=> engine->newArray(10)",
"QScriptValue(engine, QString(\"\")) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(engine, QString(\"\")) <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(engine, QString(\"\")) <=> engine->newVariant(QVariant(123))",
"QScriptValue(engine, QString(\"\")) <=> engine->newQObject(engine)",
"QScriptValue(engine, QString()) <=> QScriptValue(true)",
@@ -4952,6 +5163,10 @@ static QString lessThan_array [] = {
"QScriptValue(engine, QString()) <=> engine->evaluate(\"/foo/\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(engine, QString()) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, QString()) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(engine, QString()) <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "QScriptValue(engine, QString()) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"Null\")",
@@ -4973,6 +5188,7 @@ static QString lessThan_array [] = {
"QScriptValue(engine, QString()) <=> engine->newObject()",
"QScriptValue(engine, QString()) <=> engine->newArray(10)",
"QScriptValue(engine, QString()) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "QScriptValue(engine, QString()) <=> engine->newRegExp(\"foo\", \"gim\")",
"QScriptValue(engine, QString()) <=> engine->newVariant(QVariant(123))",
"QScriptValue(engine, QString()) <=> engine->newQObject(engine)",
"QScriptValue(engine, QString(\"0\")) <=> QScriptValue(true)",
@@ -5032,6 +5248,9 @@ static QString lessThan_array [] = {
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"new Boolean(true)\")",
+ "QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(engine, QString(\"0\")) <=> engine->evaluate(\"Null\")",
@@ -5092,6 +5311,7 @@ static QString lessThan_array [] = {
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"Null\")",
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"True\")",
@@ -5155,6 +5375,8 @@ static QString lessThan_array [] = {
"QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"new Object()\")",
"QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"new Error()\")",
+ "QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"new Number(123)\")",
+ "QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"new String('ciao')\")",
"QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"Undefined\")",
"QScriptValue(engine, QString(\"1.23\")) <=> engine->evaluate(\"Null\")",
@@ -5238,6 +5460,10 @@ static QString lessThan_array [] = {
"engine->evaluate(\"[]\") <=> engine->evaluate(\"/foo/\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"[]\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"[]\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"[]\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"[]\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"Null\")",
@@ -5259,6 +5485,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"[]\") <=> engine->newObject()",
"engine->evaluate(\"[]\") <=> engine->newArray(10)",
"engine->evaluate(\"[]\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->evaluate(\"[]\") <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->evaluate(\"[]\") <=> engine->newVariant(QVariant(123))",
"engine->evaluate(\"[]\") <=> engine->newQObject(engine)",
"engine->evaluate(\"Object.prototype\") <=> QScriptValue(\"ciao\")",
@@ -5275,6 +5502,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
+ "engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"'ciao'\")",
"engine->evaluate(\"Object.prototype\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
"engine->evaluate(\"Array.prototype\") <=> QScriptValue(true)",
@@ -5341,6 +5569,10 @@ static QString lessThan_array [] = {
"engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"/foo/\")",
"engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"Null\")",
@@ -5362,6 +5594,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"Array.prototype\") <=> engine->newObject()",
"engine->evaluate(\"Array.prototype\") <=> engine->newArray(10)",
"engine->evaluate(\"Array.prototype\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->evaluate(\"Array.prototype\") <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->evaluate(\"Array.prototype\") <=> engine->newVariant(QVariant(123))",
"engine->evaluate(\"Array.prototype\") <=> engine->newQObject(engine)",
"engine->evaluate(\"Function.prototype\") <=> engine->evaluate(\"Object\")",
@@ -5393,6 +5626,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"new Object()\")",
+ "engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"Null\")",
"engine->evaluate(\"Error.prototype\") <=> engine->evaluate(\"True\")",
@@ -5455,6 +5689,8 @@ static QString lessThan_array [] = {
"engine->evaluate(\"/foo/\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"/foo/\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"/foo/\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"/foo/\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"/foo/\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"/foo/\") <=> engine->evaluate(\"Null\")",
"engine->evaluate(\"/foo/\") <=> engine->evaluate(\"True\")",
@@ -5465,6 +5701,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"/foo/\") <=> engine->evaluate(\"'12.4'\")",
"engine->evaluate(\"/foo/\") <=> engine->newObject()",
"engine->evaluate(\"/foo/\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->evaluate(\"/foo/\") <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->evaluate(\"/foo/\") <=> engine->newQObject(engine)",
"engine->evaluate(\"new Object()\") <=> QScriptValue(\"ciao\")",
"engine->evaluate(\"new Object()\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))",
@@ -5480,6 +5717,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"new Object()\") <=> engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"new Object()\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"new Object()\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
+ "engine->evaluate(\"new Object()\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"new Object()\") <=> engine->evaluate(\"'ciao'\")",
"engine->evaluate(\"new Object()\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
"engine->evaluate(\"new Array()\") <=> QScriptValue(true)",
@@ -5546,6 +5784,10 @@ static QString lessThan_array [] = {
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Null\")",
@@ -5567,6 +5809,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"new Array()\") <=> engine->newObject()",
"engine->evaluate(\"new Array()\") <=> engine->newArray(10)",
"engine->evaluate(\"new Array()\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->evaluate(\"new Array()\") <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->evaluate(\"new Array()\") <=> engine->newVariant(QVariant(123))",
"engine->evaluate(\"new Array()\") <=> engine->newQObject(engine)",
"engine->evaluate(\"new Error()\") <=> QScriptValue(\"NaN\")",
@@ -5591,6 +5834,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Object()\")",
+ "engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"Null\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"True\")",
@@ -5599,6 +5843,175 @@ static QString lessThan_array [] = {
"engine->evaluate(\"new Error()\") <=> engine->newObject()",
"engine->evaluate(\"new Error()\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
"engine->evaluate(\"new Error()\") <=> engine->newQObject(engine)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(int(122))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(uint(124))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(123.0)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0x43211234)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0x10000)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0x10001)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(qInf())",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(\"Infinity\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(QString(\"123\"))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(QString(\"12.4\"))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, int(122))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, uint(124))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, 123.0)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, 0x43211234)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, 0x10000)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, 0x10001)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, qInf())",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, \"Infinity\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, QString(\"123\"))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(0, QString(\"12.3\"))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, int(122))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, uint(124))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, 123.0)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, 0x43211234)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, 0x10000)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, 0x10001)",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, qInf())",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, \"Infinity\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->evaluate(\"new Boolean(true)\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"122\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"124\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"123.0\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"0x43211234\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"0x10000\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"0x10001\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"Infinity\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"'123'\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"'12.4'\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->newVariant(QVariant(123))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(true)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(int(122))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(uint(124))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(123.0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(6.37e-8)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0x43211234)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0x10000)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0x10001)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(qInf())",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(\"Infinity\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(QString(\"123\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(QString(\"12.4\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, true)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, int(122))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, uint(124))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, 123.0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, 6.37e-8)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, 0x43211234)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, 0x10000)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, 0x10001)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, qInf())",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, \"Infinity\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, QString(\"123\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(0, QString(\"12.3\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, true)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, int(122))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, uint(124))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, 123.0)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, 6.37e-8)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, 0x43211234)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, 0x10000)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, 0x10001)",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, qInf())",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, \"Infinity\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"true\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"122\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"124\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"123.0\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"6.37e-8\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"0x43211234\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"0x10000\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"0x10001\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"Infinity\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"'123'\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"'12.4'\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->newVariant(QVariant(123))",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(uint(124))",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0x43211234)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0x10000)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0x10001)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(qInf())",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(\"Infinity\")",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0, uint(124))",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0, 0x43211234)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0, 0x10000)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0, 0x10001)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0, qInf())",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(0, \"Infinity\")",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(engine, uint(124))",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(engine, 0x43211234)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(engine, 0x10000)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(engine, 0x10001)",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(engine, qInf())",
+ "engine->evaluate(\"new Number(123)\") <=> QScriptValue(engine, \"Infinity\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"124\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"0x43211234\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"0x10000\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"0x10001\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"Infinity\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(\"NaN\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(\"Infinity\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(\"ciao\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(QString(\"0\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(QString(\"123\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(QString(\"12.4\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(0, \"NaN\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(0, \"Infinity\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(0, \"ciao\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(0, QString(\"0\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(0, QString(\"123\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(0, QString(\"12.3\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(engine, \"NaN\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(engine, \"Infinity\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(engine, \"ciao\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(engine, QString(\"0\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Object.prototype\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Function.prototype\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Error.prototype\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Array\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Number\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Function\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"(function() { return 1; })\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"new Object()\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"new String('ciao')\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Undefined\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Null\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"True\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"False\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"'ciao'\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"'0'\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"'123'\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"'12.4'\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->newObject()",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->newQObject(engine)",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"Function.prototype\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"Array\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"Number\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"Function\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"(function() { return 1; })\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(int(122))",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(uint(124))",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(123.0)",
@@ -5626,6 +6039,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, qInf())",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, \"Infinity\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"122\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"124\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"123.0\")",
@@ -5651,6 +6065,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"Undefined\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"Undefined\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"Undefined\") <=> engine->evaluate(\"new Object()\")",
+ "engine->evaluate(\"Undefined\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"Undefined\") <=> engine->evaluate(\"'ciao'\")",
"engine->evaluate(\"Undefined\") <=> engine->newObject()",
"engine->evaluate(\"Undefined\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
@@ -5670,6 +6085,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"Null\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"new Object()\")",
+ "engine->evaluate(\"Null\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"True\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"'ciao'\")",
@@ -5691,6 +6107,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"True\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"True\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"True\") <=> engine->evaluate(\"new Object()\")",
+ "engine->evaluate(\"True\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"True\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"True\") <=> engine->evaluate(\"'ciao'\")",
"engine->evaluate(\"True\") <=> engine->newObject()",
@@ -5711,6 +6128,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"False\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"False\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"False\") <=> engine->evaluate(\"new Object()\")",
+ "engine->evaluate(\"False\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"False\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"False\") <=> engine->evaluate(\"Null\")",
"engine->evaluate(\"False\") <=> engine->evaluate(\"True\")",
@@ -5753,6 +6171,8 @@ static QString lessThan_array [] = {
"engine->evaluate(\"null\") <=> QScriptValue(engine, \"Infinity\")",
"engine->evaluate(\"null\") <=> QScriptValue(engine, QString(\"123\"))",
"engine->evaluate(\"null\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"null\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"null\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"null\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"null\") <=> engine->evaluate(\"true\")",
"engine->evaluate(\"null\") <=> engine->evaluate(\"122\")",
@@ -5796,6 +6216,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"true\") <=> QScriptValue(engine, \"Infinity\")",
"engine->evaluate(\"true\") <=> QScriptValue(engine, QString(\"123\"))",
"engine->evaluate(\"true\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"true\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"true\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"true\") <=> engine->evaluate(\"122\")",
"engine->evaluate(\"true\") <=> engine->evaluate(\"124\")",
@@ -5843,6 +6264,8 @@ static QString lessThan_array [] = {
"engine->evaluate(\"false\") <=> QScriptValue(engine, \"Infinity\")",
"engine->evaluate(\"false\") <=> QScriptValue(engine, QString(\"123\"))",
"engine->evaluate(\"false\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"false\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"false\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"true\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"122\")",
@@ -5880,6 +6303,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"122\") <=> QScriptValue(engine, qInf())",
"engine->evaluate(\"122\") <=> QScriptValue(engine, \"Infinity\")",
"engine->evaluate(\"122\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->evaluate(\"122\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"122\") <=> engine->evaluate(\"124\")",
"engine->evaluate(\"122\") <=> engine->evaluate(\"123.0\")",
"engine->evaluate(\"122\") <=> engine->evaluate(\"0x43211234\")",
@@ -5943,6 +6367,8 @@ static QString lessThan_array [] = {
"engine->evaluate(\"0\") <=> QScriptValue(engine, \"Infinity\")",
"engine->evaluate(\"0\") <=> QScriptValue(engine, QString(\"123\"))",
"engine->evaluate(\"0\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"0\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"0\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"true\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"122\")",
@@ -5992,6 +6418,8 @@ static QString lessThan_array [] = {
"engine->evaluate(\"0.0\") <=> QScriptValue(engine, \"Infinity\")",
"engine->evaluate(\"0.0\") <=> QScriptValue(engine, QString(\"123\"))",
"engine->evaluate(\"0.0\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"0.0\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"0.0\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"true\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"122\")",
@@ -6061,6 +6489,8 @@ static QString lessThan_array [] = {
"engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, \"Infinity\")",
"engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, QString(\"123\"))",
"engine->evaluate(\"6.37e-8\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"true\")",
"engine->evaluate(\"6.37e-8\") <=> engine->evaluate(\"122\")",
@@ -6133,6 +6563,9 @@ static QString lessThan_array [] = {
"engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"[]\")",
"engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"Array.prototype\")",
"engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"new Array()\")",
+ "engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"null\")",
"engine->evaluate(\"-6.37e-8\") <=> engine->evaluate(\"true\")",
@@ -6252,6 +6685,9 @@ static QString lessThan_array [] = {
"engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"[]\")",
"engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"Array.prototype\")",
"engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"new Array()\")",
+ "engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"new Number(123)\")",
"engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"null\")",
"engine->evaluate(\"-Infinity\") <=> engine->evaluate(\"true\")",
@@ -6348,6 +6784,10 @@ static QString lessThan_array [] = {
"engine->evaluate(\"''\") <=> engine->evaluate(\"/foo/\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"''\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"''\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"''\") <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"''\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"Null\")",
@@ -6369,6 +6809,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"''\") <=> engine->newObject()",
"engine->evaluate(\"''\") <=> engine->newArray(10)",
"engine->evaluate(\"''\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->evaluate(\"''\") <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->evaluate(\"''\") <=> engine->newVariant(QVariant(123))",
"engine->evaluate(\"''\") <=> engine->newQObject(engine)",
"engine->evaluate(\"'0'\") <=> QScriptValue(true)",
@@ -6428,6 +6869,9 @@ static QString lessThan_array [] = {
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"'0'\") <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"'0'\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"'0'\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"'0'\") <=> engine->evaluate(\"Null\")",
@@ -6488,6 +6932,7 @@ static QString lessThan_array [] = {
"engine->evaluate(\"'123'\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"'123'\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"'123'\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"'123'\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"'123'\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"'123'\") <=> engine->evaluate(\"Null\")",
"engine->evaluate(\"'123'\") <=> engine->evaluate(\"True\")",
@@ -6549,6 +6994,8 @@ static QString lessThan_array [] = {
"engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Undefined\")",
"engine->evaluate(\"'12.4'\") <=> engine->evaluate(\"Null\")",
@@ -6603,6 +7050,8 @@ static QString lessThan_array [] = {
"engine->nullValue() <=> QScriptValue(engine, \"Infinity\")",
"engine->nullValue() <=> QScriptValue(engine, QString(\"123\"))",
"engine->nullValue() <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->nullValue() <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->nullValue() <=> engine->evaluate(\"new Number(123)\")",
"engine->nullValue() <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->nullValue() <=> engine->evaluate(\"true\")",
"engine->nullValue() <=> engine->evaluate(\"122\")",
@@ -6630,6 +7079,7 @@ static QString lessThan_array [] = {
"engine->newObject() <=> engine->evaluate(\"(function() { return 1; })\")",
"engine->newObject() <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->newObject() <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
+ "engine->newObject() <=> engine->evaluate(\"new String('ciao')\")",
"engine->newObject() <=> engine->evaluate(\"'ciao'\")",
"engine->newObject() <=> engine->newQMetaObject(&QObject::staticMetaObject)",
"engine->newArray() <=> QScriptValue(true)",
@@ -6696,6 +7146,10 @@ static QString lessThan_array [] = {
"engine->newArray() <=> engine->evaluate(\"/foo/\")",
"engine->newArray() <=> engine->evaluate(\"new Object()\")",
"engine->newArray() <=> engine->evaluate(\"new Error()\")",
+ "engine->newArray() <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->newArray() <=> engine->evaluate(\"new Number(123)\")",
+ "engine->newArray() <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->newArray() <=> engine->evaluate(\"new String('ciao')\")",
"engine->newArray() <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->newArray() <=> engine->evaluate(\"Undefined\")",
"engine->newArray() <=> engine->evaluate(\"Null\")",
@@ -6717,6 +7171,7 @@ static QString lessThan_array [] = {
"engine->newArray() <=> engine->newObject()",
"engine->newArray() <=> engine->newArray(10)",
"engine->newArray() <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newArray() <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->newArray() <=> engine->newVariant(QVariant(123))",
"engine->newArray() <=> engine->newQObject(engine)",
"engine->newArray(10) <=> QScriptValue(\"NaN\")",
@@ -6756,6 +7211,8 @@ static QString lessThan_array [] = {
"engine->newArray(10) <=> engine->evaluate(\"/foo/\")",
"engine->newArray(10) <=> engine->evaluate(\"new Object()\")",
"engine->newArray(10) <=> engine->evaluate(\"new Error()\")",
+ "engine->newArray(10) <=> engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->newArray(10) <=> engine->evaluate(\"new String('ciao')\")",
"engine->newArray(10) <=> engine->evaluate(\"Undefined\")",
"engine->newArray(10) <=> engine->evaluate(\"Null\")",
"engine->newArray(10) <=> engine->evaluate(\"True\")",
@@ -6766,6 +7223,7 @@ static QString lessThan_array [] = {
"engine->newArray(10) <=> engine->evaluate(\"'12.4'\")",
"engine->newArray(10) <=> engine->newObject()",
"engine->newArray(10) <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newArray(10) <=> engine->newRegExp(\"foo\", \"gim\")",
"engine->newArray(10) <=> engine->newQObject(engine)",
"engine->newQMetaObject(&QObject::staticMetaObject) <=> QScriptValue(\"ciao\")",
"engine->newQMetaObject(&QObject::staticMetaObject) <=> QScriptValue(QString::fromLatin1(\"ciao\"))",
@@ -6781,7 +7239,53 @@ static QString lessThan_array [] = {
"engine->newQMetaObject(&QObject::staticMetaObject) <=> engine->evaluate(\"(function() { return 1; })\")",
"engine->newQMetaObject(&QObject::staticMetaObject) <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->newQMetaObject(&QObject::staticMetaObject) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
+ "engine->newQMetaObject(&QObject::staticMetaObject) <=> engine->evaluate(\"new String('ciao')\")",
"engine->newQMetaObject(&QObject::staticMetaObject) <=> engine->evaluate(\"'ciao'\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(\"NaN\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(\"Infinity\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(\"ciao\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(QString(\"0\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(QString(\"123\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(QString(\"12.4\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(0, \"NaN\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(0, \"Infinity\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(0, \"ciao\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(0, QString::fromLatin1(\"ciao\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(0, QString(\"0\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(0, QString(\"123\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(0, QString(\"12.3\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(engine, \"NaN\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(engine, \"Infinity\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(engine, \"ciao\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(engine, QString::fromLatin1(\"ciao\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(engine, QString(\"0\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(engine, QString(\"123\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Object.prototype\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Function.prototype\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Error.prototype\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Object\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Array\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Number\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Function\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"(function() { return 1; })\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"new Object()\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"new Error()\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"new String('ciao')\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Undefined\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Null\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"True\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"False\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"'ciao'\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"'0'\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"'123'\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"'12.4'\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->newObject()",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->newQObject(engine)",
"engine->newVariant(QVariant(123)) <=> QScriptValue(uint(124))",
"engine->newVariant(QVariant(123)) <=> QScriptValue(0x43211234)",
"engine->newVariant(QVariant(123)) <=> QScriptValue(0x10000)",
@@ -6841,6 +7345,8 @@ static QString lessThan_array [] = {
"engine->newVariant(QVariant(false)) <=> QScriptValue(engine, \"Infinity\")",
"engine->newVariant(QVariant(false)) <=> QScriptValue(engine, QString(\"123\"))",
"engine->newVariant(QVariant(false)) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->newVariant(QVariant(false)) <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->newVariant(QVariant(false)) <=> engine->evaluate(\"new Number(123)\")",
"engine->newVariant(QVariant(false)) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->newVariant(QVariant(false)) <=> engine->evaluate(\"true\")",
"engine->newVariant(QVariant(false)) <=> engine->evaluate(\"122\")",
@@ -6890,6 +7396,8 @@ static QString lessThan_array [] = {
"engine->newQObject(0) <=> QScriptValue(engine, \"Infinity\")",
"engine->newQObject(0) <=> QScriptValue(engine, QString(\"123\"))",
"engine->newQObject(0) <=> QScriptValue(engine, QString(\"1.23\"))",
+ "engine->newQObject(0) <=> engine->evaluate(\"new Boolean(true)\")",
+ "engine->newQObject(0) <=> engine->evaluate(\"new Number(123)\")",
"engine->newQObject(0) <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->newQObject(0) <=> engine->evaluate(\"true\")",
"engine->newQObject(0) <=> engine->evaluate(\"122\")",
@@ -6919,20 +7427,21 @@ static QString lessThan_array [] = {
"engine->newQObject(engine) <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->newQObject(engine) <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->newQObject(engine) <=> engine->evaluate(\"new Object()\")",
+ "engine->newQObject(engine) <=> engine->evaluate(\"new String('ciao')\")",
"engine->newQObject(engine) <=> engine->evaluate(\"Undefined\")",
"engine->newQObject(engine) <=> engine->evaluate(\"Null\")",
"engine->newQObject(engine) <=> engine->evaluate(\"True\")",
"engine->newQObject(engine) <=> engine->evaluate(\"False\")",
"engine->newQObject(engine) <=> engine->evaluate(\"'ciao'\")",
"engine->newQObject(engine) <=> engine->newObject()",
- "engine->newQObject(engine) <=> engine->newQMetaObject(&QObject::staticMetaObject)",};
+ "engine->newQObject(engine) <=> engine->newQMetaObject(&QObject::staticMetaObject)"};
-void tst_QScriptValue::lessThan_makeData(const char *expr)
+void tst_QScriptValueGenerated::lessThan_makeData(const char *expr)
{
static QSet<QString> equals;
if (equals.isEmpty()) {
- equals.reserve(5063);
- for (unsigned i = 0; i < 5063; ++i)
+ equals.reserve(5476);
+ for (unsigned i = 0; i < 5476; ++i)
equals.insert(lessThan_array[i]);
}
QHash<QString, QScriptValue>::const_iterator it;
@@ -6942,7 +7451,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr)
}
}
-void tst_QScriptValue::lessThan_test(const char *, const QScriptValue& value)
+void tst_QScriptValueGenerated::lessThan_test(const char *, const QScriptValue& value)
{
QFETCH(QScriptValue, other);
QFETCH(bool, expected);
@@ -6952,14 +7461,14 @@ void tst_QScriptValue::lessThan_test(const char *, const QScriptValue& value)
DEFINE_TEST_FUNCTION(lessThan)
-void tst_QScriptValue::instanceOf_initData()
+void tst_QScriptValueGenerated::instanceOf_initData()
{
QTest::addColumn<QScriptValue>("other");
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString instanceOf_array [] = {
+static QString instanceOf_array[] = {
"engine->evaluate(\"[]\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"Array\")",
"engine->evaluate(\"Date.prototype\") <=> engine->evaluate(\"Object\")",
@@ -6985,6 +7494,12 @@ static QString instanceOf_array [] = {
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Array\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"new Boolean(true)\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"new Boolean(false)\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"new Number(123)\") <=> engine->evaluate(\"Number\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"new String('ciao')\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"True\") <=> engine->evaluate(\"Object\")",
@@ -6996,17 +7511,18 @@ static QString instanceOf_array [] = {
"engine->newArray(10) <=> engine->evaluate(\"Array\")",
"engine->newDate(QDateTime()) <=> engine->evaluate(\"Object\")",
"engine->newQMetaObject(&QObject::staticMetaObject) <=> engine->evaluate(\"Object\")",
+ "engine->newRegExp(\"foo\", \"gim\") <=> engine->evaluate(\"Object\")",
"engine->newVariant(QVariant()) <=> engine->evaluate(\"Object\")",
"engine->newVariant(QVariant(123)) <=> engine->evaluate(\"Object\")",
"engine->newVariant(QVariant(false)) <=> engine->evaluate(\"Object\")",
- "engine->newQObject(engine) <=> engine->evaluate(\"Object\")",};
+ "engine->newQObject(engine) <=> engine->evaluate(\"Object\")"};
-void tst_QScriptValue::instanceOf_makeData(const char *expr)
+void tst_QScriptValueGenerated::instanceOf_makeData(const char *expr)
{
static QSet<QString> equals;
if (equals.isEmpty()) {
- equals.reserve(40);
- for (unsigned i = 0; i < 40; ++i)
+ equals.reserve(47);
+ for (unsigned i = 0; i < 47; ++i)
equals.insert(instanceOf_array[i]);
}
QHash<QString, QScriptValue>::const_iterator it;
@@ -7016,7 +7532,7 @@ void tst_QScriptValue::instanceOf_makeData(const char *expr)
}
}
-void tst_QScriptValue::instanceOf_test(const char *, const QScriptValue& value)
+void tst_QScriptValueGenerated::instanceOf_test(const char *, const QScriptValue& value)
{
QFETCH(QScriptValue, other);
QFETCH(bool, expected);
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_init.cpp b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_init.cpp
index b6fcb7d259..6519ffdbaf 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_init.cpp
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_init.cpp
@@ -46,10 +46,10 @@
#include "tst_qscriptvalue.h"
-void tst_QScriptValue::initScriptValues()
+void tst_QScriptValueGenerated::initScriptValues()
{
m_values.clear();
- if (engine)
+ if (engine)
delete engine;
engine = new QScriptEngine;
DEFINE_TEST_VALUE(QScriptValue());
@@ -155,6 +155,11 @@ 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("new Boolean(true)"));
+ DEFINE_TEST_VALUE(engine->evaluate("new Boolean(false)"));
+ DEFINE_TEST_VALUE(engine->evaluate("new Number(123)"));
+ DEFINE_TEST_VALUE(engine->evaluate("new RegExp('foo', 'gim')"));
+ DEFINE_TEST_VALUE(engine->evaluate("new String('ciao')"));
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"));
@@ -189,6 +194,7 @@ void tst_QScriptValue::initScriptValues()
DEFINE_TEST_VALUE(engine->newArray(10));
DEFINE_TEST_VALUE(engine->newDate(QDateTime()));
DEFINE_TEST_VALUE(engine->newQMetaObject(&QObject::staticMetaObject));
+ DEFINE_TEST_VALUE(engine->newRegExp("foo", "gim"));
DEFINE_TEST_VALUE(engine->newVariant(QVariant()));
DEFINE_TEST_VALUE(engine->newVariant(QVariant(123)));
DEFINE_TEST_VALUE(engine->newVariant(QVariant(false)));
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_isXXX.cpp b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_isXXX.cpp
index c31588c750..111ec5882f 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_isXXX.cpp
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_isXXX.cpp
@@ -46,13 +46,13 @@
#include "tst_qscriptvalue.h"
-void tst_QScriptValue::isValid_initData()
+void tst_QScriptValueGenerated::isValid_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isValid_array [] = {
+static QString isValid_array[] = {
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
"QScriptValue(true)",
@@ -155,6 +155,11 @@ static QString isValid_array [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -189,24 +194,26 @@ static QString isValid_array [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
+ "engine->newQObject(engine)"
+};
-void tst_QScriptValue::isValid_makeData(const char* expr)
+void tst_QScriptValueGenerated::isValid_makeData(const char* expr)
{
static QSet<QString> isValid;
if (isValid.isEmpty()) {
- isValid.reserve(141);
- for (unsigned i = 0; i < 141; ++i)
+ isValid.reserve(147);
+ for (unsigned i = 0; i < 147; ++i)
isValid.insert(isValid_array[i]);
}
newRow(expr) << isValid.contains(expr);
}
-void tst_QScriptValue::isValid_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isValid_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isValid(), expected);
@@ -216,13 +223,13 @@ void tst_QScriptValue::isValid_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isValid)
-void tst_QScriptValue::isBool_initData()
+void tst_QScriptValueGenerated::isBool_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isBool_array [] = {
+static QString isBool_array[] = {
"QScriptValue(true)",
"QScriptValue(false)",
"QScriptValue(0, true)",
@@ -230,9 +237,10 @@ static QString isBool_array [] = {
"QScriptValue(engine, true)",
"QScriptValue(engine, false)",
"engine->evaluate(\"true\")",
- "engine->evaluate(\"false\")",};
+ "engine->evaluate(\"false\")"
+};
-void tst_QScriptValue::isBool_makeData(const char* expr)
+void tst_QScriptValueGenerated::isBool_makeData(const char* expr)
{
static QSet<QString> isBool;
if (isBool.isEmpty()) {
@@ -243,7 +251,7 @@ void tst_QScriptValue::isBool_makeData(const char* expr)
newRow(expr) << isBool.contains(expr);
}
-void tst_QScriptValue::isBool_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isBool_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isBool(), expected);
@@ -253,13 +261,13 @@ void tst_QScriptValue::isBool_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isBool)
-void tst_QScriptValue::isBoolean_initData()
+void tst_QScriptValueGenerated::isBoolean_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isBoolean_array [] = {
+static QString isBoolean_array[] = {
"QScriptValue(true)",
"QScriptValue(false)",
"QScriptValue(0, true)",
@@ -267,9 +275,10 @@ static QString isBoolean_array [] = {
"QScriptValue(engine, true)",
"QScriptValue(engine, false)",
"engine->evaluate(\"true\")",
- "engine->evaluate(\"false\")",};
+ "engine->evaluate(\"false\")"
+};
-void tst_QScriptValue::isBoolean_makeData(const char* expr)
+void tst_QScriptValueGenerated::isBoolean_makeData(const char* expr)
{
static QSet<QString> isBoolean;
if (isBoolean.isEmpty()) {
@@ -280,7 +289,7 @@ void tst_QScriptValue::isBoolean_makeData(const char* expr)
newRow(expr) << isBoolean.contains(expr);
}
-void tst_QScriptValue::isBoolean_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isBoolean_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isBoolean(), expected);
@@ -290,13 +299,13 @@ void tst_QScriptValue::isBoolean_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isBoolean)
-void tst_QScriptValue::isNumber_initData()
+void tst_QScriptValueGenerated::isNumber_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isNumber_array [] = {
+static QString isNumber_array[] = {
"QScriptValue(int(122))",
"QScriptValue(uint(124))",
"QScriptValue(0)",
@@ -352,9 +361,10 @@ static QString isNumber_array [] = {
"engine->evaluate(\"0x10001\")",
"engine->evaluate(\"NaN\")",
"engine->evaluate(\"Infinity\")",
- "engine->evaluate(\"-Infinity\")",};
+ "engine->evaluate(\"-Infinity\")"
+};
-void tst_QScriptValue::isNumber_makeData(const char* expr)
+void tst_QScriptValueGenerated::isNumber_makeData(const char* expr)
{
static QSet<QString> isNumber;
if (isNumber.isEmpty()) {
@@ -365,7 +375,7 @@ void tst_QScriptValue::isNumber_makeData(const char* expr)
newRow(expr) << isNumber.contains(expr);
}
-void tst_QScriptValue::isNumber_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isNumber_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isNumber(), expected);
@@ -375,13 +385,13 @@ void tst_QScriptValue::isNumber_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isNumber)
-void tst_QScriptValue::isFunction_initData()
+void tst_QScriptValueGenerated::isFunction_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isFunction_array [] = {
+static QString isFunction_array[] = {
"engine->evaluate(\"Function.prototype\")",
"engine->evaluate(\"Object\")",
"engine->evaluate(\"Array\")",
@@ -391,20 +401,23 @@ static QString isFunction_array [] = {
"engine->evaluate(\"(function() { return 'ciao'; })\")",
"engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
- "engine->newQMetaObject(&QObject::staticMetaObject)",};
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")"
+};
-void tst_QScriptValue::isFunction_makeData(const char* expr)
+void tst_QScriptValueGenerated::isFunction_makeData(const char* expr)
{
static QSet<QString> isFunction;
if (isFunction.isEmpty()) {
- isFunction.reserve(10);
- for (unsigned i = 0; i < 10; ++i)
+ isFunction.reserve(12);
+ for (unsigned i = 0; i < 12; ++i)
isFunction.insert(isFunction_array[i]);
}
newRow(expr) << isFunction.contains(expr);
}
-void tst_QScriptValue::isFunction_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isFunction_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isFunction(), expected);
@@ -414,21 +427,22 @@ void tst_QScriptValue::isFunction_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isFunction)
-void tst_QScriptValue::isNull_initData()
+void tst_QScriptValueGenerated::isNull_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isNull_array [] = {
+static QString isNull_array[] = {
"QScriptValue(QScriptValue::NullValue)",
"QScriptValue(0, QScriptValue::NullValue)",
"QScriptValue(engine, QScriptValue::NullValue)",
"engine->evaluate(\"null\")",
"engine->nullValue()",
- "engine->newQObject(0)",};
+ "engine->newQObject(0)"
+};
-void tst_QScriptValue::isNull_makeData(const char* expr)
+void tst_QScriptValueGenerated::isNull_makeData(const char* expr)
{
static QSet<QString> isNull;
if (isNull.isEmpty()) {
@@ -439,7 +453,7 @@ void tst_QScriptValue::isNull_makeData(const char* expr)
newRow(expr) << isNull.contains(expr);
}
-void tst_QScriptValue::isNull_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isNull_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isNull(), expected);
@@ -449,13 +463,13 @@ void tst_QScriptValue::isNull_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isNull)
-void tst_QScriptValue::isString_initData()
+void tst_QScriptValueGenerated::isString_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isString_array [] = {
+static QString isString_array[] = {
"QScriptValue(\"NaN\")",
"QScriptValue(\"Infinity\")",
"QScriptValue(\"-Infinity\")",
@@ -490,9 +504,10 @@ static QString isString_array [] = {
"engine->evaluate(\"''\")",
"engine->evaluate(\"'0'\")",
"engine->evaluate(\"'123'\")",
- "engine->evaluate(\"'12.4'\")",};
+ "engine->evaluate(\"'12.4'\")"
+};
-void tst_QScriptValue::isString_makeData(const char* expr)
+void tst_QScriptValueGenerated::isString_makeData(const char* expr)
{
static QSet<QString> isString;
if (isString.isEmpty()) {
@@ -503,7 +518,7 @@ void tst_QScriptValue::isString_makeData(const char* expr)
newRow(expr) << isString.contains(expr);
}
-void tst_QScriptValue::isString_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isString_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isString(), expected);
@@ -513,21 +528,22 @@ void tst_QScriptValue::isString_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isString)
-void tst_QScriptValue::isUndefined_initData()
+void tst_QScriptValueGenerated::isUndefined_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isUndefined_array [] = {
+static QString isUndefined_array[] = {
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(0, QScriptValue::UndefinedValue)",
"QScriptValue(engine, QScriptValue::UndefinedValue)",
"engine->evaluate(\"{}\")",
"engine->evaluate(\"undefined\")",
- "engine->undefinedValue()",};
+ "engine->undefinedValue()"
+};
-void tst_QScriptValue::isUndefined_makeData(const char* expr)
+void tst_QScriptValueGenerated::isUndefined_makeData(const char* expr)
{
static QSet<QString> isUndefined;
if (isUndefined.isEmpty()) {
@@ -538,7 +554,7 @@ void tst_QScriptValue::isUndefined_makeData(const char* expr)
newRow(expr) << isUndefined.contains(expr);
}
-void tst_QScriptValue::isUndefined_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isUndefined_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isUndefined(), expected);
@@ -548,18 +564,19 @@ void tst_QScriptValue::isUndefined_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isUndefined)
-void tst_QScriptValue::isVariant_initData()
+void tst_QScriptValueGenerated::isVariant_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isVariant_array [] = {
+static QString isVariant_array[] = {
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
- "engine->newVariant(QVariant(false))",};
+ "engine->newVariant(QVariant(false))"
+};
-void tst_QScriptValue::isVariant_makeData(const char* expr)
+void tst_QScriptValueGenerated::isVariant_makeData(const char* expr)
{
static QSet<QString> isVariant;
if (isVariant.isEmpty()) {
@@ -570,7 +587,7 @@ void tst_QScriptValue::isVariant_makeData(const char* expr)
newRow(expr) << isVariant.contains(expr);
}
-void tst_QScriptValue::isVariant_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isVariant_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isVariant(), expected);
@@ -580,16 +597,17 @@ void tst_QScriptValue::isVariant_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isVariant)
-void tst_QScriptValue::isQObject_initData()
+void tst_QScriptValueGenerated::isQObject_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isQObject_array [] = {
- "engine->newQObject(engine)",};
+static QString isQObject_array[] = {
+ "engine->newQObject(engine)"
+};
-void tst_QScriptValue::isQObject_makeData(const char* expr)
+void tst_QScriptValueGenerated::isQObject_makeData(const char* expr)
{
static QSet<QString> isQObject;
if (isQObject.isEmpty()) {
@@ -600,7 +618,7 @@ void tst_QScriptValue::isQObject_makeData(const char* expr)
newRow(expr) << isQObject.contains(expr);
}
-void tst_QScriptValue::isQObject_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isQObject_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isQObject(), expected);
@@ -610,16 +628,17 @@ void tst_QScriptValue::isQObject_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isQObject)
-void tst_QScriptValue::isQMetaObject_initData()
+void tst_QScriptValueGenerated::isQMetaObject_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isQMetaObject_array [] = {
- "engine->newQMetaObject(&QObject::staticMetaObject)",};
+static QString isQMetaObject_array[] = {
+ "engine->newQMetaObject(&QObject::staticMetaObject)"
+};
-void tst_QScriptValue::isQMetaObject_makeData(const char* expr)
+void tst_QScriptValueGenerated::isQMetaObject_makeData(const char* expr)
{
static QSet<QString> isQMetaObject;
if (isQMetaObject.isEmpty()) {
@@ -630,7 +649,7 @@ void tst_QScriptValue::isQMetaObject_makeData(const char* expr)
newRow(expr) << isQMetaObject.contains(expr);
}
-void tst_QScriptValue::isQMetaObject_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isQMetaObject_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isQMetaObject(), expected);
@@ -640,13 +659,13 @@ void tst_QScriptValue::isQMetaObject_test(const char*, const QScriptValue& value
DEFINE_TEST_FUNCTION(isQMetaObject)
-void tst_QScriptValue::isObject_initData()
+void tst_QScriptValueGenerated::isObject_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isObject_array [] = {
+static QString isObject_array[] = {
"engine->evaluate(\"[]\")",
"engine->evaluate(\"Object.prototype\")",
"engine->evaluate(\"Date.prototype\")",
@@ -664,6 +683,11 @@ static QString isObject_array [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -673,23 +697,25 @@ static QString isObject_array [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
- "engine->newQObject(engine)",};
+ "engine->newQObject(engine)"
+};
-void tst_QScriptValue::isObject_makeData(const char* expr)
+void tst_QScriptValueGenerated::isObject_makeData(const char* expr)
{
static QSet<QString> isObject;
if (isObject.isEmpty()) {
- isObject.reserve(30);
- for (unsigned i = 0; i < 30; ++i)
+ isObject.reserve(36);
+ for (unsigned i = 0; i < 36; ++i)
isObject.insert(isObject_array[i]);
}
newRow(expr) << isObject.contains(expr);
}
-void tst_QScriptValue::isObject_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isObject_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isObject(), expected);
@@ -699,17 +725,18 @@ void tst_QScriptValue::isObject_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isObject)
-void tst_QScriptValue::isDate_initData()
+void tst_QScriptValueGenerated::isDate_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isDate_array [] = {
+static QString isDate_array[] = {
"engine->evaluate(\"Date.prototype\")",
- "engine->newDate(QDateTime())",};
+ "engine->newDate(QDateTime())"
+};
-void tst_QScriptValue::isDate_makeData(const char* expr)
+void tst_QScriptValueGenerated::isDate_makeData(const char* expr)
{
static QSet<QString> isDate;
if (isDate.isEmpty()) {
@@ -720,7 +747,7 @@ void tst_QScriptValue::isDate_makeData(const char* expr)
newRow(expr) << isDate.contains(expr);
}
-void tst_QScriptValue::isDate_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isDate_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isDate(), expected);
@@ -730,27 +757,30 @@ void tst_QScriptValue::isDate_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isDate)
-void tst_QScriptValue::isRegExp_initData()
+void tst_QScriptValueGenerated::isRegExp_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isRegExp_array [] = {
- "engine->evaluate(\"/foo/\")",};
+static QString isRegExp_array[] = {
+ "engine->evaluate(\"/foo/\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->newRegExp(\"foo\", \"gim\")"
+};
-void tst_QScriptValue::isRegExp_makeData(const char* expr)
+void tst_QScriptValueGenerated::isRegExp_makeData(const char* expr)
{
static QSet<QString> isRegExp;
if (isRegExp.isEmpty()) {
- isRegExp.reserve(1);
- for (unsigned i = 0; i < 1; ++i)
+ isRegExp.reserve(3);
+ for (unsigned i = 0; i < 3; ++i)
isRegExp.insert(isRegExp_array[i]);
}
newRow(expr) << isRegExp.contains(expr);
}
-void tst_QScriptValue::isRegExp_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isRegExp_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isRegExp(), expected);
@@ -760,20 +790,21 @@ void tst_QScriptValue::isRegExp_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isRegExp)
-void tst_QScriptValue::isArray_initData()
+void tst_QScriptValueGenerated::isArray_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isArray_array [] = {
+static QString isArray_array[] = {
"engine->evaluate(\"[]\")",
"engine->evaluate(\"Array.prototype\")",
"engine->evaluate(\"new Array()\")",
"engine->newArray()",
- "engine->newArray(10)",};
+ "engine->newArray(10)"
+};
-void tst_QScriptValue::isArray_makeData(const char* expr)
+void tst_QScriptValueGenerated::isArray_makeData(const char* expr)
{
static QSet<QString> isArray;
if (isArray.isEmpty()) {
@@ -784,7 +815,7 @@ void tst_QScriptValue::isArray_makeData(const char* expr)
newRow(expr) << isArray.contains(expr);
}
-void tst_QScriptValue::isArray_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isArray_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isArray(), expected);
@@ -794,21 +825,22 @@ void tst_QScriptValue::isArray_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(isArray)
-void tst_QScriptValue::isError_initData()
+void tst_QScriptValueGenerated::isError_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString isError_array [] = {
+static QString isError_array[] = {
"engine->evaluate(\"Error.prototype\")",
"engine->evaluate(\"new Error()\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
- "engine->evaluate(\"False\")",};
+ "engine->evaluate(\"False\")"
+};
-void tst_QScriptValue::isError_makeData(const char* expr)
+void tst_QScriptValueGenerated::isError_makeData(const char* expr)
{
static QSet<QString> isError;
if (isError.isEmpty()) {
@@ -819,7 +851,7 @@ void tst_QScriptValue::isError_makeData(const char* expr)
newRow(expr) << isError.contains(expr);
}
-void tst_QScriptValue::isError_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::isError_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.isError(), expected);
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_toXXX.cpp b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_toXXX.cpp
index 4f7444937a..9a3592a118 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue_generated_toXXX.cpp
+++ b/tests/auto/qscriptvaluegenerated/tst_qscriptvalue_generated_toXXX.cpp
@@ -47,13 +47,13 @@
-void tst_QScriptValue::toString_initData()
+void tst_QScriptValueGenerated::toString_initData()
{
QTest::addColumn<QString>("expected");
initScriptValues();
}
-static QString toString_tagArray [] = {
+static QString toString_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -157,6 +157,11 @@ static QString toString_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -191,97 +196,101 @@ static QString toString_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
+ "engine->newQObject(engine)"};
-static QString toString_valueArray [] = {
- "", "undefined",
- "null", "true",
- "false", "122",
- "124", "0",
- "0", "123",
- "6.37e-8", "-6.37e-8",
- "1126240820", "65536",
- "65537", "NaN",
- "NaN", "Infinity",
- "-Infinity", "NaN",
- "Infinity", "-Infinity",
- "ciao", "ciao",
- "", "",
- "0", "123",
- "12.4", "undefined",
- "null", "true",
- "false", "122",
- "124", "0",
- "0", "123",
- "6.37e-8", "-6.37e-8",
- "1126240820", "65536",
- "65537", "NaN",
- "NaN", "Infinity",
- "-Infinity", "NaN",
- "Infinity", "-Infinity",
- "ciao", "ciao",
- "", "",
- "0", "123",
- "12.3", "undefined",
- "null", "true",
- "false", "122",
- "124", "0",
- "0", "123",
- "6.37e-8", "-6.37e-8",
- "1126240820", "65536",
- "65537", "NaN",
- "NaN", "Infinity",
- "-Infinity", "NaN",
- "Infinity", "-Infinity",
- "ciao", "ciao",
- "", "",
- "0", "123",
- "1.23", "",
- "undefined", "[object Object]",
- "Invalid Date", "",
- "function () {\n [native code]\n}", "Error: Unknown error",
- "function Object() {\n [native code]\n}", "function Array() {\n [native code]\n}",
- "function Number() {\n [native code]\n}", "function Function() {\n [native code]\n}",
- "function () { return 1; }", "function () { return 'ciao'; }",
- "function () { throw new Error('foo'); }", "/foo/",
- "[object Object]", "",
- "Error: Unknown error", "22",
- "ReferenceError: Can't find variable: Undefined", "ReferenceError: Can't find variable: Null",
- "ReferenceError: Can't find variable: True", "ReferenceError: Can't find variable: False",
- "undefined", "null",
- "true", "false",
- "122", "124",
- "0", "0",
- "123", "6.37e-8",
- "-6.37e-8", "1126240820",
- "65536", "65537",
- "NaN", "Infinity",
- "-Infinity", "ciao",
- "", "0",
- "123", "12.4",
- "null", "undefined",
- "[object Object]", "",
- ",,,,,,,,,", "Invalid Date",
- "[object QMetaObject]", "undefined",
- "123", "false",
- "null", "QScriptEngine(name = \"\")", };
+static QString toString_valueArray[] = {
+ "", "undefined",
+ "null", "true",
+ "false", "122",
+ "124", "0",
+ "0", "123",
+ "6.37e-8", "-6.37e-8",
+ "1126240820", "65536",
+ "65537", "NaN",
+ "NaN", "Infinity",
+ "-Infinity", "NaN",
+ "Infinity", "-Infinity",
+ "ciao", "ciao",
+ "", "",
+ "0", "123",
+ "12.4", "undefined",
+ "null", "true",
+ "false", "122",
+ "124", "0",
+ "0", "123",
+ "6.37e-8", "-6.37e-8",
+ "1126240820", "65536",
+ "65537", "NaN",
+ "NaN", "Infinity",
+ "-Infinity", "NaN",
+ "Infinity", "-Infinity",
+ "ciao", "ciao",
+ "", "",
+ "0", "123",
+ "12.3", "undefined",
+ "null", "true",
+ "false", "122",
+ "124", "0",
+ "0", "123",
+ "6.37e-8", "-6.37e-8",
+ "1126240820", "65536",
+ "65537", "NaN",
+ "NaN", "Infinity",
+ "-Infinity", "NaN",
+ "Infinity", "-Infinity",
+ "ciao", "ciao",
+ "", "",
+ "0", "123",
+ "1.23", "",
+ "undefined", "[object Object]",
+ "Invalid Date", "",
+ "function () {\n [native code]\n}", "Error: Unknown error",
+ "function Object() {\n [native code]\n}", "function Array() {\n [native code]\n}",
+ "function Number() {\n [native code]\n}", "function Function() {\n [native code]\n}",
+ "function () { return 1; }", "function () { return 'ciao'; }",
+ "function () { throw new Error('foo'); }", "/foo/",
+ "[object Object]", "",
+ "Error: Unknown error", "true",
+ "false", "123",
+ "/foo/gim", "ciao",
+ "22", "ReferenceError: Can't find variable: Undefined",
+ "ReferenceError: Can't find variable: Null", "ReferenceError: Can't find variable: True",
+ "ReferenceError: Can't find variable: False", "undefined",
+ "null", "true",
+ "false", "122",
+ "124", "0",
+ "0", "123",
+ "6.37e-8", "-6.37e-8",
+ "1126240820", "65536",
+ "65537", "NaN",
+ "Infinity", "-Infinity",
+ "ciao", "",
+ "0", "123",
+ "12.4", "null",
+ "undefined", "[object Object]",
+ "", ",,,,,,,,,",
+ "Invalid Date", "[object QMetaObject]",
+ "/foo/gim", "undefined",
+ "123", "false",
+ "null", "QScriptEngine(name = \"\")"};
-void tst_QScriptValue::toString_makeData(const char* expr)
+void tst_QScriptValueGenerated::toString_makeData(const char* expr)
{
static QHash<QString, QString> toString;
if (toString.isEmpty()) {
- toString.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ toString.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
toString.insert(toString_tagArray[i], toString_valueArray[i]);
}
newRow(expr) << toString.value(expr);
}
-void tst_QScriptValue::toString_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::toString_test(const char*, const QScriptValue& value)
{
QFETCH(QString, expected);
QCOMPARE(value.toString(), expected);
@@ -291,13 +300,13 @@ void tst_QScriptValue::toString_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(toString)
-void tst_QScriptValue::toNumber_initData()
+void tst_QScriptValueGenerated::toNumber_initData()
{
QTest::addColumn<qsreal>("expected");
initScriptValues();
}
-static QString toNumber_tagArray [] = {
+static QString toNumber_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -401,6 +410,11 @@ static QString toNumber_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -435,39 +449,40 @@ static QString toNumber_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
-static qsreal toNumber_valueArray [] = {
- 0, qQNaN(), 0, 1, 0, 122, 124, 0, 0, 123,
- 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(),
- qInf(), qInf(), qQNaN(), qQNaN(), 0, 0, 0, 123, 12.4, qQNaN(),
- 0, 1, 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08,
- 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(),
- qQNaN(), qQNaN(), 0, 0, 0, 123, 12.3, qQNaN(), 0, 1,
- 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536,
- 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(), qQNaN(), qQNaN(),
- 0, 0, 0, 123, 1.23, 0, qQNaN(), qQNaN(), qQNaN(), 0,
- qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(),
- qQNaN(), 0, qQNaN(), 22, qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), 0,
- 1, 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820,
- 65536, 65537, qQNaN(), qInf(), qInf(), qQNaN(), 0, 0, 123, 12.4,
- 0, qQNaN(), qQNaN(), 0, qQNaN(), qQNaN(), qQNaN(), qQNaN(), 123, 0,
- 0, qQNaN(), };
-void tst_QScriptValue::toNumber_makeData(const char* expr)
+ "engine->newQObject(engine)"};
+static qsreal toNumber_valueArray[] = {
+ 0, qQNaN(), 0, 1, 0, 122, 124, 0, 0, 123,
+ 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(),
+ qInf(), qInf(), qQNaN(), qQNaN(), 0, 0, 0, 123, 12.4, qQNaN(),
+ 0, 1, 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08,
+ 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(),
+ qQNaN(), qQNaN(), 0, 0, 0, 123, 12.3, qQNaN(), 0, 1,
+ 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536,
+ 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(), qQNaN(), qQNaN(),
+ 0, 0, 0, 123, 1.23, 0, qQNaN(), qQNaN(), qQNaN(), 0,
+ qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(),
+ qQNaN(), 0, qQNaN(), 1, 0, 123, qQNaN(), qQNaN(), 22, qQNaN(),
+ qQNaN(), qQNaN(), qQNaN(), qQNaN(), 0, 1, 0, 122, 124, 0,
+ 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536, 65537, qQNaN(), qInf(), qInf(),
+ qQNaN(), 0, 0, 123, 12.4, 0, qQNaN(), qQNaN(), 0, qQNaN(),
+ qQNaN(), qQNaN(), qQNaN(), qQNaN(), 123, 0, 0, qQNaN()};
+void tst_QScriptValueGenerated::toNumber_makeData(const char* expr)
{
static QHash<QString, qsreal> toNumber;
if (toNumber.isEmpty()) {
- toNumber.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ toNumber.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
toNumber.insert(toNumber_tagArray[i], toNumber_valueArray[i]);
}
newRow(expr) << toNumber.value(expr);
}
-void tst_QScriptValue::toNumber_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::toNumber_test(const char*, const QScriptValue& value)
{
QFETCH(qsreal, expected);
if (qIsNaN(expected)) {
@@ -486,13 +501,13 @@ void tst_QScriptValue::toNumber_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(toNumber)
-void tst_QScriptValue::toBool_initData()
+void tst_QScriptValueGenerated::toBool_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString toBool_tagArray [] = {
+static QString toBool_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -596,6 +611,11 @@ static QString toBool_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -630,97 +650,101 @@ static QString toBool_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
+ "engine->newQObject(engine)"};
-static bool toBool_valueArray [] = {
- false, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, true,
- false, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, false,
- true, true,
- false, false,
- true, true,
- true, true,
- true, true,
- false, true,
- true, true,
- false, true,
- true, true,
- false, false,
- true, true,
- true, true,
- true, true,
- true, true,
- false, true, };
+static bool toBool_valueArray[] = {
+ false, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, true,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ true, true,
+ true, false,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ false, true};
-void tst_QScriptValue::toBool_makeData(const char* expr)
+void tst_QScriptValueGenerated::toBool_makeData(const char* expr)
{
static QHash<QString, bool> toBool;
if (toBool.isEmpty()) {
- toBool.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ toBool.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
toBool.insert(toBool_tagArray[i], toBool_valueArray[i]);
}
newRow(expr) << toBool.value(expr);
}
-void tst_QScriptValue::toBool_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::toBool_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.toBool(), expected);
@@ -730,13 +754,13 @@ void tst_QScriptValue::toBool_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(toBool)
-void tst_QScriptValue::toBoolean_initData()
+void tst_QScriptValueGenerated::toBoolean_initData()
{
QTest::addColumn<bool>("expected");
initScriptValues();
}
-static QString toBoolean_tagArray [] = {
+static QString toBoolean_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -840,6 +864,11 @@ static QString toBoolean_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -874,97 +903,101 @@ static QString toBoolean_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
+ "engine->newQObject(engine)"};
-static bool toBoolean_valueArray [] = {
- false, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, false,
- false, true,
- false, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, false,
- false, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, true,
- true, true,
- false, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- true, true,
- false, false,
- true, false,
- true, true,
- false, false,
- true, true,
- true, true,
- true, true,
- false, true,
- true, true,
- false, true,
- true, true,
- false, false,
- true, true,
- true, true,
- true, true,
- true, true,
- false, true, };
+static bool toBoolean_valueArray[] = {
+ false, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ false, false,
+ true, true,
+ true, true,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ true, false,
+ false, true,
+ false, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, false,
+ true, true,
+ true, false,
+ true, true,
+ true, false,
+ false, true,
+ true, true,
+ true, true,
+ true, true,
+ true, true,
+ false, true};
-void tst_QScriptValue::toBoolean_makeData(const char* expr)
+void tst_QScriptValueGenerated::toBoolean_makeData(const char* expr)
{
static QHash<QString, bool> toBoolean;
if (toBoolean.isEmpty()) {
- toBoolean.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ toBoolean.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
toBoolean.insert(toBoolean_tagArray[i], toBoolean_valueArray[i]);
}
newRow(expr) << toBoolean.value(expr);
}
-void tst_QScriptValue::toBoolean_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::toBoolean_test(const char*, const QScriptValue& value)
{
QFETCH(bool, expected);
QCOMPARE(value.toBoolean(), expected);
@@ -974,13 +1007,13 @@ void tst_QScriptValue::toBoolean_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(toBoolean)
-void tst_QScriptValue::toInteger_initData()
+void tst_QScriptValueGenerated::toInteger_initData()
{
QTest::addColumn<qsreal>("expected");
initScriptValues();
}
-static QString toInteger_tagArray [] = {
+static QString toInteger_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1084,6 +1117,11 @@ static QString toInteger_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -1118,39 +1156,40 @@ static QString toInteger_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
-static qsreal toInteger_valueArray [] = {
- 0, 0, 0, 1, 0, 122, 124, 0, 0, 123,
- 0, 0, 1126240820, 65536, 65537, 0, 0, qInf(), qInf(), 0,
- qInf(), qInf(), 0, 0, 0, 0, 0, 123, 12, 0,
- 0, 1, 0, 122, 124, 0, 0, 123, 0, 0,
- 1126240820, 65536, 65537, 0, 0, qInf(), qInf(), 0, qInf(), qInf(),
- 0, 0, 0, 0, 0, 123, 12, 0, 0, 1,
- 0, 122, 124, 0, 0, 123, 0, 0, 1126240820, 65536,
- 65537, 0, 0, qInf(), qInf(), 0, qInf(), qInf(), 0, 0,
- 0, 0, 0, 123, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 22, 0, 0, 0, 0, 0, 0,
- 1, 0, 122, 124, 0, 0, 123, 0, 0, 1126240820,
- 65536, 65537, 0, qInf(), qInf(), 0, 0, 0, 123, 12,
- 0, 0, 0, 0, 0, 0, 0, 0, 123, 0,
- 0, 0, };
-void tst_QScriptValue::toInteger_makeData(const char* expr)
+ "engine->newQObject(engine)"};
+static qsreal toInteger_valueArray[] = {
+ 0, 0, 0, 1, 0, 122, 124, 0, 0, 123,
+ 0, 0, 1126240820, 65536, 65537, 0, 0, qInf(), qInf(), 0,
+ qInf(), qInf(), 0, 0, 0, 0, 0, 123, 12, 0,
+ 0, 1, 0, 122, 124, 0, 0, 123, 0, 0,
+ 1126240820, 65536, 65537, 0, 0, qInf(), qInf(), 0, qInf(), qInf(),
+ 0, 0, 0, 0, 0, 123, 12, 0, 0, 1,
+ 0, 122, 124, 0, 0, 123, 0, 0, 1126240820, 65536,
+ 65537, 0, 0, qInf(), qInf(), 0, qInf(), qInf(), 0, 0,
+ 0, 0, 0, 123, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 0, 123, 0, 0, 22, 0,
+ 0, 0, 0, 0, 0, 1, 0, 122, 124, 0,
+ 0, 123, 0, 0, 1126240820, 65536, 65537, 0, qInf(), qInf(),
+ 0, 0, 0, 123, 12, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 123, 0, 0, 0};
+void tst_QScriptValueGenerated::toInteger_makeData(const char* expr)
{
static QHash<QString, qsreal> toInteger;
if (toInteger.isEmpty()) {
- toInteger.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ toInteger.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
toInteger.insert(toInteger_tagArray[i], toInteger_valueArray[i]);
}
newRow(expr) << toInteger.value(expr);
}
-void tst_QScriptValue::toInteger_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::toInteger_test(const char*, const QScriptValue& value)
{
QFETCH(qsreal, expected);
if (qIsInf(expected)) {
@@ -1165,13 +1204,13 @@ void tst_QScriptValue::toInteger_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(toInteger)
-void tst_QScriptValue::toInt32_initData()
+void tst_QScriptValueGenerated::toInt32_initData()
{
QTest::addColumn<qint32>("expected");
initScriptValues();
}
-static QString toInt32_tagArray [] = {
+static QString toInt32_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1275,6 +1314,11 @@ static QString toInt32_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -1309,97 +1353,101 @@ static QString toInt32_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
+ "engine->newQObject(engine)"};
-static qint32 toInt32_valueArray [] = {
- 0, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 22,
- 0, 0,
- 0, 0,
- 0, 0,
- 1, 0,
- 122, 124,
- 0, 0,
- 123, 0,
- 0, 1126240820,
- 65536, 65537,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 12,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 0,
- 0, 0, };
+static qint32 toInt32_valueArray[] = {
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 123,
+ 0, 0,
+ 22, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 123, 0,
+ 0, 0};
-void tst_QScriptValue::toInt32_makeData(const char* expr)
+void tst_QScriptValueGenerated::toInt32_makeData(const char* expr)
{
static QHash<QString, qint32> toInt32;
if (toInt32.isEmpty()) {
- toInt32.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ toInt32.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
toInt32.insert(toInt32_tagArray[i], toInt32_valueArray[i]);
}
newRow(expr) << toInt32.value(expr);
}
-void tst_QScriptValue::toInt32_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::toInt32_test(const char*, const QScriptValue& value)
{
QFETCH(qint32, expected);
QCOMPARE(value.toInt32(), expected);
@@ -1409,13 +1457,13 @@ void tst_QScriptValue::toInt32_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(toInt32)
-void tst_QScriptValue::toUInt32_initData()
+void tst_QScriptValueGenerated::toUInt32_initData()
{
QTest::addColumn<quint32>("expected");
initScriptValues();
}
-static QString toUInt32_tagArray [] = {
+static QString toUInt32_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1519,6 +1567,11 @@ static QString toUInt32_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -1553,97 +1606,101 @@ static QString toUInt32_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
+ "engine->newQObject(engine)"};
-static quint32 toUInt32_valueArray [] = {
- 0, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 1126240820, 65536,
- 65537, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 22,
- 0, 0,
- 0, 0,
- 0, 0,
- 1, 0,
- 122, 124,
- 0, 0,
- 123, 0,
- 0, 1126240820,
- 65536, 65537,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 12,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 0,
- 0, 0, };
+static quint32 toUInt32_valueArray[] = {
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 123,
+ 0, 0,
+ 22, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 1126240820, 65536,
+ 65537, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 123, 0,
+ 0, 0};
-void tst_QScriptValue::toUInt32_makeData(const char* expr)
+void tst_QScriptValueGenerated::toUInt32_makeData(const char* expr)
{
static QHash<QString, quint32> toUInt32;
if (toUInt32.isEmpty()) {
- toUInt32.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ toUInt32.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
toUInt32.insert(toUInt32_tagArray[i], toUInt32_valueArray[i]);
}
newRow(expr) << toUInt32.value(expr);
}
-void tst_QScriptValue::toUInt32_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::toUInt32_test(const char*, const QScriptValue& value)
{
QFETCH(quint32, expected);
QCOMPARE(value.toUInt32(), expected);
@@ -1653,13 +1710,13 @@ void tst_QScriptValue::toUInt32_test(const char*, const QScriptValue& value)
DEFINE_TEST_FUNCTION(toUInt32)
-void tst_QScriptValue::toUInt16_initData()
+void tst_QScriptValueGenerated::toUInt16_initData()
{
QTest::addColumn<quint16>("expected");
initScriptValues();
}
-static QString toUInt16_tagArray [] = {
+static QString toUInt16_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1763,6 +1820,11 @@ static QString toUInt16_tagArray [] = {
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"new Boolean(true)\")",
+ "engine->evaluate(\"new Boolean(false)\")",
+ "engine->evaluate(\"new Number(123)\")",
+ "engine->evaluate(\"new RegExp('foo', 'gim')\")",
+ "engine->evaluate(\"new String('ciao')\")",
"engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
@@ -1797,97 +1859,101 @@ static QString toUInt16_tagArray [] = {
"engine->newArray(10)",
"engine->newDate(QDateTime())",
"engine->newQMetaObject(&QObject::staticMetaObject)",
+ "engine->newRegExp(\"foo\", \"gim\")",
"engine->newVariant(QVariant())",
"engine->newVariant(QVariant(123))",
"engine->newVariant(QVariant(false))",
"engine->newQObject(0)",
- "engine->newQObject(engine)",};
+ "engine->newQObject(engine)"};
-static quint16 toUInt16_valueArray [] = {
- 0, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 4660, 0,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 4660, 0,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 12, 0,
- 0, 1,
- 0, 122,
- 124, 0,
- 0, 123,
- 0, 0,
- 4660, 0,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 123,
- 1, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 22,
- 0, 0,
- 0, 0,
- 0, 0,
- 1, 0,
- 122, 124,
- 0, 0,
- 123, 0,
- 0, 4660,
- 0, 1,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 12,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 123, 0,
- 0, 0, };
+static quint16 toUInt16_valueArray[] = {
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 4660, 0,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 4660, 0,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 4660, 0,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 123,
+ 0, 0,
+ 22, 0,
+ 0, 0,
+ 0, 0,
+ 0, 1,
+ 0, 122,
+ 124, 0,
+ 0, 123,
+ 0, 0,
+ 4660, 0,
+ 1, 0,
+ 0, 0,
+ 0, 0,
+ 0, 123,
+ 12, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 123, 0,
+ 0, 0};
-void tst_QScriptValue::toUInt16_makeData(const char* expr)
+void tst_QScriptValueGenerated::toUInt16_makeData(const char* expr)
{
static QHash<QString, quint16> toUInt16;
if (toUInt16.isEmpty()) {
- toUInt16.reserve(142);
- for (unsigned i = 0; i < 142; ++i)
+ toUInt16.reserve(148);
+ for (unsigned i = 0; i < 148; ++i)
toUInt16.insert(toUInt16_tagArray[i], toUInt16_valueArray[i]);
}
newRow(expr) << toUInt16.value(expr);
}
-void tst_QScriptValue::toUInt16_test(const char*, const QScriptValue& value)
+void tst_QScriptValueGenerated::toUInt16_test(const char*, const QScriptValue& value)
{
QFETCH(quint16, expected);
QCOMPARE(value.toUInt16(), expected);
diff --git a/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp b/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp
index 6690d22eb4..666eb21e53 100644
--- a/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp
+++ b/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp
@@ -71,6 +71,7 @@ private slots:
void iterateString();
void iterateGetterSetter();
void assignObjectToIterator();
+ void iterateNonObject();
};
tst_QScriptValueIterator::tst_QScriptValueIterator()
@@ -583,5 +584,25 @@ void tst_QScriptValueIterator::assignObjectToIterator()
QCOMPARE(it.name(), QString::fromLatin1("bar"));
}
+void tst_QScriptValueIterator::iterateNonObject()
+{
+ QScriptValueIterator it(123);
+ QVERIFY(!it.hasNext());
+ it.next();
+ QVERIFY(!it.hasPrevious());
+ it.previous();
+ it.toFront();
+ it.toBack();
+ it.name();
+ it.scriptName();
+ it.flags();
+ it.value();
+ it.setValue(1);
+ it.remove();
+ QScriptValue num(5);
+ it = num;
+ QVERIFY(!it.hasNext());
+}
+
QTEST_MAIN(tst_QScriptValueIterator)
#include "tst_qscriptvalueiterator.moc"
diff --git a/tests/auto/qscroller/qscroller.pro b/tests/auto/qscroller/qscroller.pro
new file mode 100644
index 0000000000..845dcb9aa4
--- /dev/null
+++ b/tests/auto/qscroller/qscroller.pro
@@ -0,0 +1,3 @@
+load(qttest_p4)
+
+SOURCES += tst_qscroller.cpp
diff --git a/tests/auto/qscroller/tst_qscroller.cpp b/tests/auto/qscroller/tst_qscroller.cpp
new file mode 100644
index 0000000000..b4e4ddf6d0
--- /dev/null
+++ b/tests/auto/qscroller/tst_qscroller.cpp
@@ -0,0 +1,537 @@
+/****************************************************************************
+**
+** 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 $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 <QtGui>
+#include <QtTest>
+// #include <QDebug>
+
+class tst_QScrollerWidget : public QWidget
+{
+public:
+ tst_QScrollerWidget()
+ : QWidget()
+ {
+ reset();
+ }
+
+ void reset()
+ {
+ receivedPrepare = false;
+ receivedScroll = false;
+ receivedFirst = false;
+ receivedLast = false;
+ receivedOvershoot = false;
+ }
+
+ bool event(QEvent *e)
+ {
+ switch (e->type()) {
+ case QEvent::Gesture:
+ e->setAccepted(false); // better reject the event or QGestureManager will make trouble
+ return false;
+
+ case QEvent::ScrollPrepare:
+ {
+ receivedPrepare = true;
+ QScrollPrepareEvent *se = static_cast<QScrollPrepareEvent *>(e);
+ se->setViewportSize(QSizeF(100,100));
+ se->setContentPosRange(scrollArea);
+ se->setContentPos(scrollPosition);
+ se->accept();
+ return true;
+ }
+
+ case QEvent::Scroll:
+ {
+ receivedScroll = true;
+ QScrollEvent *se = static_cast<QScrollEvent *>(e);
+ // qDebug() << "Scroll for"<<this<<"pos"<<se->scrollPos()<<"ov"<<se->overshoot()<<"first"<<se->isFirst()<<"last"<<se->isLast();
+
+ if (se->scrollState() == QScrollEvent::ScrollStarted)
+ receivedFirst = true;
+ if (se->scrollState() == QScrollEvent::ScrollFinished)
+ receivedLast = true;
+
+ currentPos = se->contentPos();
+ overshoot = se->overshootDistance();
+ if (!qFuzzyCompare( overshoot.x() + 1.0, 1.0 ) ||
+ !qFuzzyCompare( overshoot.y() + 1.0, 1.0 ))
+ receivedOvershoot = true;
+ return true;
+ }
+
+ default:
+ return QObject::event(e);
+ }
+ }
+
+
+ QRectF scrollArea;
+ QPointF scrollPosition;
+
+ bool receivedPrepare;
+ bool receivedScroll;
+ bool receivedFirst;
+ bool receivedLast;
+ bool receivedOvershoot;
+
+ QPointF currentPos;
+ QPointF overshoot;
+};
+
+
+class tst_QScroller : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QScroller() { }
+ ~tst_QScroller() { }
+
+private:
+ void kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint touchStart, QPoint touchUpdate, QPoint touchEnd);
+ void kineticScrollNoTest( tst_QScrollerWidget *sw, QPointF from, QPoint touchStart, QPoint touchUpdate, QPoint touchEnd);
+
+private slots:
+ void staticScrollers();
+ void scrollerProperties();
+ void scrollTo();
+ void scroll();
+ void overshoot();
+};
+
+/*! \internal
+ Generates touchBegin, touchUpdate and touchEnd events to trigger scrolling.
+ Tests some in between states but does not wait until scrolling is finished.
+*/
+void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint touchStart, QPoint touchUpdate, QPoint touchEnd)
+{
+ sw->scrollPosition = from;
+ sw->currentPos= from;
+
+ QScroller *s1 = QScroller::scroller(sw);
+ QCOMPARE( s1->state(), QScroller::Inactive );
+
+ QScrollerProperties sp1 = QScroller::scroller(sw)->scrollerProperties();
+ int fps = 60;
+
+ QTouchEvent::TouchPoint rawTouchPoint;
+ rawTouchPoint.setId(0);
+
+ // send the touch begin event
+ QTouchEvent::TouchPoint touchPoint(0);
+ touchPoint.setState(Qt::TouchPointPressed);
+ touchPoint.setPos(touchStart);
+ touchPoint.setScenePos(touchStart);
+ touchPoint.setScreenPos(touchStart);
+ QTouchEvent touchEvent1(QEvent::TouchBegin,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointPressed,
+ (QList<QTouchEvent::TouchPoint>() << touchPoint));
+ QApplication::sendEvent(sw, &touchEvent1);
+
+ QCOMPARE( s1->state(), QScroller::Pressed );
+
+ // send the touch update far enough to trigger a scroll
+ QTest::qWait(200); // we need to wait a little or else the speed would be infinite. now we have around 500 pixel per second.
+ touchPoint.setPos(touchUpdate);
+ touchPoint.setScenePos(touchUpdate);
+ touchPoint.setScreenPos(touchUpdate);
+ QTouchEvent touchEvent2(QEvent::TouchUpdate,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointMoved,
+ (QList<QTouchEvent::TouchPoint>() << touchPoint));
+ QApplication::sendEvent(sw, &touchEvent2);
+
+ QCOMPARE( s1->state(), QScroller::Dragging );
+ QCOMPARE( sw->receivedPrepare, true );
+
+
+ QTest::qWait(1000 / fps * 2); // wait until the first scroll move
+ QCOMPARE( sw->receivedFirst, true );
+ QCOMPARE( sw->receivedScroll, true );
+ QCOMPARE( sw->receivedOvershoot, false );
+
+ // note that the scrolling goes in a different direction than the mouse move
+ QPoint calculatedPos = from.toPoint() - touchUpdate - touchStart;
+ QVERIFY(qAbs(sw->currentPos.x() - calculatedPos.x()) < 1.0);
+ QVERIFY(qAbs(sw->currentPos.y() - calculatedPos.y()) < 1.0);
+
+ // send the touch end
+ touchPoint.setPos(touchEnd);
+ touchPoint.setScenePos(touchEnd);
+ touchPoint.setScreenPos(touchEnd);
+ QTouchEvent touchEvent5(QEvent::TouchEnd,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointReleased,
+ (QList<QTouchEvent::TouchPoint>() << touchPoint));
+ QApplication::sendEvent(sw, &touchEvent5);
+}
+
+/*! \internal
+ Generates touchBegin, touchUpdate and touchEnd events to trigger scrolling.
+ This function does not have any in between tests, it does not expect the scroller to actually scroll.
+*/
+void tst_QScroller::kineticScrollNoTest( tst_QScrollerWidget *sw, QPointF from, QPoint touchStart, QPoint touchUpdate, QPoint touchEnd)
+{
+ sw->scrollPosition = from;
+ sw->currentPos = from;
+
+ QScroller *s1 = QScroller::scroller(sw);
+ QCOMPARE( s1->state(), QScroller::Inactive );
+
+ QScrollerProperties sp1 = s1->scrollerProperties();
+ int fps = 60;
+
+ QTouchEvent::TouchPoint rawTouchPoint;
+ rawTouchPoint.setId(0);
+
+ // send the touch begin event
+ QTouchEvent::TouchPoint touchPoint(0);
+ touchPoint.setState(Qt::TouchPointPressed);
+ touchPoint.setPos(touchStart);
+ touchPoint.setScenePos(touchStart);
+ touchPoint.setScreenPos(touchStart);
+ QTouchEvent touchEvent1(QEvent::TouchBegin,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointPressed,
+ (QList<QTouchEvent::TouchPoint>() << touchPoint));
+ QApplication::sendEvent(sw, &touchEvent1);
+
+ // send the touch update far enough to trigger a scroll
+ QTest::qWait(200); // we need to wait a little or else the speed would be infinite. now we have around 500 pixel per second.
+ touchPoint.setPos(touchUpdate);
+ touchPoint.setScenePos(touchUpdate);
+ touchPoint.setScreenPos(touchUpdate);
+ QTouchEvent touchEvent2(QEvent::TouchUpdate,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointMoved,
+ (QList<QTouchEvent::TouchPoint>() << touchPoint));
+ QApplication::sendEvent(sw, &touchEvent2);
+
+ QTest::qWait(1000 / fps * 2); // wait until the first scroll move
+
+ // send the touch end
+ touchPoint.setPos(touchEnd);
+ touchPoint.setScenePos(touchEnd);
+ touchPoint.setScreenPos(touchEnd);
+ QTouchEvent touchEvent5(QEvent::TouchEnd,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointReleased,
+ (QList<QTouchEvent::TouchPoint>() << touchPoint));
+ QApplication::sendEvent(sw, &touchEvent5);
+}
+
+
+void tst_QScroller::staticScrollers()
+{
+ // scrollers
+ {
+ QObject *o1 = new QObject(this);
+ QObject *o2 = new QObject(this);
+
+ // get scroller for object
+ QScroller *s1 = QScroller::scroller(o1);
+ QScroller *s2 = QScroller::scroller(o2);
+
+ QVERIFY(s1);
+ QVERIFY(s2);
+ QVERIFY(s1 != s2);
+
+ QVERIFY(!QScroller::scroller(static_cast<const QObject*>(0)));
+ QCOMPARE(QScroller::scroller(o1), s1);
+
+ delete o1;
+ delete o2;
+ }
+
+ // the same for properties
+ {
+ QObject *o1 = new QObject(this);
+ QObject *o2 = new QObject(this);
+
+ // get scroller for object
+ QScrollerProperties sp1 = QScroller::scroller(o1)->scrollerProperties();
+ QScrollerProperties sp2 = QScroller::scroller(o2)->scrollerProperties();
+
+ // default properties should be the same
+ QVERIFY(sp1 == sp2);
+
+ QCOMPARE(QScroller::scroller(o1)->scrollerProperties(), sp1);
+
+ delete o1;
+ delete o2;
+ }
+}
+
+void tst_QScroller::scrollerProperties()
+{
+ QObject *o1 = new QObject(this);
+ QScrollerProperties sp1 = QScroller::scroller(o1)->scrollerProperties();
+
+ QScrollerProperties::ScrollMetric metrics[] =
+ {
+ QScrollerProperties::MousePressEventDelay, // qreal [s]
+ QScrollerProperties::DragStartDistance, // qreal [m]
+ QScrollerProperties::DragVelocitySmoothingFactor, // qreal [0..1/s] (complex calculation involving time) v = v_new* DASF + v_old * (1-DASF)
+ QScrollerProperties::AxisLockThreshold, // qreal [0..1] atan(|min(dx,dy)|/|max(dx,dy)|)
+
+ QScrollerProperties::DecelerationFactor, // slope of the curve
+
+ QScrollerProperties::MinimumVelocity, // qreal [m/s]
+ QScrollerProperties::MaximumVelocity, // qreal [m/s]
+ QScrollerProperties::MaximumClickThroughVelocity, // qreal [m/s]
+
+ QScrollerProperties::AcceleratingFlickMaximumTime, // qreal [s]
+ QScrollerProperties::AcceleratingFlickSpeedupFactor, // qreal [1..]
+
+ QScrollerProperties::SnapPositionRatio, // qreal [0..1]
+ QScrollerProperties::SnapTime, // qreal [s]
+
+ QScrollerProperties::OvershootDragResistanceFactor, // qreal [0..1]
+ QScrollerProperties::OvershootDragDistanceFactor, // qreal [0..1]
+ QScrollerProperties::OvershootScrollDistanceFactor, // qreal [0..1]
+ QScrollerProperties::OvershootScrollTime, // qreal [s]
+ };
+
+ for (unsigned int i = 0; i < sizeof(metrics) / sizeof(metrics[0]); i++) {
+ sp1.setScrollMetric(metrics[i], 0.9);
+ QCOMPARE(sp1.scrollMetric(metrics[i]).toDouble(), 0.9);
+ }
+ sp1.setScrollMetric(QScrollerProperties::ScrollingCurve, QEasingCurve(QEasingCurve::OutQuart));
+ QCOMPARE(sp1.scrollMetric(QScrollerProperties::ScrollingCurve).toEasingCurve().type(), QEasingCurve::OutQuart);
+
+ sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOff));
+ QCOMPARE(sp1.scrollMetric(QScrollerProperties::HorizontalOvershootPolicy).value<QScrollerProperties::OvershootPolicy>(), QScrollerProperties::OvershootAlwaysOff);
+
+ sp1.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOn));
+ QCOMPARE(sp1.scrollMetric(QScrollerProperties::VerticalOvershootPolicy).value<QScrollerProperties::OvershootPolicy>(), QScrollerProperties::OvershootAlwaysOn);
+
+ sp1.setScrollMetric(QScrollerProperties::FrameRate, QVariant::fromValue(QScrollerProperties::Fps20));
+ QCOMPARE(sp1.scrollMetric(QScrollerProperties::FrameRate).value<QScrollerProperties::FrameRates>(), QScrollerProperties::Fps20);
+}
+
+void tst_QScroller::scrollTo()
+{
+ {
+ tst_QScrollerWidget *sw = new tst_QScrollerWidget();
+ sw->scrollArea = QRectF( 0, 0, 1000, 1000 );
+ sw->scrollPosition = QPointF( 500, 500 );
+
+ QScroller *s1 = QScroller::scroller(sw);
+ QCOMPARE( s1->state(), QScroller::Inactive );
+
+ // a normal scroll
+ s1->scrollTo(QPointF(100,100), 100);
+ QTest::qWait(200);
+
+ QCOMPARE( sw->receivedPrepare, true );
+ QCOMPARE( sw->receivedScroll, true );
+ QCOMPARE( sw->receivedFirst, true );
+ QCOMPARE( sw->receivedLast, true );
+ QCOMPARE( sw->receivedOvershoot, false );
+ QVERIFY(qFuzzyCompare( sw->currentPos.x(), 100 ));
+ QVERIFY(qFuzzyCompare( sw->currentPos.y(), 100 ));
+
+ delete sw;
+ }
+}
+
+void tst_QScroller::scroll()
+{
+#if defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
+ QSKIP("Mac OS X < 10.6 does not support QTouchEvents", SkipAll);
+ return;
+#endif
+
+#ifndef QT_NO_GESTURES
+ // -- good case. normal scroll
+ tst_QScrollerWidget *sw = new tst_QScrollerWidget();
+ sw->scrollArea = QRectF(0, 0, 1000, 1000);
+ QScroller::grabGesture(sw, QScroller::TouchGesture);
+ sw->setGeometry(100, 100, 400, 300);
+
+ QScroller *s1 = QScroller::scroller(sw);
+ kineticScroll(sw, QPointF(500, 500), QPoint(0, 0), QPoint(100, 100), QPoint(200, 200));
+ // now we should be scrolling
+ QCOMPARE( s1->state(), QScroller::Scrolling );
+
+ // wait until finished, check that no further first scroll is send
+ sw->receivedFirst = false;
+ sw->receivedScroll = false;
+ while (s1->state() == QScroller::Scrolling)
+ QTest::qWait(100);
+
+ QCOMPARE( sw->receivedFirst, false );
+ QCOMPARE( sw->receivedScroll, true );
+ QCOMPARE( sw->receivedLast, true );
+ QVERIFY(sw->currentPos.x() < 400);
+ QVERIFY(sw->currentPos.y() < 400);
+
+ // -- try to scroll when nothing to scroll
+
+ sw->reset();
+ sw->scrollArea = QRectF(0, 0, 0, 1000);
+ kineticScrollNoTest(sw, QPointF(0, 500), QPoint(0, 0), QPoint(100, 0), QPoint(200, 0));
+
+ while (s1->state() != QScroller::Inactive)
+ QTest::qWait(20);
+
+ QCOMPARE(sw->currentPos.x(), 0.0);
+ QCOMPARE(sw->currentPos.y(), 500.0);
+
+ delete sw;
+#endif
+}
+
+void tst_QScroller::overshoot()
+{
+#if defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
+ QSKIP("Mac OS X < 10.6 does not support QTouchEvents", SkipAll);
+ return;
+#endif
+
+#ifndef QT_NO_GESTURES
+ tst_QScrollerWidget *sw = new tst_QScrollerWidget();
+ sw->scrollArea = QRectF(0, 0, 1000, 1000);
+ QScroller::grabGesture(sw, QScroller::TouchGesture);
+ sw->setGeometry(100, 100, 400, 300);
+
+ QScroller *s1 = QScroller::scroller(sw);
+ QScrollerProperties sp1 = s1->scrollerProperties();
+
+ sp1.setScrollMetric(QScrollerProperties::OvershootDragResistanceFactor, 0.5);
+ sp1.setScrollMetric(QScrollerProperties::OvershootDragDistanceFactor, 0.2);
+ sp1.setScrollMetric(QScrollerProperties::OvershootScrollDistanceFactor, 0.2);
+
+ // -- try to scroll with overshoot (when scrollable good case)
+
+ sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootWhenScrollable));
+ s1->setScrollerProperties(sp1);
+ kineticScrollNoTest(sw, QPointF(500, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
+
+ while (s1->state() != QScroller::Inactive)
+ QTest::qWait(20);
+
+ //qDebug() << "Overshoot fuzzy: "<<sw->currentPos;
+ QVERIFY(qFuzzyCompare( sw->currentPos.x(), 0 ));
+ QVERIFY(qFuzzyCompare( sw->currentPos.y(), 500 ));
+ QCOMPARE( sw->receivedOvershoot, true );
+
+ // -- try to scroll with overshoot (when scrollable bad case)
+ sw->reset();
+ sw->scrollArea = QRectF(0, 0, 0, 1000);
+
+ sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootWhenScrollable));
+ s1->setScrollerProperties(sp1);
+ kineticScrollNoTest(sw, QPointF(0, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
+
+ while (s1->state() != QScroller::Inactive)
+ QTest::qWait(20);
+
+ //qDebug() << "Overshoot fuzzy: "<<sw->currentPos;
+ QVERIFY(qFuzzyCompare( sw->currentPos.x(), 0 ));
+ QVERIFY(qFuzzyCompare( sw->currentPos.y(), 500 ));
+ QCOMPARE( sw->receivedOvershoot, false );
+
+ // -- try to scroll with overshoot (always on)
+ sw->reset();
+ sw->scrollArea = QRectF(0, 0, 0, 1000);
+
+ sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOn));
+ s1->setScrollerProperties(sp1);
+ kineticScrollNoTest(sw, QPointF(0, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
+
+ while (s1->state() != QScroller::Inactive)
+ QTest::qWait(20);
+
+ //qDebug() << "Overshoot fuzzy: "<<sw->currentPos;
+
+ QVERIFY(qFuzzyCompare( sw->currentPos.x(), 0 ));
+ QVERIFY(qFuzzyCompare( sw->currentPos.y(), 500 ));
+ QCOMPARE( sw->receivedOvershoot, true );
+
+ // -- try to scroll with overshoot (always off)
+ sw->reset();
+ sw->scrollArea = QRectF(0, 0, 1000, 1000);
+
+ sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOff));
+ s1->setScrollerProperties(sp1);
+ kineticScrollNoTest(sw, QPointF(500, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
+
+ while (s1->state() != QScroller::Inactive)
+ QTest::qWait(20);
+
+ QVERIFY(qFuzzyCompare( sw->currentPos.x(), 0 ));
+ QVERIFY(qFuzzyCompare( sw->currentPos.y(), 500 ));
+ QCOMPARE( sw->receivedOvershoot, false );
+
+ // -- try to scroll with overshoot (always on but max overshoot = 0)
+ sp1.setScrollMetric(QScrollerProperties::OvershootDragDistanceFactor, 0.0);
+ sp1.setScrollMetric(QScrollerProperties::OvershootScrollDistanceFactor, 0.0);
+ sw->reset();
+ sw->scrollArea = QRectF(0, 0, 1000, 1000);
+
+ sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOn));
+ s1->setScrollerProperties(sp1);
+ kineticScrollNoTest(sw, QPointF(500, 500), QPoint(0, 0), QPoint(400, 0), QPoint(490, 0));
+
+ while (s1->state() != QScroller::Inactive)
+ QTest::qWait(20);
+
+ QVERIFY(qFuzzyCompare( sw->currentPos.x(), 0 ));
+ QVERIFY(qFuzzyCompare( sw->currentPos.y(), 500 ));
+ QCOMPARE( sw->receivedOvershoot, false );
+
+
+ delete sw;
+#endif
+}
+
+
+QTEST_MAIN(tst_QScroller)
+
+#include "tst_qscroller.moc"
diff --git a/tests/auto/qsemaphore/qsemaphore.pro b/tests/auto/qsemaphore/qsemaphore.pro
index f720c0b20b..5978215f07 100644
--- a/tests/auto/qsemaphore/qsemaphore.pro
+++ b/tests/auto/qsemaphore/qsemaphore.pro
@@ -3,3 +3,4 @@ SOURCES += tst_qsemaphore.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qsequentialanimationgroup/qsequentialanimationgroup.pro b/tests/auto/qsequentialanimationgroup/qsequentialanimationgroup.pro
index 01ef68a585..c0c10c054d 100644
--- a/tests/auto/qsequentialanimationgroup/qsequentialanimationgroup.pro
+++ b/tests/auto/qsequentialanimationgroup/qsequentialanimationgroup.pro
@@ -3,3 +3,4 @@ QT = core
SOURCES += tst_qsequentialanimationgroup.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qset/qset.pro b/tests/auto/qset/qset.pro
index b45a015c23..ebdf0d68f0 100644
--- a/tests/auto/qset/qset.pro
+++ b/tests/auto/qset/qset.pro
@@ -6,3 +6,4 @@ symbian: {
TARGET.EPOCSTACKSIZE =0x5000
TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
+CONFIG += parallel_test
diff --git a/tests/auto/qset/tst_qset.cpp b/tests/auto/qset/tst_qset.cpp
index 204ca557ea..ae293db0e3 100644
--- a/tests/auto/qset/tst_qset.cpp
+++ b/tests/auto/qset/tst_qset.cpp
@@ -65,6 +65,7 @@ public:
private slots:
void operator_eq();
+ void swap();
void size();
void capacity();
void reserve();
@@ -145,6 +146,16 @@ void tst_QSet::operator_eq()
}
}
+void tst_QSet::swap()
+{
+ QSet<int> s1, s2;
+ s1.insert(1);
+ s2.insert(2);
+ s1.swap(s2);
+ QCOMPARE(*s1.begin(),2);
+ QCOMPARE(*s2.begin(),1);
+}
+
void tst_QSet::size()
{
QSet<int> set;
diff --git a/tests/auto/qsettings/qsettings.pro b/tests/auto/qsettings/qsettings.pro
index 19513b3355..fe104dfaa9 100644
--- a/tests/auto/qsettings/qsettings.pro
+++ b/tests/auto/qsettings/qsettings.pro
@@ -6,3 +6,5 @@ contains(QT_CONFIG, qt3support):QT += qt3support
CONFIG -= debug
CONFIG += release
win32-msvc*:LIBS += advapi32.lib
+
+CONFIG += parallel_test
diff --git a/tests/auto/qsharedpointer/qsharedpointer.pro b/tests/auto/qsharedpointer/qsharedpointer.pro
index bbd31d7c7a..014006e782 100644
--- a/tests/auto/qsharedpointer/qsharedpointer.pro
+++ b/tests/auto/qsharedpointer/qsharedpointer.pro
@@ -12,3 +12,4 @@ QT = core
!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
include(externaltests.pri)
+CONFIG += parallel_test
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index 194a58de2d..e7c81752c9 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -732,7 +732,6 @@ void tst_QSharedPointer::objectCast()
ptr = baseptr.objectCast<OtherObject>();
QVERIFY(ptr == data);
-#ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
// again:
ptr = qobject_cast<OtherObject *>(baseptr);
QVERIFY(ptr == data);
@@ -740,7 +739,6 @@ void tst_QSharedPointer::objectCast()
// again:
ptr = qobject_cast<QSharedPointer<OtherObject> >(baseptr);
QVERIFY(ptr == data);
-#endif
}
check();
@@ -760,7 +758,6 @@ void tst_QSharedPointer::objectCast()
ptr = baseptr.objectCast<const OtherObject>();
QVERIFY(ptr == data);
-#ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
// again:
ptr = qobject_cast<const OtherObject *>(baseptr);
QVERIFY(ptr == data);
@@ -768,7 +765,6 @@ void tst_QSharedPointer::objectCast()
// again:
ptr = qobject_cast<QSharedPointer<const OtherObject> >(baseptr);
QVERIFY(ptr == data);
-#endif
}
check();
@@ -802,7 +798,6 @@ void tst_QSharedPointer::objectCast()
QSharedPointer<OtherObject> otherptr = qSharedPointerObjectCast<OtherObject>(weakptr);
QVERIFY(otherptr.isNull());
-#ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
// again:
otherptr = qobject_cast<OtherObject *>(weakptr);
QVERIFY(otherptr.isNull());
@@ -810,7 +805,6 @@ void tst_QSharedPointer::objectCast()
// again:
otherptr = qobject_cast<QSharedPointer<OtherObject> >(weakptr);
QVERIFY(otherptr.isNull());
-#endif
}
check();
}
@@ -1736,12 +1730,10 @@ void tst_QSharedPointer::invalidConstructs_data()
<< &QTest::QExternalTest::tryCompileFail
<< "QSharedPointer<const QObject> baseptr = QSharedPointer<const QObject>(new QObject);\n"
"qSharedPointerObjectCast<QCoreApplication>(baseptr);";
-#ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
QTest::newRow("const-dropping-object-cast2")
<< &QTest::QExternalTest::tryCompileFail
<< "QSharedPointer<const QObject> baseptr = QSharedPointer<const QObject>(new QObject);\n"
"qobject_cast<QCoreApplication *>(baseptr);";
-#endif
// arithmethics through automatic cast operators
QTest::newRow("arithmethic1")
diff --git a/tests/auto/qsignalspy/qsignalspy.pro b/tests/auto/qsignalspy/qsignalspy.pro
index 4bc4a7b751..d3ae63b5bc 100644
--- a/tests/auto/qsignalspy/qsignalspy.pro
+++ b/tests/auto/qsignalspy/qsignalspy.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qsignalspy.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qsize/qsize.pro b/tests/auto/qsize/qsize.pro
index 14786b8b35..a1814ac8c5 100644
--- a/tests/auto/qsize/qsize.pro
+++ b/tests/auto/qsize/qsize.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qsize.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qsizef/qsizef.pro b/tests/auto/qsizef/qsizef.pro
index 703d721545..5aa07d72a1 100644
--- a/tests/auto/qsizef/qsizef.pro
+++ b/tests/auto/qsizef/qsizef.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qsizef.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index bce7281b7e..6bb971d53d 100644
--- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -147,6 +147,7 @@ private slots:
void testMultipleProxiesWithSelection();
void mapSelectionFromSource();
+ void testResetInternalData();
void filteredColumns();
protected:
@@ -2800,10 +2801,12 @@ void tst_QSortFilterProxyModel::task252507_mapFromToSource()
QCOMPARE(proxy.mapFromSource(QModelIndex()), QModelIndex());
QCOMPARE(proxy.mapToSource(QModelIndex()), QModelIndex());
+#ifdef QT_NO_DEBUG //if Qt is compiled in debug mode, this will assert
QTest::ignoreMessage(QtWarningMsg, "QSortFilterProxyModel: index from wrong model passed to mapToSource ");
QCOMPARE(proxy.mapToSource(source.index(2, 3)), QModelIndex());
QTest::ignoreMessage(QtWarningMsg, "QSortFilterProxyModel: index from wrong model passed to mapFromSource ");
QCOMPARE(proxy.mapFromSource(proxy.index(6, 2)), QModelIndex());
+#endif
}
static QStandardItem *addEntry(QStandardItem* pParent, const QString &description)
@@ -3178,6 +3181,142 @@ void tst_QSortFilterProxyModel::taskQTBUG_10287_unnecessaryMapCreation()
// No assert failure, it passes.
}
+/**
+ * A proxy which changes the background color for items ending in 'y' or 'r'
+ */
+class CustomDataProxy : public QSortFilterProxyModel
+{
+ Q_OBJECT
+
+public:
+ CustomDataProxy(QObject *parent = 0)
+ : QSortFilterProxyModel(parent)
+ {
+ setDynamicSortFilter(true);
+ }
+
+ void setSourceModel(QAbstractItemModel *sourceModel)
+ {
+ // It would be possible to use only the modelReset signal of the source model to clear
+ // the data in *this, however, this requires that the slot is connected
+ // before QSortFilterProxyModel::setSourceModel is called, and even then depends
+ // on the order of invokation of slots being the same as the order of connection.
+ // ie, not reliable.
+// connect(sourceModel, SIGNAL(modelReset()), SLOT(resetInternalData()));
+ QSortFilterProxyModel::setSourceModel(sourceModel);
+ // Making the connect after the setSourceModel call clears the data too late.
+// connect(sourceModel, SIGNAL(modelReset()), SLOT(resetInternalData()));
+
+ // This could be done in data(), but the point is to need to cache something in the proxy
+ // which needs to be cleared on reset.
+ for (int i = 0; i < sourceModel->rowCount(); ++i)
+ {
+ if (sourceModel->index(i, 0).data().toString().endsWith(QLatin1Char('y')))
+ {
+ m_backgroundColours.insert(i, Qt::blue);
+ } else if (sourceModel->index(i, 0).data().toString().endsWith(QLatin1Char('r')))
+ {
+ m_backgroundColours.insert(i, Qt::red);
+ }
+ }
+ }
+
+ QVariant data(const QModelIndex &index, int role) const
+ {
+ if (role != Qt::BackgroundRole)
+ return QSortFilterProxyModel::data(index, role);
+ return m_backgroundColours.value(index.row());
+ }
+
+private slots:
+ void resetInternalData()
+ {
+ m_backgroundColours.clear();
+ }
+
+private:
+ QHash<int, QColor> m_backgroundColours;
+};
+
+class ModelObserver : public QObject
+{
+ Q_OBJECT
+public:
+ ModelObserver(QAbstractItemModel *model, QObject *parent = 0)
+ : QObject(parent), m_model(model)
+ {
+ connect(m_model, SIGNAL(modelAboutToBeReset()), SLOT(modelAboutToBeReset()));
+ connect(m_model, SIGNAL(modelReset()), SLOT(modelReset()));
+ }
+
+public slots:
+ void modelAboutToBeReset()
+ {
+ int reds = 0, blues = 0;
+ for (int i = 0; i < m_model->rowCount(); ++i)
+ {
+ QColor color = m_model->index(i, 0).data(Qt::BackgroundRole).value<QColor>();
+ if (color == Qt::blue)
+ ++blues;
+ if (color == Qt::red)
+ ++reds;
+ }
+ QCOMPARE(blues, 11);
+ QCOMPARE(reds, 4);
+ }
+
+ void modelReset()
+ {
+ int reds = 0, blues = 0;
+ for (int i = 0; i < m_model->rowCount(); ++i)
+ {
+ QColor color = m_model->index(i, 0).data(Qt::BackgroundRole).value<QColor>();
+ if (color == Qt::blue)
+ ++blues;
+ if (color == Qt::red)
+ ++reds;
+ }
+ QCOMPARE(reds, 0);
+ QCOMPARE(blues, 0);
+ }
+
+private:
+ QAbstractItemModel * const m_model;
+
+};
+
+void tst_QSortFilterProxyModel::testResetInternalData()
+{
+
+ QStringListModel model(QStringList() << "Monday"
+ << "Tuesday"
+ << "Wednesday"
+ << "Thursday"
+ << "Friday"
+ << "January"
+ << "February"
+ << "March"
+ << "April"
+ << "May"
+ << "Saturday"
+ << "June"
+ << "Sunday"
+ << "July"
+ << "August"
+ << "September"
+ << "October"
+ << "November"
+ << "December");
+
+ CustomDataProxy proxy;
+ proxy.setSourceModel(&model);
+
+ ModelObserver observer(&proxy);
+
+ // Cause the source model to reset.
+ model.setStringList(QStringList() << "Spam" << "Eggs");
+}
+
class FilteredColumnProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
@@ -3210,7 +3349,6 @@ void tst_QSortFilterProxyModel::filteredColumns()
insertCommand->setEndRow(0);
// Parent is QModelIndex()
insertCommand->doCommand();
-
}
QTEST_MAIN(tst_QSortFilterProxyModel)
diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro
index bb1981c2b4..b69d084326 100644
--- a/tests/auto/qsound/qsound.pro
+++ b/tests/auto/qsound/qsound.pro
@@ -2,8 +2,8 @@ load(qttest_p4)
SOURCES += tst_qsound.cpp
wince*|symbian: {
- deploy.sources += 4.wav
- DEPLOYMENT = deploy
+ deploy.files += 4.wav
+ DEPLOYMENT += deploy
!symbian:DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/qsound/tst_qsound.cpp b/tests/auto/qsound/tst_qsound.cpp
index 55b626d595..c6b6541eee 100644
--- a/tests/auto/qsound/tst_qsound.cpp
+++ b/tests/auto/qsound/tst_qsound.cpp
@@ -63,6 +63,9 @@ private slots:
void tst_QSound::checkFinished()
{
+#if defined(Q_WS_QPA)
+ QSKIP("QSound is not implemented on Lighthouse", SkipAll);
+#else
QSound sound(SRCDIR"4.wav");
sound.setLoops(3);
sound.play();
@@ -72,15 +75,17 @@ void tst_QSound::checkFinished()
QEXPECT_FAIL("", "QSound buggy on embedded (task QTBUG-157)", Abort);
#endif
QVERIFY(sound.isFinished() );
+#endif
}
void tst_QSound::staticPlay()
{
QSKIP("Test disabled -- only for manual purposes", SkipAll);
-
+#if !defined(Q_WS_QPA)
// Check that you hear sound with static play also.
QSound::play(SRCDIR"4.wav");
QTest::qWait(2000);
+#endif
}
QTEST_MAIN(tst_QSound);
diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro
index b11e408302..5422fae00c 100644
--- a/tests/auto/qsplitter/qsplitter.pro
+++ b/tests/auto/qsplitter/qsplitter.pro
@@ -5,7 +5,7 @@ SOURCES += tst_qsplitter.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
wince*|symbian: {
- addFiles.sources = extradata.txt setSizes3.dat
+ addFiles.files = extradata.txt setSizes3.dat
addFiles.path = .
DEPLOYMENT += addFiles
!symbian:DEFINES += SRCDIR=\\\"./\\\"
diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro
index 0ec581d71c..9bf30f8055 100644
--- a/tests/auto/qsql/qsql.pro
+++ b/tests/auto/qsql/qsql.pro
@@ -13,7 +13,7 @@ symbian {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqldatabase/qsqldatabase.pro b/tests/auto/qsqldatabase/qsqldatabase.pro
index 6381219696..066c24f395 100644
--- a/tests/auto/qsqldatabase/qsqldatabase.pro
+++ b/tests/auto/qsqldatabase/qsqldatabase.pro
@@ -13,7 +13,7 @@ win32: {
wince*: {
DEPLOYMENT_PLUGIN += qsqlite
- testData.sources = testdata
+ testData.files = testdata
testData.path = .
DEPLOYMENT += testData
@@ -26,7 +26,7 @@ symbian {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqldriver/qsqldriver.pro b/tests/auto/qsqldriver/qsqldriver.pro
index 2e9ed67369..c02d74a527 100644
--- a/tests/auto/qsqldriver/qsqldriver.pro
+++ b/tests/auto/qsqldriver/qsqldriver.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qsqldriver.cpp
QT += sql
wince*: {
- plugFiles.sources = ../../../plugins/sqldrivers
+ plugFiles.files = ../../../plugins/sqldrivers
plugFiles.path = .
DEPLOYMENT += plugFiles
LIBS += -lws2
@@ -20,7 +20,7 @@ symbian {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqlerror/qsqlerror.pro b/tests/auto/qsqlerror/qsqlerror.pro
index 456f58529f..ebf6d24381 100644
--- a/tests/auto/qsqlerror/qsqlerror.pro
+++ b/tests/auto/qsqlerror/qsqlerror.pro
@@ -11,7 +11,7 @@ symbian {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqlfield/qsqlfield.pro b/tests/auto/qsqlfield/qsqlfield.pro
index 733985461e..2359151f13 100644
--- a/tests/auto/qsqlfield/qsqlfield.pro
+++ b/tests/auto/qsqlfield/qsqlfield.pro
@@ -7,7 +7,7 @@ symbian {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqlquery/qsqlquery.pro b/tests/auto/qsqlquery/qsqlquery.pro
index 97646ede90..fbcc998900 100644
--- a/tests/auto/qsqlquery/qsqlquery.pro
+++ b/tests/auto/qsqlquery/qsqlquery.pro
@@ -8,7 +8,7 @@ QT = core sql
wince*: {
- plugFiles.sources = ../../../plugins/sqldrivers
+ plugFiles.files = ../../../plugins/sqldrivers
plugFiles.path = .
DEPLOYMENT += plugFiles
LIBS += -lws2
@@ -18,7 +18,7 @@ symbian {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
index cda8cabf10..4b23e94715 100644
--- a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
+++ b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
@@ -10,7 +10,7 @@ wince*: {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqlrecord/qsqlrecord.pro b/tests/auto/qsqlrecord/qsqlrecord.pro
index f36f0768a3..16e3ae4f80 100644
--- a/tests/auto/qsqlrecord/qsqlrecord.pro
+++ b/tests/auto/qsqlrecord/qsqlrecord.pro
@@ -5,7 +5,7 @@ symbian {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
index c6681d53b3..dad42d512c 100644
--- a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
+++ b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qsqlrelationaltablemodel.cpp
QT += sql
wince*: {
- plugFiles.sources = ../../../plugins/sqldrivers
+ plugFiles.files = ../../../plugins/sqldrivers
plugFiles.path = .
DEPLOYMENT += plugFiles
LIBS += -lws2
@@ -12,7 +12,7 @@ wince*: {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqltablemodel/qsqltablemodel.pro b/tests/auto/qsqltablemodel/qsqltablemodel.pro
index 9a23237d0d..e49020f0a6 100644
--- a/tests/auto/qsqltablemodel/qsqltablemodel.pro
+++ b/tests/auto/qsqltablemodel/qsqltablemodel.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qsqltablemodel.cpp
QT += sql
wince*: {
- plugFiles.sources = ../../../plugins/sqldrivers
+ plugFiles.files = ../../../plugins/sqldrivers
plugFiles.path = .
DEPLOYMENT += plugFiles
LIBS += -lws2
@@ -12,7 +12,7 @@ wince*: {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsqlthread/qsqlthread.pro b/tests/auto/qsqlthread/qsqlthread.pro
index 5522232bac..2e4c72ac92 100644
--- a/tests/auto/qsqlthread/qsqlthread.pro
+++ b/tests/auto/qsqlthread/qsqlthread.pro
@@ -5,7 +5,7 @@ QT = core sql
wince*: {
- plugFiles.sources = ../../../plugins/sqldrivers
+ plugFiles.files = ../../../plugins/sqldrivers
plugFiles.path = .
DEPLOYMENT += plugFiles
LIBS += -lws2
@@ -13,7 +13,7 @@ wince*: {
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
+ sqlite.files = sqlite3.dll
DEPLOYMENT += sqlite
}
}
diff --git a/tests/auto/qsslcertificate/qsslcertificate.pro b/tests/auto/qsslcertificate/qsslcertificate.pro
index b04dde3a99..05cce8e509 100644
--- a/tests/auto/qsslcertificate/qsslcertificate.pro
+++ b/tests/auto/qsslcertificate/qsslcertificate.pro
@@ -15,7 +15,7 @@ win32 {
}
wince*|symbian: {
- certFiles.sources = certificates more-certificates
+ certFiles.files = certificates more-certificates
certFiles.path = .
DEPLOYMENT += certFiles
}
diff --git a/tests/auto/qsslkey/qsslkey.pro b/tests/auto/qsslkey/qsslkey.pro
index dff0db1b91..5a90b76219 100644
--- a/tests/auto/qsslkey/qsslkey.pro
+++ b/tests/auto/qsslkey/qsslkey.pro
@@ -15,10 +15,10 @@ win32 {
}
wince*|symbian: {
- keyFiles.sources = keys
+ keyFiles.files = keys
keyFiles.path = .
- passphraseFiles.sources = rsa-without-passphrase.pem rsa-with-passphrase.pem
+ passphraseFiles.files = rsa-without-passphrase.pem rsa-with-passphrase.pem
passphraseFiles.path = .
DEPLOYMENT += keyFiles passphraseFiles
diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro
index accfa89e53..aeeae8ff8b 100644
--- a/tests/auto/qsslsocket/qsslsocket.pro
+++ b/tests/auto/qsslsocket/qsslsocket.pro
@@ -18,7 +18,7 @@ win32 {
wince* {
DEFINES += SRCDIR=\\\"./\\\"
- certFiles.sources = certs ssl.tar.gz
+ certFiles.files = certs ssl.tar.gz
certFiles.path = .
DEPLOYMENT += certFiles
} else:symbian {
@@ -26,7 +26,7 @@ wince* {
TARGET.EPOCHEAPSIZE="0x100 0x1000000"
TARGET.CAPABILITY=NetworkServices
- certFiles.sources = certs ssl.tar.gz
+ certFiles.files = certs ssl.tar.gz
certFiles.path = .
DEPLOYMENT += certFiles
INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
diff --git a/tests/auto/qstate/qstate.pro b/tests/auto/qstate/qstate.pro
index 9131fa84f8..6ee7e0cd00 100644
--- a/tests/auto/qstate/qstate.pro
+++ b/tests/auto/qstate/qstate.pro
@@ -3,3 +3,4 @@ QT = core
SOURCES += tst_qstate.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index fe71865442..0c4857a79d 100644
--- a/tests/auto/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/qstatictext/tst_qstatictext.cpp
@@ -79,8 +79,11 @@ private slots:
void rotatedPainter();
void scaledPainter();
void projectedPainter();
+#if 0
+ void rotatedScaledAndTranslatedPainter_data();
void rotatedScaledAndTranslatedPainter();
- void transformationChanged();
+#endif
+ void transformationChanged();
void plainTextVsRichText();
@@ -358,7 +361,7 @@ bool tst_QStaticText::supportsTransformations() const
QPaintEngine::Type type = engine->type();
if (type == QPaintEngine::OpenGL
-#if !defined Q_WS_WIN
+#if !defined(Q_WS_WIN) && !defined(Q_WS_X11)
|| type == QPaintEngine::Raster
#endif
)
@@ -455,12 +458,26 @@ void tst_QStaticText::projectedPainter()
QCOMPARE(imageDrawStaticText, imageDrawText);
}
+#if 0
+void tst_QStaticText::rotatedScaledAndTranslatedPainter_data()
+{
+ QTest::addColumn<qreal>("offset");
+
+ for (int i=0; i<100; ++i) {
+ qreal offset = 300 + i / 100.;
+ QTest::newRow(QByteArray::number(offset).constData()) << offset;
+ }
+}
+
void tst_QStaticText::rotatedScaledAndTranslatedPainter()
{
+ QFETCH(qreal, offset);
+
QPixmap imageDrawText(1000, 1000);
imageDrawText.fill(Qt::white);
{
QPainter p(&imageDrawText);
+ p.translate(offset, 0);
p.rotate(45.0);
p.scale(2.0, 2.0);
p.translate(100, 200);
@@ -472,6 +489,7 @@ void tst_QStaticText::rotatedScaledAndTranslatedPainter()
imageDrawStaticText.fill(Qt::white);
{
QPainter p(&imageDrawStaticText);
+ p.translate(offset, 0);
p.rotate(45.0);
p.scale(2.0, 2.0);
p.translate(100, 200);
@@ -491,6 +509,7 @@ void tst_QStaticText::rotatedScaledAndTranslatedPainter()
QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort);
QCOMPARE(imageDrawStaticText, imageDrawText);
}
+#endif
void tst_QStaticText::transformationChanged()
{
diff --git a/tests/auto/qstl/qstl.pro b/tests/auto/qstl/qstl.pro
index 5c9987496c..a0c9db1dfc 100644
--- a/tests/auto/qstl/qstl.pro
+++ b/tests/auto/qstl/qstl.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qstl.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qstring/qstring.pro b/tests/auto/qstring/qstring.pro
index ed758c634b..e980042351 100644
--- a/tests/auto/qstring/qstring.pro
+++ b/tests/auto/qstring/qstring.pro
@@ -6,3 +6,4 @@ symbian:LIBS += -llibm
QT = core
DEFINES += QT_NO_CAST_TO_ASCII
+CONFIG += parallel_test
diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp
index ecae3d806c..969521f69f 100644
--- a/tests/auto/qstring/tst_qstring.cpp
+++ b/tests/auto/qstring/tst_qstring.cpp
@@ -57,6 +57,10 @@ Q_DECLARE_METATYPE(qlonglong)
//TESTED_CLASS=
//TESTED_FILES=
+#define CREATE_REF(string) \
+ const QString padded = QString::fromLatin1(" %1 ").arg(string); \
+ QStringRef ref = padded.midRef(1, padded.size() - 2);
+
class tst_QString : public QObject
{
Q_OBJECT
@@ -110,6 +114,7 @@ private slots:
void remove_string();
void remove_regexp_data();
void remove_regexp();
+ void swap();
void prepend();
void prepend_bytearray_data();
void prepend_bytearray();
@@ -136,6 +141,7 @@ private slots:
void leftRef();
void stringRef();
void contains();
+ void count();
void lastIndexOf_data();
void lastIndexOf();
void indexOf_data();
@@ -170,6 +176,12 @@ private slots:
void fromLatin1Roundtrip();
void toLatin1Roundtrip_data();
void toLatin1Roundtrip();
+ void stringRef_toLatin1Roundtrip_data();
+ void stringRef_toLatin1Roundtrip();
+ void stringRef_utf8_data();
+ void stringRef_utf8();
+ void stringRef_local8Bit_data();
+ void stringRef_local8Bit();
void fromLatin1();
void fromAscii();
void arg();
@@ -1066,12 +1078,14 @@ void tst_QString::indexOf()
QFETCH( int, startpos );
QFETCH( bool, bcs );
QFETCH( int, resultpos );
+ CREATE_REF(needle);
Qt::CaseSensitivity cs = bcs ? Qt::CaseSensitive : Qt::CaseInsensitive;
bool needleIsLatin = (QString::fromLatin1(needle.toLatin1()) == needle);
QCOMPARE( haystack.indexOf(needle, startpos, cs), resultpos );
+ QCOMPARE( haystack.indexOf(ref, startpos, cs), resultpos );
if (needleIsLatin) {
QCOMPARE( haystack.indexOf(needle.toLatin1(), startpos, cs), resultpos );
QCOMPARE( haystack.indexOf(needle.toLatin1().data(), startpos, cs), resultpos );
@@ -1099,12 +1113,14 @@ void tst_QString::indexOf()
if (cs == Qt::CaseSensitive) {
QCOMPARE( haystack.indexOf(needle, startpos), resultpos );
+ QCOMPARE( haystack.indexOf(ref, startpos), resultpos );
if (needleIsLatin) {
QCOMPARE( haystack.indexOf(needle.toLatin1(), startpos), resultpos );
QCOMPARE( haystack.indexOf(needle.toLatin1().data(), startpos), resultpos );
}
if (startpos == 0) {
QCOMPARE( haystack.indexOf(needle), resultpos );
+ QCOMPARE( haystack.indexOf(ref), resultpos );
if (needleIsLatin) {
QCOMPARE( haystack.indexOf(needle.toLatin1()), resultpos );
QCOMPARE( haystack.indexOf(needle.toLatin1().data()), resultpos );
@@ -1113,6 +1129,7 @@ void tst_QString::indexOf()
}
if (needle.size() == 1) {
QCOMPARE(haystack.indexOf(needle.at(0), startpos, cs), resultpos);
+ QCOMPARE(haystack.indexOf(ref.at(0), startpos, cs), resultpos);
}
}
@@ -1173,14 +1190,17 @@ void tst_QString::indexOf2()
QFETCH( QString, haystack );
QFETCH( QString, needle );
QFETCH( int, resultpos );
+ CREATE_REF(needle);
QByteArray chaystack = haystack.toLatin1();
QByteArray cneedle = needle.toLatin1();
int got;
QCOMPARE( haystack.indexOf(needle, 0, Qt::CaseSensitive), resultpos );
+ QCOMPARE( haystack.indexOf(ref, 0, Qt::CaseSensitive), resultpos );
QCOMPARE( QStringMatcher(needle, Qt::CaseSensitive).indexIn(haystack, 0), resultpos );
QCOMPARE( haystack.indexOf(needle, 0, Qt::CaseInsensitive), resultpos );
+ QCOMPARE( haystack.indexOf(ref, 0, Qt::CaseInsensitive), resultpos );
QCOMPARE( QStringMatcher(needle, Qt::CaseInsensitive).indexIn(haystack, 0), resultpos );
if ( needle.length() > 0 ) {
got = haystack.lastIndexOf( needle, -1, Qt::CaseSensitive );
@@ -1247,10 +1267,12 @@ void tst_QString::lastIndexOf()
QFETCH(int, from);
QFETCH(int, expected);
QFETCH(bool, caseSensitive);
+ CREATE_REF(needle);
Qt::CaseSensitivity cs = (caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
QCOMPARE(haystack.lastIndexOf(needle, from, cs), expected);
+ QCOMPARE(haystack.lastIndexOf(ref, from, cs), expected);
QCOMPARE(haystack.lastIndexOf(needle.toLatin1(), from, cs), expected);
QCOMPARE(haystack.lastIndexOf(needle.toLatin1().data(), from, cs), expected);
@@ -1280,20 +1302,23 @@ void tst_QString::lastIndexOf()
if (cs == Qt::CaseSensitive) {
QCOMPARE(haystack.lastIndexOf(needle, from), expected);
+ QCOMPARE(haystack.lastIndexOf(ref, from), expected);
QCOMPARE(haystack.lastIndexOf(needle.toLatin1(), from), expected);
QCOMPARE(haystack.lastIndexOf(needle.toLatin1().data(), from), expected);
if (from == -1) {
QCOMPARE(haystack.lastIndexOf(needle), expected);
+ QCOMPARE(haystack.lastIndexOf(ref), expected);
QCOMPARE(haystack.lastIndexOf(needle.toLatin1()), expected);
QCOMPARE(haystack.lastIndexOf(needle.toLatin1().data()), expected);
}
}
if (needle.size() == 1) {
QCOMPARE(haystack.lastIndexOf(needle.at(0), from), expected);
+ QCOMPARE(haystack.lastIndexOf(ref.at(0), from), expected);
}
}
-void tst_QString::contains()
+void tst_QString::count()
{
QString a;
a="ABCDEFGHIEfGEFG"; // 15 chars
@@ -1308,8 +1333,42 @@ void tst_QString::contains()
QCOMPARE(a.count( "", Qt::CaseInsensitive), 16);
QCOMPARE(a.count(QRegExp("[FG][HI]")),1);
QCOMPARE(a.count(QRegExp("[G][HE]")),2);
+
+ CREATE_REF(QLatin1String("FG"));
+ QCOMPARE(a.count(ref),2);
+ QCOMPARE(a.count(ref,Qt::CaseInsensitive),3);
+ QCOMPARE(a.count( QStringRef(), Qt::CaseInsensitive), 16);
+ QStringRef emptyRef(&a, 0, 0);
+ QCOMPARE(a.count( emptyRef, Qt::CaseInsensitive), 16);
+
}
+void tst_QString::contains()
+{
+ QString a;
+ a="ABCDEFGHIEfGEFG"; // 15 chars
+ QVERIFY(a.contains('A'));
+ QVERIFY(!a.contains('Z'));
+ QVERIFY(a.contains('E'));
+ QVERIFY(a.contains('F'));
+ QVERIFY(a.contains('F',Qt::CaseInsensitive));
+ QVERIFY(a.contains("FG"));
+ QVERIFY(a.contains("FG",Qt::CaseInsensitive));
+ QVERIFY(a.contains( QString(), Qt::CaseInsensitive));
+ QVERIFY(a.contains( "", Qt::CaseInsensitive));
+ QVERIFY(a.contains(QRegExp("[FG][HI]")));
+ QVERIFY(a.contains(QRegExp("[G][HE]")));
+
+ CREATE_REF(QLatin1String("FG"));
+ QVERIFY(a.contains(ref));
+ QVERIFY(a.contains(ref, Qt::CaseInsensitive));
+ QVERIFY(a.contains( QStringRef(), Qt::CaseInsensitive));
+ QStringRef emptyRef(&a, 0, 0);
+ QVERIFY(a.contains(emptyRef, Qt::CaseInsensitive));
+
+}
+
+
void tst_QString::left()
{
QString a;
@@ -1794,6 +1853,16 @@ void tst_QString::operator_pluseq_bytearray()
}
}
+void tst_QString::swap()
+{
+ QString s1, s2;
+ s1 = "s1";
+ s2 = "s2";
+ s1.swap(s2);
+ QCOMPARE(s1,QLatin1String("s2"));
+ QCOMPARE(s2,QLatin1String("s1"));
+}
+
void tst_QString::prepend()
{
QString a;
@@ -2830,6 +2899,14 @@ void tst_QString::startsWith()
QVERIFY( !a.startsWith(QChar(), Qt::CaseSensitive) );
QVERIFY( !a.startsWith(QLatin1Char(0), Qt::CaseSensitive) );
+#define TEST_REF_STARTS_WITH(string, yes) { CREATE_REF(string); QCOMPARE(a.startsWith(ref), yes); }
+
+ TEST_REF_STARTS_WITH("A", true);
+ TEST_REF_STARTS_WITH("AB", true);
+ TEST_REF_STARTS_WITH("C", false);
+ TEST_REF_STARTS_WITH("ABCDEF", false);
+#undef TEST_REF_STARTS_WITH
+
a = "";
QVERIFY( a.startsWith("") );
QVERIFY( a.startsWith(QString::null) );
@@ -2855,6 +2932,7 @@ void tst_QString::startsWith()
QVERIFY( !a.startsWith(QLatin1Char(0)) );
QVERIFY( !a.startsWith(QLatin1Char('x')) );
QVERIFY( !a.startsWith(QChar()) );
+
}
void tst_QString::endsWith()
@@ -2922,6 +3000,17 @@ void tst_QString::endsWith()
QVERIFY( !a.endsWith(QChar(), Qt::CaseSensitive) );
QVERIFY( !a.endsWith(QLatin1Char(0), Qt::CaseSensitive) );
+
+#define TEST_REF_ENDS_WITH(string, yes) { CREATE_REF(string); QCOMPARE(a.endsWith(ref), yes); }
+ TEST_REF_ENDS_WITH(QLatin1String("B"), true);
+ TEST_REF_ENDS_WITH(QLatin1String("AB"), true);
+ TEST_REF_ENDS_WITH(QLatin1String("C"), false);
+ TEST_REF_ENDS_WITH(QLatin1String("ABCDEF"), false);
+ TEST_REF_ENDS_WITH(QLatin1String(""), true);
+ TEST_REF_ENDS_WITH(QLatin1String(0), true);
+
+#undef TEST_REF_STARTS_WITH
+
a = "";
QVERIFY( a.endsWith("") );
QVERIFY( a.endsWith(QString::null) );
@@ -3094,6 +3183,20 @@ void tst_QString::utf8()
QCOMPARE( utf8, QByteArray(res.toUtf8()) );
}
+void tst_QString::stringRef_utf8_data()
+{
+ utf8_data();
+}
+
+void tst_QString::stringRef_utf8()
+{
+ QFETCH( QByteArray, utf8 );
+ QFETCH( QString, res );
+
+ QStringRef ref(&res, 0, res.length());
+ QCOMPARE( utf8, QByteArray(ref.toUtf8()) );
+}
+
// copied to tst_QTextCodec::utf8Codec_data()
void tst_QString::fromUtf8_data()
{
@@ -3273,6 +3376,20 @@ void tst_QString::local8Bit()
QCOMPARE(local8Bit.toLocal8Bit(), QByteArray(result));
}
+void tst_QString::stringRef_local8Bit_data()
+{
+ local8Bit_data();
+}
+
+void tst_QString::stringRef_local8Bit()
+{
+ QFETCH(QString, local8Bit);
+ QFETCH(QByteArray, result);
+
+ QStringRef ref(&local8Bit, 0, local8Bit.length());
+ QCOMPARE(ref.toLocal8Bit(), QByteArray(result));
+}
+
void tst_QString::fromLatin1Roundtrip_data()
{
QTest::addColumn<QByteArray>("latin1");
@@ -3376,6 +3493,38 @@ void tst_QString::toLatin1Roundtrip()
QCOMPARE(QString::fromLatin1(latin1, latin1.length()), unicodedst);
}
+void tst_QString::stringRef_toLatin1Roundtrip_data()
+{
+ toLatin1Roundtrip_data();
+}
+
+void tst_QString::stringRef_toLatin1Roundtrip()
+{
+ QFETCH(QByteArray, latin1);
+ QFETCH(QString, unicodesrc);
+ QFETCH(QString, unicodedst);
+
+ // QtTest safety check:
+ Q_ASSERT(latin1.isNull() == unicodesrc.isNull());
+ Q_ASSERT(latin1.isEmpty() == unicodesrc.isEmpty());
+ Q_ASSERT(latin1.length() == unicodesrc.length());
+ Q_ASSERT(latin1.isNull() == unicodedst.isNull());
+ Q_ASSERT(latin1.isEmpty() == unicodedst.isEmpty());
+ Q_ASSERT(latin1.length() == unicodedst.length());
+
+ if (!latin1.isEmpty())
+ while (latin1.length() < 128) {
+ latin1 += latin1;
+ unicodesrc += unicodesrc;
+ unicodedst += unicodedst;
+ }
+
+ // toLatin1
+ QStringRef src(&unicodesrc, 0, unicodesrc.length());
+ QCOMPARE(src.toLatin1().length(), latin1.length());
+ QCOMPARE(src.toLatin1(), latin1);
+}
+
void tst_QString::fromLatin1()
{
QString a;
diff --git a/tests/auto/qstringbuilder1/qstringbuilder1.pro b/tests/auto/qstringbuilder1/qstringbuilder1.pro
index 5bb14d4290..dc9062f4da 100644
--- a/tests/auto/qstringbuilder1/qstringbuilder1.pro
+++ b/tests/auto/qstringbuilder1/qstringbuilder1.pro
@@ -4,3 +4,4 @@ QT = core
SOURCES += tst_qstringbuilder1.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qstringbuilder2/qstringbuilder2.pro b/tests/auto/qstringbuilder2/qstringbuilder2.pro
index 4152dc31e3..a57c6f19f2 100644
--- a/tests/auto/qstringbuilder2/qstringbuilder2.pro
+++ b/tests/auto/qstringbuilder2/qstringbuilder2.pro
@@ -3,3 +3,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qstringbuilder2.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qstringbuilder3/qstringbuilder3.pro b/tests/auto/qstringbuilder3/qstringbuilder3.pro
index b4d222591d..5aced7c258 100644
--- a/tests/auto/qstringbuilder3/qstringbuilder3.pro
+++ b/tests/auto/qstringbuilder3/qstringbuilder3.pro
@@ -3,3 +3,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qstringbuilder3.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qstringbuilder4/qstringbuilder4.pro b/tests/auto/qstringbuilder4/qstringbuilder4.pro
index 6ec522884b..0532a9b925 100644
--- a/tests/auto/qstringbuilder4/qstringbuilder4.pro
+++ b/tests/auto/qstringbuilder4/qstringbuilder4.pro
@@ -3,3 +3,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qstringbuilder4.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qstringlist/qstringlist.pro b/tests/auto/qstringlist/qstringlist.pro
index aee074bad3..d82a3487fd 100644
--- a/tests/auto/qstringlist/qstringlist.pro
+++ b/tests/auto/qstringlist/qstringlist.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qstringlist.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qstringmatcher/qstringmatcher.pro b/tests/auto/qstringmatcher/qstringmatcher.pro
index 2c1509746a..c5249ec84a 100644
--- a/tests/auto/qstringmatcher/qstringmatcher.pro
+++ b/tests/auto/qstringmatcher/qstringmatcher.pro
@@ -3,3 +3,4 @@ SOURCES += tst_qstringmatcher.cpp
QT = core
DEFINES += QT_NO_CAST_TO_ASCII
+CONFIG += parallel_test
diff --git a/tests/auto/qstringref/qstringref.pro b/tests/auto/qstringref/qstringref.pro
new file mode 100644
index 0000000000..34f2de46ae
--- /dev/null
+++ b/tests/auto/qstringref/qstringref.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+SOURCES += tst_qstringref.cpp
+
+QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qstringref/tst_qstringref.cpp b/tests/auto/qstringref/tst_qstringref.cpp
new file mode 100644
index 0000000000..585e14e38a
--- /dev/null
+++ b/tests/auto/qstringref/tst_qstringref.cpp
@@ -0,0 +1,881 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <qstringlist.h>
+#include <qvariant.h>
+
+#include <qlocale.h>
+#include <locale.h>
+
+Q_DECLARE_METATYPE(qlonglong)
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+
+class tst_QStringRef : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QStringRef();
+ virtual ~tst_QStringRef();
+
+
+public slots:
+ void init();
+ void cleanup();
+private slots:
+ void endsWith();
+ void startsWith();
+ void contains();
+ void count();
+ void lastIndexOf_data();
+ void lastIndexOf();
+ void indexOf_data();
+ void indexOf();
+ void indexOf2_data();
+ void indexOf2();
+ void length_data();
+ void length();
+ void isEmpty();
+ void compare_data();
+ void compare();
+ void operator_eqeq_nullstring();
+};
+
+static QStringRef emptyRef()
+{
+ static const QString empty("");
+ return empty.midRef(0);
+}
+
+#define CREATE_REF(string) \
+ const QString padded = QString::fromLatin1(" %1 ").arg(string); \
+ QStringRef ref = padded.midRef(1, padded.size() - 2);
+
+typedef QList<int> IntList;
+
+Q_DECLARE_METATYPE(QList<QVariant>)
+Q_DECLARE_METATYPE(IntList)
+
+// This next bit is needed for the NAN and INF in string -> number conversion tests
+#include <float.h>
+#include <limits.h>
+#include <math.h>
+#if defined(Q_WS_WIN)
+# include <windows.h>
+// mingw defines NAN and INFINITY to 0/0 and x/0
+# if defined(Q_CC_GNU)
+# undef NAN
+# undef INFINITY
+# else
+# define isnan(d) _isnan(d)
+# endif
+#endif
+#if defined(Q_OS_MAC) && !defined isnan
+#define isnan(d) __isnand(d)
+#endif
+#if defined(Q_OS_SOLARIS)
+# include <ieeefp.h>
+#endif
+#if defined(Q_OS_OSF) && (defined(__DECC) || defined(__DECCXX))
+# define INFINITY DBL_INFINITY
+# define NAN DBL_QNAN
+#endif
+#if defined(Q_OS_IRIX) && defined(Q_CC_GNU)
+# include <ieeefp.h>
+# define isnan(d) isnand(d)
+#endif
+
+enum {
+ LittleEndian,
+ BigEndian
+#ifdef Q_BYTE_ORDER
+# if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ , ByteOrder = BigEndian
+# elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ , ByteOrder = LittleEndian
+# else
+# error "undefined byte order"
+# endif
+};
+#else
+};
+static const unsigned int one = 1;
+static const bool ByteOrder = ((*((unsigned char *) &one) == 0) ? BigEndian : LittleEndian);
+#endif
+#if !defined(INFINITY)
+static const unsigned char be_inf_bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0,0 };
+static const unsigned char le_inf_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
+static inline double inf()
+{
+ if (ByteOrder == BigEndian)
+ return *reinterpret_cast<const double *>(be_inf_bytes);
+ return *reinterpret_cast<const double *>(le_inf_bytes);
+}
+# define INFINITY (::inf())
+#endif
+#if !defined(NAN)
+static const unsigned char be_nan_bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0,0 };
+static const unsigned char le_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
+static inline double nan()
+{
+ if (ByteOrder == BigEndian)
+ return *reinterpret_cast<const double *>(be_nan_bytes);
+ return *reinterpret_cast<const double *>(le_nan_bytes);
+}
+# define NAN (::nan())
+#endif
+
+tst_QStringRef::tst_QStringRef()
+{
+}
+
+tst_QStringRef::~tst_QStringRef()
+{
+}
+
+void tst_QStringRef::init()
+{
+}
+
+void tst_QStringRef::cleanup()
+{
+ QLocale::setDefault(QString(QLatin1Char('C')));
+}
+
+void tst_QStringRef::length_data()
+{
+ QTest::addColumn<QString>("s1");
+ QTest::addColumn<int>("res");
+
+ QTest::newRow("data0") << QString("Test") << 4;
+ QTest::newRow("data1") << QString("The quick brown fox jumps over the lazy dog") << 43;
+ QTest::newRow("data2") << QString() << 0;
+ QTest::newRow("data3") << QString("A") << 1;
+ QTest::newRow("data4") << QString("AB") << 2;
+ QTest::newRow("data5") << QString("AB\n") << 3;
+ QTest::newRow("data6") << QString("AB\nC") << 4;
+ QTest::newRow("data7") << QString("\n") << 1;
+ QTest::newRow("data8") << QString("\nA") << 2;
+ QTest::newRow("data9") << QString("\nAB") << 3;
+ QTest::newRow("data10") << QString("\nAB\nCDE") << 7;
+ QTest::newRow("data11") << QString("shdnftrheid fhgnt gjvnfmd chfugkh bnfhg thgjf vnghturkf chfnguh bjgnfhvygh hnbhgutjfv dhdnjds dcjs d") << 100;
+ QTest::newRow("data12") << QString("") << 0;
+}
+
+
+void tst_QStringRef::length()
+{
+ QFETCH(QString, s1);
+ CREATE_REF(s1);
+ QTEST(ref.length(), "res");
+}
+
+
+void tst_QStringRef::isEmpty()
+{
+ QStringRef a;
+ QVERIFY(a.isEmpty());
+ QVERIFY(emptyRef().isEmpty());
+ CREATE_REF("Not empty");
+ QVERIFY(!ref.isEmpty());
+}
+
+void tst_QStringRef::indexOf_data()
+{
+ QTest::addColumn<QString>("haystack");
+ QTest::addColumn<QString>("needle");
+ QTest::addColumn<int>("startpos");
+ QTest::addColumn<bool>("bcs");
+ QTest::addColumn<int>("resultpos");
+
+ QTest::newRow("data0") << QString("abc") << QString("a") << 0 << true << 0;
+ QTest::newRow("data1") << QString("abc") << QString("a") << 0 << false << 0;
+ QTest::newRow("data2") << QString("abc") << QString("A") << 0 << true << -1;
+ QTest::newRow("data3") << QString("abc") << QString("A") << 0 << false << 0;
+ QTest::newRow("data4") << QString("abc") << QString("a") << 1 << true << -1;
+ QTest::newRow("data5") << QString("abc") << QString("a") << 1 << false << -1;
+ QTest::newRow("data6") << QString("abc") << QString("A") << 1 << true << -1;
+ QTest::newRow("data7") << QString("abc") << QString("A") << 1 << false << -1;
+ QTest::newRow("data8") << QString("abc") << QString("b") << 0 << true << 1;
+ QTest::newRow("data9") << QString("abc") << QString("b") << 0 << false << 1;
+ QTest::newRow("data10") << QString("abc") << QString("B") << 0 << true << -1;
+ QTest::newRow("data11") << QString("abc") << QString("B") << 0 << false << 1;
+ QTest::newRow("data12") << QString("abc") << QString("b") << 1 << true << 1;
+ QTest::newRow("data13") << QString("abc") << QString("b") << 1 << false << 1;
+ QTest::newRow("data14") << QString("abc") << QString("B") << 1 << true << -1;
+ QTest::newRow("data15") << QString("abc") << QString("B") << 1 << false << 1;
+ QTest::newRow("data16") << QString("abc") << QString("b") << 2 << true << -1;
+ QTest::newRow("data17") << QString("abc") << QString("b") << 2 << false << -1;
+
+ QTest::newRow("data20") << QString("ABC") << QString("A") << 0 << true << 0;
+ QTest::newRow("data21") << QString("ABC") << QString("A") << 0 << false << 0;
+ QTest::newRow("data22") << QString("ABC") << QString("a") << 0 << true << -1;
+ QTest::newRow("data23") << QString("ABC") << QString("a") << 0 << false << 0;
+ QTest::newRow("data24") << QString("ABC") << QString("A") << 1 << true << -1;
+ QTest::newRow("data25") << QString("ABC") << QString("A") << 1 << false << -1;
+ QTest::newRow("data26") << QString("ABC") << QString("a") << 1 << true << -1;
+ QTest::newRow("data27") << QString("ABC") << QString("a") << 1 << false << -1;
+ QTest::newRow("data28") << QString("ABC") << QString("B") << 0 << true << 1;
+ QTest::newRow("data29") << QString("ABC") << QString("B") << 0 << false << 1;
+ QTest::newRow("data30") << QString("ABC") << QString("b") << 0 << true << -1;
+ QTest::newRow("data31") << QString("ABC") << QString("b") << 0 << false << 1;
+ QTest::newRow("data32") << QString("ABC") << QString("B") << 1 << true << 1;
+ QTest::newRow("data33") << QString("ABC") << QString("B") << 1 << false << 1;
+ QTest::newRow("data34") << QString("ABC") << QString("b") << 1 << true << -1;
+ QTest::newRow("data35") << QString("ABC") << QString("b") << 1 << false << 1;
+ QTest::newRow("data36") << QString("ABC") << QString("B") << 2 << true << -1;
+ QTest::newRow("data37") << QString("ABC") << QString("B") << 2 << false << -1;
+
+ QTest::newRow("data40") << QString("aBc") << QString("bc") << 0 << true << -1;
+ QTest::newRow("data41") << QString("aBc") << QString("Bc") << 0 << true << 1;
+ QTest::newRow("data42") << QString("aBc") << QString("bC") << 0 << true << -1;
+ QTest::newRow("data43") << QString("aBc") << QString("BC") << 0 << true << -1;
+ QTest::newRow("data44") << QString("aBc") << QString("bc") << 0 << false << 1;
+ QTest::newRow("data45") << QString("aBc") << QString("Bc") << 0 << false << 1;
+ QTest::newRow("data46") << QString("aBc") << QString("bC") << 0 << false << 1;
+ QTest::newRow("data47") << QString("aBc") << QString("BC") << 0 << false << 1;
+ QTest::newRow("data48") << QString("AbC") << QString("bc") << 0 << true << -1;
+ QTest::newRow("data49") << QString("AbC") << QString("Bc") << 0 << true << -1;
+ QTest::newRow("data50") << QString("AbC") << QString("bC") << 0 << true << 1;
+ QTest::newRow("data51") << QString("AbC") << QString("BC") << 0 << true << -1;
+ QTest::newRow("data52") << QString("AbC") << QString("bc") << 0 << false << 1;
+ QTest::newRow("data53") << QString("AbC") << QString("Bc") << 0 << false << 1;
+
+ QTest::newRow("data54") << QString("AbC") << QString("bC") << 0 << false << 1;
+ QTest::newRow("data55") << QString("AbC") << QString("BC") << 0 << false << 1;
+ QTest::newRow("data56") << QString("AbC") << QString("BC") << 1 << false << 1;
+ QTest::newRow("data57") << QString("AbC") << QString("BC") << 2 << false << -1;
+#if 0
+ QTest::newRow("null-in-null") << QString() << QString() << 0 << false << 0;
+ QTest::newRow("empty-in-null") << QString() << QString("") << 0 << false << 0;
+ QTest::newRow("null-in-empty") << QString("") << QString() << 0 << false << 0;
+ QTest::newRow("empty-in-empty") << QString("") << QString("") << 0 << false << 0;
+#endif
+
+
+ QString s1 = "abc";
+ s1 += QChar(0xb5);
+ QString s2;
+ s2 += QChar(0x3bc);
+ QTest::newRow("data58") << QString(s1) << QString(s2) << 0 << false << 3;
+ s2.prepend("C");
+ QTest::newRow("data59") << QString(s1) << QString(s2) << 0 << false << 2;
+
+ QString veryBigHaystack(500, 'a');
+ veryBigHaystack += 'B';
+ QTest::newRow("BoyerMooreStressTest") << veryBigHaystack << veryBigHaystack << 0 << true << 0;
+ QTest::newRow("BoyerMooreStressTest2") << veryBigHaystack + 'c' << veryBigHaystack << 0 << true << 0;
+ QTest::newRow("BoyerMooreStressTest3") << 'c' + veryBigHaystack << veryBigHaystack << 0 << true << 1;
+ QTest::newRow("BoyerMooreStressTest4") << veryBigHaystack << veryBigHaystack + 'c' << 0 << true << -1;
+ QTest::newRow("BoyerMooreStressTest5") << veryBigHaystack << 'c' + veryBigHaystack << 0 << true << -1;
+ QTest::newRow("BoyerMooreStressTest6") << 'd' + veryBigHaystack << 'c' + veryBigHaystack << 0 << true << -1;
+ QTest::newRow("BoyerMooreStressTest6") << veryBigHaystack + 'c' << 'c' + veryBigHaystack << 0 << true << -1;
+
+ QTest::newRow("BoyerMooreInsensitiveStressTest") << veryBigHaystack << veryBigHaystack << 0 << false << 0;
+
+}
+
+void tst_QStringRef::indexOf()
+{
+ QFETCH(QString, haystack);
+ QFETCH(QString, needle);
+ QFETCH(int, startpos);
+ QFETCH(bool, bcs);
+ QFETCH(int, resultpos);
+
+ const QString haystackPadded = QString::fromLatin1(" %1 ").arg(haystack);
+ const QString needlePadded = QString::fromLatin1(" %1 ").arg(needle);
+ const QStringRef haystackRef(&haystackPadded, 1, haystack.size());
+ const QStringRef needleRef(&needlePadded, 1, needle.size());
+
+ Qt::CaseSensitivity cs = bcs ? Qt::CaseSensitive : Qt::CaseInsensitive;
+
+ QCOMPARE(haystack.indexOf(needle, startpos, cs), resultpos);
+ QCOMPARE(haystackRef.indexOf(needle, startpos, cs), resultpos);
+ QCOMPARE(haystackRef.indexOf(needleRef, startpos, cs), resultpos);
+ QCOMPARE(haystack.indexOf(needleRef, startpos, cs), resultpos);
+
+ if (cs == Qt::CaseSensitive) {
+ QCOMPARE(haystack.indexOf(needle, startpos), resultpos);
+ QCOMPARE(haystackRef.indexOf(needle, startpos), resultpos);
+ QCOMPARE(haystackRef.indexOf(needleRef, startpos), resultpos);
+ QCOMPARE(haystack.indexOf(needleRef, startpos), resultpos);
+ if (startpos == 0) {
+ QCOMPARE(haystack.indexOf(needle), resultpos);
+ QCOMPARE(haystackRef.indexOf(needle), resultpos);
+ QCOMPARE(haystackRef.indexOf(needleRef), resultpos);
+ QCOMPARE(haystack.indexOf(needleRef), resultpos);
+ }
+ }
+ if (needle.size() == 1) {
+ QCOMPARE(needle.at(0), needleRef.at(0));
+ QCOMPARE(haystack.indexOf(needleRef.at(0), startpos, cs), resultpos);
+ QCOMPARE(haystackRef.indexOf(needle.at(0), startpos, cs), resultpos);
+ QCOMPARE(haystackRef.indexOf(needleRef.at(0), startpos, cs), resultpos);
+ QCOMPARE(haystack.indexOf(needleRef.at(0), startpos ,cs), resultpos);
+ }
+}
+
+void tst_QStringRef::indexOf2_data()
+{
+ QTest::addColumn<QString>("haystack");
+ QTest::addColumn<QString>("needle");
+ QTest::addColumn<int>("resultpos");
+
+ QTest::newRow("data0") << QString() << QString() << 0;
+ QTest::newRow("data1") << QString() << QString("") << 0;
+ QTest::newRow("data2") << QString("") << QString() << 0;
+ QTest::newRow("data3") << QString("") << QString("") << 0;
+ QTest::newRow("data4") << QString() << QString("a") << -1;
+ QTest::newRow("data5") << QString() << QString("abcdefg") << -1;
+ QTest::newRow("data6") << QString("") << QString("a") << -1;
+ QTest::newRow("data7") << QString("") << QString("abcdefg") << -1;
+
+ QTest::newRow("data8") << QString("a") << QString() << 0;
+ QTest::newRow("data9") << QString("a") << QString("") << 0;
+ QTest::newRow("data10") << QString("a") << QString("a") << 0;
+ QTest::newRow("data11") << QString("a") << QString("b") << -1;
+ QTest::newRow("data12") << QString("a") << QString("abcdefg") << -1;
+ QTest::newRow("data13") << QString("ab") << QString() << 0;
+ QTest::newRow("data14") << QString("ab") << QString("") << 0;
+ QTest::newRow("data15") << QString("ab") << QString("a") << 0;
+ QTest::newRow("data16") << QString("ab") << QString("b") << 1;
+ QTest::newRow("data17") << QString("ab") << QString("ab") << 0;
+ QTest::newRow("data18") << QString("ab") << QString("bc") << -1;
+ QTest::newRow("data19") << QString("ab") << QString("abcdefg") << -1;
+
+ QTest::newRow("data30") << QString("abc") << QString("a") << 0;
+ QTest::newRow("data31") << QString("abc") << QString("b") << 1;
+ QTest::newRow("data32") << QString("abc") << QString("c") << 2;
+ QTest::newRow("data33") << QString("abc") << QString("d") << -1;
+ QTest::newRow("data34") << QString("abc") << QString("ab") << 0;
+ QTest::newRow("data35") << QString("abc") << QString("bc") << 1;
+ QTest::newRow("data36") << QString("abc") << QString("cd") << -1;
+ QTest::newRow("data37") << QString("abc") << QString("ac") << -1;
+
+ // sizeof(whale) > 32
+ QString whale = "a5zby6cx7dw8evf9ug0th1si2rj3qkp4lomn";
+ QString minnow = "zby";
+ QTest::newRow("data40") << whale << minnow << 2;
+ QTest::newRow("data41") << (whale + whale) << minnow << 2;
+ QTest::newRow("data42") << (minnow + whale) << minnow << 0;
+ QTest::newRow("data43") << whale << whale << 0;
+ QTest::newRow("data44") << (whale + whale) << whale << 0;
+ QTest::newRow("data45") << whale << (whale + whale) << -1;
+ QTest::newRow("data46") << (whale + whale) << (whale + whale) << 0;
+ QTest::newRow("data47") << (whale + whale) << (whale + minnow) << -1;
+ QTest::newRow("data48") << (minnow + whale) << whale << (int)minnow.length();
+}
+
+void tst_QStringRef::indexOf2()
+{
+ QFETCH(QString, haystack);
+ QFETCH(QString, needle);
+ QFETCH(int, resultpos);
+
+ const QString haystackPadded = QString::fromLatin1(" %1 ").arg(haystack);
+ const QString needlePadded = QString::fromLatin1(" %1 ").arg(needle);
+ const QStringRef haystackRef(&haystackPadded, 1, haystack.size());
+ const QStringRef needleRef(&needlePadded, 1, needle.size());
+
+
+ int got;
+
+ QCOMPARE(haystack.indexOf(needleRef, 0, Qt::CaseSensitive), resultpos);
+ QCOMPARE(haystackRef.indexOf(needle, 0, Qt::CaseSensitive), resultpos);
+ QCOMPARE(haystackRef.indexOf(needleRef, 0, Qt::CaseSensitive), resultpos);
+ QCOMPARE(haystack.indexOf(needleRef, 0, Qt::CaseInsensitive), resultpos);
+ QCOMPARE(haystackRef.indexOf(needle, 0, Qt::CaseInsensitive), resultpos);
+ QCOMPARE(haystackRef.indexOf(needleRef, 0, Qt::CaseInsensitive), resultpos);
+ if (needle.length() > 0) {
+ got = haystackRef.lastIndexOf(needle, -1, Qt::CaseSensitive);
+ QVERIFY(got == resultpos || (resultpos >= 0 && got >= resultpos));
+ got = haystackRef.lastIndexOf(needle, -1, Qt::CaseInsensitive);
+ QVERIFY(got == resultpos || (resultpos >= 0 && got >= resultpos));
+
+ got = haystack.lastIndexOf(needleRef, -1, Qt::CaseSensitive);
+ QVERIFY(got == resultpos || (resultpos >= 0 && got >= resultpos));
+ got = haystack.lastIndexOf(needleRef, -1, Qt::CaseInsensitive);
+ QVERIFY(got == resultpos || (resultpos >= 0 && got >= resultpos));
+
+ got = haystackRef.lastIndexOf(needleRef, -1, Qt::CaseSensitive);
+ QVERIFY(got == resultpos || (resultpos >= 0 && got >= resultpos));
+ got = haystackRef.lastIndexOf(needleRef, -1, Qt::CaseInsensitive);
+ QVERIFY(got == resultpos || (resultpos >= 0 && got >= resultpos));
+ }
+}
+
+void tst_QStringRef::lastIndexOf_data()
+{
+ QTest::addColumn<QString>("haystack");
+ QTest::addColumn<QString>("needle");
+ QTest::addColumn<int>("from");
+ QTest::addColumn<int>("expected");
+ QTest::addColumn<bool>("caseSensitive");
+
+ QString a = "ABCDEFGHIEfGEFG";
+
+ QTest::newRow("-1") << a << "G" << a.size() - 1 << 14 << true;
+ QTest::newRow("1") << a << "G" << - 1 << 14 << true;
+ QTest::newRow("2") << a << "G" << -3 << 11 << true;
+ QTest::newRow("3") << a << "G" << -5 << 6 << true;
+ QTest::newRow("4") << a << "G" << 14 << 14 << true;
+ QTest::newRow("5") << a << "G" << 13 << 11 << true;
+ QTest::newRow("6") << a << "B" << a.size() - 1 << 1 << true;
+ QTest::newRow("6") << a << "B" << - 1 << 1 << true;
+ QTest::newRow("7") << a << "B" << 1 << 1 << true;
+ QTest::newRow("8") << a << "B" << 0 << -1 << true;
+
+ QTest::newRow("9") << a << "G" << -1 << a.size()-1 << true;
+ QTest::newRow("10") << a << "G" << a.size()-1 << a.size()-1 << true;
+ QTest::newRow("11") << a << "G" << a.size() << -1 << true;
+ QTest::newRow("12") << a << "A" << 0 << 0 << true;
+ QTest::newRow("13") << a << "A" << -1*a.size() << 0 << true;
+
+ QTest::newRow("15") << a << "efg" << 0 << -1 << false;
+ QTest::newRow("16") << a << "efg" << a.size() << -1 << false;
+ QTest::newRow("17") << a << "efg" << -1 * a.size() << -1 << false;
+ QTest::newRow("19") << a << "efg" << a.size() - 1 << 12 << false;
+ QTest::newRow("20") << a << "efg" << 12 << 12 << false;
+ QTest::newRow("21") << a << "efg" << -12 << -1 << false;
+ QTest::newRow("22") << a << "efg" << 11 << 9 << false;
+
+ QTest::newRow("24") << "" << "asdf" << -1 << -1 << false;
+ QTest::newRow("25") << "asd" << "asdf" << -1 << -1 << false;
+ QTest::newRow("26") << "" << QString() << -1 << -1 << false;
+
+ QTest::newRow("27") << a << "" << a.size() << a.size() << false;
+ QTest::newRow("28") << a << "" << a.size() + 10 << -1 << false;
+}
+
+void tst_QStringRef::lastIndexOf()
+{
+ QFETCH(QString, haystack);
+ QFETCH(QString, needle);
+ QFETCH(int, from);
+ QFETCH(int, expected);
+ QFETCH(bool, caseSensitive);
+
+ const QString haystackPadded = QString::fromLatin1(" %1 ").arg(haystack);
+ const QString needlePadded = QString::fromLatin1(" %1 ").arg(needle);
+ const QStringRef haystackRef(&haystackPadded, 1, haystack.size());
+ const QStringRef needleRef(&needlePadded, 1, needle.size());
+
+ Qt::CaseSensitivity cs = (caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
+
+ QCOMPARE(haystack.lastIndexOf(needleRef, from, cs), expected);
+ QCOMPARE(haystackRef.lastIndexOf(needle, from, cs), expected);
+ QCOMPARE(haystackRef.lastIndexOf(needleRef, from, cs), expected);
+
+
+ if (cs == Qt::CaseSensitive) {
+ QCOMPARE(haystack.lastIndexOf(needleRef, from), expected);
+ QCOMPARE(haystackRef.lastIndexOf(needle, from), expected);
+ QCOMPARE(haystackRef.lastIndexOf(needleRef, from), expected);
+
+ if (from == -1) {
+ QCOMPARE(haystack.lastIndexOf(needleRef), expected);
+ QCOMPARE(haystackRef.lastIndexOf(needle), expected);
+ QCOMPARE(haystackRef.lastIndexOf(needleRef), expected);
+
+ }
+ }
+ if (needle.size() == 1) {
+ QCOMPARE(haystack.lastIndexOf(needleRef.at(0), from), expected);
+ QCOMPARE(haystackRef.lastIndexOf(needle.at(0), from), expected);
+ QCOMPARE(haystackRef.lastIndexOf(needleRef.at(0), from), expected);
+ }
+}
+
+void tst_QStringRef::count()
+{
+ const QString a = QString::fromLatin1("ABCDEFGHIEfGEFG"); // 15 chars
+ CREATE_REF(a);
+ QCOMPARE(ref.count('A'),1);
+ QCOMPARE(ref.count('Z'),0);
+ QCOMPARE(ref.count('E'),3);
+ QCOMPARE(ref.count('F'),2);
+ QCOMPARE(ref.count('F',Qt::CaseInsensitive),3);
+ QCOMPARE(ref.count("FG"),2);
+ QCOMPARE(ref.count("FG",Qt::CaseInsensitive),3);
+ QCOMPARE(ref.count(QString(), Qt::CaseInsensitive), 16);
+ QCOMPARE(ref.count("", Qt::CaseInsensitive), 16);
+}
+
+void tst_QStringRef::contains()
+{
+ const QString a = QString::fromLatin1("ABCDEFGHIEfGEFG"); // 15 chars
+ CREATE_REF(a);
+ QVERIFY(ref.contains('A'));
+ QVERIFY(!ref.contains('Z'));
+ QVERIFY(ref.contains('E'));
+ QVERIFY(ref.contains('F'));
+ QVERIFY(ref.contains('F',Qt::CaseInsensitive));
+ QVERIFY(ref.contains("FG"));
+ QVERIFY(ref.contains(QString("FG").midRef(0)));
+ const QString ref2 = QString::fromLatin1(" FG ");
+ QVERIFY(ref.contains(ref2.midRef(1, 2),Qt::CaseInsensitive));
+ QVERIFY(ref.contains(QString(), Qt::CaseInsensitive));
+ QVERIFY(ref.contains("", Qt::CaseInsensitive)); // apparently
+}
+
+void tst_QStringRef::startsWith()
+{
+ {
+ const QString a = QString::fromLatin1("AB");
+ CREATE_REF(a);
+ QVERIFY(ref.startsWith("A"));
+ QVERIFY(ref.startsWith("AB"));
+ QVERIFY(!ref.startsWith("C"));
+ QVERIFY(!ref.startsWith("ABCDEF"));
+ QVERIFY(ref.startsWith(""));
+ QVERIFY(ref.startsWith(QString::null));
+ QVERIFY(ref.startsWith('A'));
+ QVERIFY(ref.startsWith(QLatin1Char('A')));
+ QVERIFY(ref.startsWith(QChar('A')));
+ QVERIFY(!ref.startsWith('C'));
+ QVERIFY(!ref.startsWith(QChar()));
+ QVERIFY(!ref.startsWith(QLatin1Char(0)));
+
+ QVERIFY(ref.startsWith(QLatin1String("A")));
+ QVERIFY(ref.startsWith(QLatin1String("AB")));
+ QVERIFY(!ref.startsWith(QLatin1String("C")));
+ QVERIFY(!ref.startsWith(QLatin1String("ABCDEF")));
+ QVERIFY(ref.startsWith(QLatin1String("")));
+ QVERIFY(ref.startsWith(QLatin1String(0)));
+
+ QVERIFY(ref.startsWith("A", Qt::CaseSensitive));
+ QVERIFY(ref.startsWith("A", Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith("a", Qt::CaseSensitive));
+ QVERIFY(ref.startsWith("a", Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith("aB", Qt::CaseSensitive));
+ QVERIFY(ref.startsWith("aB", Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith("C", Qt::CaseSensitive));
+ QVERIFY(!ref.startsWith("C", Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith("c", Qt::CaseSensitive));
+ QVERIFY(!ref.startsWith("c", Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith("abcdef", Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith("", Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith(QString::null, Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith('a', Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith('A', Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith(QLatin1Char('a'), Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith(QChar('a'), Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith('c', Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith(QChar(), Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith(QLatin1Char(0), Qt::CaseInsensitive));
+
+ QVERIFY(ref.startsWith(QLatin1String("A"), Qt::CaseSensitive));
+ QVERIFY(ref.startsWith(QLatin1String("A"), Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith(QLatin1String("a"), Qt::CaseSensitive));
+ QVERIFY(ref.startsWith(QLatin1String("a"), Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith(QLatin1String("aB"), Qt::CaseSensitive));
+ QVERIFY(ref.startsWith(QLatin1String("aB"), Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith(QLatin1String("C"), Qt::CaseSensitive));
+ QVERIFY(!ref.startsWith(QLatin1String("C"), Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith(QLatin1String("c"), Qt::CaseSensitive));
+ QVERIFY(!ref.startsWith(QLatin1String("c"), Qt::CaseInsensitive));
+ QVERIFY(!ref.startsWith(QLatin1String("abcdef"), Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith(QLatin1String(""), Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith(QLatin1String(0), Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith('A', Qt::CaseSensitive));
+ QVERIFY(ref.startsWith(QLatin1Char('A'), Qt::CaseSensitive));
+ QVERIFY(ref.startsWith(QChar('A'), Qt::CaseSensitive));
+ QVERIFY(!ref.startsWith('a', Qt::CaseSensitive));
+ QVERIFY(!ref.startsWith(QChar(), Qt::CaseSensitive));
+ QVERIFY(!ref.startsWith(QLatin1Char(0), Qt::CaseSensitive));
+ }
+ {
+ const QString a = QString::fromLatin1("");
+ CREATE_REF(a);
+ QVERIFY(ref.startsWith(""));
+ QVERIFY(ref.startsWith(QString::null));
+ QVERIFY(!ref.startsWith("ABC"));
+
+ QVERIFY(ref.startsWith(QLatin1String("")));
+ QVERIFY(ref.startsWith(QLatin1String(0)));
+ QVERIFY(!ref.startsWith(QLatin1String("ABC")));
+
+ QVERIFY(!ref.startsWith(QLatin1Char(0)));
+ QVERIFY(!ref.startsWith(QLatin1Char('x')));
+ QVERIFY(!ref.startsWith(QChar()));
+ }
+ {
+ const QStringRef ref;
+ QVERIFY(!ref.startsWith(""));
+ QVERIFY(ref.startsWith(QString::null));
+ QVERIFY(!ref.startsWith("ABC"));
+
+ QVERIFY(!ref.startsWith(QLatin1String("")));
+ QVERIFY(ref.startsWith(QLatin1String(0)));
+ QVERIFY(!ref.startsWith(QLatin1String("ABC")));
+
+ QVERIFY(!ref.startsWith(QLatin1Char(0)));
+ QVERIFY(!ref.startsWith(QLatin1Char('x')));
+ QVERIFY(!ref.startsWith(QChar()));
+ }
+}
+
+void tst_QStringRef::endsWith()
+{
+ {
+ const QString a = QString::fromLatin1("AB");
+ CREATE_REF(a);
+ QVERIFY(ref.endsWith("B"));
+ QVERIFY(ref.endsWith("AB"));
+ QVERIFY(!ref.endsWith("C"));
+ QVERIFY(!ref.endsWith("ABCDEF"));
+ QVERIFY(ref.endsWith(""));
+ QVERIFY(ref.endsWith(QString::null));
+ QVERIFY(ref.endsWith('B'));
+ QVERIFY(ref.endsWith(QLatin1Char('B')));
+ QVERIFY(ref.endsWith(QChar('B')));
+ QVERIFY(!ref.endsWith('C'));
+ QVERIFY(!ref.endsWith(QChar()));
+ QVERIFY(!ref.endsWith(QLatin1Char(0)));
+
+ QVERIFY(ref.endsWith(QLatin1String("B")));
+ QVERIFY(ref.endsWith(QLatin1String("AB")));
+ QVERIFY(!ref.endsWith(QLatin1String("C")));
+ QVERIFY(!ref.endsWith(QLatin1String("ABCDEF")));
+ QVERIFY(ref.endsWith(QLatin1String("")));
+ QVERIFY(ref.endsWith(QLatin1String(0)));
+
+ QVERIFY(ref.endsWith("B", Qt::CaseSensitive));
+ QVERIFY(ref.endsWith("B", Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith("b", Qt::CaseSensitive));
+ QVERIFY(ref.endsWith("b", Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith("aB", Qt::CaseSensitive));
+ QVERIFY(ref.endsWith("aB", Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith("C", Qt::CaseSensitive));
+ QVERIFY(!ref.endsWith("C", Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith("c", Qt::CaseSensitive));
+ QVERIFY(!ref.endsWith("c", Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith("abcdef", Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith("", Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith(QString::null, Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith('b', Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith('B', Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith(QLatin1Char('b'), Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith(QChar('b'), Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith('c', Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith(QChar(), Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith(QLatin1Char(0), Qt::CaseInsensitive));
+
+ QVERIFY(ref.endsWith(QLatin1String("B"), Qt::CaseSensitive));
+ QVERIFY(ref.endsWith(QLatin1String("B"), Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith(QLatin1String("b"), Qt::CaseSensitive));
+ QVERIFY(ref.endsWith(QLatin1String("b"), Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith(QLatin1String("aB"), Qt::CaseSensitive));
+ QVERIFY(ref.endsWith(QLatin1String("aB"), Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith(QLatin1String("C"), Qt::CaseSensitive));
+ QVERIFY(!ref.endsWith(QLatin1String("C"), Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith(QLatin1String("c"), Qt::CaseSensitive));
+ QVERIFY(!ref.endsWith(QLatin1String("c"), Qt::CaseInsensitive));
+ QVERIFY(!ref.endsWith(QLatin1String("abcdef"), Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith(QLatin1String(""), Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith(QLatin1String(0), Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith('B', Qt::CaseSensitive));
+ QVERIFY(ref.endsWith(QLatin1Char('B'), Qt::CaseSensitive));
+ QVERIFY(ref.endsWith(QChar('B'), Qt::CaseSensitive));
+ QVERIFY(!ref.endsWith('b', Qt::CaseSensitive));
+ QVERIFY(!ref.endsWith(QChar(), Qt::CaseSensitive));
+ QVERIFY(!ref.endsWith(QLatin1Char(0), Qt::CaseSensitive));
+
+ }
+ {
+ const QString a = QString::fromLatin1("");
+ CREATE_REF(a);
+ QVERIFY(ref.endsWith(""));
+ QVERIFY(ref.endsWith(QString::null));
+ QVERIFY(!ref.endsWith("ABC"));
+ QVERIFY(!ref.endsWith(QLatin1Char(0)));
+ QVERIFY(!ref.endsWith(QLatin1Char('x')));
+ QVERIFY(!ref.endsWith(QChar()));
+
+ QVERIFY(ref.endsWith(QLatin1String("")));
+ QVERIFY(ref.endsWith(QLatin1String(0)));
+ QVERIFY(!ref.endsWith(QLatin1String("ABC")));
+ }
+
+ {
+ QStringRef ref;
+ QVERIFY(!ref.endsWith(""));
+ QVERIFY(ref.endsWith(QString::null));
+ QVERIFY(!ref.endsWith("ABC"));
+
+ QVERIFY(!ref.endsWith(QLatin1String("")));
+ QVERIFY(ref.endsWith(QLatin1String(0)));
+ QVERIFY(!ref.endsWith(QLatin1String("ABC")));
+
+ QVERIFY(!ref.endsWith(QLatin1Char(0)));
+ QVERIFY(!ref.endsWith(QLatin1Char('x')));
+ QVERIFY(!ref.endsWith(QChar()));
+ }
+}
+
+void tst_QStringRef::operator_eqeq_nullstring()
+{
+ /* Some of these might not be all that logical but it's the behaviour we've had since 3.0.0
+ so we should probably stick with it. */
+
+ QVERIFY(QStringRef() == "");
+ QVERIFY("" == QStringRef());
+
+ QVERIFY(QString("") == "");
+ QVERIFY("" == QString(""));
+
+ QVERIFY(QStringRef().size() == 0);
+
+ QVERIFY(QString("").size() == 0);
+
+ QVERIFY(QStringRef() == QString(""));
+ QVERIFY(QString("") == QString());
+}
+
+static inline int sign(int x)
+{
+ return x == 0 ? 0 : (x < 0 ? -1 : 1);
+}
+
+void tst_QStringRef::compare_data()
+{
+ QTest::addColumn<QString>("s1");
+ QTest::addColumn<QString>("s2");
+ QTest::addColumn<int>("csr"); // case sensitive result
+ QTest::addColumn<int>("cir"); // case insensitive result
+
+
+ // null strings
+ QTest::newRow("data0") << QString("") << QString("") << 0 << 0;
+ QTest::newRow("data1") << QString("a") << QString("") << 1 << 1;
+ QTest::newRow("data2") << QString("") << QString("a") << -1 << -1;
+
+ // equal length
+ QTest::newRow("data3") << QString("abc") << QString("abc") << 0 << 0;
+ QTest::newRow("data4") << QString("abC") << QString("abc") << -1 << 0;
+ QTest::newRow("data5") << QString("abc") << QString("abC") << 1 << 0;
+
+ // different length
+ QTest::newRow("data6") << QString("abcdef") << QString("abc") << 1 << 1;
+ QTest::newRow("data6") << QString("abCdef") << QString("abc") << -1 << 1;
+ QTest::newRow("data7") << QString("abc") << QString("abcdef") << -1 << -1;
+
+ QString upper;
+ upper += QChar(QChar::highSurrogate(0x10400));
+ upper += QChar(QChar::lowSurrogate(0x10400));
+ QString lower;
+ lower += QChar(QChar::highSurrogate(0x10428));
+ lower += QChar(QChar::lowSurrogate(0x10428));
+ QTest::newRow("data8") << upper << lower << -1 << 0;
+
+ // embedded nulls
+ // These dont work as of now. Its OK that these dont work since \0 is not a valid unicode
+ /*QTest::newRow("data9") << QString(QByteArray("\0", 1)) << QString(QByteArray("\0", 1)) << 0 << 0;
+ QTest::newRow("data10") << QString(QByteArray("\0", 1)) << QString("") << 1 << 1;
+ QTest::newRow("data11") << QString("") << QString(QByteArray("\0", 1)) << -1 << -1;
+ QTest::newRow("data12") << QString("ab\0c") << QString(QByteArray("ab\0c", 4)) << 0 << 0;
+ QTest::newRow("data13") << QString(QByteArray("ab\0c", 4)) << QString("abc") << -1 << -1;
+ QTest::newRow("data14") << QString("abc") << QString(QByteArray("ab\0c", 4)) << 1 << 1;*/
+}
+
+static bool isLatin(const QString &s)
+{
+ for (int i = 0; i < s.length(); ++i)
+ if (s.at(i).unicode() > 0xff)
+ return false;
+ return true;
+}
+
+void tst_QStringRef::compare()
+{
+ QFETCH(QString, s1);
+ QFETCH(QString, s2);
+ QFETCH(int, csr);
+ QFETCH(int, cir);
+
+ QStringRef r1(&s1, 0, s1.length());
+ QStringRef r2(&s2, 0, s2.length());
+
+ QCOMPARE(sign(QString::compare(s1, s2)), csr);
+ QCOMPARE(sign(QStringRef::compare(r1, r2)), csr);
+ QCOMPARE(sign(s1.compare(s2)), csr);
+ QCOMPARE(sign(s1.compare(r2)), csr);
+ QCOMPARE(sign(r1.compare(r2)), csr);
+
+ QCOMPARE(sign(s1.compare(s2, Qt::CaseSensitive)), csr);
+ QCOMPARE(sign(s1.compare(s2, Qt::CaseInsensitive)), cir);
+ QCOMPARE(sign(s1.compare(r2, Qt::CaseSensitive)), csr);
+ QCOMPARE(sign(s1.compare(r2, Qt::CaseInsensitive)), cir);
+ QCOMPARE(sign(r1.compare(r2, Qt::CaseSensitive)), csr);
+ QCOMPARE(sign(r1.compare(r2, Qt::CaseInsensitive)), cir);
+
+ QCOMPARE(sign(QString::compare(s1, s2, Qt::CaseSensitive)), csr);
+ QCOMPARE(sign(QString::compare(s1, s2, Qt::CaseInsensitive)), cir);
+ QCOMPARE(sign(QString::compare(s1, r2, Qt::CaseSensitive)), csr);
+ QCOMPARE(sign(QString::compare(s1, r2, Qt::CaseInsensitive)), cir);
+ QCOMPARE(sign(QStringRef::compare(r1, r2, Qt::CaseSensitive)), csr);
+ QCOMPARE(sign(QStringRef::compare(r1, r2, Qt::CaseInsensitive)), cir);
+
+ if (!cir) {
+ QCOMPARE(s1.toCaseFolded(), s2.toCaseFolded());
+ }
+
+ if (isLatin(s2)) {
+ QCOMPARE(sign(QString::compare(s1, QLatin1String(s2.toLatin1()))), csr);
+ QCOMPARE(sign(QString::compare(s1, QLatin1String(s2.toLatin1()), Qt::CaseInsensitive)), cir);
+ QCOMPARE(sign(QStringRef::compare(r1, QLatin1String(s2.toLatin1()))), csr);
+ QCOMPARE(sign(QStringRef::compare(r1, QLatin1String(s2.toLatin1()), Qt::CaseInsensitive)), cir);
+ }
+
+ if (isLatin(s1)) {
+ QCOMPARE(sign(QString::compare(QLatin1String(s1.toLatin1()), s2)), csr);
+ QCOMPARE(sign(QString::compare(QLatin1String(s1.toLatin1()), s2, Qt::CaseInsensitive)), cir);
+ }
+}
+
+QTEST_APPLESS_MAIN(tst_QStringRef)
+
+#include "tst_qstringref.moc"
diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro
index 11f5943df3..eb198e28f5 100644
--- a/tests/auto/qstyle/qstyle.pro
+++ b/tests/auto/qstyle/qstyle.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qstyle.cpp
wince*|symbian: {
!symbian:DEFINES += SRCDIR=\\\".\\\"
- addPixmap.sources = task_25863.png
+ addPixmap.files = task_25863.png
addPixmap.path = .
DEPLOYMENT += addPixmap
} else {
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
index f3e21a084b..50002a6169 100644
--- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -104,6 +104,7 @@ private slots:
//at the end because it mess with the style.
void widgetStyle();
void appStyle();
+ void QTBUG11658_cachecrash();
private:
QColor COLOR(const QWidget& w) {
w.ensurePolished();
@@ -1626,6 +1627,37 @@ void tst_QStyleSheetStyle::changeStyleInChangeEvent()
wid.ensurePolished();
}
+void tst_QStyleSheetStyle::QTBUG11658_cachecrash()
+{
+ //should not crash
+ class Widget : public QWidget
+ {
+ public:
+ Widget(QWidget *parent = 0)
+ : QWidget(parent)
+ {
+ QVBoxLayout* pLayout = new QVBoxLayout(this);
+ QCheckBox* pCheckBox = new QCheckBox(this);
+ pLayout->addWidget(pCheckBox);
+ setLayout(pLayout);
+
+ QString szStyleSheet = QLatin1String("* { color: red; }");
+ qApp->setStyleSheet(szStyleSheet);
+ qApp->setStyle(QStyleFactory::create(QLatin1String("Windows")));
+ }
+ };
+
+ Widget *w = new Widget();
+ delete w;
+ w = new Widget();
+ w->show();
+
+ QTest::qWaitForWindowShown(w);
+ delete w;
+ qApp->setStyleSheet(QString());
+}
+
+
QTEST_MAIN(tst_QStyleSheetStyle)
#include "tst_qstylesheetstyle.moc"
diff --git a/tests/auto/qsvggenerator/qsvggenerator.pro b/tests/auto/qsvggenerator/qsvggenerator.pro
index 1ccf8e92f1..2e899a99aa 100644
--- a/tests/auto/qsvggenerator/qsvggenerator.pro
+++ b/tests/auto/qsvggenerator/qsvggenerator.pro
@@ -8,7 +8,7 @@ QT += svg xml
SOURCES += tst_qsvggenerator.cpp
wince*|symbian {
- addFiles.sources = referenceSvgs
+ addFiles.files = referenceSvgs
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qsvgrenderer/qsvgrenderer.pro b/tests/auto/qsvgrenderer/qsvgrenderer.pro
index 0b785e3dfe..49337e2f5a 100644
--- a/tests/auto/qsvgrenderer/qsvgrenderer.pro
+++ b/tests/auto/qsvgrenderer/qsvgrenderer.pro
@@ -9,7 +9,7 @@ SOURCES += tst_qsvgrenderer.cpp
RESOURCES += resources.qrc
wince*|symbian {
- addFiles.sources = *.svg *.svgz
+ addFiles.files = *.svg *.svgz
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp
index f49fe97bfe..ec7c0731c6 100644
--- a/tests/auto/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/qtabbar/tst_qtabbar.cpp
@@ -76,6 +76,7 @@ private slots:
void setElideMode_data();
void setElideMode();
+ void sizeHints();
void setUsesScrollButtons_data();
void setUsesScrollButtons();
@@ -280,6 +281,46 @@ void tst_QTabBar::setElideMode()
QTEST(int(tabBar.elideMode()), "expectedMode");
}
+void tst_QTabBar::sizeHints()
+{
+ QTabBar tabBar;
+ QSKIP("To be fixed on Mac (font size below not large enough) and Linux QWS (probably too large for the screen).", SkipSingle);
+ tabBar.setFont(QFont("Arial", 10));
+ tabBar.addTab("tab 01");
+ tabBar.addTab("tab 02");
+ tabBar.addTab("tab 03");
+ tabBar.addTab("tab 04");
+ tabBar.addTab("tab 05");
+ tabBar.addTab("tab 06");
+ tabBar.addTab("This is tab7");
+ tabBar.addTab("This is tab8");
+ tabBar.addTab("This is tab9 with a very long title");
+
+ // No eliding and no scrolling -> tabbar becomes very wide
+ tabBar.setUsesScrollButtons(false);
+ tabBar.setElideMode(Qt::ElideNone);
+// qDebug() << tabBar.minimumSizeHint() << tabBar.sizeHint();
+ QVERIFY(tabBar.minimumSizeHint().width() > 700);
+ QVERIFY(tabBar.sizeHint().width() > 700);
+
+ // Scrolling enabled -> no reason to become very wide
+ tabBar.setUsesScrollButtons(true);
+ // qDebug() << tabBar.minimumSizeHint() << tabBar.sizeHint();
+ QVERIFY(tabBar.minimumSizeHint().width() < 200);
+ QVERIFY(tabBar.sizeHint().width() > 700); // unchanged
+
+ // Eliding enabled -> no reason to become very wide
+ tabBar.setUsesScrollButtons(false);
+ tabBar.setElideMode(Qt::ElideRight);
+// qDebug() << tabBar.minimumSizeHint() << tabBar.sizeHint();
+ QVERIFY(tabBar.minimumSizeHint().width() < 500);
+ QVERIFY(tabBar.sizeHint().width() > 700); // unchanged
+
+ tabBar.addTab("This is tab10 with a very long title");
+ QVERIFY(tabBar.minimumSizeHint().width() < 600);
+ QVERIFY(tabBar.sizeHint().width() > 700); // unchanged
+}
+
void tst_QTabBar::setUsesScrollButtons_data()
{
QTest::addColumn<int>("usesArrows");
diff --git a/tests/auto/qtabwidget/tst_qtabwidget.cpp b/tests/auto/qtabwidget/tst_qtabwidget.cpp
index 5a3edde83c..252450cc71 100644
--- a/tests/auto/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/qtabwidget/tst_qtabwidget.cpp
@@ -45,6 +45,7 @@
#include <qdebug.h>
#include <qapplication.h>
#include <qlabel.h>
+#include <QtGui/qboxlayout.h>
//TESTED_CLASS=
//TESTED_FILES=
@@ -120,6 +121,9 @@ class tst_QTabWidget:public QObject {
void clear();
void keyboardNavigation();
void paintEventCount();
+ void minimumSizeHint();
+ void heightForWidth_data();
+ void heightForWidth();
private:
int addPage();
@@ -624,6 +628,74 @@ void tst_QTabWidget::paintEventCount()
QCOMPARE(tab2->count, 1);
}
+void tst_QTabWidget::minimumSizeHint()
+{
+ QTabWidget tw;
+ QWidget *page = new QWidget;
+ QVBoxLayout *lay = new QVBoxLayout;
+
+ QLabel *label = new QLabel(QLatin1String("XXgypq lorem ipsum must be long, must be long. lorem ipsumMMMW"));
+ lay->addWidget(label);
+
+ page->setLayout(lay);
+
+ tw.addTab(page, QLatin1String("page1"));
+
+ tw.show();
+ QTest::qWaitForWindowShown(&tw);
+ tw.resize(tw.minimumSizeHint());
+
+ QSize minSize = label->minimumSizeHint();
+ QSize actSize = label->geometry().size();
+ QVERIFY(minSize.width() <= actSize.width());
+ QVERIFY(minSize.height() <= actSize.height());
+}
+
+void tst_QTabWidget::heightForWidth_data()
+{
+ QTest::addColumn<int>("tabPosition");
+ QTest::newRow("West") << int(QTabWidget::West);
+ QTest::newRow("North") << int(QTabWidget::North);
+ QTest::newRow("East") << int(QTabWidget::East);
+ QTest::newRow("South") << int(QTabWidget::South);
+}
+
+void tst_QTabWidget::heightForWidth()
+{
+ QFETCH(int, tabPosition);
+
+ QWidget *window = new QWidget;
+ QVBoxLayout *lay = new QVBoxLayout(window);
+ lay->setMargin(0);
+ lay->setSpacing(0);
+ QTabWidget *tabWid = new QTabWidget(window);
+ QWidget *w = new QWidget;
+ tabWid->addTab(w, QLatin1String("HFW page"));
+ tabWid->setTabPosition(QTabWidget::TabPosition(tabPosition));
+ QVBoxLayout *lay2 = new QVBoxLayout(w);
+ QLabel *label = new QLabel("Label with wordwrap turned on makes it trade height for width."
+ " Make it a really long text so that it spans on several lines"
+ " when the label is on its narrowest."
+ " I don't like to repeat myself."
+ " I don't like to repeat myself."
+ " I don't like to repeat myself."
+ " I don't like to repeat myself."
+ );
+ label->setWordWrap(true);
+ lay2->addWidget(label);
+ lay2->setMargin(0);
+
+ lay->addWidget(tabWid);
+ int h = window->heightForWidth(160);
+ window->resize(160, h);
+ window->show();
+
+ QTest::qWaitForWindowShown(window);
+ QVERIFY(label->height() >= label->heightForWidth(label->width()));
+
+ delete window;
+}
+
QTEST_MAIN(tst_QTabWidget)
#include "tst_qtabwidget.moc"
diff --git a/tests/auto/qtconcurrentfilter/qtconcurrentfilter.pro b/tests/auto/qtconcurrentfilter/qtconcurrentfilter.pro
index e93c5d25da..ee2b77d63c 100644
--- a/tests/auto/qtconcurrentfilter/qtconcurrentfilter.pro
+++ b/tests/auto/qtconcurrentfilter/qtconcurrentfilter.pro
@@ -2,3 +2,5 @@ load(qttest_p4)
DEFINES += QT_STRICT_ITERATORS
SOURCES += tst_qtconcurrentfilter.cpp
QT = core
+CONFIG += parallel_test
+CONFIG += parallel_test
diff --git a/tests/auto/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro b/tests/auto/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro
index 4fdcc222fe..a61d275241 100644
--- a/tests/auto/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro
+++ b/tests/auto/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro
@@ -1,3 +1,5 @@
load(qttest_p4)
SOURCES += tst_qtconcurrentiteratekernel.cpp
QT = core
+CONFIG += parallel_test
+CONFIG += parallel_test
diff --git a/tests/auto/qtconcurrentmap/qtconcurrentmap.pro b/tests/auto/qtconcurrentmap/qtconcurrentmap.pro
index 8cae71443d..6fc358514e 100644
--- a/tests/auto/qtconcurrentmap/qtconcurrentmap.pro
+++ b/tests/auto/qtconcurrentmap/qtconcurrentmap.pro
@@ -2,3 +2,5 @@ load(qttest_p4)
DEFINES += QT_STRICT_ITERATORS
SOURCES += tst_qtconcurrentmap.cpp
QT = core
+CONFIG += parallel_test
+CONFIG += parallel_test
diff --git a/tests/auto/qtconcurrentrun/qtconcurrentrun.pro b/tests/auto/qtconcurrentrun/qtconcurrentrun.pro
index ac29dd425b..24576048e9 100644
--- a/tests/auto/qtconcurrentrun/qtconcurrentrun.pro
+++ b/tests/auto/qtconcurrentrun/qtconcurrentrun.pro
@@ -1,3 +1,5 @@
load(qttest_p4)
SOURCES += tst_qtconcurrentrun.cpp
QT = core
+CONFIG += parallel_test
+CONFIG += parallel_test
diff --git a/tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp
index 006744ceaf..1069cb5777 100644
--- a/tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp
+++ b/tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp
@@ -61,6 +61,9 @@ private slots:
void implicitConvertibleTypes();
void runWaitLoop();
void recursive();
+#ifndef QT_NO_EXCEPTIONS
+ void exceptions();
+#endif
#if 0
void createFunctor();
#endif
@@ -374,6 +377,41 @@ int fn2(double, int *)
return 1;
}
+
+#ifndef QT_NO_EXCEPTIONS
+void throwFunction()
+{
+ throw QtConcurrent::Exception();
+}
+
+int throwFunctionReturn()
+{
+ throw QtConcurrent::Exception();
+ return 0;
+}
+
+void tst_QtConcurrentRun::exceptions()
+{
+ bool caught = false;
+ try {
+ QtConcurrent::run(throwFunction).waitForFinished();
+ } catch (Exception &e) {
+ caught = true;
+ }
+ if (!caught)
+ QFAIL("did not get exception");
+
+ caught = false;
+ try {
+ QtConcurrent::run(throwFunctionReturn).waitForFinished();
+ } catch (Exception &e) {
+ caught = true;
+ }
+ if (!caught)
+ QFAIL("did not get exception");
+}
+#endif
+
#if 0
void tst_QtConcurrentRun::createFunctor()
{
diff --git a/tests/auto/qtconcurrentthreadengine/qtconcurrentthreadengine.pro b/tests/auto/qtconcurrentthreadengine/qtconcurrentthreadengine.pro
index cd8d74e6fd..bbfcf5ebe3 100644
--- a/tests/auto/qtconcurrentthreadengine/qtconcurrentthreadengine.pro
+++ b/tests/auto/qtconcurrentthreadengine/qtconcurrentthreadengine.pro
@@ -1,3 +1,5 @@
load(qttest_p4)
SOURCES += tst_qtconcurrentthreadengine.cpp
QT = core
+CONFIG += parallel_test
+CONFIG += parallel_test
diff --git a/tests/auto/qtcpserver/test/test.pro b/tests/auto/qtcpserver/test/test.pro
index 123c79e408..e91ba20a13 100644
--- a/tests/auto/qtcpserver/test/test.pro
+++ b/tests/auto/qtcpserver/test/test.pro
@@ -4,7 +4,7 @@ SOURCES += ../tst_qtcpserver.cpp
win32: {
wince*: {
LIBS += -lws2
- crashApp.sources = ../crashingServer/crashingServer.exe
+ crashApp.files = ../crashingServer/crashingServer.exe
crashApp.path = crashingServer
DEPLOYMENT += crashApp
} else {
@@ -13,7 +13,7 @@ wince*: {
}
symbian {
- crashApp.sources = $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/crashingServer.exe
+ crashApp.files = $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/crashingServer.exe
crashApp.path = .
DEPLOYMENT += crashApp
}
diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro
index c93a2e57e9..64a043b19a 100644
--- a/tests/auto/qtemporaryfile/qtemporaryfile.pro
+++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro
@@ -4,9 +4,11 @@ QT = core
symbian {
- testData.sources = tst_qtemporaryfile.cpp
+ testData.files = tst_qtemporaryfile.cpp
testData.path = .
DEPLOYMENT += testData
}else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+
+CONFIG += parallel_test
diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
index aa1fbb5206..5f3cb119f4 100644
--- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
+++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
@@ -5,7 +5,8 @@ SOURCES += tst_qtextboundaryfinder.cpp
!symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\"
wince*|symbian:{
- addFiles.sources = data
+ addFiles.files = data
addFiles.path = .
DEPLOYMENT += addFiles
}
+CONFIG += parallel_test
diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro
index 88061a9d7b..773fb975a8 100644
--- a/tests/auto/qtextbrowser/qtextbrowser.pro
+++ b/tests/auto/qtextbrowser/qtextbrowser.pro
@@ -6,9 +6,9 @@ contains(QT_CONFIG, qt3support): QT += qt3support
wince*|symbian: {
- addFiles.sources = *.html
+ addFiles.files = *.html
addFiles.path = .
- addDir.sources = subdir/*
+ addDir.files = subdir/*
addDir.path = subdir
DEPLOYMENT += addFiles addDir
}
diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/qtextcodec/test/test.pro
index b85032a942..2188d2f22f 100644
--- a/tests/auto/qtextcodec/test/test.pro
+++ b/tests/auto/qtextcodec/test/test.pro
@@ -17,7 +17,7 @@ win32: {
}
wince*|symbian {
- addFiles.sources = ../*.txt
+ addFiles.files = ../*.txt
addFiles.path = .
DEPLOYMENT += addFiles
wince*|qt_not_deployed {
diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro
index 43813da277..e7d6c039a6 100644
--- a/tests/auto/qtextedit/qtextedit.pro
+++ b/tests/auto/qtextedit/qtextedit.pro
@@ -6,7 +6,7 @@ HEADERS +=
SOURCES += tst_qtextedit.cpp
wince*|symbian: {
- addImages.sources = fullWidthSelection/*
+ addImages.files = fullWidthSelection/*
addImages.path = fullWidthSelection
DEPLOYMENT += addImages
}
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index d6cf54c22a..d1b615ed47 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -85,6 +85,7 @@ private slots:
void cursorToXForSetColumns();
void defaultWordSeparators_data();
void defaultWordSeparators();
+ void cursorMovementFromInvalidPositions();
void cursorMovementInsideSpaces();
void charWordStopOnLineSeparator();
void xToCursorAtEndOfLine();
@@ -124,6 +125,7 @@ private slots:
void lineWidthFromBOM();
void textWidthVsWIdth();
+ void textWithSurrogates_qtbug15679();
private:
QFont testFont;
@@ -544,6 +546,10 @@ void tst_QTextLayout::defaultWordSeparators_data()
QTest::newRow("lineseparator")
<< QString::fromLatin1("abcd") + QString(QChar::LineSeparator) + QString::fromLatin1("efgh")
<< 0 << 5;
+
+ QTest::newRow("empty")
+ << QString()
+ << 0 << 0;
}
void tst_QTextLayout::defaultWordSeparators()
@@ -557,12 +563,31 @@ void tst_QTextLayout::defaultWordSeparators()
QCOMPARE(layout.previousCursorPosition(endPos, QTextLayout::SkipWords), startPos);
}
+void tst_QTextLayout::cursorMovementFromInvalidPositions()
+{
+ int badpos = 10000;
+
+ QTextLayout layout("ABC", testFont);
+
+ QCOMPARE(layout.previousCursorPosition(-badpos, QTextLayout::SkipCharacters), -badpos);
+ QCOMPARE(layout.nextCursorPosition(-badpos, QTextLayout::SkipCharacters), -badpos);
+
+ QCOMPARE(layout.previousCursorPosition(badpos, QTextLayout::SkipCharacters), badpos);
+ QCOMPARE(layout.nextCursorPosition(badpos, QTextLayout::SkipCharacters), badpos);
+}
+
void tst_QTextLayout::cursorMovementInsideSpaces()
{
QTextLayout layout("ABC DEF", testFont);
QCOMPARE(layout.previousCursorPosition(6, QTextLayout::SkipWords), 0);
QCOMPARE(layout.nextCursorPosition(6, QTextLayout::SkipWords), 15);
+
+
+ QTextLayout layout2("ABC\t\t\t\t\t\t\t\t\t\t\t\tDEF", testFont);
+
+ QCOMPARE(layout2.previousCursorPosition(6, QTextLayout::SkipWords), 0);
+ QCOMPARE(layout2.nextCursorPosition(6, QTextLayout::SkipWords), 15);
}
void tst_QTextLayout::charWordStopOnLineSeparator()
@@ -1388,6 +1413,24 @@ void tst_QTextLayout::textWidthVsWIdth()
}
}
+void tst_QTextLayout::textWithSurrogates_qtbug15679()
+{
+ QString str = QString::fromUtf8("🀀a🀀");
+ QTextLayout layout(str);
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+
+ qreal x[6];
+ for (int i = 0; i < 6; i++)
+ x[i] = line.cursorToX(i);
+
+ // If the first and third character are using the same
+ // font, they must have the same advance (since they
+ // are surrogate pairs, we need to add two for each
+ // character)
+ QCOMPARE(x[2] - x[0], x[5] - x[3]);
+}
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"
diff --git a/tests/auto/qtextlist/tst_qtextlist.cpp b/tests/auto/qtextlist/tst_qtextlist.cpp
index f56646fe81..01c04c5cf7 100644
--- a/tests/auto/qtextlist/tst_qtextlist.cpp
+++ b/tests/auto/qtextlist/tst_qtextlist.cpp
@@ -67,6 +67,9 @@ private slots:
void item();
void autoNumbering();
void autoNumberingRTL();
+ void autoNumberingPrefixAndSuffix();
+ void autoNumberingPrefixAndSuffixRTL();
+ void autoNumberingPrefixAndSuffixHtmlExportImport();
void romanNumbering();
void romanNumberingLimit();
void formatChange();
@@ -128,6 +131,76 @@ void tst_QTextList::autoNumbering()
QVERIFY(cursor.currentList()->itemText(cursor.block()) == "ab.");
}
+void tst_QTextList::autoNumberingPrefixAndSuffix()
+{
+ QTextListFormat fmt;
+ fmt.setStyle(QTextListFormat::ListLowerAlpha);
+ fmt.setNumberPrefix("-");
+ fmt.setNumberSuffix(")");
+ QTextList *list = cursor.createList(fmt);
+ QVERIFY(list);
+
+ for (int i = 0; i < 27; ++i)
+ cursor.insertBlock();
+
+ QVERIFY(list->count() == 28);
+
+ QVERIFY(cursor.currentList());
+ QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 27);
+ QVERIFY(cursor.currentList()->itemText(cursor.block()) == "-ab)");
+}
+
+void tst_QTextList::autoNumberingPrefixAndSuffixRTL()
+{
+ QTextBlockFormat bfmt;
+ bfmt.setLayoutDirection(Qt::RightToLeft);
+ cursor.setBlockFormat(bfmt);
+
+ QTextListFormat fmt;
+ fmt.setStyle(QTextListFormat::ListUpperAlpha);
+ fmt.setNumberPrefix("-");
+ fmt.setNumberSuffix("*");
+ QTextList *list = cursor.createList(fmt);
+ QVERIFY(list);
+
+ cursor.insertBlock();
+
+ QVERIFY(list->count() == 2);
+
+ QVERIFY(cursor.currentList()->itemText(cursor.block()) == "*B-");
+}
+
+void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
+{
+ QTextListFormat fmt;
+ fmt.setStyle(QTextListFormat::ListLowerAlpha);
+ fmt.setNumberPrefix("\"");
+ fmt.setNumberSuffix("#");
+ fmt.setIndent(10);
+ // FIXME: Would like to test "'" but there's a problem in the css parser (Scanner::preprocess
+ // is called before the values are being parsed), so the quoting does not work.
+ QTextList *list = cursor.createList(fmt);
+ QVERIFY(list);
+
+ for (int i = 0; i < 27; ++i)
+ cursor.insertBlock();
+
+ QVERIFY(list->count() == 28);
+
+ QString htmlExport = doc->toHtml();
+ QTextDocument importDoc;
+ importDoc.setHtml(htmlExport);
+
+ QTextCursor importCursor(&importDoc);
+ for (int i = 0; i < 27; ++i)
+ importCursor.movePosition(QTextCursor::NextBlock);
+
+ QVERIFY(importCursor.currentList());
+ QVERIFY(importCursor.currentList()->itemNumber(importCursor.block()) == 27);
+ QVERIFY(importCursor.currentList()->itemText(importCursor.block()) == "\"ab#");
+ QVERIFY(importCursor.currentList()->format().indent() == 10);
+}
+
void tst_QTextList::autoNumberingRTL()
{
QTextBlockFormat bfmt;
diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
index ab7c1f3b91..91d0f3ff17 100644
--- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -103,6 +103,7 @@ private slots:
void khmer();
void linearB();
+ void controlInSyllable_qtbug14204();
};
tst_QTextScriptEngine::tst_QTextScriptEngine()
@@ -1111,6 +1112,26 @@ void tst_QTextScriptEngine::greek()
#endif
}
+void tst_QTextScriptEngine::controlInSyllable_qtbug14204()
+{
+#if defined(Q_WS_X11)
+ QString s;
+ s.append(QChar(0x0915));
+ s.append(QChar(0x094d));
+ s.append(QChar(0x200d));
+ s.append(QChar(0x0915));
+
+ QTextLayout layout(s);
+ QTextEngine *e = layout.d;
+ e->itemize();
+ e->shape(0);
+
+ QVERIFY(e->layoutData->items[0].num_glyphs == 2);
+ QVERIFY(e->layoutData->glyphLayout.advances_x[1] != 0);
+#else
+ QSKIP("X11 specific test", SkipAll);
+#endif
+}
QTEST_MAIN(tst_QTextScriptEngine)
#include "tst_qtextscriptengine.moc"
diff --git a/tests/auto/qtextstream/test/test.pro b/tests/auto/qtextstream/test/test.pro
index 20823de331..8805fb9f61 100644
--- a/tests/auto/qtextstream/test/test.pro
+++ b/tests/auto/qtextstream/test/test.pro
@@ -18,9 +18,9 @@ QT = core network
wince*|symbian: {
- addFiles.sources = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp
+ addFiles.files = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp
addFiles.path = .
- res.sources = ../resources
+ res.files = ../resources
res.path = .
DEPLOYMENT += addFiles
}
@@ -30,7 +30,7 @@ wince*: {
}else:symbian {
# Symbian can't define SRCDIR meaningfully here
qt_not_deployed {
- codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll
+ codecs_plugins.files = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll
codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs
DEPLOYMENT += codecs_plugins
}
diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp
index 3bafcc8973..99f25563b7 100644
--- a/tests/auto/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/qtextstream/tst_qtextstream.cpp
@@ -228,6 +228,7 @@ private slots:
void status_real_read();
void status_integer_read();
void status_word_read();
+ void status_write_error();
// use case tests
void useCase1();
@@ -4176,6 +4177,42 @@ void tst_QTextStream::status_word_read()
QCOMPARE(s.status(), QTextStream::ReadPastEnd);
}
+class FakeBuffer : public QBuffer
+{
+protected:
+ qint64 writeData(const char *c, qint64 i) { return m_lock ? 0 : QBuffer::writeData(c, i); }
+public:
+ FakeBuffer(bool locked = false) : m_lock(locked) {}
+ void setLocked(bool locked) { m_lock = locked; }
+private:
+ bool m_lock;
+};
+
+void tst_QTextStream::status_write_error()
+{
+ FakeBuffer fb(false);
+ QVERIFY(fb.open(QBuffer::ReadWrite));
+ QTextStream fs(&fb);
+ fs.setCodec(QTextCodec::codecForName("latin1"));
+ /* first write some initial content */
+ fs << "hello";
+ fs.flush();
+ QCOMPARE(fs.status(), QTextStream::Ok);
+ QCOMPARE(fb.data(), QByteArray("hello"));
+ /* then test that writing can cause an error */
+ fb.setLocked(true);
+ fs << "error";
+ fs.flush();
+ QCOMPARE(fs.status(), QTextStream::WriteFailed);
+ QCOMPARE(fb.data(), QByteArray("hello"));
+ /* finally test that writing after an error doesn't change the stream any more */
+ fb.setLocked(false);
+ fs << "can't do that";
+ fs.flush();
+ QCOMPARE(fs.status(), QTextStream::WriteFailed);
+ QCOMPARE(fb.data(), QByteArray("hello"));
+}
+
void tst_QTextStream::task180679_alignAccountingStyle()
{
{
diff --git a/tests/auto/qthread/qthread.pro b/tests/auto/qthread/qthread.pro
index 0b042ab8b2..d3b1028034 100644
--- a/tests/auto/qthread/qthread.pro
+++ b/tests/auto/qthread/qthread.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
SOURCES += tst_qthread.cpp
QT = core
symbian:LIBS += -llibpthread
+CONFIG += parallel_test
diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp
index e6bf9ceae5..19c6c166dc 100644
--- a/tests/auto/qthread/tst_qthread.cpp
+++ b/tests/auto/qthread/tst_qthread.cpp
@@ -108,6 +108,12 @@ private slots:
void QTBUG13810_exitAndStart();
void QTBUG15378_exitAndExec();
+ void connectThreadFinishedSignalToObjectDeleteLaterSlot();
+ void wait2();
+ void wait3_slowDestructor();
+ void destroyFinishRace();
+ void startFinishRace();
+
void stressTest();
};
@@ -976,7 +982,6 @@ void tst_QThread::QTBUG13810_exitAndStart()
QCOMPARE(sync1.m_prop, 89);
}
-
void tst_QThread::QTBUG15378_exitAndExec()
{
class Thread : public QThread {
@@ -999,7 +1004,7 @@ void tst_QThread::QTBUG15378_exitAndExec()
thread.sem2.acquire();
int v = thread.value;
QCOMPARE(v, 556);
-
+
//test that the thread is running by executing queued connected signal there
Syncronizer sync1;
sync1.moveToThread(&thread);
@@ -1015,7 +1020,135 @@ void tst_QThread::QTBUG15378_exitAndExec()
QCOMPARE(sync1.m_prop, 89);
}
+void tst_QThread::connectThreadFinishedSignalToObjectDeleteLaterSlot()
+{
+ QThread thread;
+ QObject *object = new QObject;
+ QWeakPointer<QObject> p = object;
+ QVERIFY(!p.isNull());
+ connect(&thread, SIGNAL(started()), &thread, SLOT(quit()), Qt::DirectConnection);
+ connect(&thread, SIGNAL(finished()), object, SLOT(deleteLater()));
+ object->moveToThread(&thread);
+ thread.start();
+ QVERIFY(thread.wait(30000));
+ QVERIFY(p.isNull());
+}
+
+class Waiting_Thread : public QThread
+{
+public:
+ enum { WaitTime = 800 };
+ QMutex mutex;
+ QWaitCondition cond1;
+ QWaitCondition cond2;
+
+ void run()
+ {
+ QMutexLocker locker(&mutex);
+ cond1.wait(&mutex);
+ cond2.wait(&mutex, WaitTime);
+ }
+};
+
+void tst_QThread::wait2()
+{
+ QElapsedTimer timer;
+ Waiting_Thread thread;
+ thread.start();
+ timer.start();
+ QVERIFY(!thread.wait(Waiting_Thread::WaitTime));
+ qint64 elapsed = timer.elapsed();
+
+ QVERIFY(elapsed >= Waiting_Thread::WaitTime);
+ //QVERIFY(elapsed < Waiting_Thread::WaitTime * 1.4);
+
+ timer.start();
+ thread.cond1.wakeOne();
+ QVERIFY(thread.wait(/*Waiting_Thread::WaitTime * 1.4*/));
+ elapsed = timer.elapsed();
+ QVERIFY(elapsed >= Waiting_Thread::WaitTime);
+ //QVERIFY(elapsed < Waiting_Thread::WaitTime * 1.4);
+}
+
+class SlowSlotObject : public QObject {
+ Q_OBJECT
+public:
+ QMutex mutex;
+ QWaitCondition cond;
+public slots:
+ void slowSlot() {
+ QMutexLocker locker(&mutex);
+ cond.wait(&mutex);
+ }
+};
+
+void tst_QThread::wait3_slowDestructor()
+{
+ SlowSlotObject slow;
+ QThread thread;
+ QObject::connect(&thread, SIGNAL(finished()), &slow, SLOT(slowSlot()), Qt::DirectConnection);
+
+ enum { WaitTime = 1800 };
+ QElapsedTimer timer;
+
+ thread.start();
+ thread.quit();
+ //the quit function will cause the thread to finish and enter the slowSlot that is blocking
+
+ timer.start();
+ QVERIFY(!thread.wait(Waiting_Thread::WaitTime));
+ qint64 elapsed = timer.elapsed();
+
+ QVERIFY(elapsed >= Waiting_Thread::WaitTime);
+ //QVERIFY(elapsed < Waiting_Thread::WaitTime * 1.4);
+
+ slow.cond.wakeOne();
+ //now the thread should finish quickly
+ QVERIFY(thread.wait(one_minute));
+}
+
+void tst_QThread::destroyFinishRace()
+{
+ class Thread : public QThread { void run() {} };
+ for (int i = 0; i < 15; i++) {
+ Thread *thr = new Thread;
+ connect(thr, SIGNAL(finished()), thr, SLOT(deleteLater()));
+ QWeakPointer<QThread> weak(static_cast<QThread*>(thr));
+ thr->start();
+ while (weak) {
+ qApp->processEvents();
+ qApp->processEvents();
+ qApp->processEvents();
+ qApp->processEvents();
+ }
+ }
+}
+
+void tst_QThread::startFinishRace()
+{
+ class Thread : public QThread {
+ public:
+ Thread() : i (50) {}
+ void run() {
+ i--;
+ if (!i) disconnect(this, SIGNAL(finished()), 0, 0);
+ }
+ int i;
+ };
+ for (int i = 0; i < 15; i++) {
+ Thread thr;
+ connect(&thr, SIGNAL(finished()), &thr, SLOT(start()));
+ thr.start();
+ while (!thr.isFinished() || thr.i != 0) {
+ qApp->processEvents();
+ qApp->processEvents();
+ qApp->processEvents();
+ qApp->processEvents();
+ }
+ QCOMPARE(thr.i, 0);
+ }
+}
QTEST_MAIN(tst_QThread)
#include "tst_qthread.moc"
diff --git a/tests/auto/qthreadonce/qthreadonce.pro b/tests/auto/qthreadonce/qthreadonce.pro
index a672a03f0c..d7ef4d4c23 100644
--- a/tests/auto/qthreadonce/qthreadonce.pro
+++ b/tests/auto/qthreadonce/qthreadonce.pro
@@ -10,3 +10,4 @@ QT = core
# Temporary:
SOURCES += qthreadonce.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/qthreadpool/qthreadpool.pro b/tests/auto/qthreadpool/qthreadpool.pro
index 3f6ea64948..dbaeb208dd 100644
--- a/tests/auto/qthreadpool/qthreadpool.pro
+++ b/tests/auto/qthreadpool/qthreadpool.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qthreadpool.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qthreadpool/tst_qthreadpool.cpp b/tests/auto/qthreadpool/tst_qthreadpool.cpp
index a3f9712e38..165e3f87ba 100644
--- a/tests/auto/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/qthreadpool/tst_qthreadpool.cpp
@@ -89,6 +89,7 @@ private slots:
void tryStartPeakThreadCount();
void tryStartCount();
void waitForDone();
+ void waitForDoneTimeout();
void destroyingWaitsForTasksToFinish();
void stressTest();
};
@@ -774,6 +775,32 @@ void tst_QThreadPool::waitForDone()
}
}
+void tst_QThreadPool::waitForDoneTimeout()
+{
+ class BlockedTask : public QRunnable
+ {
+ public:
+ QMutex mutex;
+ BlockedTask() { setAutoDelete(false); }
+
+ void run()
+ {
+ mutex.lock();
+ mutex.unlock();
+ QTest::qSleep(50);
+ }
+ };
+
+ QThreadPool threadPool;
+
+ BlockedTask *task = new BlockedTask;
+ task->mutex.lock();
+ threadPool.start(task);
+ QVERIFY(!threadPool.waitForDone(100));
+ task->mutex.unlock();
+ QVERIFY(threadPool.waitForDone(400));
+}
+
void tst_QThreadPool::destroyingWaitsForTasksToFinish()
{
QTime total, pass;
diff --git a/tests/auto/qthreadstorage/qthreadstorage.pro b/tests/auto/qthreadstorage/qthreadstorage.pro
index a06f89c368..0dc8d086df 100644
--- a/tests/auto/qthreadstorage/qthreadstorage.pro
+++ b/tests/auto/qthreadstorage/qthreadstorage.pro
@@ -2,3 +2,4 @@ TEMPLATE = subdirs
SUBDIRS = \
tst_qthreadstorage.pro \
crashOnExit.pro
+CONFIG += parallel_test
diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp
index 2f23edb15e..a62bfee974 100644
--- a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp
@@ -77,6 +77,9 @@ private slots:
void adoptedThreads();
void ensureCleanupOrder();
void QTBUG13877_crashOnExit();
+ void QTBUG14579_leakInDestructor();
+ void QTBUG14579_resetInDestructor();
+ void valueBased();
};
class Pointer
@@ -310,5 +313,192 @@ void tst_QThreadStorage::QTBUG13877_crashOnExit()
QVERIFY(process.exitStatus() != QProcess::CrashExit);
}
+// S stands for thread Safe.
+class SPointer
+{
+public:
+ static QBasicAtomicInt count;
+ inline SPointer() { count.ref(); }
+ inline ~SPointer() { count.deref(); }
+ inline SPointer(const SPointer &other) { count.ref(); }
+};
+QBasicAtomicInt SPointer::count = Q_BASIC_ATOMIC_INITIALIZER(0);
+
+Q_GLOBAL_STATIC(QThreadStorage<SPointer *>, QTBUG14579_pointers1)
+Q_GLOBAL_STATIC(QThreadStorage<SPointer *>, QTBUG14579_pointers2)
+
+class QTBUG14579_class
+{
+public:
+ SPointer member;
+ inline ~QTBUG14579_class() {
+ QVERIFY(!QTBUG14579_pointers1()->hasLocalData());
+ QVERIFY(!QTBUG14579_pointers2()->hasLocalData());
+ QTBUG14579_pointers2()->setLocalData(new SPointer);
+ QTBUG14579_pointers1()->setLocalData(new SPointer);
+ QVERIFY(QTBUG14579_pointers1()->hasLocalData());
+ QVERIFY(QTBUG14579_pointers2()->hasLocalData());
+ }
+};
+
+
+void tst_QThreadStorage::QTBUG14579_leakInDestructor()
+{
+ class Thread : public QThread
+ {
+ public:
+ QThreadStorage<QTBUG14579_class *> &tls;
+
+ Thread(QThreadStorage<QTBUG14579_class *> &t) : tls(t) { }
+
+ void run()
+ {
+ QVERIFY(!tls.hasLocalData());
+ tls.setLocalData(new QTBUG14579_class);
+ QVERIFY(tls.hasLocalData());
+ }
+ };
+ int c = SPointer::count;
+
+ QThreadStorage<QTBUG14579_class *> tls;
+
+ QVERIFY(!QTBUG14579_pointers1()->hasLocalData());
+ QThreadStorage<int *> tls2; //add some more tls to make sure ids are not following each other too much
+ QThreadStorage<int *> tls3;
+ QVERIFY(!tls2.hasLocalData());
+ QVERIFY(!tls3.hasLocalData());
+ QVERIFY(!tls.hasLocalData());
+
+ Thread t1(tls);
+ Thread t2(tls);
+ Thread t3(tls);
+
+ t1.start();
+ t2.start();
+ t3.start();
+
+ QVERIFY(t1.wait());
+ QVERIFY(t2.wait());
+ QVERIFY(t3.wait());
+
+ //check all the constructed things have been destructed
+ QCOMPARE(int(SPointer::count), c);
+}
+
+
+class QTBUG14579_reset;
+Q_GLOBAL_STATIC(QThreadStorage<QTBUG14579_reset *>, QTBUG14579_resetTls)
+
+class QTBUG14579_reset {
+public:
+ SPointer member;
+ ~QTBUG14579_reset() {
+ //Quite stupid, but WTF::ThreadSpecific<T>::destroy does it.
+ QTBUG14579_resetTls()->setLocalData(this);
+ }
+};
+
+
+void tst_QThreadStorage::QTBUG14579_resetInDestructor()
+{
+ class Thread : public QThread
+ {
+ public:
+ void run()
+ {
+ QVERIFY(!QTBUG14579_resetTls()->hasLocalData());
+ QTBUG14579_resetTls()->setLocalData(new QTBUG14579_reset);
+ QVERIFY(QTBUG14579_resetTls()->hasLocalData());
+ }
+ };
+ int c = SPointer::count;
+
+ Thread t1;
+ Thread t2;
+ Thread t3;
+ t1.start();
+ t2.start();
+ t3.start();
+ QVERIFY(t1.wait());
+ QVERIFY(t2.wait());
+ QVERIFY(t3.wait());
+
+ //check all the constructed things have been destructed
+ QCOMPARE(int(SPointer::count), c);
+}
+
+
+void tst_QThreadStorage::valueBased()
+{
+ struct Thread : QThread {
+ QThreadStorage<SPointer> &tlsSPointer;
+ QThreadStorage<QString> &tlsString;
+ QThreadStorage<int> &tlsInt;
+
+ int someNumber;
+ QString someString;
+ Thread(QThreadStorage<SPointer> &t1, QThreadStorage<QString> &t2, QThreadStorage<int> &t3)
+ : tlsSPointer(t1), tlsString(t2), tlsInt(t3) { }
+
+ void run() {
+ /*QVERIFY(!tlsSPointer.hasLocalData());
+ QVERIFY(!tlsString.hasLocalData());
+ QVERIFY(!tlsInt.hasLocalData());*/
+ SPointer pointercopy = tlsSPointer.localData();
+
+ //Default constructed values
+ QVERIFY(tlsString.localData().isNull());
+ QCOMPARE(tlsInt.localData(), 0);
+
+ //setting
+ tlsString.setLocalData(someString);
+ tlsInt.setLocalData(someNumber);
+
+ QCOMPARE(tlsString.localData(), someString);
+ QCOMPARE(tlsInt.localData(), someNumber);
+
+ //changing
+ tlsSPointer.setLocalData(SPointer());
+ tlsInt.localData() += 42;
+ tlsString.localData().append(QLatin1String(" world"));
+
+ QCOMPARE(tlsString.localData(), (someString + QLatin1String(" world")));
+ QCOMPARE(tlsInt.localData(), (someNumber + 42));
+
+ // operator=
+ tlsString.localData() = QString::number(someNumber);
+ QCOMPARE(tlsString.localData().toInt(), someNumber);
+ }
+ };
+
+ QThreadStorage<SPointer> tlsSPointer;
+ QThreadStorage<QString> tlsString;
+ QThreadStorage<int> tlsInt;
+
+ int c = SPointer::count;
+
+ Thread t1(tlsSPointer, tlsString, tlsInt);
+ Thread t2(tlsSPointer, tlsString, tlsInt);
+ Thread t3(tlsSPointer, tlsString, tlsInt);
+ t1.someNumber = 42;
+ t2.someNumber = -128;
+ t3.someNumber = 78;
+ t1.someString = "hello";
+ t2.someString = "trolltech";
+ t3.someString = "nokia";
+
+ t1.start();
+ t2.start();
+ t3.start();
+
+ QVERIFY(t1.wait());
+ QVERIFY(t2.wait());
+ QVERIFY(t3.wait());
+
+ QCOMPARE(c, int(SPointer::count));
+
+}
+
+
QTEST_MAIN(tst_QThreadStorage)
#include "tst_qthreadstorage.moc"
diff --git a/tests/auto/qtime/qtime.pro b/tests/auto/qtime/qtime.pro
index 88277a001f..ce4f7ae91f 100644
--- a/tests/auto/qtime/qtime.pro
+++ b/tests/auto/qtime/qtime.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qtime.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qtimeline/qtimeline.pro b/tests/auto/qtimeline/qtimeline.pro
index 78204552e5..9be717dba8 100644
--- a/tests/auto/qtimeline/qtimeline.pro
+++ b/tests/auto/qtimeline/qtimeline.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qtimeline.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qtimer/qtimer.pro b/tests/auto/qtimer/qtimer.pro
index 79ae7dbd0b..086df1dd18 100644
--- a/tests/auto/qtimer/qtimer.pro
+++ b/tests/auto/qtimer/qtimer.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qtimer.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qtipc/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro
index 68a5362e2b..50c266986c 100644
--- a/tests/auto/qtipc/qsharedmemory/test/test.pro
+++ b/tests/auto/qtipc/qsharedmemory/test/test.pro
@@ -20,16 +20,16 @@ TARGET = ../tst_qsharedmemory
wince*:{
requires(contains(QT_CONFIG,script))
QT += gui script
-addFiles.sources = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts
+addFiles.files = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
}else:symbian{
requires(contains(QT_CONFIG,script))
QT += gui script
-addFiles.sources = ../../lackey/scripts
+addFiles.files = ../../lackey/scripts
addFiles.path = /data/qsharedmemorytemp/lackey
-addBin.sources = lackey.exe
+addBin.files = lackey.exe
addBin.path = /sys/bin
DEPLOYMENT += addFiles addBin
} else {
diff --git a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp
index 50205bcb98..be6049b3e6 100644
--- a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp
+++ b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp
@@ -107,6 +107,10 @@ private slots:
void useTooMuchMemory();
void attachTooMuch();
+ // unique keys
+ void uniqueKey_data();
+ void uniqueKey();
+
protected:
int remove(const QString &key);
@@ -225,11 +229,17 @@ void tst_QSharedMemory::key_data()
{
QTest::addColumn<QString>("constructorKey");
QTest::addColumn<QString>("setKey");
-
- QTest::newRow("null, null") << QString() << QString();
- QTest::newRow("null, one") << QString() << QString("one");
- QTest::newRow("one, two") << QString("one") << QString("two");
- QTest::newRow("invalid") << QString("o/e") << QString("t/o");
+ QTest::addColumn<QString>("setNativeKey");
+
+ QTest::newRow("null, null, null") << QString() << QString() << QString();
+ QTest::newRow("one, null, null") << QString("one") << QString() << QString();
+ QTest::newRow("null, one, null") << QString() << QString("one") << QString();
+ QTest::newRow("null, null, one") << QString() << QString() << QString("one");
+ QTest::newRow("one, two, null") << QString("one") << QString("two") << QString();
+ QTest::newRow("one, null, two") << QString("one") << QString() << QString("two");
+ QTest::newRow("null, one, two") << QString() << QString("one") << QString("two");
+ QTest::newRow("one, two, three") << QString("one") << QString("two") << QString("three");
+ QTest::newRow("invalid") << QString("o/e") << QString("t/o") << QString("|x");
}
/*!
@@ -239,11 +249,17 @@ void tst_QSharedMemory::key()
{
QFETCH(QString, constructorKey);
QFETCH(QString, setKey);
+ QFETCH(QString, setNativeKey);
QSharedMemory sm(constructorKey);
QCOMPARE(sm.key(), constructorKey);
+ QCOMPARE(sm.nativeKey().isEmpty(), constructorKey.isEmpty());
sm.setKey(setKey);
QCOMPARE(sm.key(), setKey);
+ QCOMPARE(sm.nativeKey().isEmpty(), setKey.isEmpty());
+ sm.setNativeKey(setNativeKey);
+ QVERIFY(sm.key().isNull());
+ QCOMPARE(sm.nativeKey(), setNativeKey);
QCOMPARE(sm.isAttached(), false);
QCOMPARE(sm.error(), QSharedMemory::NoError);
@@ -262,7 +278,7 @@ void tst_QSharedMemory::create_data()
QTest::addColumn<QSharedMemory::SharedMemoryError>("error");
QTest::newRow("null key") << QString() << 1024
- << false << QSharedMemory::LockError;
+ << false << QSharedMemory::KeyError;
QTest::newRow("-1 size") << QString("negsize") << -1
<< false << QSharedMemory::InvalidSize;
QTest::newRow("nor size") << QString("norsize") << 1024
@@ -302,7 +318,7 @@ void tst_QSharedMemory::attach_data()
QTest::addColumn<bool>("exists");
QTest::addColumn<QSharedMemory::SharedMemoryError>("error");
- QTest::newRow("null key") << QString() << false << QSharedMemory::LockError;
+ QTest::newRow("null key") << QString() << false << QSharedMemory::KeyError;
QTest::newRow("doesn't exists") << QString("doesntexists") << false << QSharedMemory::NotFound;
QTest::newRow("already exists") << QString(EXISTING_SHARE) << true << QSharedMemory::NoError;
}
@@ -783,6 +799,35 @@ void tst_QSharedMemory::simpleProcessProducerConsumer()
QCOMPARE(failedProcesses, (unsigned int)(0));
}
+void tst_QSharedMemory::uniqueKey_data()
+{
+ QTest::addColumn<QString>("key1");
+ QTest::addColumn<QString>("key2");
+
+ QTest::newRow("null == null") << QString() << QString();
+ QTest::newRow("key == key") << QString("key") << QString("key");
+ QTest::newRow("key1 == key1") << QString("key1") << QString("key1");
+ QTest::newRow("key != key1") << QString("key") << QString("key1");
+ QTest::newRow("ke1y != key1") << QString("ke1y") << QString("key1");
+ QTest::newRow("key1 != key2") << QString("key1") << QString("key2");
+}
+
+void tst_QSharedMemory::uniqueKey()
+{
+ QFETCH(QString, key1);
+ QFETCH(QString, key2);
+
+ QSharedMemory sm1(key1);
+ QSharedMemory sm2(key2);
+
+ bool setEqual = (key1 == key2);
+ bool keyEqual = (sm1.key() == sm2.key());
+ bool nativeEqual = (sm1.nativeKey() == sm2.nativeKey());
+
+ QCOMPARE(keyEqual, setEqual);
+ QCOMPARE(nativeEqual, setEqual);
+}
+
QTEST_MAIN(tst_QSharedMemory)
#include "tst_qsharedmemory.moc"
diff --git a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro
index e21e5df8a0..e05b6b878b 100644
--- a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro
+++ b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro
@@ -17,7 +17,7 @@ requires(contains(QT_CONFIG,script))
# this test calls lackey, which then again depends on QtScript.
# let's add it here so that it gets deployed easily
QT += script
-lackey.sources = $$OUT_PWD/../lackey/lackey.exe ../lackey/scripts
+lackey.files = $$OUT_PWD/../lackey/lackey.exe ../lackey/scripts
lackey.path = .
DEPLOYMENT += lackey
}
@@ -28,7 +28,7 @@ requires(contains(QT_CONFIG,script))
# let's add it here so that it gets deployed easily
QT += script
-lackey.sources = ../lackey/lackey.exe
+lackey.files = ../lackey/lackey.exe
lackey.path = /sys/bin
DEPLOYMENT += lackey
diff --git a/tests/auto/qtmd5/qtmd5.pro b/tests/auto/qtmd5/qtmd5.pro
index cb4a5398b8..0afc6b1b14 100644
--- a/tests/auto/qtmd5/qtmd5.pro
+++ b/tests/auto/qtmd5/qtmd5.pro
@@ -12,3 +12,4 @@ SOURCES += tst_qtmd5.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qtokenautomaton/qtokenautomaton.pro b/tests/auto/qtokenautomaton/qtokenautomaton.pro
index 6ebf7c46d2..5e2e590a4b 100644
--- a/tests/auto/qtokenautomaton/qtokenautomaton.pro
+++ b/tests/auto/qtokenautomaton/qtokenautomaton.pro
@@ -15,3 +15,4 @@ HEADERS += tokenizers/basic/basic.h \
tokenizers/withNamespace/withNamespace.h
QT -= gui
+CONFIG += parallel_test
diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro
index 5b742f76e9..0001d1c329 100644
--- a/tests/auto/qtranslator/qtranslator.pro
+++ b/tests/auto/qtranslator/qtranslator.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qtranslator.cpp
RESOURCES += qtranslator.qrc
wince*|symbian: {
- addFiles.sources = hellotr_la.qm msgfmt_from_po.qm
+ addFiles.files = hellotr_la.qm msgfmt_from_po.qm
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qudpsocket/test/test.pro b/tests/auto/qudpsocket/test/test.pro
index 9c0d009009..7e5ffe493e 100644
--- a/tests/auto/qudpsocket/test/test.pro
+++ b/tests/auto/qudpsocket/test/test.pro
@@ -15,7 +15,7 @@ win32 {
}
wince*|symbian: {
- addApp.sources = ../clientserver/clientserver.exe
+ addApp.files = ../clientserver/clientserver.exe
addApp.path = clientserver
DEPLOYMENT += addApp
}
diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp
index a6f8edbcc7..6ba55b2f6d 100644
--- a/tests/auto/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp
@@ -50,11 +50,13 @@
#include <qhostinfo.h>
#include <qmap.h>
#include <QNetworkProxy>
+#include <QNetworkInterface>
#include <qstringlist.h>
#include "../network-settings.h"
Q_DECLARE_METATYPE(QHostAddress)
+Q_DECLARE_METATYPE(QNetworkInterface)
//TESTED_CLASS=
//TESTED_FILES=
@@ -94,6 +96,18 @@ private slots:
void outOfProcessConnectedClientServerTest();
void outOfProcessUnconnectedClientServerTest();
void zeroLengthDatagram();
+ void multicastTtlOption_data();
+ void multicastTtlOption();
+ void multicastLoopbackOption_data();
+ void multicastLoopbackOption();
+ void multicastJoinBeforeBind_data();
+ void multicastJoinBeforeBind();
+ void multicastLeaveAfterClose_data();
+ void multicastLeaveAfterClose();
+ void setMulticastInterface_data();
+ void setMulticastInterface();
+ void multicast_data();
+ void multicast();
protected slots:
void empty_readyReadSlot();
@@ -844,5 +858,242 @@ void tst_QUdpSocket::zeroLengthDatagram()
QCOMPARE(receiver.readDatagram(&buf, 1), qint64(0));
}
+void tst_QUdpSocket::multicastTtlOption_data()
+{
+ QTest::addColumn<QHostAddress>("bindAddress");
+ QTest::addColumn<int>("ttl");
+ QTest::addColumn<int>("expected");
+
+ QList<QHostAddress> addresses;
+ addresses += QHostAddress(QHostAddress::Any);
+ addresses += QHostAddress(QHostAddress::AnyIPv6);
+
+ foreach (const QHostAddress &address, addresses) {
+ QTest::newRow(QString("%1 0").arg(address.toString()).toAscii()) << address << 0 << 0;
+ QTest::newRow(QString("%1 1").arg(address.toString()).toAscii()) << address << 1 << 1;
+ QTest::newRow(QString("%1 2").arg(address.toString()).toAscii()) << address << 2 << 2;
+ QTest::newRow(QString("%1 128").arg(address.toString()).toAscii()) << address << 128 << 128;
+ QTest::newRow(QString("%1 255").arg(address.toString()).toAscii()) << address << 255 << 255;
+ QTest::newRow(QString("%1 1024").arg(address.toString()).toAscii()) << address << 1024 << 1;
+ }
+}
+
+void tst_QUdpSocket::multicastTtlOption()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ QFETCH(QHostAddress, bindAddress);
+ QFETCH(int, ttl);
+ QFETCH(int, expected);
+ if (setProxy) {
+ // UDP multicast does not work with proxies
+ expected = 0;
+ }
+
+ QUdpSocket udpSocket;
+ // bind, but ignore the result, we are only interested in initializing the socket
+ (void) udpSocket.bind(bindAddress, 0);
+ udpSocket.setSocketOption(QUdpSocket::MulticastTtlOption, ttl);
+ QCOMPARE(udpSocket.socketOption(QUdpSocket::MulticastTtlOption).toInt(), expected);
+}
+
+void tst_QUdpSocket::multicastLoopbackOption_data()
+{
+ QTest::addColumn<QHostAddress>("bindAddress");
+ QTest::addColumn<int>("loopback");
+ QTest::addColumn<int>("expected");
+
+ QList<QHostAddress> addresses;
+ addresses += QHostAddress(QHostAddress::Any);
+ addresses += QHostAddress(QHostAddress::AnyIPv6);
+
+ foreach (const QHostAddress &address, addresses) {
+ QTest::newRow(QString("%1 0").arg(address.toString()).toAscii()) << address << 0 << 0;
+ QTest::newRow(QString("%1 1").arg(address.toString()).toAscii()) << address << 1 << 1;
+ QTest::newRow(QString("%1 2").arg(address.toString()).toAscii()) << address << 2 << 1;
+ QTest::newRow(QString("%1 0 again").arg(address.toString()).toAscii()) << address << 0 << 0;
+ QTest::newRow(QString("%1 2 again").arg(address.toString()).toAscii()) << address << 2 << 1;
+ QTest::newRow(QString("%1 0 last time").arg(address.toString()).toAscii()) << address << 0 << 0;
+ QTest::newRow(QString("%1 1 again").arg(address.toString()).toAscii()) << address << 1 << 1;
+ }
+}
+
+void tst_QUdpSocket::multicastLoopbackOption()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ QFETCH(QHostAddress, bindAddress);
+ QFETCH(int, loopback);
+ QFETCH(int, expected);
+ if (setProxy) {
+ // UDP multicast does not work with proxies
+ expected = 0;
+ }
+
+ QUdpSocket udpSocket;
+ // bind, but ignore the result, we are only interested in initializing the socket
+ (void) udpSocket.bind(bindAddress, 0);
+ udpSocket.setSocketOption(QUdpSocket::MulticastLoopbackOption, loopback);
+ QCOMPARE(udpSocket.socketOption(QUdpSocket::MulticastLoopbackOption).toInt(), expected);
+}
+
+void tst_QUdpSocket::multicastJoinBeforeBind_data()
+{
+ QTest::addColumn<QHostAddress>("groupAddress");
+ QTest::newRow("valid ipv4 group address") << QHostAddress("239.255.118.62");
+ QTest::newRow("invalid ipv4 group address") << QHostAddress(QHostAddress::Broadcast);
+ QTest::newRow("valid ipv6 group address") << QHostAddress("FF01::114");
+ QTest::newRow("invalid ipv6 group address") << QHostAddress(QHostAddress::AnyIPv6);
+}
+
+void tst_QUdpSocket::multicastJoinBeforeBind()
+{
+ QFETCH(QHostAddress, groupAddress);
+
+ QUdpSocket udpSocket;
+ // cannot join group before binding
+ QTest::ignoreMessage(QtWarningMsg, "QUdpSocket::joinMulticastGroup() called on a QUdpSocket when not in QUdpSocket::BoundState");
+ QVERIFY(!udpSocket.joinMulticastGroup(groupAddress));
+}
+
+void tst_QUdpSocket::multicastLeaveAfterClose_data()
+{
+ QTest::addColumn<QHostAddress>("groupAddress");
+ QTest::newRow("valid ipv4 group address") << QHostAddress("239.255.118.62");
+ QTest::newRow("valid ipv6 group address") << QHostAddress("FF01::114");
+}
+
+void tst_QUdpSocket::multicastLeaveAfterClose()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ QFETCH(QHostAddress, groupAddress);
+ if (setProxy) {
+ QSKIP("UDP Multicast does not work with proxies", SkipAll);
+ }
+
+ QUdpSocket udpSocket;
+ QVERIFY2(udpSocket.bind(groupAddress, 0),
+ qPrintable(udpSocket.errorString()));
+ QVERIFY2(udpSocket.joinMulticastGroup(groupAddress),
+ qPrintable(udpSocket.errorString()));
+ udpSocket.close();
+ QTest::ignoreMessage(QtWarningMsg, "QUdpSocket::leaveMulticastGroup() called on a QUdpSocket when not in QUdpSocket::BoundState");
+ QVERIFY(!udpSocket.leaveMulticastGroup(groupAddress));
+}
+
+void tst_QUdpSocket::setMulticastInterface_data()
+{
+ QTest::addColumn<QNetworkInterface>("iface");
+ QTest::addColumn<QHostAddress>("address");
+ QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
+ foreach (const QNetworkInterface &iface, interfaces) {
+ foreach (const QNetworkAddressEntry &entry, iface.addressEntries()) {
+ QTest::newRow(QString("%1:%2").arg(iface.name()).arg(entry.ip().toString()).toAscii())
+ << iface
+ << entry.ip();
+ }
+ }
+}
+
+void tst_QUdpSocket::setMulticastInterface()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ QFETCH(QNetworkInterface, iface);
+ QFETCH(QHostAddress, address);
+
+ QUdpSocket udpSocket;
+ // bind initializes the socket
+ bool bound = udpSocket.bind((address.protocol() == QAbstractSocket::IPv6Protocol
+ ? QHostAddress(QHostAddress::AnyIPv6)
+ : QHostAddress(QHostAddress::Any)),
+ 0);
+ if (!bound)
+ QTest::ignoreMessage(QtWarningMsg, "QUdpSocket::setMulticastInterface() called on a QUdpSocket when not in QUdpSocket::BoundState");
+ udpSocket.setMulticastInterface(iface);
+ if (!bound)
+ QTest::ignoreMessage(QtWarningMsg, "QUdpSocket::multicastInterface() called on a QUdpSocket when not in QUdpSocket::BoundState");
+ QNetworkInterface iface2 = udpSocket.multicastInterface();
+ if (!setProxy) {
+ QVERIFY(iface2.isValid());
+ QCOMPARE(iface.name(), iface2.name());
+ } else {
+ QVERIFY(!iface2.isValid());
+ }
+}
+
+void tst_QUdpSocket::multicast_data()
+{
+ QHostAddress anyAddress = QHostAddress(QHostAddress::Any);
+ QHostAddress groupAddress = QHostAddress("239.255.118.62");
+ QHostAddress any6Address = QHostAddress(QHostAddress::AnyIPv6);
+ QHostAddress group6Address = QHostAddress("FF01::114");
+
+ QTest::addColumn<QHostAddress>("bindAddress");
+ QTest::addColumn<bool>("bindResult");
+ QTest::addColumn<QHostAddress>("groupAddress");
+ QTest::addColumn<bool>("joinResult");
+ QTest::newRow("valid bind, group ipv4 address") << anyAddress << true << groupAddress << true;
+ QTest::newRow("valid bind, invalid group ipv4 address") << anyAddress << true << anyAddress << false;
+ QTest::newRow("same bind, group ipv4 address") << groupAddress << true << groupAddress << true;
+ QTest::newRow("valid bind, group ipv6 address") << any6Address << true << group6Address << true;
+ QTest::newRow("valid bind, invalid group ipv6 address") << any6Address << true << any6Address << false;
+ QTest::newRow("same bind, group ipv6 address") << group6Address << true << group6Address << true;
+}
+
+void tst_QUdpSocket::multicast()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ QFETCH(QHostAddress, bindAddress);
+ QFETCH(bool, bindResult);
+ QFETCH(QHostAddress, groupAddress);
+ QFETCH(bool, joinResult);
+ if (setProxy) {
+ // UDP multicast does not work with proxies
+ if ((bindAddress.protocol() == QAbstractSocket::IPv4Protocol && (bindAddress.toIPv4Address() & 0xffff0000) == 0xefff0000)
+ || bindAddress.protocol() == QAbstractSocket::IPv6Protocol) {
+ // proxy cannot bind to IPv6 or multicast addresses
+ bindResult = false;
+ }
+ joinResult = false;
+ }
+
+ QUdpSocket receiver;
+
+ // bind first, then verify that we can join the multicast group
+ QVERIFY2(receiver.bind(bindAddress, 0) == bindResult,
+ qPrintable(receiver.errorString()));
+ if (!bindResult)
+ return;
+
+ QVERIFY2(receiver.joinMulticastGroup(groupAddress) == joinResult,
+ qPrintable(receiver.errorString()));
+ if (!joinResult)
+ return;
+
+ QList<QByteArray> datagrams = QList<QByteArray>()
+ << QByteArray("0123")
+ << QByteArray("4567")
+ << QByteArray("89ab")
+ << QByteArray("cdef");
+
+ QUdpSocket sender;
+ foreach (const QByteArray &datagram, datagrams) {
+ QCOMPARE(int(sender.writeDatagram(datagram, groupAddress, receiver.localPort())),
+ int(datagram.size()));
+ }
+
+ QVERIFY2(receiver.waitForReadyRead(),
+ qPrintable(receiver.errorString()));
+ QVERIFY(receiver.hasPendingDatagrams());
+ QList<QByteArray> receivedDatagrams;
+ while (receiver.hasPendingDatagrams()) {
+ QByteArray datagram;
+ datagram.resize(receiver.pendingDatagramSize());
+ receiver.readDatagram(datagram.data(), datagram.size(), 0, 0);
+ receivedDatagrams << datagram;
+ }
+ QCOMPARE(receivedDatagrams, datagrams);
+
+ QVERIFY2(receiver.leaveMulticastGroup(groupAddress), qPrintable(receiver.errorString()));
+}
+
QTEST_MAIN(tst_QUdpSocket)
#include "tst_qudpsocket.moc"
diff --git a/tests/auto/qurl/qurl.pro b/tests/auto/qurl/qurl.pro
index 018bb38612..a5c39a5a98 100644
--- a/tests/auto/qurl/qurl.pro
+++ b/tests/auto/qurl/qurl.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
SOURCES += tst_qurl.cpp
QT = core
symbian: TARGET.CAPABILITY = NetworkServices
+CONFIG += parallel_test
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index b89413406e..336ee36584 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -132,6 +132,7 @@ private slots:
void compat_encode();
void percentEncoding_data();
void percentEncoding();
+ void swap();
void symmetry();
void ipv6_data();
void ipv6();
@@ -161,6 +162,8 @@ private slots:
void idna_testsuite();
void nameprep_testsuite_data();
void nameprep_testsuite();
+ void nameprep_highcodes_data();
+ void nameprep_highcodes();
void ace_testsuite_data();
void ace_testsuite();
void std3violations_data();
@@ -315,6 +318,7 @@ void tst_QUrl::constructing()
QUrl buildUNC;
+ buildUNC.setScheme(QString::fromLatin1("file"));
buildUNC.setHost(QString::fromLatin1("somehost"));
buildUNC.setPath(QString::fromLatin1("somepath"));
QCOMPARE(buildUNC.toLocalFile(), QString::fromLatin1("//somehost/somepath"));
@@ -1766,7 +1770,15 @@ void tst_QUrl::toLocalFile_data()
QTest::newRow("data7") << QString::fromLatin1("file://somehost/") << QString::fromLatin1("//somehost/");
QTest::newRow("data8") << QString::fromLatin1("file://somehost") << QString::fromLatin1("//somehost");
QTest::newRow("data9") << QString::fromLatin1("file:////somehost/somedir/somefile") << QString::fromLatin1("//somehost/somedir/somefile");
+ QTest::newRow("data10") << QString::fromLatin1("FILE:/a.txt") << QString::fromLatin1("/a.txt");
+ // and some that result in empty (i.e., not local)
+ QTest::newRow("xdata0") << QString::fromLatin1("/a.txt") << QString();
+ QTest::newRow("xdata1") << QString::fromLatin1("//a.txt") << QString();
+ QTest::newRow("xdata2") << QString::fromLatin1("///a.txt") << QString();
+ QTest::newRow("xdata3") << QString::fromLatin1("foo:/a.txt") << QString();
+ QTest::newRow("xdata4") << QString::fromLatin1("foo://a.txt") << QString();
+ QTest::newRow("xdata5") << QString::fromLatin1("foo:///a.txt") << QString();
}
void tst_QUrl::toLocalFile()
@@ -2207,6 +2219,14 @@ void tst_QUrl::toPercentEncoding()
QCOMPARE(original, QUrl::fromPercentEncoding(encodedUrl));
}
+void tst_QUrl::swap()
+{
+ QUrl u1(QLatin1String("http://qt.nokia.com")), u2(QLatin1String("http://www.kdab.com"));
+ u1.swap(u2);
+ QCOMPARE(u2.host(),QLatin1String("qt.nokia.com"));
+ QCOMPARE(u1.host(),QLatin1String("www.kdab.com"));
+}
+
void tst_QUrl::symmetry()
{
QUrl url(QString::fromLatin1("http://www.räksmörgås.se/pub?a=b&a=dø&a=f#vræl"));
@@ -2926,7 +2946,6 @@ void tst_QUrl::nameprep_testsuite_data()
<< QString() << 0 << 0;
QTest::newRow("Case folding 8bit U+00DF (german sharp s)")
-// << QString::fromUtf8("\xC3\xDF") ### typo in the original testsuite
<< QString::fromUtf8("\xC3\x9F")
<< QString("ss")
<< QString() << 0 << 0;
@@ -2957,7 +2976,8 @@ void tst_QUrl::nameprep_testsuite_data()
<< QString() << 0 << 0;
QTest::newRow("Self-reverting case folding U+01F0 and normalization")
- << QString::fromUtf8("\xC7\xF0")
+// << QString::fromUtf8("\xC7\xF0") ### typo in the original testsuite
+ << QString::fromUtf8("\xC7\xB0")
<< QString::fromUtf8("\xC7\xB0")
<< QString() << 0 << 0;
@@ -3132,13 +3152,13 @@ void tst_QUrl::nameprep_testsuite_data()
<< QString("Nameprep") << STRINGPREP_NO_UNASSIGNED << STRINGPREP_CONTAINS_UNASSIGNED;
QTest::newRow("Larger test (shrinking)")
- << QString::fromUtf8("X\xC2\xAD\xC3\xDF\xC4\xB0\xE2\x84\xA1\x6a\xcc\x8c\xc2\xa0\xc2"
+ << QString::fromUtf8("X\xC2\xAD\xC3\x9F\xC4\xB0\xE2\x84\xA1\x6a\xcc\x8c\xc2\xa0\xc2"
"\xaa\xce\xb0\xe2\x80\x80")
<< QString::fromUtf8("xssi\xcc\x87""tel\xc7\xb0 a\xce\xb0 ")
<< QString("Nameprep") << 0 << 0;
QTest::newRow("Larger test (expanding)")
- << QString::fromUtf8("X\xC3\xDF\xe3\x8c\x96\xC4\xB0\xE2\x84\xA1\xE2\x92\x9F\xE3\x8c\x80")
+ << QString::fromUtf8("X\xC3\x9F\xe3\x8c\x96\xC4\xB0\xE2\x84\xA1\xE2\x92\x9F\xE3\x8c\x80")
<< QString::fromUtf8("xss\xe3\x82\xad\xe3\x83\xad\xe3\x83\xa1\xe3\x83\xbc\xe3\x83\x88"
"\xe3\x83\xab""i\xcc\x87""tel\x28""d\x29\xe3\x82\xa2\xe3\x83\x91"
"\xe3\x83\xbc\xe3\x83\x88")
@@ -3159,20 +3179,58 @@ void tst_QUrl::nameprep_testsuite()
QFETCH(QString, out);
QFETCH(QString, profile);
- QEXPECT_FAIL("Case folding U+2121 U+33C6 U+1D7BB",
- ">0xffff unicode points are not supported", Continue);
- QEXPECT_FAIL("Self-reverting case folding U+01F0 and normalization",
- "Investigate further", Continue);
QEXPECT_FAIL("Left-to-right mark U+200E",
"Investigate further", Continue);
QEXPECT_FAIL("Deprecated U+202A",
"Investigate further", Continue);
QEXPECT_FAIL("Language tagging character U+E0001",
"Investigate further", Continue);
- QEXPECT_FAIL("Larger test (shrinking)",
- "Investigate further", Continue);
- QEXPECT_FAIL("Larger test (expanding)",
- "Investigate further", Continue);
+ qt_nameprep(&in, 0);
+ QCOMPARE(in, out);
+#endif
+}
+
+void tst_QUrl::nameprep_highcodes_data()
+{
+ QTest::addColumn<QString>("in");
+ QTest::addColumn<QString>("out");
+ QTest::addColumn<QString>("profile");
+ QTest::addColumn<int>("flags");
+ QTest::addColumn<int>("rc");
+
+ {
+ QChar st[] = { '-', 0xd801, 0xdc1d, 'a' };
+ QChar se[] = { '-', 0xd801, 0xdc45, 'a' };
+ QTest::newRow("highcodes (U+1041D)")
+ << QString(st, sizeof(st)/sizeof(st[0]))
+ << QString(se, sizeof(se)/sizeof(se[0]))
+ << QString() << 0 << 0;
+ }
+ {
+ QChar st[] = { 0x011C, 0xd835, 0xdf6e, 0x0110 };
+ QChar se[] = { 0x011D, 0x03C9, 0x0111 };
+ QTest::newRow("highcodes (U+1D76E)")
+ << QString(st, sizeof(st)/sizeof(st[0]))
+ << QString(se, sizeof(se)/sizeof(se[0]))
+ << QString() << 0 << 0;
+ }
+ {
+ QChar st[] = { 'D', 0xdb40, 0xdc20, 'o', 0xd834, 0xdd7a, '\'', 0x2060, 'h' };
+ QChar se[] = { 'd', 'o', '\'', 'h' };
+ QTest::newRow("highcodes (D, U+E0020, o, U+1D17A, ', U+2060, h)")
+ << QString(st, sizeof(st)/sizeof(st[0]))
+ << QString(se, sizeof(se)/sizeof(se[0]))
+ << QString() << 0 << 0;
+ }
+}
+
+void tst_QUrl::nameprep_highcodes()
+{
+#ifdef QT_BUILD_INTERNAL
+ QFETCH(QString, in);
+ QFETCH(QString, out);
+ QFETCH(QString, profile);
+
qt_nameprep(&in, 0);
QCOMPARE(in, out);
#endif
diff --git a/tests/auto/quuid/quuid.pro b/tests/auto/quuid/quuid.pro
index 25e24561ae..461956f313 100644
--- a/tests/auto/quuid/quuid.pro
+++ b/tests/auto/quuid/quuid.pro
@@ -4,3 +4,4 @@ SUBDIRS = testProcessUniqueness
SUBDIRS += test
+CONFIG += parallel_test
diff --git a/tests/auto/quuid/test/test.pro b/tests/auto/quuid/test/test.pro
index 123aa50e4e..06ae3bd362 100644
--- a/tests/auto/quuid/test/test.pro
+++ b/tests/auto/quuid/test/test.pro
@@ -15,14 +15,14 @@ CONFIG(debug_and_release_target) {
}
wince* {
- addFile_processUniqueness.sources = $$OUT_PWD/../testProcessUniqueness/testProcessUniqueness.exe
+ addFile_processUniqueness.files = $$OUT_PWD/../testProcessUniqueness/testProcessUniqueness.exe
addFile_processUniqueness.path = testProcessUniqueness
DEPLOYMENT += addFile_processUniqueness
}
symbian {
- binDep.sources = testProcessUniqueness.exe
+ binDep.files = testProcessUniqueness.exe
binDep.path = \\sys\\bin
DEPLOYMENT += binDep
diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp
index 24bfffc8e6..62babdbe88 100644
--- a/tests/auto/qvariant/tst_qvariant.cpp
+++ b/tests/auto/qvariant/tst_qvariant.cpp
@@ -100,6 +100,7 @@ private slots:
void constructor();
void copy_constructor();
void isNull();
+ void swap();
void canConvert_data();
void canConvert();
@@ -372,6 +373,16 @@ void tst_QVariant::isNull()
QVERIFY(var7.isNull());
}
+void tst_QVariant::swap()
+{
+ QVariant v1 = 1, v2 = 2.0;
+ v1.swap(v2);
+ QCOMPARE(v1.type(),QVariant::Double);
+ QCOMPARE(v1.toDouble(),2.0);
+ QCOMPARE(v2.type(),QVariant::Int);
+ QCOMPARE(v2.toInt(),1);
+}
+
void tst_QVariant::canConvert_data()
{
QTest::addColumn<QVariant>("val");
diff --git a/tests/auto/qvarlengtharray/qvarlengtharray.pro b/tests/auto/qvarlengtharray/qvarlengtharray.pro
index 7a02790578..183da1b938 100644
--- a/tests/auto/qvarlengtharray/qvarlengtharray.pro
+++ b/tests/auto/qvarlengtharray/qvarlengtharray.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
QT = core
SOURCES += tst_qvarlengtharray.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qvector/qvector.pro b/tests/auto/qvector/qvector.pro
index 80311b46c6..a7c3957f2c 100644
--- a/tests/auto/qvector/qvector.pro
+++ b/tests/auto/qvector/qvector.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qvector.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qvector/tst_qvector.cpp b/tests/auto/qvector/tst_qvector.cpp
index 889c640efa..dde59d73b7 100644
--- a/tests/auto/qvector/tst_qvector.cpp
+++ b/tests/auto/qvector/tst_qvector.cpp
@@ -80,6 +80,7 @@ private slots:
void remove() const;
void size() const;
void startsWith() const;
+ void swap() const;
void toList() const;
void toStdVector() const;
void value() const;
@@ -88,6 +89,7 @@ private slots:
void outOfMemory();
void QTBUG6416_reserve();
+ void initializeList();
};
void tst_QVector::constructors() const
@@ -578,6 +580,17 @@ void tst_QVector::startsWith() const
QVERIFY(myvec.startsWith(1));
}
+void tst_QVector::swap() const
+{
+ QVector<int> v1, v2;
+ v1 << 1 << 2 << 3;
+ v2 << 4 << 5 << 6;
+
+ v1.swap(v2);
+ QCOMPARE(v1,QVector<int>() << 4 << 5 << 6);
+ QCOMPARE(v2,QVector<int>() << 1 << 2 << 3);
+}
+
void tst_QVector::toList() const
{
QVector<QString> myvec;
@@ -834,5 +847,19 @@ void tst_QVector::QTBUG6416_reserve()
QCOMPARE(fooCtor, fooDtor);
}
+void tst_QVector::initializeList()
+{
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+ QVector<int> v1{2,3,4};
+ QCOMPARE(v1, QVector<int>() << 2 << 3 << 4);
+ QCOMPARE(v1, (QVector<int>{2,3,4}));
+
+ QVector<QVector<int>> v2{ v1, {1}, QVector<int>(), {2,3,4} };
+ QVector<QVector<int>> v3;
+ v3 << v1 << (QVector<int>() << 1) << QVector<int>() << v1;
+ QCOMPARE(v3, v2);
+#endif
+}
+
QTEST_APPLESS_MAIN(tst_QVector)
#include "tst_qvector.moc"
diff --git a/tests/auto/qwaitcondition/qwaitcondition.pro b/tests/auto/qwaitcondition/qwaitcondition.pro
index 4d9a08204d..9af0c71301 100644
--- a/tests/auto/qwaitcondition/qwaitcondition.pro
+++ b/tests/auto/qwaitcondition/qwaitcondition.pro
@@ -3,3 +3,4 @@ SOURCES += tst_qwaitcondition.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index bb8b8b4ae3..35ffd408e4 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -364,7 +364,7 @@ private slots:
void setClearAndResizeMask();
void maskedUpdate();
-#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS)
+#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
void syntheticEnterLeave();
void taskQTBUG_4055_sendSyntheticEnterLeave();
#endif
@@ -466,23 +466,15 @@ void tst_QWidget::getSetCheck()
QCOMPARE(obj1.minimumWidth(), 0); // A widgets width can never be less than 0
obj1.setMinimumWidth(INT_MAX);
#ifndef Q_WS_QWS //QWS doesn't allow toplevels to be bigger than the screen
-#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
- QCOMPARE((long)obj1.minimumWidth(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium
-#else
QCOMPARE(obj1.minimumWidth(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium
#endif
-#endif
child1.setMinimumWidth(0);
QCOMPARE(child1.minimumWidth(), 0);
child1.setMinimumWidth(INT_MIN);
QCOMPARE(child1.minimumWidth(), 0); // A widgets width can never be less than 0
child1.setMinimumWidth(INT_MAX);
-#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
- QCOMPARE((long)child1.minimumWidth(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium
-#else
QCOMPARE(child1.minimumWidth(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium
-#endif
// int QWidget::minimumHeight()
// void QWidget::setMinimumHeight(int)
@@ -492,38 +484,24 @@ void tst_QWidget::getSetCheck()
QCOMPARE(obj1.minimumHeight(), 0); // A widgets height can never be less than 0
obj1.setMinimumHeight(INT_MAX);
#ifndef Q_WS_QWS //QWS doesn't allow toplevels to be bigger than the screen
-#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
- QCOMPARE((long)obj1.minimumHeight(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium
-#else
QCOMPARE(obj1.minimumHeight(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium
#endif
-#endif
child1.setMinimumHeight(0);
QCOMPARE(child1.minimumHeight(), 0);
child1.setMinimumHeight(INT_MIN);
QCOMPARE(child1.minimumHeight(), 0); // A widgets height can never be less than 0
child1.setMinimumHeight(INT_MAX);
-#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
- QCOMPARE((long)child1.minimumHeight(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium
-#else
QCOMPARE(child1.minimumHeight(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium
-#endif
-
-
-// int QWidget::maximumWidth()
+ // int QWidget::maximumWidth()
// void QWidget::setMaximumWidth(int)
obj1.setMaximumWidth(0);
QCOMPARE(obj1.maximumWidth(), 0);
obj1.setMaximumWidth(INT_MIN);
QCOMPARE(obj1.maximumWidth(), 0); // A widgets width can never be less than 0
obj1.setMaximumWidth(INT_MAX);
-#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
- QCOMPARE((long)obj1.maximumWidth(), QWIDGETSIZE_MAX); // QWIDGETSIZE_MAX is the abs max, not INT_MAX
-#else
QCOMPARE(obj1.maximumWidth(), QWIDGETSIZE_MAX); // QWIDGETSIZE_MAX is the abs max, not INT_MAX
-#endif
// int QWidget::maximumHeight()
// void QWidget::setMaximumHeight(int)
@@ -532,11 +510,7 @@ void tst_QWidget::getSetCheck()
obj1.setMaximumHeight(INT_MIN);
QCOMPARE(obj1.maximumHeight(), 0); // A widgets height can never be less than 0
obj1.setMaximumHeight(INT_MAX);
-#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
- QCOMPARE((long)obj1.maximumHeight(), QWIDGETSIZE_MAX); // QWIDGETSIZE_MAX is the abs max, not INT_MAX
-#else
QCOMPARE(obj1.maximumHeight(), QWIDGETSIZE_MAX); // QWIDGETSIZE_MAX is the abs max, not INT_MAX
-#endif
// back to normal
obj1.setMinimumWidth(0);
@@ -1992,7 +1966,7 @@ void tst_QWidget::showMaximized()
layouted.showNormal();
QVERIFY(!(layouted.windowState() & Qt::WindowMaximized));
-#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE) && !defined(Q_WS_S60)
+#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE) && !defined(Q_WS_S60) && !defined(Q_WS_QPA)
//embedded may choose a different size to fit on the screen.
QCOMPARE(layouted.size(), layouted.sizeHint());
#endif
@@ -2091,7 +2065,7 @@ void tst_QWidget::showFullScreen()
layouted.showNormal();
QVERIFY(!(layouted.windowState() & Qt::WindowFullScreen));
-#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE) && !defined (Q_WS_S60)
+#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE) && !defined (Q_WS_S60) && !defined(Q_WS_QPA)
//embedded may choose a different size to fit on the screen.
QCOMPARE(layouted.size(), layouted.sizeHint());
#endif
@@ -2180,7 +2154,10 @@ void tst_QWidget::resizeEvent()
wParent.show();
QCOMPARE (wChild.m_resizeEventCount, 1); // initial resize event before paint
wParent.hide();
- wChild.resize(QSize(640,480));
+ QSize safeSize(640,480);
+ if (wChild.size() == safeSize)
+ safeSize.setWidth(639);
+ wChild.resize(safeSize);
QCOMPARE (wChild.m_resizeEventCount, 1);
wParent.show();
QCOMPARE (wChild.m_resizeEventCount, 2);
@@ -2191,7 +2168,10 @@ void tst_QWidget::resizeEvent()
wTopLevel.show();
QCOMPARE (wTopLevel.m_resizeEventCount, 1); // initial resize event before paint for toplevels
wTopLevel.hide();
- wTopLevel.resize(QSize(640,480));
+ QSize safeSize(640,480);
+ if (wTopLevel.size() == safeSize)
+ safeSize.setWidth(639);
+ wTopLevel.resize(safeSize);
QCOMPARE (wTopLevel.m_resizeEventCount, 1);
wTopLevel.show();
QCOMPARE (wTopLevel.m_resizeEventCount, 2);
@@ -3388,6 +3368,10 @@ void tst_QWidget::widgetAt()
#if defined(Q_OS_SYMBIAN)
QEXPECT_FAIL("", "Symbian/S60 does only support rectangular regions", Continue); //See also task 147191
#endif
+#if defined(Q_WS_QPA)
+ QEXPECT_FAIL("", "Window mask not implemented on Lighthouse", Continue);
+#endif
+
QTRY_COMPARE(QApplication::widgetAt(100,100)->objectName(), w1->objectName());
QTRY_COMPARE(QApplication::widgetAt(101,101)->objectName(), w2->objectName());
@@ -3406,6 +3390,9 @@ void tst_QWidget::widgetAt()
#if defined(Q_OS_SYMBIAN)
QEXPECT_FAIL("", "Symbian/S60 does only support rectangular regions", Continue); //See also task 147191
#endif
+#if defined(Q_WS_QPA)
+ QEXPECT_FAIL("", "Window mask not implemented on Lighthouse", Continue);
+#endif
QTRY_VERIFY(QApplication::widgetAt(100,100) == w1);
QTRY_VERIFY(QApplication::widgetAt(101,101) == w2);
@@ -5483,9 +5470,12 @@ public:
QCOMPARE(pixmap.size(), rect.size()); \
QPixmap expectedPixmap(pixmap); /* ensure equal formats */ \
expectedPixmap.fill(color); \
- if (pixmap.toImage().pixel(0,0) != QColor(color).rgb() && t < 4 ) \
+ QImage image = pixmap.toImage(); \
+ uint alphaCorrection = image.format() == QImage::Format_RGB32 ? 0xff000000 : 0; \
+ uint firstPixel = image.pixel(0,0) | alphaCorrection; \
+ if ( firstPixel != QColor(color).rgb() && t < 4 ) \
{ QTest::qWait(200); continue; } \
- QCOMPARE(pixmap.toImage().pixel(0,0), QColor(color).rgb()); \
+ QCOMPARE(firstPixel, QColor(color).rgb()); \
QCOMPARE(pixmap, expectedPixmap); \
break; \
} \
@@ -6377,7 +6367,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
EventRecorder::EventList()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) || defined(Q_WS_QPA)
<< qMakePair(&widget, QEvent::UpdateRequest)
#endif
;
@@ -6473,7 +6463,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
<< qMakePair(&widget, QEvent::Type(QEvent::User + 2))
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) || defined(Q_WS_QPA)
<< qMakePair(&widget, QEvent::UpdateRequest)
#endif
;
@@ -6569,7 +6559,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
<< qMakePair(&widget, QEvent::Type(QEvent::User + 2))
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) || defined(Q_WS_QPA)
<< qMakePair(&widget, QEvent::UpdateRequest)
#endif
;
@@ -9182,7 +9172,7 @@ void tst_QWidget::maskedUpdate()
QTRY_COMPARE(grandChild.paintedRegion, QRegion(grandChild.rect())); // Full update.
}
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
void tst_QWidget::syntheticEnterLeave()
{
class MyWidget : public QWidget
diff --git a/tests/auto/qwineventnotifier/qwineventnotifier.pro b/tests/auto/qwineventnotifier/qwineventnotifier.pro
index 0c8bd2bd94..62da3a33ea 100644
--- a/tests/auto/qwineventnotifier/qwineventnotifier.pro
+++ b/tests/auto/qwineventnotifier/qwineventnotifier.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qwineventnotifier.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qwritelocker/qwritelocker.pro b/tests/auto/qwritelocker/qwritelocker.pro
index acae4efb28..39a98aaba5 100644
--- a/tests/auto/qwritelocker/qwritelocker.pro
+++ b/tests/auto/qwritelocker/qwritelocker.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qwritelocker.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qxml/qxml.pro b/tests/auto/qxml/qxml.pro
index 5fb7fe2904..c87518a7ff 100644
--- a/tests/auto/qxml/qxml.pro
+++ b/tests/auto/qxml/qxml.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qxml.cpp
QT = core xml
wince*|symbian: {
- addFiles.sources = 0x010D.xml
+ addFiles.files = 0x010D.xml
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qxmlformatter/qxmlformatter.pro b/tests/auto/qxmlformatter/qxmlformatter.pro
index 339fa55439..bcab0b4c02 100644
--- a/tests/auto/qxmlformatter/qxmlformatter.pro
+++ b/tests/auto/qxmlformatter/qxmlformatter.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qxmlformatter.cpp
include (../xmlpatterns.pri)
wince*|symbian:{
- addFiles.sources = baselines input
+ addFiles.files = baselines input
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro
index 044b7cec19..d5e822846e 100644
--- a/tests/auto/qxmlquery/qxmlquery.pro
+++ b/tests/auto/qxmlquery/qxmlquery.pro
@@ -19,10 +19,10 @@ wince* {
include (../xmlpatterns.pri)
wince*|symbian: {
- addFiles.sources = pushBaselines input.xml
+ addFiles.files = pushBaselines input.xml
addFiles.path = .
- patternistFiles.sources = ../xmlpatterns/queries
+ patternistFiles.files = ../xmlpatterns/queries
symbian: {
#../xmlpatterns resolves to an illegal path for deployment
patternistFiles.path = xmlpatterns
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index 20db14a764..e3c97d27fb 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -455,6 +455,7 @@ void tst_QXmlQuery::assignmentOperator() const
class ReturnURI : public QAbstractUriResolver
{
public:
+ ReturnURI() {}
virtual QUrl resolve(const QUrl &relative,
const QUrl &baseURI) const
{
@@ -2871,6 +2872,7 @@ void tst_QXmlQuery::useUriResolver() const
, private TestFundament
{
public:
+ TestUriResolver() {}
virtual QUrl resolve(const QUrl &relative,
const QUrl &baseURI) const
{
diff --git a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
index c107470b4b..bc3cbd2dfd 100644
--- a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
+++ b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
@@ -13,7 +13,7 @@ QT -= gui
wince*|symbian: {
- addFiles.sources = encodings parser xmldocs
+ addFiles.files = encodings parser xmldocs
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/tests/auto/qxmlstream/qxmlstream.pro b/tests/auto/qxmlstream/qxmlstream.pro
index 8f076be395..894801d8dc 100644
--- a/tests/auto/qxmlstream/qxmlstream.pro
+++ b/tests/auto/qxmlstream/qxmlstream.pro
@@ -5,10 +5,10 @@ QT = core xml network
wince*|symbian: {
- addFiles.sources = data XML-Test-Suite
+ addFiles.files = data XML-Test-Suite
addFiles.path = .
DEPLOYMENT += addFiles
- DEFINES += SRCDIR=\\\"\\\"
+ wince*:DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qxmlstream/tst_qxmlstream.cpp b/tests/auto/qxmlstream/tst_qxmlstream.cpp
index 798256f347..fd2f90e47f 100644
--- a/tests/auto/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/qxmlstream/tst_qxmlstream.cpp
@@ -55,6 +55,10 @@
//TESTED_CLASS=QXmlStreamReader QXmlStreamWriter
//TESTED_FILES=corelib/xml/stream/qxmlutils.cpp corelib/xml/stream/qxmlstream.cpp corelib/xml/stream/qxmlstream_p.h
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR ""
+#endif
+
Q_DECLARE_METATYPE(QXmlStreamReader::ReadElementTextBehaviour)
static const char *const catalogFile = SRCDIR "XML-Test-Suite/xmlconf/finalCatalog.xml";
@@ -570,6 +574,7 @@ private slots:
void checkCommentIndentation() const;
void checkCommentIndentation_data() const;
void qtbug9196_crash() const;
+ void hasError() const;
private:
static QByteArray readFile(const QString &filename);
@@ -1556,5 +1561,86 @@ void tst_QXmlStream::qtbug9196_crash() const
}
}
+class FakeBuffer : public QBuffer
+{
+protected:
+ qint64 writeData(const char *c, qint64 i)
+ {
+ qint64 ai = qMin(m_capacity, i);
+ m_capacity -= ai;
+ return ai ? QBuffer::writeData(c, ai) : 0;
+ }
+public:
+ void setCapacity(int capacity) { m_capacity = capacity; }
+private:
+ qint64 m_capacity;
+};
+
+void tst_QXmlStream::hasError() const
+{
+ {
+ FakeBuffer fb;
+ QVERIFY(fb.open(QBuffer::ReadWrite));
+ fb.setCapacity(1000);
+ QXmlStreamWriter writer(&fb);
+ writer.writeStartDocument();
+ writer.writeEndDocument();
+ QVERIFY(!writer.hasError());
+ QCOMPARE(fb.data(), QByteArray("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"));
+ }
+
+ {
+ // Failure caused by write(QString)
+ FakeBuffer fb;
+ QVERIFY(fb.open(QBuffer::ReadWrite));
+ fb.setCapacity(strlen("<?xml version=\""));
+ QXmlStreamWriter writer(&fb);
+ writer.writeStartDocument();
+ QVERIFY(writer.hasError());
+ QCOMPARE(fb.data(), QByteArray("<?xml version=\""));
+ }
+
+ {
+ // Failure caused by write(char *)
+ FakeBuffer fb;
+ QVERIFY(fb.open(QBuffer::ReadWrite));
+ fb.setCapacity(strlen("<?xml version=\"1.0"));
+ QXmlStreamWriter writer(&fb);
+ writer.writeStartDocument();
+ QVERIFY(writer.hasError());
+ QCOMPARE(fb.data(), QByteArray("<?xml version=\"1.0"));
+ }
+
+ {
+ // Failure caused by write(QStringRef)
+ FakeBuffer fb;
+ QVERIFY(fb.open(QBuffer::ReadWrite));
+ fb.setCapacity(strlen("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test xmlns:"));
+ QXmlStreamWriter writer(&fb);
+ writer.writeStartDocument();
+ writer.writeStartElement("test");
+ writer.writeNamespace("http://foo.bar", "foo");
+ QVERIFY(writer.hasError());
+ QCOMPARE(fb.data(), QByteArray("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test xmlns:"));
+ }
+
+ {
+ // Refusal to write after 1st failure
+ FakeBuffer fb;
+ QVERIFY(fb.open(QBuffer::ReadWrite));
+ fb.setCapacity(10);
+ QXmlStreamWriter writer(&fb);
+ writer.writeStartDocument();
+ QVERIFY(writer.hasError());
+ QCOMPARE(fb.data(), QByteArray("<?xml vers"));
+ fb.setCapacity(1000);
+ writer.writeStartElement("test"); // literal & qstring
+ writer.writeNamespace("http://foo.bar", "foo"); // literal & qstringref
+ QVERIFY(writer.hasError());
+ QCOMPARE(fb.data(), QByteArray("<?xml vers"));
+ }
+
+}
+
#include "tst_qxmlstream.moc"
// vim: et:ts=4:sw=4:sts=4
diff --git a/tests/auto/qzip/qzip.pro b/tests/auto/qzip/qzip.pro
index 632c743f1a..683da62e37 100644
--- a/tests/auto/qzip/qzip.pro
+++ b/tests/auto/qzip/qzip.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qzip.cpp
wince*|symbian: {
- addFiles.sources = testdata
+ addFiles.files = testdata
addFiles.path = .
DEPLOYMENT += addFiles
!symbian:DEFINES += SRCDIR=\\\".\\\"
diff --git a/tests/auto/script.pro b/tests/auto/script.pro
index 06f51b5b98..c4d05440c6 100644
--- a/tests/auto/script.pro
+++ b/tests/auto/script.pro
@@ -7,10 +7,12 @@ SUBDIRS=\
qscriptengine \
qscriptengineagent \
qscriptenginedebugger \
+ qscriptextensionplugin \
qscriptextqobject \
qscriptjstestsuite \
qscriptstring \
qscriptv8testsuite \
qscriptvalue \
+ qscriptvaluegenerated \
qscriptvalueiterator \
diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt
index fccaca36d3..0beb46b26c 100644
--- a/tests/auto/selftests/expected_cmptest.txt
+++ b/tests/auto/selftests/expected_cmptest.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Cmptest *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.8.0, Qt 4.8.0
PASS : tst_Cmptest::initTestCase()
PASS : tst_Cmptest::compare_boolfuncs()
PASS : tst_Cmptest::compare_pointerfuncs()
diff --git a/tests/auto/selftests/expected_crashes_3.txt b/tests/auto/selftests/expected_crashes_3.txt
index 2558f680d2..b7f462a1eb 100644
--- a/tests/auto/selftests/expected_crashes_3.txt
+++ b/tests/auto/selftests/expected_crashes_3.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Crashes *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.8.0, Qt 4.8.0
PASS : tst_Crashes::initTestCase()
QFATAL : tst_Crashes::crash() Received signal 11
FAIL! : tst_Crashes::crash() Received a fatal error.
diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt
index c56244b1ef..99809a8f9e 100644
--- a/tests/auto/selftests/expected_longstring.txt
+++ b/tests/auto/selftests/expected_longstring.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_LongString *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.8.0, Qt 4.8.0
PASS : tst_LongString::initTestCase()
FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
diff --git a/tests/auto/selftests/expected_maxwarnings.txt b/tests/auto/selftests/expected_maxwarnings.txt
index 7846435bb3..165bdda81f 100644
--- a/tests/auto/selftests/expected_maxwarnings.txt
+++ b/tests/auto/selftests/expected_maxwarnings.txt
@@ -1,5 +1,5 @@
********* Start testing of MaxWarnings *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.8.0, Qt 4.8.0
PASS : MaxWarnings::initTestCase()
QWARN : MaxWarnings::warn() 0
QWARN : MaxWarnings::warn() 1
diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt
index 5c9e497c39..4b53a43543 100644
--- a/tests/auto/selftests/expected_skip.txt
+++ b/tests/auto/selftests/expected_skip.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Skip *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.8.0, Qt 4.8.0
PASS : tst_Skip::initTestCase()
SKIP : tst_Skip::test() skipping all
Loc: [/home/user/depot/qt-git/mainline/tests/auto/selftests/skip/tst_skip.cpp(68)]
diff --git a/tests/auto/selftests/selftests.pro b/tests/auto/selftests/selftests.pro
index d854b5e5b5..2f1c327e34 100644
--- a/tests/auto/selftests/selftests.pro
+++ b/tests/auto/selftests/selftests.pro
@@ -12,3 +12,4 @@ INSTALLS =
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/uic/baseline/gridalignment.ui b/tests/auto/uic/baseline/gridalignment.ui
new file mode 100644
index 0000000000..11c28b1372
--- /dev/null
+++ b/tests/auto/uic/baseline/gridalignment.ui
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>279</width>
+ <height>163</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" alignment="Qt::AlignLeft">
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>Left</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" alignment="Qt::AlignTop">
+ <widget class="QPushButton" name="pushButton_3">
+ <property name="text">
+ <string>Top</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" alignment="Qt::AlignRight">
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="text">
+ <string>Right</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" alignment="Qt::AlignBottom">
+ <widget class="QPushButton" name="pushButton_4">
+ <property name="text">
+ <string>Bottom</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/auto/uic/baseline/gridalignment.ui.h b/tests/auto/uic/baseline/gridalignment.ui.h
new file mode 100644
index 0000000000..8386190eb0
--- /dev/null
+++ b/tests/auto/uic/baseline/gridalignment.ui.h
@@ -0,0 +1,83 @@
+/********************************************************************************
+** Form generated from reading UI file 'gridalignment.ui'
+**
+** Created: Fri Oct 22 14:33:59 2010
+** by: Qt User Interface Compiler version 4.8.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef GRIDALIGNMENT_H
+#define GRIDALIGNMENT_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QGridLayout>
+#include <QtGui/QHeaderView>
+#include <QtGui/QPushButton>
+#include <QtGui/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Form
+{
+public:
+ QGridLayout *gridLayout;
+ QPushButton *pushButton;
+ QPushButton *pushButton_3;
+ QPushButton *pushButton_2;
+ QPushButton *pushButton_4;
+
+ void setupUi(QWidget *Form)
+ {
+ if (Form->objectName().isEmpty())
+ Form->setObjectName(QString::fromUtf8("Form"));
+ Form->resize(279, 163);
+ gridLayout = new QGridLayout(Form);
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ pushButton = new QPushButton(Form);
+ pushButton->setObjectName(QString::fromUtf8("pushButton"));
+
+ gridLayout->addWidget(pushButton, 0, 0, 1, 1, Qt::AlignLeft);
+
+ pushButton_3 = new QPushButton(Form);
+ pushButton_3->setObjectName(QString::fromUtf8("pushButton_3"));
+
+ gridLayout->addWidget(pushButton_3, 0, 1, 1, 1, Qt::AlignTop);
+
+ pushButton_2 = new QPushButton(Form);
+ pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));
+
+ gridLayout->addWidget(pushButton_2, 1, 0, 1, 1, Qt::AlignRight);
+
+ pushButton_4 = new QPushButton(Form);
+ pushButton_4->setObjectName(QString::fromUtf8("pushButton_4"));
+
+ gridLayout->addWidget(pushButton_4, 1, 1, 1, 1, Qt::AlignBottom);
+
+
+ retranslateUi(Form);
+
+ QMetaObject::connectSlotsByName(Form);
+ } // setupUi
+
+ void retranslateUi(QWidget *Form)
+ {
+ Form->setWindowTitle(QApplication::translate("Form", "Form", 0, QApplication::UnicodeUTF8));
+ pushButton->setText(QApplication::translate("Form", "Left", 0, QApplication::UnicodeUTF8));
+ pushButton_3->setText(QApplication::translate("Form", "Top", 0, QApplication::UnicodeUTF8));
+ pushButton_2->setText(QApplication::translate("Form", "Right", 0, QApplication::UnicodeUTF8));
+ pushButton_4->setText(QApplication::translate("Form", "Bottom", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class Form: public Ui_Form {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // GRIDALIGNMENT_H
diff --git a/tests/auto/uic/baseline/icontheme.ui b/tests/auto/uic/baseline/icontheme.ui
new file mode 100644
index 0000000000..a21463561b
--- /dev/null
+++ b/tests/auto/uic/baseline/icontheme.ui
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>122</width>
+ <height>117</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QPushButton" name="fileicon">
+ <property name="text">
+ <string>fileicon</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>image1.png</normaloff>image1.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="fileandthemeicon">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ <property name="icon">
+ <iconset theme="edit-copy">
+ <normaloff>image7.png</normaloff>image7.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="themeicon">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ <property name="icon">
+ <iconset theme="edit-copy">
+ <normaloff/>
+ </iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/auto/uic/baseline/icontheme.ui.h b/tests/auto/uic/baseline/icontheme.ui.h
new file mode 100644
index 0000000000..946fff9f49
--- /dev/null
+++ b/tests/auto/uic/baseline/icontheme.ui.h
@@ -0,0 +1,95 @@
+/********************************************************************************
+** Form generated from reading UI file 'icontheme.ui'
+**
+** Created: Thu Sep 2 10:28:19 2010
+** by: Qt User Interface Compiler version 4.8.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef ICONTHEME_H
+#define ICONTHEME_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QHeaderView>
+#include <QtGui/QPushButton>
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Form
+{
+public:
+ QVBoxLayout *verticalLayout;
+ QPushButton *fileicon;
+ QPushButton *fileandthemeicon;
+ QPushButton *themeicon;
+
+ void setupUi(QWidget *Form)
+ {
+ if (Form->objectName().isEmpty())
+ Form->setObjectName(QString::fromUtf8("Form"));
+ Form->resize(122, 117);
+ verticalLayout = new QVBoxLayout(Form);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+ fileicon = new QPushButton(Form);
+ fileicon->setObjectName(QString::fromUtf8("fileicon"));
+ QIcon icon;
+ icon.addFile(QString::fromUtf8("image1.png"), QSize(), QIcon::Normal, QIcon::Off);
+ fileicon->setIcon(icon);
+
+ verticalLayout->addWidget(fileicon);
+
+ fileandthemeicon = new QPushButton(Form);
+ fileandthemeicon->setObjectName(QString::fromUtf8("fileandthemeicon"));
+ QIcon icon1;
+ QString iconThemeName = QString::fromUtf8("edit-copy");
+ if (QIcon::hasThemeIcon(iconThemeName)) {
+ icon1 = QIcon::fromTheme(iconThemeName);
+ } else {
+ icon1.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Normal, QIcon::Off);
+ }
+ fileandthemeicon->setIcon(icon1);
+
+ verticalLayout->addWidget(fileandthemeicon);
+
+ themeicon = new QPushButton(Form);
+ themeicon->setObjectName(QString::fromUtf8("themeicon"));
+ QIcon icon2;
+ iconThemeName = QString::fromUtf8("edit-copy");
+ if (QIcon::hasThemeIcon(iconThemeName)) {
+ icon2 = QIcon::fromTheme(iconThemeName);
+ } else {
+ icon2.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon::Off);
+ }
+ themeicon->setIcon(icon2);
+
+ verticalLayout->addWidget(themeicon);
+
+
+ retranslateUi(Form);
+
+ QMetaObject::connectSlotsByName(Form);
+ } // setupUi
+
+ void retranslateUi(QWidget *Form)
+ {
+ Form->setWindowTitle(QApplication::translate("Form", "Form", 0, QApplication::UnicodeUTF8));
+ fileicon->setText(QApplication::translate("Form", "fileicon", 0, QApplication::UnicodeUTF8));
+ fileandthemeicon->setText(QApplication::translate("Form", "PushButton", 0, QApplication::UnicodeUTF8));
+ themeicon->setText(QApplication::translate("Form", "PushButton", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class Form: public Ui_Form {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // ICONTHEME_H
diff --git a/tests/auto/uiloader/uiloader/uiloader.pro b/tests/auto/uiloader/uiloader/uiloader.pro
index d99df00e9a..4e95956522 100644
--- a/tests/auto/uiloader/uiloader/uiloader.pro
+++ b/tests/auto/uiloader/uiloader/uiloader.pro
@@ -17,10 +17,10 @@ QT += xml svg network
contains(QT_CONFIG, qt3support): QT += qt3support
wince*|symbian: {
- configuration.sources = ../*.ini
+ configuration.files = ../*.ini
configuration.path = .
- screenapp.sources = ../tst_screenshot/tst_screenshot.exe
+ screenapp.files = ../tst_screenshot/tst_screenshot.exe
screenapp.path = tst_screenshot
DEPLOYMENT += configuration screenapp
diff --git a/tests/auto/utf8/tst_utf8.cpp b/tests/auto/utf8/tst_utf8.cpp
index 9deda04cb7..d4bb26fa0a 100644
--- a/tests/auto/utf8/tst_utf8.cpp
+++ b/tests/auto/utf8/tst_utf8.cpp
@@ -210,7 +210,9 @@ void tst_Utf8::invalidUtf8_data()
QTest::addColumn<QByteArray>("utf8");
QTest::newRow("1char") << QByteArray("\x80");
- QTest::newRow("2chars") << QByteArray("\xC2\xC0");
+ QTest::newRow("2chars-1") << QByteArray("\xC2\xC0");
+ QTest::newRow("2chars-2") << QByteArray("\xC3\xDF");
+ QTest::newRow("2chars-3") << QByteArray("\xC7\xF0");
QTest::newRow("3chars-1") << QByteArray("\xE0\xA0\xC0");
QTest::newRow("3chars-2") << QByteArray("\xE0\xC0\xA0");
QTest::newRow("4chars-1") << QByteArray("\xF0\x90\x80\xC0");
diff --git a/tests/auto/utf8/utf8.pro b/tests/auto/utf8/utf8.pro
index 4ec6851b9b..aa133fe3ee 100644
--- a/tests/auto/utf8/utf8.pro
+++ b/tests/auto/utf8/utf8.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
QT -= gui
SOURCES += tst_utf8.cpp
+CONFIG += parallel_test
diff --git a/tests/auto/windowsmobile/test/test.pro b/tests/auto/windowsmobile/test/test.pro
index f3124a31e0..b0536a5e79 100644
--- a/tests/auto/windowsmobile/test/test.pro
+++ b/tests/auto/windowsmobile/test/test.pro
@@ -8,7 +8,7 @@ RESOURCES += windowsmobile.qrc
TARGET = ../tst_windowsmobile
wincewm*: {
- addFiles.sources = $$OUT_PWD/../testQMenuBar/*.exe
+ addFiles.files = $$OUT_PWD/../testQMenuBar/*.exe
addFiles.path = "\\Program Files\\tst_windowsmobile"
diff --git a/tests/auto/xmlpatterns.pri b/tests/auto/xmlpatterns.pri
index 8c8ccadb20..57b85170ca 100644
--- a/tests/auto/xmlpatterns.pri
+++ b/tests/auto/xmlpatterns.pri
@@ -4,9 +4,9 @@ contains(QT_CONFIG,xmlpatterns) {
}
wince*: {
- patternsdk.sources = $$QT_BUILD_TREE/lib/QtXmlPatternsSDK*.dll
+ patternsdk.files = $$QT_BUILD_TREE/lib/QtXmlPatternsSDK*.dll
patternsdk.path = .
- basedata.sources = xmlpaternsxqts/Baseline.xml
+ basedata.files = xmlpaternsxqts/Baseline.xml
basedata.path = .
DEPLOYMENT += patternsdk
QT += network
diff --git a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro
index 981adab764..3e252f68b0 100644
--- a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro
+++ b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro
@@ -21,7 +21,7 @@ INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \
../xmlpatternssdk
wince*|symbian {
- catalog.sources = TestSuite Baseline.xml
+ catalog.files = TestSuite Baseline.xml
catalog.path = .
DEPLOYMENT += catalog
}
diff --git a/tests/auto/xmlpatternsview/xmlpatternsview.pro b/tests/auto/xmlpatternsview/xmlpatternsview.pro
index d93cba3cfb..5ab0f0e010 100644
--- a/tests/auto/xmlpatternsview/xmlpatternsview.pro
+++ b/tests/auto/xmlpatternsview/xmlpatternsview.pro
@@ -6,7 +6,7 @@ include (../xmlpatterns.pri)
TARGET = tst_xmlpatternsview
wince*: {
- viewexe.sources = $$QT_BUILD_TREE/xmlpatternsview.exe
+ viewexe.files = $$QT_BUILD_TREE/xmlpatternsview.exe
viewexe.path = .
DEPLOYMENT += viewexe
}
diff --git a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro
index 940cc3161f..44c47549d1 100644
--- a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro
+++ b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro
@@ -18,7 +18,7 @@ INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \
../xmlpatternssdk
wince*: {
- testdata.sources = XSLTS Baseline.xml
+ testdata.files = XSLTS Baseline.xml
testdata.path = .
DEPLOYMENT += testdata
}
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index 01d5cd5c98..00a1b37eb1 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -7,3 +7,6 @@ SUBDIRS = \
svg
contains(QT_CONFIG, opengl): SUBDIRS += opengl
contains(QT_CONFIG, declarative): SUBDIRS += declarative
+
+check-trusted.CONFIG += recursive
+QMAKE_EXTRA_TARGETS += check-trusted
diff --git a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro
index 23f0e0005f..f26d623ad3 100644
--- a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro
+++ b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro
@@ -6,7 +6,7 @@ SOURCES += main.cpp
wince*:{
DEFINES += SRCDIR=\\\"\\\"
} else:symbian* {
- addFiles.sources = utf-8.txt
+ addFiles.files = utf-8.txt
addFiles.path = .
DEPLOYMENT += addFiles
TARGET.EPOCHEAPSIZE="0x100 0x1000000"
diff --git a/tests/benchmarks/corelib/corelib.pro b/tests/benchmarks/corelib/corelib.pro
index 8a6941bd2e..335280ec21 100644
--- a/tests/benchmarks/corelib/corelib.pro
+++ b/tests/benchmarks/corelib/corelib.pro
@@ -4,5 +4,13 @@ SUBDIRS = \
kernel \
thread \
tools \
- codecs \
+ codecs \
plugin
+
+TRUSTED_BENCHMARKS += \
+ kernel/qmetaobject \
+ kernel/qmetatype \
+ kernel/qobject \
+ thread/qthreadstorage
+
+include(../trusted-benchmarks.pri) \ No newline at end of file
diff --git a/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp b/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp
index 9741ba5514..236332b355 100644
--- a/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp
+++ b/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp
@@ -55,12 +55,24 @@ class bench_QDir_tree
public:
bench_QDir_tree()
- : prefix("./test-tree/")
+ : prefix("./test-tree/"),
+ musicprefix(QLatin1String("music")),
+ photoprefix(QLatin1String("photos")),
+ sourceprefix(QLatin1String("source")),
+ musicsize(0),
+ photosize(0),
+ sourcesize(0)
{
}
private:
QByteArray prefix;
+ QString musicprefix;
+ QString photoprefix;
+ QString sourceprefix;
+ qint64 musicsize;
+ qint64 photosize;
+ qint64 sourcesize;
private slots:
void initTestCase()
@@ -105,6 +117,34 @@ private slots:
line.clear();
}
+
+ //Use case: music collection - 10 files in 100 directories (albums)
+ QVERIFY(fs.createDirectory(musicprefix));
+ for (int i=0;i<1000;i++) {
+ if ((i % 10) == 0)
+ QVERIFY(fs.createDirectory(QString("%1/directory%2").arg(musicprefix).arg(i/10)));
+ qint64 size = fs.createFileWithContent(QString("%1/directory%2/file%3").arg(musicprefix).arg(i/10).arg(i));
+ QVERIFY(size > 0);
+ musicsize += size;
+ }
+ //Use case: photos - 1000 files in 1 directory
+ QVERIFY(fs.createDirectory(photoprefix));
+ for (int i=0;i<1000;i++) {
+ qint64 size = fs.createFileWithContent(QString("%1/file%2").arg(photoprefix).arg(i));
+ QVERIFY(size > 0);
+ photosize += size;
+ }
+ //Use case: source - 10 files in 10 subdirectories in 10 directories (1000 total)
+ QVERIFY(fs.createDirectory(sourceprefix));
+ for (int i=0;i<1000;i++) {
+ if ((i % 100) == 0)
+ QVERIFY(fs.createDirectory(QString("%1/directory%2").arg(sourceprefix).arg(i/100)));
+ if ((i % 10) == 0)
+ QVERIFY(fs.createDirectory(QString("%1/directory%2/subdirectory%3").arg(sourceprefix).arg(i/100).arg(i/10)));
+ qint64 size = fs.createFileWithContent(QString("%1/directory%2/subdirectory%3/file%4").arg(sourceprefix).arg(i/100).arg(i/10).arg(i));
+ QVERIFY(size > 0);
+ sourcesize += size;
+ }
}
void fileSearch_data() const
@@ -154,6 +194,7 @@ private slots:
QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System,
QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
+ count = 0;
while (iterator.hasNext()) {
iterator.next();
++count;
@@ -165,6 +206,32 @@ private slots:
QCOMPARE(count, 11963);
}
+ void thousandFiles_data() const
+ {
+ QTest::addColumn<QString>("dirName");
+ QTest::addColumn<qint64>("expectedSize");
+ QTest::newRow("music") << musicprefix << musicsize;
+ QTest::newRow("photos") << photoprefix << photosize;
+ QTest::newRow("src") << sourceprefix << sourcesize;
+ }
+
+ void thousandFiles() const
+ {
+ QFETCH(QString, dirName);
+ QFETCH(qint64, expectedSize);
+ QBENCHMARK {
+ qint64 totalsize = 0;
+ int count = 0;
+ QDirIterator iter(dirName, QDir::Files, QDirIterator::Subdirectories);
+ while(iter.hasNext()) {
+ iter.next();
+ count++;
+ totalsize += iter.fileInfo().size();
+ }
+ QCOMPARE(count, 1000);
+ QCOMPARE(totalsize, expectedSize);
+ }
+ }
private:
FileSystem fs;
};
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
index 320746c1aa..17d164d463 100755
--- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
+++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
@@ -16,7 +16,7 @@ SOURCES += qfilesystemiterator.cpp
HEADERS += qfilesystemiterator.h
wince*|symbian: {
- corelibdir.sources = $$QT_SOURCE_TREE/src/corelib
+ corelibdir.files = $$QT_SOURCE_TREE/src/corelib
corelibdir.path = ./depot/src
DEPLOYMENT += corelibdir
}
diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
index a6d3db5559..3274adee8f 100644
--- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp
+++ b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
@@ -43,15 +43,20 @@
#include <QtTest/QtTest>
#include <QtCore/QCoreApplication>
#include <QtCore/QFileInfo>
+#include <QtCore/QFile>
#include "private/qfsfileengine_p.h"
+#include "../../../../shared/filesystem.h"
class qfileinfo : public QObject
{
Q_OBJECT
private slots:
void canonicalFileNamePerformance();
-
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ void symLinkTargetPerformanceLNK();
+ void symLinkTargetPerformanceMounpoint();
+#endif
void initTestCase();
void cleanupTestCase();
public:
@@ -78,6 +83,43 @@ void qfileinfo::canonicalFileNamePerformance()
}
}
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+void qfileinfo::symLinkTargetPerformanceLNK()
+{
+ QVERIFY(QFile::link("file","link.lnk"));
+ QFileInfo info("link.lnk");
+ info.setCaching(false);
+ QVERIFY(info.isSymLink());
+ QString linkTarget;
+ QBENCHMARK {
+ for(int i=0; i<100; i++)
+ linkTarget = info.readLink();
+ }
+ QVERIFY(QFile::remove("link.lnk"));
+}
+
+void qfileinfo::symLinkTargetPerformanceMounpoint()
+{
+ wchar_t buffer[MAX_PATH];
+ QString rootPath = QDir::toNativeSeparators(QDir::rootPath());
+ QVERIFY(GetVolumeNameForVolumeMountPointW(rootPath.utf16(), buffer, MAX_PATH));
+ QString rootVolume = QString::fromWCharArray(buffer);
+ QString mountpoint = "mountpoint";
+ rootVolume.replace("\\\\?\\","\\??\\");
+ FileSystem::createNtfsJunction(rootVolume, mountpoint);
+
+ QFileInfo info(mountpoint);
+ info.setCaching(false);
+ QVERIFY(info.isSymLink());
+ QString linkTarget;
+ QBENCHMARK {
+ for(int i=0; i<100; i++)
+ linkTarget = info.readLink();
+ }
+ QVERIFY(QDir().rmdir(mountpoint));
+}
+#endif
+
QTEST_MAIN(qfileinfo)
#include "main.moc"
diff --git a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp
index 1fda7e6400..4ead826d25 100644
--- a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -71,6 +71,11 @@ private slots:
void isRegisteredBuiltin();
void isRegisteredCustom();
void isRegisteredNotRegistered();
+
+ void constructCoreType_data();
+ void constructCoreType();
+ void constructCoreTypeCopy_data();
+ void constructCoreTypeCopy();
};
tst_QMetaType::tst_QMetaType()
@@ -229,5 +234,52 @@ void tst_QMetaType::isRegisteredNotRegistered()
}
}
+void tst_QMetaType::constructCoreType_data()
+{
+ QTest::addColumn<int>("typeId");
+ for (int i = 0; i <= QMetaType::LastCoreType; ++i)
+ QTest::newRow(QMetaType::typeName(i)) << i;
+ for (int i = QMetaType::FirstCoreExtType; i <= QMetaType::LastCoreExtType; ++i)
+ QTest::newRow(QMetaType::typeName(i)) << i;
+ // GUI types are tested in tst_QGuiMetaType.
+}
+
+// Tests how fast QMetaType can default-construct and destroy a Qt
+// core type. The purpose of this benchmark is to measure the overhead
+// of using type id-based creation compared to creating the type
+// directly (i.e. "T *t = new T(); delete t;").
+void tst_QMetaType::constructCoreType()
+{
+ QFETCH(int, typeId);
+ QBENCHMARK {
+ for (int i = 0; i < 100000; ++i) {
+ void *data = QMetaType::construct(typeId, (void *)0);
+ QMetaType::destroy(typeId, data);
+ }
+ }
+}
+
+void tst_QMetaType::constructCoreTypeCopy_data()
+{
+ constructCoreType_data();
+}
+
+// Tests how fast QMetaType can copy-construct and destroy a Qt core
+// type. The purpose of this benchmark is to measure the overhead of
+// using type id-based creation compared to creating the type directly
+// (i.e. "T *t = new T(other); delete t;").
+void tst_QMetaType::constructCoreTypeCopy()
+{
+ QFETCH(int, typeId);
+ QVariant other(typeId, (void *)0);
+ const void *copy = other.constData();
+ QBENCHMARK {
+ for (int i = 0; i < 100000; ++i) {
+ void *data = QMetaType::construct(typeId, copy);
+ QMetaType::destroy(typeId, data);
+ }
+ }
+}
+
QTEST_MAIN(tst_QMetaType)
#include "tst_qmetatype.moc"
diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
index 2492ccaef6..2e217e2a63 100644
--- a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -71,6 +71,11 @@ private slots:
void floatVariantValue();
void rectVariantValue();
void stringVariantValue();
+
+ void createCoreType_data();
+ void createCoreType();
+ void createCoreTypeCopy_data();
+ void createCoreTypeCopy();
};
void tst_qvariant::testBound()
@@ -220,6 +225,48 @@ void tst_qvariant::stringVariantValue()
}
}
+void tst_qvariant::createCoreType_data()
+{
+ QTest::addColumn<int>("typeId");
+ for (int i = 0; i <= QMetaType::LastCoreType; ++i)
+ QTest::newRow(QMetaType::typeName(i)) << i;
+ for (int i = QMetaType::FirstCoreExtType; i <= QMetaType::LastCoreExtType; ++i)
+ QTest::newRow(QMetaType::typeName(i)) << i;
+}
+
+// Tests how fast a Qt core type can be default-constructed by a
+// QVariant. The purpose of this benchmark is to measure the overhead
+// of creating (and destroying) a QVariant compared to creating the
+// type directly.
+void tst_qvariant::createCoreType()
+{
+ QFETCH(int, typeId);
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ QVariant(typeId, (void *)0);
+ }
+}
+
+void tst_qvariant::createCoreTypeCopy_data()
+{
+ createCoreType_data();
+}
+
+// Tests how fast a Qt core type can be copy-constructed by a
+// QVariant. The purpose of this benchmark is to measure the overhead
+// of creating (and destroying) a QVariant compared to creating the
+// type directly.
+void tst_qvariant::createCoreTypeCopy()
+{
+ QFETCH(int, typeId);
+ QVariant other(typeId, (void *)0);
+ const void *copy = other.constData();
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ QVariant(typeId, copy);
+ }
+}
+
QTEST_MAIN(tst_qvariant)
#include "tst_qvariant.moc"
diff --git a/tests/benchmarks/corelib/thread/qmutex/qmutex.pro b/tests/benchmarks/corelib/thread/qmutex/qmutex.pro
new file mode 100644
index 0000000000..8fda5faaef
--- /dev/null
+++ b/tests/benchmarks/corelib/thread/qmutex/qmutex.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_qmutex
+QT -= gui
+SOURCES += tst_qmutex.cpp
+
diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
new file mode 100644
index 0000000000..b0c570276b
--- /dev/null
+++ b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
@@ -0,0 +1,433 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <QtCore/QtCore>
+#include <QtTest/QtTest>
+
+#include <math.h>
+
+#ifdef Q_OS_UNIX
+# include <pthread.h>
+# include <errno.h>
+typedef pthread_mutex_t NativeMutexType;
+void NativeMutexInitialize(NativeMutexType *mutex)
+{
+ pthread_mutex_init(mutex, NULL);
+}
+void NativeMutexDestroy(NativeMutexType *mutex)
+{
+ pthread_mutex_destroy(mutex);
+}
+void NativeMutexLock(NativeMutexType *mutex)
+{
+ pthread_mutex_lock(mutex);
+}
+void NativeMutexUnlock(NativeMutexType *mutex)
+{
+ pthread_mutex_unlock(mutex);
+}
+#elif defined(Q_OS_WIN)
+# define _WIN32_WINNT 0x0400
+# include <windows.h>
+typedef CRITICAL_SECTION NativeMutexType;
+void NativeMutexInitialize(NativeMutexType *mutex)
+{
+ InitializeCriticalSection(mutex);
+}
+void NativeMutexDestroy(NativeMutexType *mutex)
+{
+ DeleteCriticalSection(mutex);
+}
+void NativeMutexLock(NativeMutexType *mutex)
+{
+ EnterCriticalSection(mutex);
+}
+void NativeMutexUnlock(NativeMutexType *mutex)
+{
+ LeaveCriticalSection(mutex);
+}
+#endif
+
+//TESTED_FILES=
+
+class tst_QMutex : public QObject
+{
+ Q_OBJECT
+
+ int threadCount;
+
+public:
+ // barriers for the contended tests
+ static QSemaphore semaphore1, semaphore2, semaphore3, semaphore4;
+
+ tst_QMutex()
+ {
+ // at least 2 threads, even on single cpu/core machines
+ threadCount = qMax(2, QThread::idealThreadCount());
+ qDebug("thread count: %d", threadCount);
+ }
+
+private slots:
+ void noThread_data();
+ void noThread();
+
+ void uncontendedNative();
+ void uncontendedQMutex();
+ void uncontendedQMutexLocker();
+
+ void contendedNative_data();
+ void contendedQMutex_data() { contendedNative_data(); }
+ void contendedQMutexLocker_data() { contendedNative_data(); }
+
+ void contendedNative();
+ void contendedQMutex();
+ void contendedQMutexLocker();
+};
+
+QSemaphore tst_QMutex::semaphore1;
+QSemaphore tst_QMutex::semaphore2;
+QSemaphore tst_QMutex::semaphore3;
+QSemaphore tst_QMutex::semaphore4;
+
+void tst_QMutex::noThread_data()
+{
+ QTest::addColumn<int>("t");
+
+ QTest::newRow("noLock") << 1;
+ QTest::newRow("QMutexInline") << 2;
+ QTest::newRow("QMutex") << 3;
+ QTest::newRow("QMutexLocker") << 4;
+}
+
+void tst_QMutex::noThread()
+{
+ volatile int count = 0;
+ const int N = 5000000;
+ QMutex mtx;
+
+ QFETCH(int, t);
+ switch(t) {
+ case 1:
+ QBENCHMARK {
+ count = 0;
+ for (int i = 0; i < N; i++) {
+ count++;
+ }
+ }
+ break;
+ case 2:
+ QBENCHMARK {
+ count = 0;
+ for (int i = 0; i < N; i++) {
+ mtx.lockInline();
+ count++;
+ mtx.unlockInline();
+ }
+ }
+ break;
+ case 3:
+ QBENCHMARK {
+ count = 0;
+ for (int i = 0; i < N; i++) {
+ mtx.lock();
+ count++;
+ mtx.unlock();
+ }
+ }
+ break;
+ case 4:
+ QBENCHMARK {
+ count = 0;
+ for (int i = 0; i < N; i++) {
+ QMutexLocker locker(&mtx);
+ count++;
+ }
+ }
+ break;
+ }
+ QCOMPARE(int(count), N);
+}
+
+void tst_QMutex::uncontendedNative()
+{
+ NativeMutexType mutex;
+ NativeMutexInitialize(&mutex);
+ QBENCHMARK {
+ NativeMutexLock(&mutex);
+ NativeMutexUnlock(&mutex);
+ }
+ NativeMutexDestroy(&mutex);
+}
+
+void tst_QMutex::uncontendedQMutex()
+{
+ QMutex mutex;
+ QBENCHMARK {
+ mutex.lock();
+ mutex.unlock();
+ }
+}
+
+void tst_QMutex::uncontendedQMutexLocker()
+{
+ QMutex mutex;
+ QBENCHMARK {
+ QMutexLocker locker(&mutex);
+ }
+}
+
+void tst_QMutex::contendedNative_data()
+{
+ QTest::addColumn<int>("iterations");
+ QTest::addColumn<int>("msleepDuration");
+ QTest::addColumn<bool>("use2mutexes");
+
+ QTest::newRow("baseline") << 0 << -1 << false;
+
+ QTest::newRow("no msleep, 1 mutex") << 1000 << -1 << false;
+ QTest::newRow("no msleep, 2 mutexes") << 1000 << -1 << true;
+ QTest::newRow("msleep(0), 1 mutex") << 1000 << 0 << false;
+ QTest::newRow("msleep(0), 2 mutexes") << 1000 << 0 << true;
+ QTest::newRow("msleep(1), 1 mutex") << 10 << 1 << false;
+ QTest::newRow("msleep(1), 2 mutexes") << 10 << 1 << true;
+ QTest::newRow("msleep(2), 1 mutex") << 10 << 2 << false;
+ QTest::newRow("msleep(2), 2 mutexes") << 10 << 2 << true;
+ QTest::newRow("msleep(10), 1 mutex") << 10 << 10 << false;
+ QTest::newRow("msleep(10), 2 mutexes") << 10 << 10 << true;
+}
+
+class NativeMutexThread : public QThread
+{
+ NativeMutexType *mutex1, *mutex2;
+ int iterations, msleepDuration;
+ bool use2mutexes;
+public:
+ bool done;
+ NativeMutexThread(NativeMutexType *mutex1, NativeMutexType *mutex2, int iterations, int msleepDuration, bool use2mutexes)
+ : mutex1(mutex1), mutex2(mutex2), iterations(iterations), msleepDuration(msleepDuration), use2mutexes(use2mutexes), done(false)
+ { }
+ void run() {
+ forever {
+ tst_QMutex::semaphore1.release();
+ tst_QMutex::semaphore2.acquire();
+ if (done)
+ break;
+ for (int i = 0; i < iterations; ++i) {
+ NativeMutexLock(mutex1);
+ if (use2mutexes)
+ NativeMutexLock(mutex2);
+ if (msleepDuration >= 0)
+ msleep(msleepDuration);
+ if (use2mutexes)
+ NativeMutexUnlock(mutex2);
+ NativeMutexUnlock(mutex1);
+
+ QThread::yieldCurrentThread();
+ }
+ tst_QMutex::semaphore3.release();
+ tst_QMutex::semaphore4.acquire();
+ }
+ }
+};
+
+void tst_QMutex::contendedNative()
+{
+ QFETCH(int, iterations);
+ QFETCH(int, msleepDuration);
+ QFETCH(bool, use2mutexes);
+
+ NativeMutexType mutex1, mutex2;
+ NativeMutexInitialize(&mutex1);
+ NativeMutexInitialize(&mutex2);
+
+ QVector<NativeMutexThread *> threads(threadCount);
+ for (int i = 0; i < threads.count(); ++i) {
+ threads[i] = new NativeMutexThread(&mutex1, &mutex2, iterations, msleepDuration, use2mutexes);
+ threads[i]->start();
+ }
+
+ QBENCHMARK {
+ semaphore1.acquire(threadCount);
+ semaphore2.release(threadCount);
+ semaphore3.acquire(threadCount);
+ semaphore4.release(threadCount);
+ }
+
+ for (int i = 0; i < threads.count(); ++i)
+ threads[i]->done = true;
+ semaphore1.acquire(threadCount);
+ semaphore2.release(threadCount);
+ for (int i = 0; i < threads.count(); ++i)
+ threads[i]->wait();
+ qDeleteAll(threads);
+
+ NativeMutexDestroy(&mutex1);
+ NativeMutexDestroy(&mutex2);
+}
+
+class QMutexThread : public QThread
+{
+ QMutex *mutex1, *mutex2;
+ int iterations, msleepDuration;
+ bool use2mutexes;
+public:
+ bool done;
+ QMutexThread(QMutex *mutex1, QMutex *mutex2, int iterations, int msleepDuration, bool use2mutexes)
+ : mutex1(mutex1), mutex2(mutex2), iterations(iterations), msleepDuration(msleepDuration), use2mutexes(use2mutexes), done(false)
+ { }
+ void run() {
+ forever {
+ tst_QMutex::semaphore1.release();
+ tst_QMutex::semaphore2.acquire();
+ if (done)
+ break;
+ for (int i = 0; i < iterations; ++i) {
+ mutex1->lock();
+ if (use2mutexes)
+ mutex2->lock();
+ if (msleepDuration >= 0)
+ msleep(msleepDuration);
+ if (use2mutexes)
+ mutex2->unlock();
+ mutex1->unlock();
+
+ QThread::yieldCurrentThread();
+ }
+ tst_QMutex::semaphore3.release();
+ tst_QMutex::semaphore4.acquire();
+ }
+ }
+};
+
+void tst_QMutex::contendedQMutex()
+{
+ QFETCH(int, iterations);
+ QFETCH(int, msleepDuration);
+ QFETCH(bool, use2mutexes);
+
+ QMutex mutex1, mutex2;
+
+ QVector<QMutexThread *> threads(threadCount);
+ for (int i = 0; i < threads.count(); ++i) {
+ threads[i] = new QMutexThread(&mutex1, &mutex2, iterations, msleepDuration, use2mutexes);
+ threads[i]->start();
+ }
+
+ QBENCHMARK {
+ semaphore1.acquire(threadCount);
+ semaphore2.release(threadCount);
+ semaphore3.acquire(threadCount);
+ semaphore4.release(threadCount);
+ }
+
+ for (int i = 0; i < threads.count(); ++i)
+ threads[i]->done = true;
+ semaphore1.acquire(threadCount);
+ semaphore2.release(threadCount);
+ for (int i = 0; i < threads.count(); ++i)
+ threads[i]->wait();
+ qDeleteAll(threads);
+}
+
+class QMutexLockerThread : public QThread
+{
+ QMutex *mutex1, *mutex2;
+ int iterations, msleepDuration;
+ bool use2mutexes;
+public:
+ bool done;
+ QMutexLockerThread(QMutex *mutex1, QMutex *mutex2, int iterations, int msleepDuration, bool use2mutexes)
+ : mutex1(mutex1), mutex2(mutex2), iterations(iterations), msleepDuration(msleepDuration), use2mutexes(use2mutexes), done(false)
+ { }
+ void run() {
+ forever {
+ tst_QMutex::semaphore1.release();
+ tst_QMutex::semaphore2.acquire();
+ if (done)
+ break;
+ for (int i = 0; i < iterations; ++i) {
+ {
+ QMutexLocker locker1(mutex1);
+ QMutexLocker locker2(use2mutexes ? mutex2 : 0);
+ if (msleepDuration >= 0)
+ msleep(msleepDuration);
+ }
+
+ QThread::yieldCurrentThread();
+ }
+ tst_QMutex::semaphore3.release();
+ tst_QMutex::semaphore4.acquire();
+ }
+ }
+};
+
+void tst_QMutex::contendedQMutexLocker()
+{
+ QFETCH(int, iterations);
+ QFETCH(int, msleepDuration);
+ QFETCH(bool, use2mutexes);
+
+ QMutex mutex1, mutex2;
+
+ QVector<QMutexLockerThread *> threads(threadCount);
+ for (int i = 0; i < threads.count(); ++i) {
+ threads[i] = new QMutexLockerThread(&mutex1, &mutex2, iterations, msleepDuration, use2mutexes);
+ threads[i]->start();
+ }
+
+ QBENCHMARK {
+ semaphore1.acquire(threadCount);
+ semaphore2.release(threadCount);
+ semaphore3.acquire(threadCount);
+ semaphore4.release(threadCount);
+ }
+
+ for (int i = 0; i < threads.count(); ++i)
+ threads[i]->done = true;
+ semaphore1.acquire(threadCount);
+ semaphore2.release(threadCount);
+ for (int i = 0; i < threads.count(); ++i)
+ threads[i]->wait();
+ qDeleteAll(threads);
+}
+
+QTEST_MAIN(tst_QMutex)
+#include "tst_qmutex.moc"
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index ae59839f64..a6412a818f 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -1007,6 +1007,7 @@ static inline __attribute__((optimize("no-unroll-loops"))) int ucstrncmp_sse2_al
return ucstrncmp_short_tail(a + counter, b + counter, len);
}
+#ifdef __SSSE3__
static inline __attribute__((optimize("no-unroll-loops"))) int ucstrncmp_ssse3_alignr_aligned(const ushort *a, const ushort *b, int len)
{
quintptr counter = 0;
@@ -1276,6 +1277,7 @@ static int ucstrncmp_ssse3_aligning2(const ushort *a, const ushort *b, int len)
}
#endif
+#endif
typedef int (* UcstrncmpFunction)(const ushort *, const ushort *, int);
Q_DECLARE_METATYPE(UcstrncmpFunction)
diff --git a/tests/benchmarks/corelib/tools/qstring/qstring.pro b/tests/benchmarks/corelib/tools/qstring/qstring.pro
index e8720e1919..e43e400771 100644
--- a/tests/benchmarks/corelib/tools/qstring/qstring.pro
+++ b/tests/benchmarks/corelib/tools/qstring/qstring.pro
@@ -6,7 +6,7 @@ SOURCES += main.cpp data.cpp
wince*:{
DEFINES += SRCDIR=\\\"\\\"
} else:symbian* {
- addFiles.sources = utf-8.txt
+ addFiles.files = utf-8.txt
addFiles.path = .
DEPLOYMENT += addFiles
TARGET.EPOCHEAPSIZE="0x100 0x1000000"
diff --git a/tests/benchmarks/declarative/binding/binding.pro b/tests/benchmarks/declarative/binding/binding.pro
index c1a8223c09..bbe8701d32 100644
--- a/tests/benchmarks/declarative/binding/binding.pro
+++ b/tests/benchmarks/declarative/binding/binding.pro
@@ -8,9 +8,9 @@ SOURCES += tst_binding.cpp testtypes.cpp
HEADERS += testtypes.h
symbian {
- data.sources = data
+ data.files = data
data.path = .
- DEPLOYMENT = data
+ DEPLOYMENT += data
} else {
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/benchmarks/declarative/compilation/compilation.pro b/tests/benchmarks/declarative/compilation/compilation.pro
index 9277187479..9ab2a25731 100644
--- a/tests/benchmarks/declarative/compilation/compilation.pro
+++ b/tests/benchmarks/declarative/compilation/compilation.pro
@@ -9,7 +9,7 @@ CONFIG += release
SOURCES += tst_compilation.cpp
symbian {
- data.sources += data
+ data.files += data
data.path = .
DEPLOYMENT += data
} else {
diff --git a/tests/benchmarks/declarative/creation/creation.pro b/tests/benchmarks/declarative/creation/creation.pro
index 6540fa2e24..74cb47fb73 100644
--- a/tests/benchmarks/declarative/creation/creation.pro
+++ b/tests/benchmarks/declarative/creation/creation.pro
@@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle
SOURCES += tst_creation.cpp
symbian {
- data.sources = data
+ data.files = data
data.path = .
DEPLOYMENT += data
} else {
diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro
index 5dd31f3d13..cb02a35c27 100644
--- a/tests/benchmarks/declarative/declarative.pro
+++ b/tests/benchmarks/declarative/declarative.pro
@@ -12,4 +12,4 @@ SUBDIRS += \
contains(QT_CONFIG, opengl): SUBDIRS += painting
-
+include(../trusted-benchmarks.pri)
diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
index b2f39c1c79..4693a82231 100644
--- a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
+++ b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
@@ -8,7 +8,7 @@ SOURCES += tst_qdeclarativecomponent.cpp testtypes.cpp
HEADERS += testtypes.h
symbian {
- data.sources = data
+ data.files = data
data.path = .
DEPLOYMENT += data
} else {
diff --git a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro
index a68792b981..0d7c184f37 100644
--- a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro
+++ b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro
@@ -8,9 +8,9 @@ CONFIG += release
SOURCES += tst_qdeclarativeimage.cpp
symbian {
- importFiles.sources = image.png
+ importFiles.files = image.png
importFiles.path =
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
index 65ee7e0cad..765e37a15d 100644
--- a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
+++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
@@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativemetaproperty.cpp
symbian {
- data.sources += data
+ data.files += data
data.path = .
DEPLOYMENT += data
} else {
diff --git a/tests/benchmarks/declarative/qmltime/qmltime.pro b/tests/benchmarks/declarative/qmltime/qmltime.pro
index 6f5ad5eff2..273a60ac75 100644
--- a/tests/benchmarks/declarative/qmltime/qmltime.pro
+++ b/tests/benchmarks/declarative/qmltime/qmltime.pro
@@ -8,7 +8,7 @@ SOURCES += qmltime.cpp
symbian {
TARGET.CAPABILITY = "All -TCB"
- example.sources = example.qml tests
+ example.files = example.qml tests
example.path = .
DEPLOYMENT += example
}
diff --git a/tests/benchmarks/declarative/script/script.pro b/tests/benchmarks/declarative/script/script.pro
index 685ba03dcb..75faa5cf38 100644
--- a/tests/benchmarks/declarative/script/script.pro
+++ b/tests/benchmarks/declarative/script/script.pro
@@ -8,9 +8,9 @@ CONFIG += release
SOURCES += tst_script.cpp
symbian {
- importFiles.sources = data
+ importFiles.files = data
importFiles.path =
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/benchmarks/declarative/typeimports/typeimports.pro b/tests/benchmarks/declarative/typeimports/typeimports.pro
index a5df3f0763..56834e6175 100644
--- a/tests/benchmarks/declarative/typeimports/typeimports.pro
+++ b/tests/benchmarks/declarative/typeimports/typeimports.pro
@@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle
SOURCES += tst_typeimports.cpp
symbian {
- data.sources = data
+ data.files = data
data.path = .
DEPLOYMENT += data
} else {
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro
index 6e044f9375..bfa374cdf8 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro
@@ -9,7 +9,7 @@ include(chiptester/chiptester.pri)
symbian {
qt_not_deployed {
- plugins.sources = qjpeg.dll
+ plugins.files = qjpeg.dll
plugins.path = imageformats
DEPLOYMENT += plugins
}
diff --git a/tests/benchmarks/gui/gui.pro b/tests/benchmarks/gui/gui.pro
index 946f1847fa..d8254583c5 100644
--- a/tests/benchmarks/gui/gui.pro
+++ b/tests/benchmarks/gui/gui.pro
@@ -9,3 +9,10 @@ SUBDIRS = \
painting \
styles \
text
+
+TRUSTED_BENCHMARKS += \
+ graphicsview/functional/GraphicsViewBenchmark \
+ graphicsview/qgraphicsview \
+ painting/qtracebench
+
+include(../trusted-benchmarks.pri) \ No newline at end of file
diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
index d67f4bedd4..db5ffcd01d 100644
--- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
+++ b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
@@ -11,15 +11,15 @@ SOURCES += tst_qimagereader.cpp
QT += network
wince*: {
- addFiles.sources = images
+ addFiles.files = images
addFiles.path = .
CONFIG(debug, debug|release):{
- imageFormatsPlugins.sources = $$(QTDIR)/plugins/imageformats/*d4.dll
+ imageFormatsPlugins.files = $$(QTDIR)/plugins/imageformats/*d4.dll
}
CONFIG(release, debug|release):{
- imageFormatsPlugins.sources = $$(QTDIR)/plugins/imageformats/*[^d]4.dll
+ imageFormatsPlugins.files = $$(QTDIR)/plugins/imageformats/*[^d]4.dll
}
imageFormatsPlugins.path = imageformats
DEPLOYMENT += addFiles imageFormatsPlugins
diff --git a/tests/benchmarks/gui/kernel/qguimetatype/qguimetatype.pro b/tests/benchmarks/gui/kernel/qguimetatype/qguimetatype.pro
new file mode 100644
index 0000000000..7ef99e4cb4
--- /dev/null
+++ b/tests/benchmarks/gui/kernel/qguimetatype/qguimetatype.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_qguimetatype
+
+SOURCES += tst_qguimetatype.cpp
+
diff --git a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
new file mode 100644
index 0000000000..f94767b512
--- /dev/null
+++ b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtCore/qmetatype.h>
+
+class tst_QGuiMetaType : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QGuiMetaType();
+ virtual ~tst_QGuiMetaType();
+
+private slots:
+ void constructGuiType_data();
+ void constructGuiType();
+ void constructGuiTypeCopy_data();
+ void constructGuiTypeCopy();
+};
+
+tst_QGuiMetaType::tst_QGuiMetaType()
+{
+}
+
+tst_QGuiMetaType::~tst_QGuiMetaType()
+{
+}
+
+void tst_QGuiMetaType::constructGuiType_data()
+{
+ QTest::addColumn<int>("typeId");
+ for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
+ QTest::newRow(QMetaType::typeName(i)) << i;
+}
+
+// Tests how fast QMetaType can default-construct and destroy a Qt GUI
+// type. The purpose of this benchmark is to measure the overhead of
+// using type id-based creation compared to creating the type directly
+// (i.e. "T *t = new T(); delete t;").
+void tst_QGuiMetaType::constructGuiType()
+{
+ QFETCH(int, typeId);
+ QBENCHMARK {
+ for (int i = 0; i < 100000; ++i) {
+ void *data = QMetaType::construct(typeId, (void *)0);
+ QMetaType::destroy(typeId, data);
+ }
+ }
+}
+
+void tst_QGuiMetaType::constructGuiTypeCopy_data()
+{
+ constructGuiType_data();
+}
+
+// Tests how fast QMetaType can copy-construct and destroy a Qt GUI
+// type. The purpose of this benchmark is to measure the overhead of
+// using type id-based creation compared to creating the type directly
+// (i.e. "T *t = new T(other); delete t;").
+void tst_QGuiMetaType::constructGuiTypeCopy()
+{
+ QFETCH(int, typeId);
+ QVariant other(typeId, (void *)0);
+ const void *copy = other.constData();
+ QBENCHMARK {
+ for (int i = 0; i < 100000; ++i) {
+ void *data = QMetaType::construct(typeId, copy);
+ QMetaType::destroy(typeId, data);
+ }
+ }
+}
+
+QTEST_MAIN(tst_QGuiMetaType)
+#include "tst_qguimetatype.moc"
diff --git a/tests/benchmarks/gui/kernel/qguivariant/qguivariant.pro b/tests/benchmarks/gui/kernel/qguivariant/qguivariant.pro
new file mode 100644
index 0000000000..4e05dd7d4b
--- /dev/null
+++ b/tests/benchmarks/gui/kernel/qguivariant/qguivariant.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_qguivariant
+
+SOURCES += tst_qguivariant.cpp
+
diff --git a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
new file mode 100644
index 0000000000..4016be1142
--- /dev/null
+++ b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtCore/qvariant.h>
+
+#define ITERATION_COUNT 1e5
+
+class tst_QGuiVariant : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QGuiVariant();
+ virtual ~tst_QGuiVariant();
+
+private slots:
+ void createGuiType_data();
+ void createGuiType();
+ void createGuiTypeCopy_data();
+ void createGuiTypeCopy();
+};
+
+tst_QGuiVariant::tst_QGuiVariant()
+{
+}
+
+tst_QGuiVariant::~tst_QGuiVariant()
+{
+}
+
+void tst_QGuiVariant::createGuiType_data()
+{
+ QTest::addColumn<int>("typeId");
+ for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
+ QTest::newRow(QMetaType::typeName(i)) << i;
+}
+
+// Tests how fast a Qt GUI type can be default-constructed by a
+// QVariant. The purpose of this benchmark is to measure the overhead
+// of creating (and destroying) a QVariant compared to creating the
+// type directly.
+void tst_QGuiVariant::createGuiType()
+{
+ QFETCH(int, typeId);
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ QVariant(typeId, (void *)0);
+ }
+}
+
+void tst_QGuiVariant::createGuiTypeCopy_data()
+{
+ createGuiType_data();
+}
+
+// Tests how fast a Qt GUI type can be copy-constructed by a
+// QVariant. The purpose of this benchmark is to measure the overhead
+// of creating (and destroying) a QVariant compared to creating the
+// type directly.
+void tst_QGuiVariant::createGuiTypeCopy()
+{
+ QFETCH(int, typeId);
+ QVariant other(typeId, (void *)0);
+ const void *copy = other.constData();
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ QVariant(typeId, copy);
+ }
+}
+
+QTEST_MAIN(tst_QGuiVariant)
+#include "tst_qguivariant.moc"
diff --git a/tests/benchmarks/gui/text/qtext/qtext.pro b/tests/benchmarks/gui/text/qtext/qtext.pro
index a1b6a22fca..1c18302a39 100644
--- a/tests/benchmarks/gui/text/qtext/qtext.pro
+++ b/tests/benchmarks/gui/text/qtext/qtext.pro
@@ -6,7 +6,7 @@ SOURCES += main.cpp
symbian* {
TARGET.CAPABILITY = ALL -TCB
- addFiles.sources = bidi.txt
+ addFiles.files = bidi.txt
addFiles.path = .
DEPLOYMENT += addFiles
} else {
diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 8b37646e77..9a07aa4940 100644
--- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -51,6 +51,8 @@
#include "../../../../auto/network-settings.h"
+Q_DECLARE_METATYPE(QSharedPointer<char>)
+
class TimedSender: public QThread
{
Q_OBJECT
@@ -465,7 +467,8 @@ private slots:
void httpUploadPerformance();
void httpDownloadPerformance_data();
void httpDownloadPerformance();
-
+ void httpDownloadPerformanceDownloadBuffer_data();
+ void httpDownloadPerformanceDownloadBuffer();
};
void tst_qnetworkreply::httpLatency()
@@ -649,6 +652,91 @@ void tst_qnetworkreply::httpDownloadPerformance()
qint64 elapsed = time.elapsed();
qDebug() << "tst_QNetworkReply::httpDownloadPerformance" << elapsed << "msec, "
<< ((UploadSize/1024.0)/(elapsed/1000.0)) << " kB/sec";
+};
+
+enum HttpDownloadPerformanceDownloadBufferTestType {
+ JustDownloadBuffer,
+ DownloadBufferButUseRead,
+ NoDownloadBuffer
+};
+Q_DECLARE_METATYPE(HttpDownloadPerformanceDownloadBufferTestType)
+
+class HttpDownloadPerformanceClientDownloadBuffer : QObject {
+ Q_OBJECT
+private:
+ HttpDownloadPerformanceDownloadBufferTestType testType;
+ QNetworkReply *reply;
+ qint64 uploadSize;
+ QList<qint64> bytesAvailableList;
+public:
+ HttpDownloadPerformanceClientDownloadBuffer (QNetworkReply *reply, HttpDownloadPerformanceDownloadBufferTestType testType, qint64 uploadSize)
+ : testType(testType), reply(reply), uploadSize(uploadSize)
+ {
+ connect(reply, SIGNAL(finished()), this, SLOT(finishedSlot()));
+ }
+
+ public slots:
+ void finishedSlot() {
+ if (testType == JustDownloadBuffer) {
+ // We have a download buffer and use it. This should be the fastest benchmark result.
+ QVariant downloadBufferAttribute = reply->attribute(QNetworkRequest::DownloadBufferAttribute);
+ QSharedPointer<char> data = downloadBufferAttribute.value<QSharedPointer<char> >();
+ } else if (testType == DownloadBufferButUseRead) {
+ // We had a download buffer but we benchmark here the "legacy" read() way to access it
+ char* replyData = (char*) qMalloc(uploadSize);
+ QVERIFY(reply->read(replyData, uploadSize) == uploadSize);
+ qFree(replyData);
+ } else if (testType == NoDownloadBuffer) {
+ // We did not have a download buffer but we still need to benchmark having the data, e.g. reading it all.
+ // This should be the slowest benchmark result.
+ char* replyData = (char*) qMalloc(uploadSize);
+ QVERIFY(reply->read(replyData, uploadSize) == uploadSize);
+ qFree(replyData);
+ }
+
+ QMetaObject::invokeMethod(&QTestEventLoop::instance(), "exitLoop", Qt::QueuedConnection);
+ }
+};
+
+void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer_data()
+{
+ QTest::addColumn<HttpDownloadPerformanceDownloadBufferTestType>("testType");
+
+ QTest::newRow("use-download-buffer") << JustDownloadBuffer;
+ QTest::newRow("use-download-buffer-but-use-read") << DownloadBufferButUseRead;
+ QTest::newRow("do-not-use-download-buffer") << NoDownloadBuffer;
+}
+
+// Please note that the whole "zero copy" download buffer API is private right now. Do not use it.
+void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer()
+{
+ QFETCH(HttpDownloadPerformanceDownloadBufferTestType, testType);
+
+ // On my Linux Desktop the results are already visible with 128 kB, however we use this to have good results.
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM)
+ // Show some mercy to non-desktop platform/s
+ enum {UploadSize = 4*1024*1024}; // 4 MB
+#else
+ enum {UploadSize = 32*1024*1024}; // 32 MB
+#endif
+
+ HttpDownloadPerformanceServer server(UploadSize, true, false);
+
+ QNetworkRequest request(QUrl("http://127.0.0.1:" + QString::number(server.serverPort()) + "/?bare=1"));
+ if (testType == JustDownloadBuffer || testType == DownloadBufferButUseRead)
+ request.setAttribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute, 1024*1024*128); // 128 MB is max allowed
+
+ QNetworkAccessManager manager;
+ QNetworkReplyPtr reply = manager.get(request);
+
+ HttpDownloadPerformanceClientDownloadBuffer client(reply, testType, UploadSize);
+
+ QBENCHMARK_ONCE {
+ QTestEventLoop::instance().enterLoop(40);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QVERIFY(reply->isFinished());
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ }
}
QTEST_MAIN(tst_qnetworkreply)
diff --git a/tests/benchmarks/network/network.pro b/tests/benchmarks/network/network.pro
index 73de556664..692a0a1b7e 100644
--- a/tests/benchmarks/network/network.pro
+++ b/tests/benchmarks/network/network.pro
@@ -4,3 +4,10 @@ SUBDIRS = \
kernel \
ssl \
socket
+
+TRUSTED_BENCHMARKS += \
+ kernel/qhostinfo \
+ socket/qtcpserver \
+ ssl/qsslsocket
+
+include(../trusted-benchmarks.pri) \ No newline at end of file
diff --git a/tests/benchmarks/opengl/opengl.pro b/tests/benchmarks/opengl/opengl.pro
index 5c58751178..b510c2bb06 100644
--- a/tests/benchmarks/opengl/opengl.pro
+++ b/tests/benchmarks/opengl/opengl.pro
@@ -8,3 +8,5 @@ QT += opengl
# Input
SOURCES += main.cpp
+
+include(../trusted-benchmarks.pri) \ No newline at end of file
diff --git a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
index 71d1c7b675..15ba6b9e3d 100644
--- a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
@@ -44,6 +44,8 @@
#include <QtScript/private/qscriptdeclarativeclass_p.h>
+Q_DECLARE_METATYPE(QScriptValue)
+
//TESTED_FILES=
class tst_QScriptEngine : public QObject
@@ -60,32 +62,65 @@ public slots:
private slots:
void constructor();
+ void defaultPrototype();
+ void setDefaultPrototype();
void evaluate_data();
void evaluate();
void evaluateProgram_data();
void evaluateProgram();
void connectAndDisconnect();
+ void globalObject();
+ void hasUncaughtException();
+ void isEvaluating();
+ void newArray_data();
+ void newArray();
+ void newDate();
+ void newDateFromMs();
void newObject();
+ void newObjectWithScriptClass();
+ void newQMetaObject();
void newQObject();
void newFunction();
+ void newRegExp();
+ void newRegExpFromString();
void newVariant();
+ void nullValue();
+ void undefinedValue();
void collectGarbage();
+ void currentContext();
void pushAndPopContext();
+ void availableExtensions();
+ void importedExtensions();
+ void toObject_data();
+ void toObject();
void toStringHandle();
void castValueToQreal();
void nativeCall();
+ void installTranslatorFunctions();
void translation_data();
void translation();
void readScopeProperty_data();
void readScopeProperty();
+
+private:
+ void defineStandardTestValues();
+ void newEngine()
+ {
+ delete m_engine;
+ m_engine = new QScriptEngine;
+ }
+
+ QScriptEngine *m_engine;
};
tst_QScriptEngine::tst_QScriptEngine()
+ : m_engine(0)
{
}
tst_QScriptEngine::~tst_QScriptEngine()
{
+ delete m_engine;
}
void tst_QScriptEngine::init()
@@ -104,6 +139,26 @@ void tst_QScriptEngine::constructor()
}
}
+void tst_QScriptEngine::defaultPrototype()
+{
+ newEngine();
+ int type = qMetaTypeId<int>();
+ m_engine->setDefaultPrototype(type, m_engine->newObject());
+ QBENCHMARK {
+ m_engine->defaultPrototype(type);
+ }
+}
+
+void tst_QScriptEngine::setDefaultPrototype()
+{
+ newEngine();
+ int type = qMetaTypeId<int>();
+ QScriptValue proto = m_engine->newObject();
+ QBENCHMARK {
+ m_engine->setDefaultPrototype(type, proto);
+ }
+}
+
void tst_QScriptEngine::evaluate_data()
{
QTest::addColumn<QString>("code");
@@ -144,20 +199,20 @@ void tst_QScriptEngine::evaluate_data()
void tst_QScriptEngine::evaluate()
{
QFETCH(QString, code);
- QScriptEngine engine;
+ newEngine();
QBENCHMARK {
- (void)engine.evaluate(code);
+ (void)m_engine->evaluate(code);
}
}
void tst_QScriptEngine::connectAndDisconnect()
{
- QScriptEngine engine;
- QScriptValue fun = engine.evaluate("(function() { })");
+ newEngine();
+ QScriptValue fun = m_engine->evaluate("(function() { })");
QBENCHMARK {
- qScriptConnect(&engine, SIGNAL(destroyed()), QScriptValue(), fun);
- qScriptDisconnect(&engine, SIGNAL(destroyed()), QScriptValue(), fun);
+ qScriptConnect(m_engine, SIGNAL(destroyed()), QScriptValue(), fun);
+ qScriptDisconnect(m_engine, SIGNAL(destroyed()), QScriptValue(), fun);
}
}
@@ -169,27 +224,105 @@ void tst_QScriptEngine::evaluateProgram_data()
void tst_QScriptEngine::evaluateProgram()
{
QFETCH(QString, code);
- QScriptEngine engine;
QScriptProgram program(code);
+ newEngine();
QBENCHMARK {
- (void)engine.evaluate(program);
+ (void)m_engine->evaluate(program);
+ }
+}
+
+void tst_QScriptEngine::globalObject()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->globalObject();
+ }
+}
+
+void tst_QScriptEngine::hasUncaughtException()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->hasUncaughtException();
+ }
+}
+
+void tst_QScriptEngine::isEvaluating()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->isEvaluating();
+ }
+}
+
+void tst_QScriptEngine::newArray_data()
+{
+ QTest::addColumn<int>("size");
+ QTest::newRow("size=0") << 0;
+ QTest::newRow("size=10") << 10;
+ QTest::newRow("size=100") << 0;
+ QTest::newRow("size=1000") << 0;
+ QTest::newRow("size=10000") << 0;
+ QTest::newRow("size=50000") << 0;
+}
+
+void tst_QScriptEngine::newArray()
+{
+ QFETCH(int, size);
+ newEngine();
+ QBENCHMARK {
+ m_engine->newArray(size);
+ }
+}
+
+void tst_QScriptEngine::newDate()
+{
+ newEngine();
+ QDateTime dt = QDateTime::currentDateTime();
+ QBENCHMARK {
+ m_engine->newDate(dt);
+ }
+}
+
+void tst_QScriptEngine::newDateFromMs()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->newDate(0);
}
}
void tst_QScriptEngine::newObject()
{
- QScriptEngine engine;
+ newEngine();
QBENCHMARK {
- (void)engine.newObject();
+ (void)m_engine->newObject();
+ }
+}
+
+void tst_QScriptEngine::newObjectWithScriptClass()
+{
+ newEngine();
+ QScriptClass cls(m_engine);
+ QBENCHMARK {
+ m_engine->newObject(&cls);
+ }
+}
+
+void tst_QScriptEngine::newQMetaObject()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->newQMetaObject(&QScriptEngine::staticMetaObject);
}
}
void tst_QScriptEngine::newQObject()
{
- QScriptEngine engine;
+ newEngine();
QBENCHMARK {
- (void)engine.newQObject(QCoreApplication::instance());
+ (void)m_engine->newQObject(QCoreApplication::instance());
}
}
@@ -200,50 +333,145 @@ static QScriptValue testFunction(QScriptContext *, QScriptEngine *)
void tst_QScriptEngine::newFunction()
{
- QScriptEngine engine;
+ newEngine();
+ QBENCHMARK {
+ (void)m_engine->newFunction(testFunction);
+ }
+}
+
+void tst_QScriptEngine::newRegExp()
+{
+ newEngine();
+ QRegExp re = QRegExp("foo");
+ QBENCHMARK {
+ m_engine->newRegExp(re);
+ }
+}
+
+void tst_QScriptEngine::newRegExpFromString()
+{
+ newEngine();
+ QString pattern("foo");
+ QString flags("gim");
QBENCHMARK {
- (void)engine.newFunction(testFunction);
+ m_engine->newRegExp(pattern, flags);
}
}
void tst_QScriptEngine::newVariant()
{
- QScriptEngine engine;
+ newEngine();
QVariant var(123);
QBENCHMARK {
- (void)engine.newVariant(var);
+ (void)m_engine->newVariant(var);
+ }
+}
+
+void tst_QScriptEngine::nullValue()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->nullValue();
+ }
+}
+
+void tst_QScriptEngine::undefinedValue()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->undefinedValue();
}
}
void tst_QScriptEngine::collectGarbage()
{
- QScriptEngine engine;
+ newEngine();
+ QBENCHMARK {
+ m_engine->collectGarbage();
+ }
+}
+
+void tst_QScriptEngine::availableExtensions()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->availableExtensions();
+ }
+}
+
+void tst_QScriptEngine::importedExtensions()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->importedExtensions();
+ }
+}
+
+void tst_QScriptEngine::currentContext()
+{
+ newEngine();
QBENCHMARK {
- engine.collectGarbage();
+ m_engine->currentContext();
}
}
void tst_QScriptEngine::pushAndPopContext()
{
- QScriptEngine engine;
+ newEngine();
QBENCHMARK {
- (void)engine.pushContext();
- engine.popContext();
+ (void)m_engine->pushContext();
+ m_engine->popContext();
+ }
+}
+
+void tst_QScriptEngine::toObject_data()
+{
+ newEngine();
+ QTest::addColumn<QScriptValue>("val");
+ QTest::newRow("bool") << m_engine->evaluate("true");
+ QTest::newRow("number") << m_engine->evaluate("123");
+ QTest::newRow("string") << m_engine->evaluate("'ciao'");
+ QTest::newRow("null") << m_engine->evaluate("null");
+ QTest::newRow("undefined") << m_engine->evaluate("undefined");
+ QTest::newRow("object") << m_engine->evaluate("({foo:123})");
+ QTest::newRow("array") << m_engine->evaluate("[10,20,30]");
+ QTest::newRow("function") << m_engine->evaluate("(function foo(a, b, c) { return a + b + c; })");
+ QTest::newRow("date") << m_engine->evaluate("new Date");
+ QTest::newRow("regexp") << m_engine->evaluate("new RegExp('foo')");
+ QTest::newRow("error") << m_engine->evaluate("new Error");
+
+ QTest::newRow("qobject") << m_engine->newQObject(this);
+ QTest::newRow("qmetaobject") << m_engine->newQMetaObject(&QScriptEngine::staticMetaObject);
+ QTest::newRow("variant") << m_engine->newVariant(123);
+ QTest::newRow("qscriptclassobject") << m_engine->newObject(new QScriptClass(m_engine));
+
+ QTest::newRow("invalid") << QScriptValue();
+ QTest::newRow("bool-no-engine") << QScriptValue(true);
+ QTest::newRow("number-no-engine") << QScriptValue(123.0);
+ QTest::newRow("string-no-engine") << QScriptValue(QString::fromLatin1("hello"));
+ QTest::newRow("null-no-engine") << QScriptValue(QScriptValue::NullValue);
+ QTest::newRow("undefined-no-engine") << QScriptValue(QScriptValue::UndefinedValue);
+}
+
+void tst_QScriptEngine::toObject()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ m_engine->toObject(val);
}
}
void tst_QScriptEngine::toStringHandle()
{
- QScriptEngine engine;
+ newEngine();
QString str = QString::fromLatin1("foobarbaz");
QBENCHMARK {
- (void)engine.toStringHandle(str);
+ (void)m_engine->toStringHandle(str);
}
}
void tst_QScriptEngine::castValueToQreal()
{
- QScriptEngine engine;
QScriptValue val(123);
QBENCHMARK {
(void)qscriptvalue_cast<qreal>(val);
@@ -257,19 +485,27 @@ static QScriptValue native_function(QScriptContext *, QScriptEngine *)
void tst_QScriptEngine::nativeCall()
{
- QScriptEngine eng;
- eng.globalObject().setProperty("fun", eng.newFunction(native_function));
+ newEngine();
+ m_engine->globalObject().setProperty("fun", m_engine->newFunction(native_function));
QBENCHMARK{
#if !defined(Q_OS_SYMBIAN)
- eng.evaluate("var w = 0; for (i = 0; i < 100000; ++i) {\n"
+ m_engine->evaluate("var w = 0; for (i = 0; i < 100000; ++i) {\n"
" w += fun() + fun(); w -= fun(); fun(); w -= fun(); }");
#else
- eng.evaluate("var w = 0; for (i = 0; i < 25000; ++i) {\n"
+ m_engine->evaluate("var w = 0; for (i = 0; i < 25000; ++i) {\n"
" w += fun() + fun(); w -= fun(); fun(); w -= fun(); }");
#endif
}
}
+void tst_QScriptEngine::installTranslatorFunctions()
+{
+ newEngine();
+ QBENCHMARK {
+ m_engine->installTranslatorFunctions();
+ }
+}
+
void tst_QScriptEngine::translation_data()
{
QTest::addColumn<QString>("text");
@@ -284,11 +520,11 @@ void tst_QScriptEngine::translation()
{
QFETCH(QString, text);
QFETCH(QString, fileName);
- QScriptEngine engine;
- engine.installTranslatorFunctions();
+ newEngine();
+ m_engine->installTranslatorFunctions();
QBENCHMARK {
- (void)engine.evaluate(text, fileName);
+ (void)m_engine->evaluate(text, fileName);
}
}
@@ -307,33 +543,33 @@ void tst_QScriptEngine::readScopeProperty()
QFETCH(bool, staticScope);
QFETCH(bool, nestedScope);
- QScriptEngine engine;
- QScriptContext *ctx = engine.pushContext();
+ newEngine();
+ QScriptContext *ctx = m_engine->pushContext();
QScriptValue scope;
if (staticScope)
- scope = QScriptDeclarativeClass::newStaticScopeObject(&engine);
+ scope = QScriptDeclarativeClass::newStaticScopeObject(m_engine);
else
- scope = engine.newObject();
+ scope = m_engine->newObject();
scope.setProperty("foo", 123);
ctx->pushScope(scope);
if (nestedScope) {
QScriptValue scope2;
if (staticScope)
- scope2 = QScriptDeclarativeClass::newStaticScopeObject(&engine);
+ scope2 = QScriptDeclarativeClass::newStaticScopeObject(m_engine);
else
- scope2 = engine.newObject();
+ scope2 = m_engine->newObject();
scope2.setProperty("bar", 456); // ensure a miss in inner scope
ctx->pushScope(scope2);
}
- QScriptValue fun = engine.evaluate("(function() {\n"
+ QScriptValue fun = m_engine->evaluate("(function() {\n"
" for (var i = 0; i < 10000; ++i) {\n"
" foo; foo; foo; foo; foo; foo; foo; foo;\n"
" }\n"
"})");
- engine.popContext();
+ m_engine->popContext();
QVERIFY(fun.isFunction());
QBENCHMARK {
fun.call();
diff --git a/tests/benchmarks/script/qscriptqobject/qscriptqobject.pro b/tests/benchmarks/script/qscriptqobject/qscriptqobject.pro
new file mode 100644
index 0000000000..30bc447451
--- /dev/null
+++ b/tests/benchmarks/script/qscriptqobject/qscriptqobject.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_qscriptqobject
+
+SOURCES += tst_qscriptqobject.cpp
+
+QT += script
diff --git a/tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp b/tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp
new file mode 100644
index 0000000000..62f3c2a3ff
--- /dev/null
+++ b/tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp
@@ -0,0 +1,1265 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtGui>
+#include <QtScript>
+
+#define ITERATION_COUNT 1e4
+
+struct CustomType
+{
+ int a;
+};
+Q_DECLARE_METATYPE(CustomType)
+
+class PropertyTestObject : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(EnumType)
+ Q_FLAGS(FlagsType)
+ Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty)
+ Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty)
+ Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty)
+ Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty)
+ Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty)
+ Q_PROPERTY(QObject* qobjectProperty READ qobjectProperty WRITE setQObjectProperty)
+ Q_PROPERTY(CustomType customProperty READ customProperty WRITE setCustomProperty)
+ Q_PROPERTY(EnumType enumProperty READ enumProperty WRITE setEnumProperty)
+ Q_PROPERTY(FlagsType flagsProperty READ flagsProperty WRITE setFlagsProperty)
+public:
+ enum EnumType {
+ NoEnumValue = 0,
+ FirstEnumValue = 1,
+ SecondEnumValue = 2,
+ ThirdEnumValue = 4
+ };
+ Q_DECLARE_FLAGS(FlagsType, EnumType)
+
+ PropertyTestObject(QObject *parent = 0)
+ : QObject(parent),
+ m_boolProperty(false),
+ m_intProperty(123),
+ m_doubleProperty(123),
+ m_stringProperty("hello"),
+ m_variantProperty(double(123)),
+ m_qobjectProperty(this),
+ m_enumProperty(SecondEnumValue),
+ m_flagsProperty(FirstEnumValue | ThirdEnumValue)
+ { }
+
+ bool boolProperty() const
+ { return m_boolProperty; }
+ void setBoolProperty(bool value)
+ { m_boolProperty = value; }
+
+ int intProperty() const
+ { return m_intProperty; }
+ void setIntProperty(int value)
+ { m_intProperty = value; }
+
+ int doubleProperty() const
+ { return m_doubleProperty; }
+ void setDoubleProperty(double value)
+ { m_doubleProperty = value; }
+
+ QString stringProperty() const
+ { return m_stringProperty; }
+ void setStringProperty(const QString &value)
+ { m_stringProperty = value; }
+
+ QVariant variantProperty() const
+ { return m_variantProperty; }
+ void setVariantProperty(const QVariant &value)
+ { m_variantProperty = value; }
+
+ QObject *qobjectProperty() const
+ { return m_qobjectProperty; }
+ void setQObjectProperty(QObject *qobject)
+ { m_qobjectProperty = qobject; }
+
+ CustomType customProperty() const
+ { return m_customProperty; }
+ void setCustomProperty(const CustomType &value)
+ { m_customProperty = value; }
+
+ EnumType enumProperty() const
+ { return m_enumProperty; }
+ void setEnumProperty(EnumType value)
+ { m_enumProperty = value; }
+
+ FlagsType flagsProperty() const
+ { return m_flagsProperty; }
+ void setFlagsProperty(FlagsType value)
+ { m_flagsProperty = value; }
+
+private:
+ bool m_boolProperty;
+ int m_intProperty;
+ double m_doubleProperty;
+ QString m_stringProperty;
+ QVariant m_variantProperty;
+ QObject *m_qobjectProperty;
+ CustomType m_customProperty;
+ EnumType m_enumProperty;
+ FlagsType m_flagsProperty;
+};
+
+class SlotTestObject : public QObject
+{
+ Q_OBJECT
+public:
+ SlotTestObject(QObject *parent = 0)
+ : QObject(parent),
+ m_string(QString::fromLatin1("hello")),
+ m_variant(123)
+ { }
+
+public Q_SLOTS:
+ void voidSlot() { }
+ void boolSlot(bool) { }
+ void intSlot(int) { }
+ void doubleSlot(double) { }
+ void stringSlot(const QString &) { }
+ void variantSlot(const QVariant &) { }
+ void qobjectSlot(QObject *) { }
+ void customTypeSlot(const CustomType &) { }
+
+ bool returnBoolSlot() { return true; }
+ int returnIntSlot() { return 123; }
+ double returnDoubleSlot() { return 123.0; }
+ QString returnStringSlot() { return m_string; }
+ QVariant returnVariantSlot() { return m_variant; }
+ QObject *returnQObjectSlot() { return this; }
+ CustomType returnCustomTypeSlot() { return m_custom; }
+
+ void fourDoubleSlot(double, double, double, double) { }
+ void sixDoubleSlot(double, double, double, double, double, double) { }
+ void eightDoubleSlot(double, double, double, double, double, double, double, double) { }
+
+ void fourStringSlot(const QString &, const QString &, const QString &, const QString &) { }
+ void sixStringSlot(const QString &, const QString &, const QString &, const QString &,
+ const QString &, const QString &) { }
+ void eightStringSlot(const QString &, const QString &, const QString &, const QString &,
+ const QString &, const QString &, const QString &, const QString &) { }
+
+private:
+ QString m_string;
+ QVariant m_variant;
+ CustomType m_custom;
+};
+
+class SignalTestObject : public QObject
+{
+ Q_OBJECT
+public:
+ SignalTestObject(QObject *parent = 0)
+ : QObject(parent)
+ { }
+
+ void emitVoidSignal()
+ { emit voidSignal(); }
+ void emitBoolSignal(bool value)
+ { emit boolSignal(value); }
+ void emitIntSignal(int value)
+ { emit intSignal(value); }
+ void emitDoubleSignal(double value)
+ { emit doubleSignal(value); }
+ void emitStringSignal(const QString &value)
+ { emit stringSignal(value); }
+ void emitVariantSignal(const QVariant &value)
+ { emit variantSignal(value); }
+ void emitQObjectSignal(QObject *object)
+ { emit qobjectSignal(object); }
+ void emitCustomTypeSignal(const CustomType &value)
+ { emit customTypeSignal(value); }
+
+Q_SIGNALS:
+ void voidSignal();
+ void boolSignal(bool);
+ void intSignal(int);
+ void doubleSignal(double);
+ void stringSignal(const QString &);
+ void variantSignal(const QVariant &);
+ void qobjectSignal(QObject *);
+ void customTypeSignal(const CustomType &);
+};
+
+class OverloadedSlotTestObject : public QObject
+{
+ Q_OBJECT
+public:
+ OverloadedSlotTestObject(QObject *parent = 0)
+ : QObject(parent)
+ { }
+
+public Q_SLOTS:
+ void overloadedSlot() { }
+ void overloadedSlot(bool) { }
+ void overloadedSlot(double) { }
+ void overloadedSlot(const QString &) { }
+};
+
+class QtScriptablePropertyTestObject
+ : public PropertyTestObject, public QScriptable
+{
+};
+
+class QtScriptableSlotTestObject
+ : public SlotTestObject, public QScriptable
+{
+};
+
+class tst_QScriptQObject : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QScriptQObject();
+ virtual ~tst_QScriptQObject();
+
+private slots:
+ void initTestCase();
+
+ void readMetaProperty_data();
+ void readMetaProperty();
+
+ void writeMetaProperty_data();
+ void writeMetaProperty();
+
+ void readDynamicProperty_data();
+ void readDynamicProperty();
+
+ void writeDynamicProperty_data();
+ void writeDynamicProperty();
+
+ void readMethodByName_data();
+ void readMethodByName();
+
+ void readMethodBySignature_data();
+ void readMethodBySignature();
+
+ void readChild_data();
+ void readChild();
+
+ void readOneOfManyChildren_data();
+ void readOneOfManyChildren();
+
+ void readPrototypeProperty_data();
+ void readPrototypeProperty();
+
+ void readScriptProperty_data();
+ void readScriptProperty();
+
+ void readNoSuchProperty_data();
+ void readNoSuchProperty();
+
+ void readAllMetaProperties();
+
+ void callSlot_data();
+ void callSlot();
+
+ void callOverloadedSlot_data();
+ void callOverloadedSlot();
+
+ void voidSignalHandler();
+ void boolSignalHandler();
+ void intSignalHandler();
+ void doubleSignalHandler();
+ void stringSignalHandler();
+ void variantSignalHandler();
+ void qobjectSignalHandler();
+ void customTypeSignalHandler();
+
+ void emitSignal_data();
+ void emitSignal();
+
+ void readButtonMetaProperty_data();
+ void readButtonMetaProperty();
+
+ void writeButtonMetaProperty_data();
+ void writeButtonMetaProperty();
+
+ void readDynamicButtonProperty_data();
+ void readDynamicButtonProperty();
+
+ void writeDynamicButtonProperty_data();
+ void writeDynamicButtonProperty();
+
+ void readButtonMethodByName_data();
+ void readButtonMethodByName();
+
+ void readButtonMethodBySignature_data();
+ void readButtonMethodBySignature();
+
+ void readButtonChild_data();
+ void readButtonChild();
+
+ void readButtonPrototypeProperty_data();
+ void readButtonPrototypeProperty();
+
+ void readButtonScriptProperty_data();
+ void readButtonScriptProperty();
+
+ void readNoSuchButtonProperty_data();
+ void readNoSuchButtonProperty();
+
+ void callButtonMethod_data();
+ void callButtonMethod();
+
+ void readAllButtonMetaProperties();
+
+ void readQScriptableMetaProperty_data();
+ void readQScriptableMetaProperty();
+
+ void writeQScriptableMetaProperty_data();
+ void writeQScriptableMetaProperty();
+
+ void callQScriptableSlot_data();
+ void callQScriptableSlot();
+
+private:
+ void readMetaProperty_dataHelper(const QMetaObject *mo);
+ void readMethodByName_dataHelper(const QMetaObject *mo);
+ void readMethodBySignature_dataHelper(const QMetaObject *mo);
+ void readAllMetaPropertiesHelper(QObject *o);
+
+ void readPropertyHelper(QScriptEngine &engine, const QScriptValue &object,
+ const QString &propertyName, const QString &argTemplate = ".%0");
+ void writePropertyHelper(QScriptEngine &engine, const QScriptValue &object,
+ const QString &propertyName, const QScriptValue &value,
+ const QString &argTemplate = ".%0");
+
+ void callMethodHelper(QScriptEngine &engine, QObject *object,
+ const QString &propertyName, const QString &arguments);
+ void signalHandlerHelper(QScriptEngine &engine, QObject *object, const char *signal);
+};
+
+tst_QScriptQObject::tst_QScriptQObject()
+{
+}
+
+tst_QScriptQObject::~tst_QScriptQObject()
+{
+}
+
+void tst_QScriptQObject::initTestCase()
+{
+ qMetaTypeId<CustomType>();
+}
+
+void tst_QScriptQObject::readMetaProperty_dataHelper(const QMetaObject *mo)
+{
+ QTest::addColumn<QString>("propertyName");
+
+ for (int i = 0; i < mo->propertyCount(); ++i) {
+ QMetaProperty prop = mo->property(i);
+ if (!qstrcmp(prop.name(), "default"))
+ continue; // skip reserved word
+ QTest::newRow(prop.name()) << prop.name();
+ }
+}
+
+void tst_QScriptQObject::readMethodByName_dataHelper(const QMetaObject *mo)
+{
+ QTest::addColumn<QString>("propertyName");
+
+ QSet<QByteArray> uniqueNames;
+ for (int i = 0; i < mo->methodCount(); ++i) {
+ QMetaMethod method = mo->method(i);
+ if (method.access() == QMetaMethod::Private)
+ continue;
+ QByteArray signature = method.signature();
+ QByteArray name = signature.left(signature.indexOf('('));
+ if (uniqueNames.contains(name))
+ continue;
+ QTest::newRow(name) << QString::fromLatin1(name);
+ uniqueNames.insert(name);
+ }
+}
+
+void tst_QScriptQObject::readMethodBySignature_dataHelper(const QMetaObject *mo)
+{
+ QTest::addColumn<QString>("propertyName");
+
+ for (int i = 0; i < mo->methodCount(); ++i) {
+ QMetaMethod method = mo->method(i);
+ if (method.access() == QMetaMethod::Private)
+ continue;
+ QTest::newRow(method.signature()) << QString::fromLatin1(method.signature());
+ }
+}
+
+void tst_QScriptQObject::readAllMetaPropertiesHelper(QObject *o)
+{
+ QString code = QString::fromLatin1(
+ "(function() {\n"
+ " for (var i = 0; i < 100; ++i) {\n");
+ const QMetaObject *mo = o->metaObject();
+ for (int i = 0; i < mo->propertyCount(); ++i) {
+ QMetaProperty prop = mo->property(i);
+ if (!qstrcmp(prop.name(), "default"))
+ continue; // skip reserved word
+ code.append(QString::fromLatin1(" this.%0;\n").arg(prop.name()));
+ }
+ code.append(
+ " }\n"
+ "})");
+
+ QScriptEngine engine;
+ QScriptValue fun = engine.evaluate(code);
+ QVERIFY(fun.isFunction());
+
+ QScriptValue wrapper = engine.newQObject(o);
+ QBENCHMARK {
+ fun.call(wrapper);
+ }
+ QVERIFY(!engine.hasUncaughtException());
+}
+
+void tst_QScriptQObject::readPropertyHelper(
+ QScriptEngine &engine, const QScriptValue &object,
+ const QString &propertyName, const QString &argTemplate)
+{
+ QString code = QString::fromLatin1(
+ "(function() {\n"
+ " for (var i = 0; i < %0; ++i)\n"
+ " this%1;\n"
+ "})").arg(ITERATION_COUNT).arg(argTemplate.arg(propertyName));
+ QScriptValue fun = engine.evaluate(code);
+ QVERIFY(fun.isFunction());
+
+ QBENCHMARK {
+ fun.call(object);
+ }
+ QVERIFY(!engine.hasUncaughtException());
+}
+
+void tst_QScriptQObject::writePropertyHelper(
+ QScriptEngine &engine, const QScriptValue &object,
+ const QString &propertyName, const QScriptValue &value,
+ const QString &argTemplate)
+{
+ QVERIFY(value.isValid());
+ QString code = QString::fromLatin1(
+ "(function(v) {\n"
+ " for (var i = 0; i < %0; ++i)\n"
+ " this%1 = v;\n"
+ "})").arg(ITERATION_COUNT).arg(argTemplate.arg(propertyName));
+ QScriptValue fun = engine.evaluate(code);
+ QVERIFY(fun.isFunction());
+
+ QScriptValueList args;
+ args << value;
+ QBENCHMARK {
+ fun.call(object, args);
+ }
+ QVERIFY(!engine.hasUncaughtException());
+}
+
+void tst_QScriptQObject::callMethodHelper(
+ QScriptEngine &engine, QObject *object,
+ const QString &propertyName, const QString &arguments)
+{
+ QScriptValue wrapper = engine.newQObject(object);
+ QScriptValue method = wrapper.property(propertyName);
+ QVERIFY(method.isFunction());
+
+ // Generate code that calls the function directly; in this way
+ // only function call performance is measured, not function lookup
+ // as well.
+ QString code = QString::fromLatin1(
+ "(function(f) {\n"
+ " for (var i = 0; i < %0; ++i)\n"
+ " f(%1);\n"
+ "})").arg(ITERATION_COUNT).arg(arguments);
+ QScriptValue fun = engine.evaluate(code);
+ QVERIFY(fun.isFunction());
+
+ QScriptValueList args;
+ args << method;
+ QBENCHMARK {
+ fun.call(wrapper, args);
+ }
+ QVERIFY(!engine.hasUncaughtException());
+}
+
+void tst_QScriptQObject::signalHandlerHelper(
+ QScriptEngine &engine, QObject *object, const char *signal)
+{
+ QScriptValue handler = engine.evaluate("(function(a) { return a; })");
+ QVERIFY(handler.isFunction());
+ QVERIFY(qScriptConnect(object, signal, QScriptValue(), handler));
+}
+
+void tst_QScriptQObject::readMetaProperty_data()
+{
+ readMetaProperty_dataHelper(&PropertyTestObject::staticMetaObject);
+}
+
+// Reads a meta-object-defined property from JS. The purpose of this
+// benchmark is to measure the overhead of reading a property from JS
+// compared to calling the property getter directly from C++ without
+// introspection or value conversion (that's the fastest we could
+// possibly hope to get).
+void tst_QScriptQObject::readMetaProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ PropertyTestObject testObject;
+ readPropertyHelper(engine, engine.newQObject(&testObject), propertyName);
+}
+
+void tst_QScriptQObject::writeMetaProperty_data()
+{
+ readMetaProperty_data();
+}
+
+// Writes a meta-object-defined property from JS. The purpose of this
+// benchmark is to measure the overhead of writing a property from JS
+// compared to calling the property setter directly from C++ without
+// introspection or value conversion (that's the fastest we could
+// possibly hope to get).
+void tst_QScriptQObject::writeMetaProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ PropertyTestObject testObject;
+ QScriptValue wrapper = engine.newQObject(&testObject);
+ QScriptValue value = wrapper.property(propertyName);
+ writePropertyHelper(engine, wrapper, propertyName, value);
+}
+
+void tst_QScriptQObject::readDynamicProperty_data()
+{
+ QTest::addColumn<QVariant>("value");
+
+ QTest::newRow("bool") << QVariant(false);
+ QTest::newRow("int") << QVariant(123);
+ QTest::newRow("double") << QVariant(double(123.0));
+ QTest::newRow("string") << QVariant(QString::fromLatin1("hello"));
+ QTest::newRow("QObject*") << qVariantFromValue((QObject*)this);
+ QTest::newRow("CustomType") << qVariantFromValue(CustomType());
+}
+
+// Reads a dynamic property from JS. The purpose of this benchmark is
+// to measure the overhead of reading a dynamic property from JS
+// versus calling QObject::property(aDynamicProperty) directly from
+// C++.
+void tst_QScriptQObject::readDynamicProperty()
+{
+ QFETCH(QVariant, value);
+
+ QObject testObject;
+ const char *propertyName = "dynamicProperty";
+ testObject.setProperty(propertyName, value);
+ QVERIFY(testObject.dynamicPropertyNames().contains(propertyName));
+
+ QScriptEngine engine;
+ readPropertyHelper(engine, engine.newQObject(&testObject), propertyName);
+}
+
+void tst_QScriptQObject::writeDynamicProperty_data()
+{
+ readDynamicProperty_data();
+}
+
+// Writes an existing dynamic property from JS. The purpose of this
+// benchmark is to measure the overhead of writing a dynamic property
+// from JS versus calling QObject::setProperty(aDynamicProperty,
+// aVariant) directly from C++.
+void tst_QScriptQObject::writeDynamicProperty()
+{
+ QFETCH(QVariant, value);
+
+ QObject testObject;
+ const char *propertyName = "dynamicProperty";
+ testObject.setProperty(propertyName, value);
+ QVERIFY(testObject.dynamicPropertyNames().contains(propertyName));
+
+ QScriptEngine engine;
+ writePropertyHelper(engine, engine.newQObject(&testObject), propertyName,
+ qScriptValueFromValue(&engine, value));
+}
+
+void tst_QScriptQObject::readMethodByName_data()
+{
+ readMethodByName_dataHelper(&SlotTestObject::staticMetaObject);
+}
+
+// Reads a meta-object-defined method from JS by name. The purpose of
+// this benchmark is to measure the overhead of resolving a method
+// from JS (effectively, creating and returning a JS wrapper function
+// object for a C++ method).
+void tst_QScriptQObject::readMethodByName()
+{
+ readMetaProperty();
+}
+
+void tst_QScriptQObject::readMethodBySignature_data()
+{
+ readMethodBySignature_dataHelper(&SlotTestObject::staticMetaObject);
+}
+
+// Reads a meta-object-defined method from JS by signature. The
+// purpose of this benchmark is to measure the overhead of resolving a
+// method from JS (effectively, creating and returning a JS wrapper
+// function object for a C++ method).
+void tst_QScriptQObject::readMethodBySignature()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ SlotTestObject testObject;
+ readPropertyHelper(engine, engine.newQObject(&testObject), propertyName, "['%0']");
+}
+
+void tst_QScriptQObject::readChild_data()
+{
+ QTest::addColumn<QString>("propertyName");
+
+ QTest::newRow("child") << "child";
+}
+
+// Reads a child object from JS. The purpose of this benchmark is to
+// measure the overhead of reading a child object from JS compared to
+// calling e.g. qFindChild() directly from C++, when the test object
+// is a plain QObject with only one child.
+void tst_QScriptQObject::readChild()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QObject testObject;
+ QObject *child = new QObject(&testObject);
+ child->setObjectName(propertyName);
+ readPropertyHelper(engine, engine.newQObject(&testObject), propertyName);
+}
+
+void tst_QScriptQObject::readOneOfManyChildren_data()
+{
+ QTest::addColumn<QString>("propertyName");
+
+ QTest::newRow("child0") << "child0";
+ QTest::newRow("child50") << "child50";
+ QTest::newRow("child99") << "child99";
+}
+
+// Reads a child object from JS for an object that has many
+// children. The purpose of this benchmark is to measure the overhead
+// of reading a child object from JS compared to calling
+// e.g. qFindChild() directly from C++.
+void tst_QScriptQObject::readOneOfManyChildren()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QObject testObject;
+ for (int i = 0; i < 100; ++i) {
+ QObject *child = new QObject(&testObject);
+ child->setObjectName(QString::fromLatin1("child%0").arg(i));
+ }
+ readPropertyHelper(engine, engine.newQObject(&testObject), propertyName);
+}
+
+void tst_QScriptQObject::readPrototypeProperty_data()
+{
+ QTest::addColumn<QString>("propertyName");
+
+ // Inherited from Object.prototype.
+ QTest::newRow("hasOwnProperty") << "hasOwnProperty";
+ QTest::newRow("isPrototypeOf") << "isPrototypeOf";
+ QTest::newRow("propertyIsEnumerable") << "propertyIsEnumerable";
+ QTest::newRow("valueOf") << "valueOf";
+}
+
+// Reads a property that's inherited from a prototype object. The
+// purpose of this benchmark is to measure the overhead of resolving a
+// prototype property (i.e., how long it takes the binding to
+// determine that the QObject doesn't have the property itself).
+void tst_QScriptQObject::readPrototypeProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ PropertyTestObject testObject;
+ readPropertyHelper(engine, engine.newQObject(&testObject), propertyName);
+}
+
+void tst_QScriptQObject::readScriptProperty_data()
+{
+ QTest::addColumn<QString>("propertyName");
+
+ QTest::newRow("scriptProperty") << "scriptProperty";
+}
+
+// Reads a JS (non-Qt) property of a wrapper object. The purpose of
+// this benchmark is to measure the overhead of reading a property
+// that only exists on the wrapper object, not on the underlying
+// QObject.
+void tst_QScriptQObject::readScriptProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ PropertyTestObject testObject;
+ QScriptValue wrapper = engine.newQObject(&testObject);
+ wrapper.setProperty(propertyName, 123);
+ QVERIFY(wrapper.property(propertyName).isValid());
+ QVERIFY(!testObject.property(propertyName.toLatin1()).isValid());
+
+ readPropertyHelper(engine, wrapper, propertyName);
+}
+
+void tst_QScriptQObject::readNoSuchProperty_data()
+{
+ QTest::addColumn<QString>("propertyName");
+
+ QTest::newRow("noSuchProperty") << "noSuchProperty";
+}
+
+// Reads a non-existing (undefined) property of a wrapper object. The
+// purpose of this benchmark is to measure the overhead of reading a
+// property that doesn't exist (i.e., how long it takes the binding to
+// determine this).
+void tst_QScriptQObject::readNoSuchProperty()
+{
+ readMetaProperty();
+}
+
+// Reads all meta-object-defined properties from JS. The purpose of
+// this benchmark is to measure the overhead of reading different
+// properties in sequence, not just the same one repeatedly (like
+// readMetaProperty() does).
+void tst_QScriptQObject::readAllMetaProperties()
+{
+ PropertyTestObject testObject;
+ readAllMetaPropertiesHelper(&testObject);
+}
+
+void tst_QScriptQObject::callSlot_data()
+{
+ QTest::addColumn<QString>("propertyName");
+ QTest::addColumn<QString>("arguments");
+
+ QTest::newRow("voidSlot()") << "voidSlot" << "";
+
+ QTest::newRow("boolSlot(true)") << "boolSlot" << "true";
+ QTest::newRow("intSlot(123)") << "intSlot" << "123";
+ QTest::newRow("doubleSlot(123)") << "doubleSlot" << "123";
+ QTest::newRow("stringSlot('hello')") << "stringSlot" << "'hello'";
+ QTest::newRow("variantSlot(123)") << "variantSlot" << "123";
+ QTest::newRow("qobjectSlot(this)") << "qobjectSlot" << "this"; // assumes 'this' is a QObject
+
+ QTest::newRow("returnBoolSlot()") << "returnBoolSlot" << "";
+ QTest::newRow("returnIntSlot()") << "returnIntSlot" << "";
+ QTest::newRow("returnDoubleSlot()") << "returnDoubleSlot" << "";
+ QTest::newRow("returnStringSlot()") << "returnStringSlot" << "";
+ QTest::newRow("returnVariantSlot()") << "returnVariantSlot" << "";
+ QTest::newRow("returnQObjectSlot()") << "returnQObjectSlot" << "";
+ QTest::newRow("returnCustomTypeSlot()") << "returnCustomTypeSlot" << "";
+
+ // Implicit conversion.
+ QTest::newRow("boolSlot(0)") << "boolSlot" << "0";
+ QTest::newRow("intSlot('123')") << "intSlot" << "'123'";
+ QTest::newRow("doubleSlot('123')") << "doubleSlot" << "'123'";
+ QTest::newRow("stringSlot(123)") << "stringSlot" << "123";
+
+ // Many arguments.
+ QTest::newRow("fourDoubleSlot(1,2,3,4)") << "fourDoubleSlot" << "1,2,3,4";
+ QTest::newRow("sixDoubleSlot(1,2,3,4,5,6)") << "sixDoubleSlot" << "1,2,3,4,5,6";
+ QTest::newRow("eightDoubleSlot(1,2,3,4,5,6,7,8)") << "eightDoubleSlot" << "1,2,3,4,5,6,7,8";
+
+ QTest::newRow("fourStringSlot('a','b','c','d')") << "fourStringSlot" << "'a','b','c','d'";
+ QTest::newRow("sixStringSlot('a','b','c','d','e','f')") << "sixStringSlot" << "'a','b','c','d','e','f'";
+ QTest::newRow("eightStringSlot('a','b','c','d','e','f','g','h')") << "eightStringSlot" << "'a','b','c','d','e','f','g','h'";
+}
+
+// Calls a slot from JS. The purpose of this benchmark is to measure
+// the overhead of calling a slot from JS compared to calling the slot
+// directly from C++ without introspection or value conversion (that's
+// the fastest we could possibly hope to get). The slots themselves
+// don't do any work.
+void tst_QScriptQObject::callSlot()
+{
+ QFETCH(QString, propertyName);
+ QFETCH(QString, arguments);
+
+ QScriptEngine engine;
+ SlotTestObject testObject;
+ callMethodHelper(engine, &testObject, propertyName, arguments);
+}
+
+void tst_QScriptQObject::callOverloadedSlot_data()
+{
+ QTest::addColumn<QString>("propertyName");
+ QTest::addColumn<QString>("arguments");
+
+ QTest::newRow("overloadedSlot()") << "overloadedSlot" << "";
+ QTest::newRow("overloadedSlot(true)") << "overloadedSlot" << "true";
+ QTest::newRow("overloadedSlot(123)") << "overloadedSlot" << "123";
+ QTest::newRow("overloadedSlot('hello')") << "overloadedSlot" << "'hello'";
+}
+
+// Calls an overloaded slot from JS. The purpose of this benchmark is
+// to measure the overhead of calling an overloaded slot from JS
+// compared to calling the overloaded slot directly from C++ without
+// introspection or value conversion (that's the fastest we could
+// possibly hope to get).
+void tst_QScriptQObject::callOverloadedSlot()
+{
+ QFETCH(QString, propertyName);
+ QFETCH(QString, arguments);
+
+ QScriptEngine engine;
+ OverloadedSlotTestObject testObject;
+ callMethodHelper(engine, &testObject, propertyName, arguments);
+}
+
+// Benchmarks for JS signal handling. The purpose of these benchmarks
+// is to measure the overhead of dispatching a Qt signal to JS code
+// compared to a normal C++ signal-to-slot dispatch.
+
+void tst_QScriptQObject::voidSignalHandler()
+{
+ SignalTestObject testObject;
+ QScriptEngine engine;
+ signalHandlerHelper(engine, &testObject, SIGNAL(voidSignal()));
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ testObject.emitVoidSignal();
+ }
+}
+
+void tst_QScriptQObject::boolSignalHandler()
+{
+ SignalTestObject testObject;
+ QScriptEngine engine;
+ signalHandlerHelper(engine, &testObject, SIGNAL(boolSignal(bool)));
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ testObject.emitBoolSignal(true);
+ }
+}
+
+void tst_QScriptQObject::intSignalHandler()
+{
+ SignalTestObject testObject;
+ QScriptEngine engine;
+ signalHandlerHelper(engine, &testObject, SIGNAL(intSignal(int)));
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ testObject.emitIntSignal(123);
+ }
+}
+
+void tst_QScriptQObject::doubleSignalHandler()
+{
+ SignalTestObject testObject;
+ QScriptEngine engine;
+ signalHandlerHelper(engine, &testObject, SIGNAL(doubleSignal(double)));
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ testObject.emitDoubleSignal(123.0);
+ }
+}
+
+void tst_QScriptQObject::stringSignalHandler()
+{
+ SignalTestObject testObject;
+ QScriptEngine engine;
+ signalHandlerHelper(engine, &testObject, SIGNAL(stringSignal(QString)));
+ QString value = QString::fromLatin1("hello");
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ testObject.emitStringSignal(value);
+ }
+}
+
+void tst_QScriptQObject::variantSignalHandler()
+{
+ SignalTestObject testObject;
+ QScriptEngine engine;
+ signalHandlerHelper(engine, &testObject, SIGNAL(variantSignal(QVariant)));
+ QVariant value = 123;
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ testObject.emitVariantSignal(value);
+ }
+}
+
+void tst_QScriptQObject::qobjectSignalHandler()
+{
+ SignalTestObject testObject;
+ QScriptEngine engine;
+ signalHandlerHelper(engine, &testObject, SIGNAL(qobjectSignal(QObject*)));
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ testObject.emitQObjectSignal(this);
+ }
+}
+
+void tst_QScriptQObject::customTypeSignalHandler()
+{
+ SignalTestObject testObject;
+ QScriptEngine engine;
+ signalHandlerHelper(engine, &testObject, SIGNAL(customTypeSignal(CustomType)));
+ CustomType value;
+ QBENCHMARK {
+ for (int i = 0; i < ITERATION_COUNT; ++i)
+ testObject.emitCustomTypeSignal(value);
+ }
+}
+
+void tst_QScriptQObject::emitSignal_data()
+{
+ QTest::addColumn<QString>("propertyName");
+ QTest::addColumn<QString>("arguments");
+
+ QTest::newRow("voidSignal()") << "voidSignal" << "";
+
+ QTest::newRow("boolSignal(true)") << "boolSignal" << "true";
+ QTest::newRow("intSignal(123)") << "intSignal" << "123";
+ QTest::newRow("doubleSignal(123)") << "doubleSignal" << "123";
+ QTest::newRow("stringSignal('hello')") << "stringSignal" << "'hello'";
+ QTest::newRow("variantSignal(123)") << "variantSignal" << "123";
+ QTest::newRow("qobjectSignal(this)") << "qobjectSignal" << "this"; // assumes 'this' is a QObject
+}
+
+void tst_QScriptQObject::emitSignal()
+{
+ QFETCH(QString, propertyName);
+ QFETCH(QString, arguments);
+
+ QScriptEngine engine;
+ SignalTestObject testObject;
+ callMethodHelper(engine, &testObject, propertyName, arguments);
+}
+
+void tst_QScriptQObject::readButtonMetaProperty_data()
+{
+ readMetaProperty_dataHelper(&QPushButton::staticMetaObject);
+}
+
+// Reads a meta-object-defined property from JS. The purpose of this
+// benchmark is to measure the overhead of reading a property from JS
+// compared to calling the property getter directly from C++ without
+// introspection or value conversion (that's the fastest we could
+// possibly hope to get).
+void tst_QScriptQObject::readButtonMetaProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QPushButton pb;
+ readPropertyHelper(engine, engine.newQObject(&pb), propertyName);
+}
+
+void tst_QScriptQObject::writeButtonMetaProperty_data()
+{
+ readButtonMetaProperty_data();
+}
+
+// Writes a meta-object-defined property from JS. The purpose of this
+// benchmark is to measure the overhead of writing a property from JS
+// compared to calling the property setter directly from C++ without
+// introspection or value conversion (that's the fastest we could
+// possibly hope to get).
+void tst_QScriptQObject::writeButtonMetaProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QPushButton pb;
+ QVariant value = pb.property(propertyName.toLatin1());
+ writePropertyHelper(engine, engine.newQObject(&pb), propertyName,
+ qScriptValueFromValue(&engine, value));
+}
+
+void tst_QScriptQObject::readDynamicButtonProperty_data()
+{
+ readDynamicProperty_data();
+}
+
+// Reads a dynamic property from JS. The purpose of this benchmark is
+// to measure the overhead of reading a dynamic property from JS
+// versus calling QObject::property(aDynamicProperty) directly from
+// C++.
+void tst_QScriptQObject::readDynamicButtonProperty()
+{
+ QFETCH(QVariant, value);
+
+ QPushButton pb;
+ const char *propertyName = "dynamicProperty";
+ pb.setProperty(propertyName, value);
+ QVERIFY(pb.dynamicPropertyNames().contains(propertyName));
+
+ QScriptEngine engine;
+ readPropertyHelper(engine, engine.newQObject(&pb), propertyName);
+}
+
+void tst_QScriptQObject::writeDynamicButtonProperty_data()
+{
+ readDynamicButtonProperty_data();
+}
+
+// Writes an existing dynamic property from JS. The purpose of this
+// benchmark is to measure the overhead of writing a dynamic property
+// from JS versus calling QObject::setProperty(aDynamicProperty,
+// aVariant) directly from C++.
+void tst_QScriptQObject::writeDynamicButtonProperty()
+{
+ QFETCH(QVariant, value);
+
+ QPushButton pb;
+ const char *propertyName = "dynamicProperty";
+ pb.setProperty(propertyName, value);
+ QVERIFY(pb.dynamicPropertyNames().contains(propertyName));
+
+ QScriptEngine engine;
+ writePropertyHelper(engine, engine.newQObject(&pb), propertyName,
+ qScriptValueFromValue(&engine, value));
+}
+
+void tst_QScriptQObject::readButtonMethodByName_data()
+{
+ readMethodByName_dataHelper(&QPushButton::staticMetaObject);
+}
+
+// Reads a meta-object-defined method from JS by name. The purpose of
+// this benchmark is to measure the overhead of resolving a method
+// from JS (effectively, creating and returning a JS wrapper function
+// object for a C++ method).
+void tst_QScriptQObject::readButtonMethodByName()
+{
+ readButtonMetaProperty();
+}
+
+void tst_QScriptQObject::readButtonMethodBySignature_data()
+{
+ readMethodBySignature_dataHelper(&QPushButton::staticMetaObject);
+}
+
+// Reads a meta-object-defined method from JS by signature. The
+// purpose of this benchmark is to measure the overhead of resolving a
+// method from JS (effectively, creating and returning a JS wrapper
+// function object for a C++ method).
+void tst_QScriptQObject::readButtonMethodBySignature()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QPushButton pb;
+ readPropertyHelper(engine, engine.newQObject(&pb), propertyName, "['%0']");
+}
+
+void tst_QScriptQObject::readButtonChild_data()
+{
+ QTest::addColumn<QString>("propertyName");
+
+ QTest::newRow("child") << "child";
+}
+
+// Reads a child object from JS. The purpose of this benchmark is to
+// measure the overhead of reading a child object from JS compared to
+// calling e.g. qFindChild() directly from C++.
+void tst_QScriptQObject::readButtonChild()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QPushButton pb;
+ QObject *child = new QObject(&pb);
+ child->setObjectName(propertyName);
+ readPropertyHelper(engine, engine.newQObject(&pb), propertyName);
+}
+
+void tst_QScriptQObject::readButtonPrototypeProperty_data()
+{
+ readPrototypeProperty_data();
+}
+
+// Reads a property that's inherited from a prototype object. The
+// purpose of this benchmark is to measure the overhead of resolving a
+// prototype property (i.e., how long does it take the binding to
+// determine that the QObject doesn't have the property itself).
+void tst_QScriptQObject::readButtonPrototypeProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QPushButton pb;
+ readPropertyHelper(engine, engine.newQObject(&pb), propertyName);
+}
+
+void tst_QScriptQObject::readButtonScriptProperty_data()
+{
+ readScriptProperty_data();
+}
+
+// Reads a JS (non-Qt) property of a wrapper object. The purpose of
+// this benchmark is to measure the overhead of reading a property
+// that only exists on the wrapper object, not on the underlying
+// QObject.
+void tst_QScriptQObject::readButtonScriptProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QPushButton pb;
+ QScriptValue wrapper = engine.newQObject(&pb);
+ wrapper.setProperty(propertyName, 123);
+ QVERIFY(wrapper.property(propertyName).isValid());
+ QVERIFY(!pb.property(propertyName.toLatin1()).isValid());
+
+ readPropertyHelper(engine, wrapper, propertyName);
+}
+
+void tst_QScriptQObject::readNoSuchButtonProperty_data()
+{
+ readNoSuchProperty_data();
+}
+
+// Reads a non-existing (undefined) property of a wrapper object. The
+// purpose of this benchmark is to measure the overhead of reading a
+// property that doesn't exist (i.e., how long does it take the
+// binding to determine that it doesn't exist).
+void tst_QScriptQObject::readNoSuchButtonProperty()
+{
+ readButtonMetaProperty();
+}
+
+void tst_QScriptQObject::callButtonMethod_data()
+{
+ QTest::addColumn<QString>("propertyName");
+ QTest::addColumn<QString>("arguments");
+
+ QTest::newRow("click()") << "click" << "";
+ QTest::newRow("animateClick(50)") << "animateClick" << "10";
+ QTest::newRow("setChecked(true)") << "setChecked" << "true";
+ QTest::newRow("close()") << "close" << "";
+ QTest::newRow("setWindowTitle('foo')") << "setWindowTitle" << "'foo'";
+}
+
+// Calls a slot from JS. The purpose of this benchmark is to measure
+// the overhead of calling a slot from JS compared to calling the slot
+// directly from C++ without introspection or value conversion (that's
+// the fastest we could possibly hope to get).
+void tst_QScriptQObject::callButtonMethod()
+{
+ QFETCH(QString, propertyName);
+ QFETCH(QString, arguments);
+
+ QScriptEngine engine;
+ QPushButton pb;
+ callMethodHelper(engine, &pb, propertyName, arguments);
+}
+
+// Reads all meta-object-defined properties from JS. The purpose of
+// this benchmark is to measure the overhead of reading different
+// properties in sequence, not just the same one repeatedly (like
+// readButtonMetaProperty() does).
+void tst_QScriptQObject::readAllButtonMetaProperties()
+{
+ QPushButton pb;
+ readAllMetaPropertiesHelper(&pb);
+}
+
+void tst_QScriptQObject::readQScriptableMetaProperty_data()
+{
+ readMetaProperty_dataHelper(&QtScriptablePropertyTestObject::staticMetaObject);
+}
+
+// Reads a meta-object-defined property from JS for an object that
+// subclasses QScriptable. The purpose of this benchmark is to measure
+// the overhead compared to reading a property of a non-QScriptable
+// (see readMetaProperty()).
+void tst_QScriptQObject::readQScriptableMetaProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QtScriptablePropertyTestObject testObject;
+ readPropertyHelper(engine, engine.newQObject(&testObject), propertyName);
+}
+
+void tst_QScriptQObject::writeQScriptableMetaProperty_data()
+{
+ readMetaProperty_data();
+}
+
+// Writes a meta-object-defined property from JS for an object that
+// subclasses QScriptable. The purpose of this benchmark is to measure
+// the overhead compared to writing a property of a non-QScriptable
+// object (see writeMetaProperty()).
+void tst_QScriptQObject::writeQScriptableMetaProperty()
+{
+ QFETCH(QString, propertyName);
+
+ QScriptEngine engine;
+ QtScriptablePropertyTestObject testObject;
+ QVariant value = testObject.property(propertyName.toLatin1());
+ writePropertyHelper(engine, engine.newQObject(&testObject), propertyName,
+ qScriptValueFromValue(&engine, value));
+}
+
+void tst_QScriptQObject::callQScriptableSlot_data()
+{
+ callSlot_data();
+}
+
+// Calls a slot from JS for an object that subclasses QScriptable. The
+// purpose of this benchmark is to measure the overhead compared to
+// calling a slot of a non-QScriptable object (see callSlot()).
+void tst_QScriptQObject::callQScriptableSlot()
+{
+ QFETCH(QString, propertyName);
+ QFETCH(QString, arguments);
+
+ QScriptEngine engine;
+ QtScriptableSlotTestObject testObject;
+ callMethodHelper(engine, &testObject, propertyName, arguments);
+}
+
+QTEST_MAIN(tst_QScriptQObject)
+#include "tst_qscriptqobject.moc"
diff --git a/tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp b/tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp
index 884c385dd5..f3bd745f36 100644
--- a/tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp
@@ -42,6 +42,8 @@
#include <qtest.h>
#include <QtScript>
+Q_DECLARE_METATYPE(QScriptValue)
+
//TESTED_FILES=
class tst_QScriptValue : public QObject
@@ -57,28 +59,133 @@ public slots:
void cleanup();
private slots:
+ void boolConstructor();
+ void floatConstructor();
void numberConstructor();
void stringConstructor();
+ void nullConstructor();
+ void undefinedConstructor();
+ void boolConstructorWithEngine();
+ void floatConstructorWithEngine();
+ void intConstructorWithEngine();
+ void stringConstructorWithEngine();
+ void nullConstructorWithEngine();
+ void undefinedConstructorWithEngine();
+ void copyConstructor_data();
+ void copyConstructor();
void call_data();
void call();
void construct_data();
void construct();
+ void data();
+ void setData();
+ void data_noData_data();
+ void data_noData();
+ void engine_data();
+ void engine();
+ void equalsSelf_data();
+ void equalsSelf();
+ void lessThanSelf_data();
+ void lessThanSelf();
+ void strictlyEqualsSelf_data();
+ void strictlyEqualsSelf();
+ void instanceOf();
+ void isArray_data();
+ void isArray();
+ void isBool_data();
+ void isBool();
+ void isDate_data();
+ void isDate();
+ void isError_data();
+ void isError();
+ void isFunction_data();
+ void isFunction();
+ void isNull_data();
+ void isNull();
+ void isNumber_data();
+ void isNumber();
+ void isObject_data();
+ void isObject();
+ void isQMetaObject_data();
+ void isQMetaObject();
+ void isQObject_data();
+ void isQObject();
+ void isRegExp_data();
+ void isRegExp();
+ void isString_data();
+ void isString();
+ void isUndefined_data();
+ void isUndefined();
+ void isValid_data();
+ void isValid();
+ void isVariant_data();
+ void isVariant();
+ void toBool_data();
+ void toBool();
+ void toDateTime_data();
+ void toDateTime();
+ void toInt32_data();
+ void toInt32();
+ void toInteger_data();
+ void toInteger();
+ void toNumber_data();
+ void toNumber();
+ void toRegExp_data();
+ void toRegExp();
void toString_data();
void toString();
+ void toUInt16_data();
+ void toUInt16();
+ void toUInt32_data();
+ void toUInt32();
+ void toQMetaObject_data();
+ void toQMetaObject();
+ void toQObject_data();
void toQObject();
+ void toVariant_data();
+ void toVariant();
+ void property_data();
void property();
+ void propertyById_data();
+ void propertyById();
+ void propertyByIndex();
+ void setProperty_data();
void setProperty();
+ void setPropertyById_data();
+ void setPropertyById();
+ void setPropertyByIndex();
+ void propertyFlags_data();
void propertyFlags();
+ void propertyFlagsById_data();
+ void propertyFlagsById();
+ void prototype_data();
+ void prototype();
+ void setPrototype();
+ void scriptClass_data();
+ void scriptClass();
+ void setScriptClass();
void readMetaProperty();
void writeMetaProperty();
+
+private:
+ void defineStandardTestValues();
+ void newEngine()
+ {
+ delete m_engine;
+ m_engine = new QScriptEngine;
+ }
+
+ QScriptEngine *m_engine;
};
tst_QScriptValue::tst_QScriptValue()
+ : m_engine(0)
{
}
tst_QScriptValue::~tst_QScriptValue()
{
+ delete m_engine;
}
void tst_QScriptValue::init()
@@ -89,6 +196,20 @@ void tst_QScriptValue::cleanup()
{
}
+void tst_QScriptValue::boolConstructor()
+{
+ QBENCHMARK {
+ QScriptValue val(true);
+ }
+}
+
+void tst_QScriptValue::floatConstructor()
+{
+ QBENCHMARK {
+ QScriptValue val(123.0);
+ }
+}
+
void tst_QScriptValue::numberConstructor()
{
QBENCHMARK {
@@ -104,8 +225,85 @@ void tst_QScriptValue::stringConstructor()
}
}
+void tst_QScriptValue::nullConstructor()
+{
+ QBENCHMARK {
+ QScriptValue val(QScriptValue::NullValue);
+ }
+}
+
+void tst_QScriptValue::undefinedConstructor()
+{
+ QBENCHMARK {
+ QScriptValue val(QScriptValue::UndefinedValue);
+ }
+}
+
+void tst_QScriptValue::boolConstructorWithEngine()
+{
+ newEngine();
+ QBENCHMARK {
+ QScriptValue val(m_engine, true);
+ }
+}
+
+void tst_QScriptValue::floatConstructorWithEngine()
+{
+ newEngine();
+ QBENCHMARK {
+ QScriptValue val(m_engine, 123.0);
+ }
+}
+
+void tst_QScriptValue::intConstructorWithEngine()
+{
+ newEngine();
+ QBENCHMARK {
+ (void)QScriptValue(m_engine, 123);
+ }
+}
+
+void tst_QScriptValue::stringConstructorWithEngine()
+{
+ newEngine();
+ QString str = QString::fromLatin1("ciao");
+ QBENCHMARK {
+ (void)QScriptValue(m_engine, str);
+ }
+}
+
+void tst_QScriptValue::nullConstructorWithEngine()
+{
+ newEngine();
+ QBENCHMARK {
+ QScriptValue val(m_engine, QScriptValue::NullValue);
+ }
+}
+
+void tst_QScriptValue::undefinedConstructorWithEngine()
+{
+ newEngine();
+ QBENCHMARK {
+ QScriptValue val(m_engine, QScriptValue::UndefinedValue);
+ }
+}
+
+void tst_QScriptValue::copyConstructor_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::copyConstructor()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ QScriptValue copy(val);
+ }
+}
+
void tst_QScriptValue::call_data()
{
+ newEngine();
QTest::addColumn<QString>("code");
QTest::newRow("empty function") << QString::fromLatin1("(function(){})");
QTest::newRow("function returning number") << QString::fromLatin1("(function(){ return 123; })");
@@ -115,8 +313,7 @@ void tst_QScriptValue::call_data()
void tst_QScriptValue::call()
{
QFETCH(QString, code);
- QScriptEngine engine;
- QScriptValue fun = engine.evaluate(code);
+ QScriptValue fun = m_engine->evaluate(code);
QVERIFY(fun.isFunction());
QBENCHMARK {
(void)fun.call();
@@ -125,6 +322,7 @@ void tst_QScriptValue::call()
void tst_QScriptValue::construct_data()
{
+ newEngine();
QTest::addColumn<QString>("code");
QTest::newRow("empty function") << QString::fromLatin1("(function(){})");
QTest::newRow("simple constructor") << QString::fromLatin1("(function(){ this.x = 10; this.y = 20; })");
@@ -133,81 +331,646 @@ void tst_QScriptValue::construct_data()
void tst_QScriptValue::construct()
{
QFETCH(QString, code);
- QScriptEngine engine;
- QScriptValue fun = engine.evaluate(code);
+ QScriptValue fun = m_engine->evaluate(code);
QVERIFY(fun.isFunction());
QBENCHMARK {
(void)fun.construct();
}
}
+void tst_QScriptValue::data()
+{
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ obj.setData(QScriptValue(m_engine, 123));
+ QBENCHMARK {
+ obj.data();
+ }
+}
+
+void tst_QScriptValue::setData()
+{
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ QScriptValue val(m_engine, 123);
+ QBENCHMARK {
+ obj.setData(val);
+ }
+}
+
+void tst_QScriptValue::data_noData_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::data_noData()
+{
+ QFETCH(QScriptValue, val);
+ QVERIFY(!val.data().isValid());
+ QBENCHMARK {
+ val.data();
+ }
+}
+
+void tst_QScriptValue::engine_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::engine()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.engine();
+ }
+}
+
+void tst_QScriptValue::equalsSelf_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::equalsSelf()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.equals(val);
+ }
+}
+
+void tst_QScriptValue::lessThanSelf_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::lessThanSelf()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.lessThan(val);
+ }
+}
+
+void tst_QScriptValue::strictlyEqualsSelf_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::strictlyEqualsSelf()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.strictlyEquals(val);
+ }
+}
+
+void tst_QScriptValue::instanceOf()
+{
+ newEngine();
+ QScriptValue arrayCtor = m_engine->globalObject().property("Array");
+ QScriptValue array = arrayCtor.construct();
+ QVERIFY(array.instanceOf(arrayCtor));
+ QBENCHMARK {
+ array.instanceOf(arrayCtor);
+ }
+}
+
+void tst_QScriptValue::isArray_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isArray()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isArray();
+ }
+}
+
+void tst_QScriptValue::isBool_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isBool()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isBool();
+ }
+}
+
+void tst_QScriptValue::isDate_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isDate()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isDate();
+ }
+}
+
+void tst_QScriptValue::isError_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isError()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isError();
+ }
+}
+
+void tst_QScriptValue::isFunction_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isFunction()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isFunction();
+ }
+}
+
+void tst_QScriptValue::isNull_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isNull()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isNull();
+ }
+}
+
+void tst_QScriptValue::isNumber_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isNumber()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isNumber();
+ }
+}
+
+void tst_QScriptValue::isObject_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isObject()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isObject();
+ }
+}
+
+void tst_QScriptValue::isQMetaObject_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isQMetaObject()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isQMetaObject();
+ }
+}
+
+void tst_QScriptValue::isQObject_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isQObject()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isQObject();
+ }
+}
+
+void tst_QScriptValue::isRegExp_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isRegExp()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isRegExp();
+ }
+}
+
+void tst_QScriptValue::isString_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isString()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isString();
+ }
+}
+
+void tst_QScriptValue::isUndefined_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isUndefined()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isUndefined();
+ }
+}
+
+void tst_QScriptValue::isValid_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isValid()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isValid();
+ }
+}
+
+void tst_QScriptValue::isVariant_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::isVariant()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.isVariant();
+ }
+}
+
+void tst_QScriptValue::toBool_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toBool()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toBool();
+ }
+}
+
+void tst_QScriptValue::toDateTime_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toDateTime()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toDateTime();
+ }
+}
+
+void tst_QScriptValue::toInt32_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toInt32()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toInt32();
+ }
+}
+
+void tst_QScriptValue::toInteger_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toInteger()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toInteger();
+ }
+}
+
+void tst_QScriptValue::toNumber_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toNumber()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toNumber();
+ }
+}
+
+void tst_QScriptValue::toRegExp_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toRegExp()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toRegExp();
+ }
+}
+
void tst_QScriptValue::toString_data()
{
- QTest::addColumn<QString>("code");
- QTest::newRow("number") << QString::fromLatin1("123");
- QTest::newRow("string") << QString::fromLatin1("'ciao'");
- QTest::newRow("null") << QString::fromLatin1("null");
- QTest::newRow("undefined") << QString::fromLatin1("undefined");
- QTest::newRow("function") << QString::fromLatin1("(function foo(a, b, c) { return a + b + c; })");
+ defineStandardTestValues();
}
void tst_QScriptValue::toString()
{
- QFETCH(QString, code);
- QScriptEngine engine;
- QScriptValue val = engine.evaluate(code);
+ QFETCH(QScriptValue, val);
QBENCHMARK {
(void)val.toString();
}
}
+void tst_QScriptValue::toQMetaObject_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toQMetaObject()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toQMetaObject();
+ }
+}
+
+void tst_QScriptValue::toQObject_data()
+{
+ defineStandardTestValues();
+}
+
void tst_QScriptValue::toQObject()
{
- QScriptEngine engine;
- QScriptValue obj = engine.newQObject(QCoreApplication::instance());
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ (void)val.toQObject();
+ }
+}
+
+void tst_QScriptValue::toUInt16_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toUInt16()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toUInt16();
+ }
+}
+
+void tst_QScriptValue::toUInt32_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toUInt32()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.toUInt32();
+ }
+}
+
+void tst_QScriptValue::toVariant_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::toVariant()
+{
+ QFETCH(QScriptValue, val);
QBENCHMARK {
- (void)obj.toQObject();
+ val.toVariant();
}
}
+void tst_QScriptValue::property_data()
+{
+ QTest::addColumn<QString>("propertyName");
+ QTest::addColumn<bool>("create");
+ QTest::newRow("foo") << QString::fromLatin1("foo") << true;
+ QTest::newRow("hasOwnProperty") << QString::fromLatin1("hasOwnProperty") << false; // From Object.prototype.
+ QTest::newRow("noSuchProperty") << QString::fromLatin1("noSuchProperty") << false;
+}
void tst_QScriptValue::property()
{
- QScriptEngine engine;
- QScriptValue obj = engine.newObject();
- QString propertyName = QString::fromLatin1("foo");
- obj.setProperty(propertyName, 123);
+ QFETCH(QString, propertyName);
+ QFETCH(bool, create);
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ if (create)
+ obj.setProperty(propertyName, 123);
QBENCHMARK {
(void)obj.property(propertyName);
}
}
+void tst_QScriptValue::propertyById_data()
+{
+ property_data();
+}
+
+void tst_QScriptValue::propertyById()
+{
+ QFETCH(QString, propertyName);
+ QFETCH(bool, create);
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ QScriptString id = m_engine->toStringHandle(propertyName);
+ if (create)
+ obj.setProperty(id, 123);
+ QBENCHMARK {
+ obj.property(id);
+ }
+}
+
+void tst_QScriptValue::propertyByIndex()
+{
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ obj.setProperty(123, 456);
+ QBENCHMARK {
+ obj.property(123);
+ }
+}
+
+void tst_QScriptValue::setProperty_data()
+{
+ newEngine();
+ QTest::addColumn<QString>("propertyName");
+ QTest::addColumn<QScriptValue>("val");
+ QTest::newRow("foo") << QString::fromLatin1("foo") << QScriptValue(123);
+ QTest::newRow("bar") << QString::fromLatin1("bar") << QScriptValue(m_engine, 123);
+ QTest::newRow("baz") << QString::fromLatin1("baz") << QScriptValue();
+ QTest::newRow("toString") << QString::fromLatin1("toString") << QScriptValue(m_engine, true);
+}
+
void tst_QScriptValue::setProperty()
{
- QScriptEngine engine;
- QScriptValue obj = engine.newObject();
- QString propertyName = QString::fromLatin1("foo");
- QScriptValue val(123);
+ QFETCH(QString, propertyName);
+ QFETCH(QScriptValue, val);
+ QScriptValue obj = m_engine->newObject();
QBENCHMARK {
obj.setProperty(propertyName, val);
}
}
+void tst_QScriptValue::setPropertyById_data()
+{
+ setProperty_data();
+}
+
+void tst_QScriptValue::setPropertyById()
+{
+ QFETCH(QString, propertyName);
+ QFETCH(QScriptValue, val);
+ QScriptValue obj = m_engine->newObject();
+ QScriptString id = m_engine->toStringHandle(propertyName);
+ QBENCHMARK {
+ obj.setProperty(id, val);
+ }
+}
+
+void tst_QScriptValue::setPropertyByIndex()
+{
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ QScriptValue val(456);
+ QBENCHMARK {
+ obj.setProperty(123, 456);
+ }
+}
+
+void tst_QScriptValue::propertyFlags_data()
+{
+ property_data();
+}
+
void tst_QScriptValue::propertyFlags()
{
- QScriptEngine engine;
- QScriptValue obj = engine.newObject();
- QString propertyName = QString::fromLatin1("foo");
- obj.setProperty(propertyName, 123, QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
+ QFETCH(QString, propertyName);
+ QFETCH(bool, create);
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ if (create)
+ obj.setProperty(propertyName, 123, QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
QBENCHMARK {
(void)obj.propertyFlags(propertyName);
}
}
+void tst_QScriptValue::propertyFlagsById_data()
+{
+ propertyFlags_data();
+}
+
+void tst_QScriptValue::propertyFlagsById()
+{
+ QFETCH(QString, propertyName);
+ QFETCH(bool, create);
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ QScriptString id = m_engine->toStringHandle(propertyName);
+ if (create)
+ obj.setProperty(id, 123, QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
+ QBENCHMARK {
+ obj.propertyFlags(id);
+ }
+}
+
+void tst_QScriptValue::prototype_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::prototype()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.prototype();
+ }
+}
+
+void tst_QScriptValue::setPrototype()
+{
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ QScriptValue proto = m_engine->newObject();
+ QBENCHMARK {
+ obj.setPrototype(proto);
+ }
+}
+
+void tst_QScriptValue::scriptClass_data()
+{
+ defineStandardTestValues();
+}
+
+void tst_QScriptValue::scriptClass()
+{
+ QFETCH(QScriptValue, val);
+ QBENCHMARK {
+ val.scriptClass();
+ }
+}
+
+void tst_QScriptValue::setScriptClass()
+{
+ newEngine();
+ QScriptValue obj = m_engine->newObject();
+ QScriptClass cls(m_engine);
+ QBENCHMARK {
+ obj.setScriptClass(&cls);
+ }
+}
+
void tst_QScriptValue::readMetaProperty()
{
- QScriptEngine engine;
- QScriptValue object = engine.newQObject(QCoreApplication::instance());
- QScriptString propertyName = engine.toStringHandle("objectName");
+ newEngine();
+ QScriptValue object = m_engine->newQObject(QCoreApplication::instance());
+ QScriptString propertyName = m_engine->toStringHandle("objectName");
QBENCHMARK {
for (int i = 0; i < 10000; ++i)
object.property(propertyName);
@@ -216,15 +979,44 @@ void tst_QScriptValue::readMetaProperty()
void tst_QScriptValue::writeMetaProperty()
{
- QScriptEngine engine;
- QScriptValue object = engine.newQObject(QCoreApplication::instance());
- QScriptString propertyName = engine.toStringHandle("objectName");
- QScriptValue value(&engine, "foo");
+ newEngine();
+ QScriptValue object = m_engine->newQObject(QCoreApplication::instance());
+ QScriptString propertyName = m_engine->toStringHandle("objectName");
+ QScriptValue value(m_engine, "foo");
QBENCHMARK {
for (int i = 0; i < 10000; ++i)
object.setProperty(propertyName, value);
}
}
+void tst_QScriptValue::defineStandardTestValues()
+{
+ newEngine();
+ QTest::addColumn<QScriptValue>("val");
+ QTest::newRow("bool") << m_engine->evaluate("true");
+ QTest::newRow("number") << m_engine->evaluate("123");
+ QTest::newRow("string") << m_engine->evaluate("'ciao'");
+ QTest::newRow("null") << m_engine->evaluate("null");
+ QTest::newRow("undefined") << m_engine->evaluate("undefined");
+ QTest::newRow("object") << m_engine->evaluate("({foo:123})");
+ QTest::newRow("array") << m_engine->evaluate("[10,20,30]");
+ QTest::newRow("function") << m_engine->evaluate("(function foo(a, b, c) { return a + b + c; })");
+ QTest::newRow("date") << m_engine->evaluate("new Date");
+ QTest::newRow("regexp") << m_engine->evaluate("new RegExp('foo')");
+ QTest::newRow("error") << m_engine->evaluate("new Error");
+
+ QTest::newRow("qobject") << m_engine->newQObject(this);
+ QTest::newRow("qmetaobject") << m_engine->newQMetaObject(&QScriptEngine::staticMetaObject);
+ QTest::newRow("variant") << m_engine->newVariant(123);
+ QTest::newRow("qscriptclassobject") << m_engine->newObject(new QScriptClass(m_engine));
+
+ QTest::newRow("invalid") << QScriptValue();
+ QTest::newRow("bool-no-engine") << QScriptValue(true);
+ QTest::newRow("number-no-engine") << QScriptValue(123.0);
+ QTest::newRow("string-no-engine") << QScriptValue(QString::fromLatin1("hello"));
+ QTest::newRow("null-no-engine") << QScriptValue(QScriptValue::NullValue);
+ QTest::newRow("undefined-no-engine") << QScriptValue(QScriptValue::UndefinedValue);
+}
+
QTEST_MAIN(tst_QScriptValue)
#include "tst_qscriptvalue.moc"
diff --git a/tests/benchmarks/script/script.pro b/tests/benchmarks/script/script.pro
index 8d689b618f..dd17012700 100644
--- a/tests/benchmarks/script/script.pro
+++ b/tests/benchmarks/script/script.pro
@@ -2,4 +2,13 @@ TEMPLATE = subdirs
SUBDIRS = \
qscriptclass \
qscriptengine \
- qscriptvalue
+ qscriptvalue \
+ sunspider \
+ v8
+
+TRUSTED_BENCHMARKS += \
+ qscriptclass \
+ qscriptvalue \
+ qscriptengine
+
+include(../trusted-benchmarks.pri) \ No newline at end of file
diff --git a/tests/benchmarks/script/sunspider/sunspider.pro b/tests/benchmarks/script/sunspider/sunspider.pro
new file mode 100644
index 0000000000..dce3855569
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/sunspider.pro
@@ -0,0 +1,12 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_sunspider
+RESOURCES += sunspider.qrc
+SOURCES += tst_sunspider.cpp
+
+QT = core script
+
+symbian* {
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 // Min 128kB, Max 32MB
+ TARGET.EPOCSTACKSIZE = 0x14000
+}
diff --git a/tests/benchmarks/script/sunspider/sunspider.qrc b/tests/benchmarks/script/sunspider/sunspider.qrc
new file mode 100644
index 0000000000..a894ee5859
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/sunspider.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>tests</file>
+</qresource>
+</RCC>
diff --git a/tests/benchmarks/script/sunspider/tests/3d-cube.js b/tests/benchmarks/script/sunspider/tests/3d-cube.js
new file mode 100644
index 0000000000..e2cd6f9a5f
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/3d-cube.js
@@ -0,0 +1,337 @@
+// 3D Cube Rotation
+// http://www.speich.net/computer/moztesting/3d.htm
+// Created by Simon Speich
+
+var Q = new Array();
+var MTrans = new Array(); // transformation matrix
+var MQube = new Array(); // position information of qube
+var I = new Array(); // entity matrix
+var Origin = new Object();
+var Testing = new Object();
+var LoopTimer;
+
+var DisplArea = new Object();
+DisplArea.Width = 300;
+DisplArea.Height = 300;
+
+function DrawLine(From, To) {
+ var x1 = From.V[0];
+ var x2 = To.V[0];
+ var y1 = From.V[1];
+ var y2 = To.V[1];
+ var dx = Math.abs(x2 - x1);
+ var dy = Math.abs(y2 - y1);
+ var x = x1;
+ var y = y1;
+ var IncX1, IncY1;
+ var IncX2, IncY2;
+ var Den;
+ var Num;
+ var NumAdd;
+ var NumPix;
+
+ if (x2 >= x1) { IncX1 = 1; IncX2 = 1; }
+ else { IncX1 = -1; IncX2 = -1; }
+ if (y2 >= y1) { IncY1 = 1; IncY2 = 1; }
+ else { IncY1 = -1; IncY2 = -1; }
+ if (dx >= dy) {
+ IncX1 = 0;
+ IncY2 = 0;
+ Den = dx;
+ Num = dx / 2;
+ NumAdd = dy;
+ NumPix = dx;
+ }
+ else {
+ IncX2 = 0;
+ IncY1 = 0;
+ Den = dy;
+ Num = dy / 2;
+ NumAdd = dx;
+ NumPix = dy;
+ }
+
+ NumPix = Math.round(Q.LastPx + NumPix);
+
+ var i = Q.LastPx;
+ for (; i < NumPix; i++) {
+ Num += NumAdd;
+ if (Num >= Den) {
+ Num -= Den;
+ x += IncX1;
+ y += IncY1;
+ }
+ x += IncX2;
+ y += IncY2;
+ }
+ Q.LastPx = NumPix;
+}
+
+function CalcCross(V0, V1) {
+ var Cross = new Array();
+ Cross[0] = V0[1]*V1[2] - V0[2]*V1[1];
+ Cross[1] = V0[2]*V1[0] - V0[0]*V1[2];
+ Cross[2] = V0[0]*V1[1] - V0[1]*V1[0];
+ return Cross;
+}
+
+function CalcNormal(V0, V1, V2) {
+ var A = new Array(); var B = new Array();
+ for (var i = 0; i < 3; i++) {
+ A[i] = V0[i] - V1[i];
+ B[i] = V2[i] - V1[i];
+ }
+ A = CalcCross(A, B);
+ var Length = Math.sqrt(A[0]*A[0] + A[1]*A[1] + A[2]*A[2]);
+ for (var i = 0; i < 3; i++) A[i] = A[i] / Length;
+ A[3] = 1;
+ return A;
+}
+
+function CreateP(X,Y,Z) {
+ this.V = [X,Y,Z,1];
+}
+
+// multiplies two matrices
+function MMulti(M1, M2) {
+ var M = [[],[],[],[]];
+ var i = 0;
+ var j = 0;
+ for (; i < 4; i++) {
+ j = 0;
+ for (; j < 4; j++) M[i][j] = M1[i][0] * M2[0][j] + M1[i][1] * M2[1][j] + M1[i][2] * M2[2][j] + M1[i][3] * M2[3][j];
+ }
+ return M;
+}
+
+//multiplies matrix with vector
+function VMulti(M, V) {
+ var Vect = new Array();
+ var i = 0;
+ for (;i < 4; i++) Vect[i] = M[i][0] * V[0] + M[i][1] * V[1] + M[i][2] * V[2] + M[i][3] * V[3];
+ return Vect;
+}
+
+function VMulti2(M, V) {
+ var Vect = new Array();
+ var i = 0;
+ for (;i < 3; i++) Vect[i] = M[i][0] * V[0] + M[i][1] * V[1] + M[i][2] * V[2];
+ return Vect;
+}
+
+// add to matrices
+function MAdd(M1, M2) {
+ var M = [[],[],[],[]];
+ var i = 0;
+ var j = 0;
+ for (; i < 4; i++) {
+ j = 0;
+ for (; j < 4; j++) M[i][j] = M1[i][j] + M2[i][j];
+ }
+ return M;
+}
+
+function Translate(M, Dx, Dy, Dz) {
+ var T = [
+ [1,0,0,Dx],
+ [0,1,0,Dy],
+ [0,0,1,Dz],
+ [0,0,0,1]
+ ];
+ return MMulti(T, M);
+}
+
+function RotateX(M, Phi) {
+ var a = Phi;
+ a *= Math.PI / 180;
+ var Cos = Math.cos(a);
+ var Sin = Math.sin(a);
+ var R = [
+ [1,0,0,0],
+ [0,Cos,-Sin,0],
+ [0,Sin,Cos,0],
+ [0,0,0,1]
+ ];
+ return MMulti(R, M);
+}
+
+function RotateY(M, Phi) {
+ var a = Phi;
+ a *= Math.PI / 180;
+ var Cos = Math.cos(a);
+ var Sin = Math.sin(a);
+ var R = [
+ [Cos,0,Sin,0],
+ [0,1,0,0],
+ [-Sin,0,Cos,0],
+ [0,0,0,1]
+ ];
+ return MMulti(R, M);
+}
+
+function RotateZ(M, Phi) {
+ var a = Phi;
+ a *= Math.PI / 180;
+ var Cos = Math.cos(a);
+ var Sin = Math.sin(a);
+ var R = [
+ [Cos,-Sin,0,0],
+ [Sin,Cos,0,0],
+ [0,0,1,0],
+ [0,0,0,1]
+ ];
+ return MMulti(R, M);
+}
+
+function DrawQube() {
+ // calc current normals
+ var CurN = new Array();
+ var i = 5;
+ Q.LastPx = 0;
+ for (; i > -1; i--) CurN[i] = VMulti2(MQube, Q.Normal[i]);
+ if (CurN[0][2] < 0) {
+ if (!Q.Line[0]) { DrawLine(Q[0], Q[1]); Q.Line[0] = true; };
+ if (!Q.Line[1]) { DrawLine(Q[1], Q[2]); Q.Line[1] = true; };
+ if (!Q.Line[2]) { DrawLine(Q[2], Q[3]); Q.Line[2] = true; };
+ if (!Q.Line[3]) { DrawLine(Q[3], Q[0]); Q.Line[3] = true; };
+ }
+ if (CurN[1][2] < 0) {
+ if (!Q.Line[2]) { DrawLine(Q[3], Q[2]); Q.Line[2] = true; };
+ if (!Q.Line[9]) { DrawLine(Q[2], Q[6]); Q.Line[9] = true; };
+ if (!Q.Line[6]) { DrawLine(Q[6], Q[7]); Q.Line[6] = true; };
+ if (!Q.Line[10]) { DrawLine(Q[7], Q[3]); Q.Line[10] = true; };
+ }
+ if (CurN[2][2] < 0) {
+ if (!Q.Line[4]) { DrawLine(Q[4], Q[5]); Q.Line[4] = true; };
+ if (!Q.Line[5]) { DrawLine(Q[5], Q[6]); Q.Line[5] = true; };
+ if (!Q.Line[6]) { DrawLine(Q[6], Q[7]); Q.Line[6] = true; };
+ if (!Q.Line[7]) { DrawLine(Q[7], Q[4]); Q.Line[7] = true; };
+ }
+ if (CurN[3][2] < 0) {
+ if (!Q.Line[4]) { DrawLine(Q[4], Q[5]); Q.Line[4] = true; };
+ if (!Q.Line[8]) { DrawLine(Q[5], Q[1]); Q.Line[8] = true; };
+ if (!Q.Line[0]) { DrawLine(Q[1], Q[0]); Q.Line[0] = true; };
+ if (!Q.Line[11]) { DrawLine(Q[0], Q[4]); Q.Line[11] = true; };
+ }
+ if (CurN[4][2] < 0) {
+ if (!Q.Line[11]) { DrawLine(Q[4], Q[0]); Q.Line[11] = true; };
+ if (!Q.Line[3]) { DrawLine(Q[0], Q[3]); Q.Line[3] = true; };
+ if (!Q.Line[10]) { DrawLine(Q[3], Q[7]); Q.Line[10] = true; };
+ if (!Q.Line[7]) { DrawLine(Q[7], Q[4]); Q.Line[7] = true; };
+ }
+ if (CurN[5][2] < 0) {
+ if (!Q.Line[8]) { DrawLine(Q[1], Q[5]); Q.Line[8] = true; };
+ if (!Q.Line[5]) { DrawLine(Q[5], Q[6]); Q.Line[5] = true; };
+ if (!Q.Line[9]) { DrawLine(Q[6], Q[2]); Q.Line[9] = true; };
+ if (!Q.Line[1]) { DrawLine(Q[2], Q[1]); Q.Line[1] = true; };
+ }
+ Q.Line = [false,false,false,false,false,false,false,false,false,false,false,false];
+ Q.LastPx = 0;
+}
+
+function Loop() {
+ if (Testing.LoopCount > Testing.LoopMax) return;
+ var TestingStr = String(Testing.LoopCount);
+ while (TestingStr.length < 3) TestingStr = "0" + TestingStr;
+ MTrans = Translate(I, -Q[8].V[0], -Q[8].V[1], -Q[8].V[2]);
+ MTrans = RotateX(MTrans, 1);
+ MTrans = RotateY(MTrans, 3);
+ MTrans = RotateZ(MTrans, 5);
+ MTrans = Translate(MTrans, Q[8].V[0], Q[8].V[1], Q[8].V[2]);
+ MQube = MMulti(MTrans, MQube);
+ var i = 8;
+ for (; i > -1; i--) {
+ Q[i].V = VMulti(MTrans, Q[i].V);
+ }
+ DrawQube();
+ Testing.LoopCount++;
+ Loop();
+}
+
+function Init(CubeSize) {
+ // init/reset vars
+ Origin.V = [150,150,20,1];
+ Testing.LoopCount = 0;
+ Testing.LoopMax = 50;
+ Testing.TimeMax = 0;
+ Testing.TimeAvg = 0;
+ Testing.TimeMin = 0;
+ Testing.TimeTemp = 0;
+ Testing.TimeTotal = 0;
+ Testing.Init = false;
+
+ // transformation matrix
+ MTrans = [
+ [1,0,0,0],
+ [0,1,0,0],
+ [0,0,1,0],
+ [0,0,0,1]
+ ];
+
+ // position information of qube
+ MQube = [
+ [1,0,0,0],
+ [0,1,0,0],
+ [0,0,1,0],
+ [0,0,0,1]
+ ];
+
+ // entity matrix
+ I = [
+ [1,0,0,0],
+ [0,1,0,0],
+ [0,0,1,0],
+ [0,0,0,1]
+ ];
+
+ // create qube
+ Q[0] = new CreateP(-CubeSize,-CubeSize, CubeSize);
+ Q[1] = new CreateP(-CubeSize, CubeSize, CubeSize);
+ Q[2] = new CreateP( CubeSize, CubeSize, CubeSize);
+ Q[3] = new CreateP( CubeSize,-CubeSize, CubeSize);
+ Q[4] = new CreateP(-CubeSize,-CubeSize,-CubeSize);
+ Q[5] = new CreateP(-CubeSize, CubeSize,-CubeSize);
+ Q[6] = new CreateP( CubeSize, CubeSize,-CubeSize);
+ Q[7] = new CreateP( CubeSize,-CubeSize,-CubeSize);
+
+ // center of gravity
+ Q[8] = new CreateP(0, 0, 0);
+
+ // anti-clockwise edge check
+ Q.Edge = [[0,1,2],[3,2,6],[7,6,5],[4,5,1],[4,0,3],[1,5,6]];
+
+ // calculate squad normals
+ Q.Normal = new Array();
+ for (var i = 0; i < Q.Edge.length; i++) Q.Normal[i] = CalcNormal(Q[Q.Edge[i][0]].V, Q[Q.Edge[i][1]].V, Q[Q.Edge[i][2]].V);
+
+ // line drawn ?
+ Q.Line = [false,false,false,false,false,false,false,false,false,false,false,false];
+
+ // create line pixels
+ Q.NumPx = 9 * 2 * CubeSize;
+ for (var i = 0; i < Q.NumPx; i++) CreateP(0,0,0);
+
+ MTrans = Translate(MTrans, Origin.V[0], Origin.V[1], Origin.V[2]);
+ MQube = MMulti(MTrans, MQube);
+
+ var i = 0;
+ for (; i < 9; i++) {
+ Q[i].V = VMulti(MTrans, Q[i].V);
+ }
+ DrawQube();
+ Testing.Init = true;
+ Loop();
+}
+
+for ( var i = 20; i <= 160; i *= 2 ) {
+ Init(i);
+}
+
+Q = null;
+MTrans = null;
+MQube = null;
+I = null;
+Origin = null;
+Testing = null;
+LoopTime = null;
+DisplArea = null;
diff --git a/tests/benchmarks/script/sunspider/tests/3d-morph.js b/tests/benchmarks/script/sunspider/tests/3d-morph.js
new file mode 100644
index 0000000000..d4238c080b
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/3d-morph.js
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var loops = 15
+var nx = 120
+var nz = 120
+
+function morph(a, f) {
+ var PI2nx = Math.PI * 8/nx
+ var sin = Math.sin
+ var f30 = -(50 * sin(f*Math.PI*2))
+
+ for (var i = 0; i < nz; ++i) {
+ for (var j = 0; j < nx; ++j) {
+ a[3*(i*nx+j)+1] = sin((j-1) * PI2nx ) * -f30
+ }
+ }
+}
+
+
+var a = Array()
+for (var i=0; i < nx*nz*3; ++i)
+ a[i] = 0
+
+for (var i = 0; i < loops; ++i) {
+ morph(a, i/loops)
+}
+
+testOutput = 0;
+for (var i = 0; i < nx; i++)
+ testOutput += a[3*(i*nx+i)+1];
+a = null;
diff --git a/tests/benchmarks/script/sunspider/tests/3d-raytrace.js b/tests/benchmarks/script/sunspider/tests/3d-raytrace.js
new file mode 100644
index 0000000000..e7b959e1ca
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/3d-raytrace.js
@@ -0,0 +1,441 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+function createVector(x,y,z) {
+ return new Array(x,y,z);
+}
+
+function sqrLengthVector(self) {
+ return self[0] * self[0] + self[1] * self[1] + self[2] * self[2];
+}
+
+function lengthVector(self) {
+ return Math.sqrt(self[0] * self[0] + self[1] * self[1] + self[2] * self[2]);
+}
+
+function addVector(self, v) {
+ self[0] += v[0];
+ self[1] += v[1];
+ self[2] += v[2];
+ return self;
+}
+
+function subVector(self, v) {
+ self[0] -= v[0];
+ self[1] -= v[1];
+ self[2] -= v[2];
+ return self;
+}
+
+function scaleVector(self, scale) {
+ self[0] *= scale;
+ self[1] *= scale;
+ self[2] *= scale;
+ return self;
+}
+
+function normaliseVector(self) {
+ var len = Math.sqrt(self[0] * self[0] + self[1] * self[1] + self[2] * self[2]);
+ self[0] /= len;
+ self[1] /= len;
+ self[2] /= len;
+ return self;
+}
+
+function add(v1, v2) {
+ return new Array(v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2]);
+}
+
+function sub(v1, v2) {
+ return new Array(v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2]);
+}
+
+function scalev(v1, v2) {
+ return new Array(v1[0] * v2[0], v1[1] * v2[1], v1[2] * v2[2]);
+}
+
+function dot(v1, v2) {
+ return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
+}
+
+function scale(v, scale) {
+ return [v[0] * scale, v[1] * scale, v[2] * scale];
+}
+
+function cross(v1, v2) {
+ return [v1[1] * v2[2] - v1[2] * v2[1],
+ v1[2] * v2[0] - v1[0] * v2[2],
+ v1[0] * v2[1] - v1[1] * v2[0]];
+
+}
+
+function normalise(v) {
+ var len = lengthVector(v);
+ return [v[0] / len, v[1] / len, v[2] / len];
+}
+
+function transformMatrix(self, v) {
+ var vals = self;
+ var x = vals[0] * v[0] + vals[1] * v[1] + vals[2] * v[2] + vals[3];
+ var y = vals[4] * v[0] + vals[5] * v[1] + vals[6] * v[2] + vals[7];
+ var z = vals[8] * v[0] + vals[9] * v[1] + vals[10] * v[2] + vals[11];
+ return [x, y, z];
+}
+
+function invertMatrix(self) {
+ var temp = new Array(16);
+ var tx = -self[3];
+ var ty = -self[7];
+ var tz = -self[11];
+ for (h = 0; h < 3; h++)
+ for (v = 0; v < 3; v++)
+ temp[h + v * 4] = self[v + h * 4];
+ for (i = 0; i < 11; i++)
+ self[i] = temp[i];
+ self[3] = tx * self[0] + ty * self[1] + tz * self[2];
+ self[7] = tx * self[4] + ty * self[5] + tz * self[6];
+ self[11] = tx * self[8] + ty * self[9] + tz * self[10];
+ return self;
+}
+
+
+// Triangle intersection using barycentric coord method
+function Triangle(p1, p2, p3) {
+ var edge1 = sub(p3, p1);
+ var edge2 = sub(p2, p1);
+ var normal = cross(edge1, edge2);
+ if (Math.abs(normal[0]) > Math.abs(normal[1]))
+ if (Math.abs(normal[0]) > Math.abs(normal[2]))
+ this.axis = 0;
+ else
+ this.axis = 2;
+ else
+ if (Math.abs(normal[1]) > Math.abs(normal[2]))
+ this.axis = 1;
+ else
+ this.axis = 2;
+ var u = (this.axis + 1) % 3;
+ var v = (this.axis + 2) % 3;
+ var u1 = edge1[u];
+ var v1 = edge1[v];
+
+ var u2 = edge2[u];
+ var v2 = edge2[v];
+ this.normal = normalise(normal);
+ this.nu = normal[u] / normal[this.axis];
+ this.nv = normal[v] / normal[this.axis];
+ this.nd = dot(normal, p1) / normal[this.axis];
+ var det = u1 * v2 - v1 * u2;
+ this.eu = p1[u];
+ this.ev = p1[v];
+ this.nu1 = u1 / det;
+ this.nv1 = -v1 / det;
+ this.nu2 = v2 / det;
+ this.nv2 = -u2 / det;
+ this.material = [0.7, 0.7, 0.7];
+}
+
+Triangle.prototype.intersect = function(orig, dir, near, far) {
+ var u = (this.axis + 1) % 3;
+ var v = (this.axis + 2) % 3;
+ var d = dir[this.axis] + this.nu * dir[u] + this.nv * dir[v];
+ var t = (this.nd - orig[this.axis] - this.nu * orig[u] - this.nv * orig[v]) / d;
+ if (t < near || t > far)
+ return null;
+ var Pu = orig[u] + t * dir[u] - this.eu;
+ var Pv = orig[v] + t * dir[v] - this.ev;
+ var a2 = Pv * this.nu1 + Pu * this.nv1;
+ if (a2 < 0)
+ return null;
+ var a3 = Pu * this.nu2 + Pv * this.nv2;
+ if (a3 < 0)
+ return null;
+
+ if ((a2 + a3) > 1)
+ return null;
+ return t;
+}
+
+function Scene(a_triangles) {
+ this.triangles = a_triangles;
+ this.lights = [];
+ this.ambient = [0,0,0];
+ this.background = [0.8,0.8,1];
+}
+var zero = new Array(0,0,0);
+
+Scene.prototype.intersect = function(origin, dir, near, far) {
+ var closest = null;
+ for (i = 0; i < this.triangles.length; i++) {
+ var triangle = this.triangles[i];
+ var d = triangle.intersect(origin, dir, near, far);
+ if (d == null || d > far || d < near)
+ continue;
+ far = d;
+ closest = triangle;
+ }
+
+ if (!closest)
+ return [this.background[0],this.background[1],this.background[2]];
+
+ var normal = closest.normal;
+ var hit = add(origin, scale(dir, far));
+ if (dot(dir, normal) > 0)
+ normal = [-normal[0], -normal[1], -normal[2]];
+
+ var colour = null;
+ if (closest.shader) {
+ colour = closest.shader(closest, hit, dir);
+ } else {
+ colour = closest.material;
+ }
+
+ // do reflection
+ var reflected = null;
+ if (colour.reflection > 0.001) {
+ var reflection = addVector(scale(normal, -2*dot(dir, normal)), dir);
+ reflected = this.intersect(hit, reflection, 0.0001, 1000000);
+ if (colour.reflection >= 0.999999)
+ return reflected;
+ }
+
+ var l = [this.ambient[0], this.ambient[1], this.ambient[2]];
+ for (var i = 0; i < this.lights.length; i++) {
+ var light = this.lights[i];
+ var toLight = sub(light, hit);
+ var distance = lengthVector(toLight);
+ scaleVector(toLight, 1.0/distance);
+ distance -= 0.0001;
+ if (this.blocked(hit, toLight, distance))
+ continue;
+ var nl = dot(normal, toLight);
+ if (nl > 0)
+ addVector(l, scale(light.colour, nl));
+ }
+ l = scalev(l, colour);
+ if (reflected) {
+ l = addVector(scaleVector(l, 1 - colour.reflection), scaleVector(reflected, colour.reflection));
+ }
+ return l;
+}
+
+Scene.prototype.blocked = function(O, D, far) {
+ var near = 0.0001;
+ var closest = null;
+ for (i = 0; i < this.triangles.length; i++) {
+ var triangle = this.triangles[i];
+ var d = triangle.intersect(O, D, near, far);
+ if (d == null || d > far || d < near)
+ continue;
+ return true;
+ }
+
+ return false;
+}
+
+
+// this camera code is from notes i made ages ago, it is from *somewhere* -- i cannot remember where
+// that somewhere is
+function Camera(origin, lookat, up) {
+ var zaxis = normaliseVector(subVector(lookat, origin));
+ var xaxis = normaliseVector(cross(up, zaxis));
+ var yaxis = normaliseVector(cross(xaxis, subVector([0,0,0], zaxis)));
+ var m = new Array(16);
+ m[0] = xaxis[0]; m[1] = xaxis[1]; m[2] = xaxis[2];
+ m[4] = yaxis[0]; m[5] = yaxis[1]; m[6] = yaxis[2];
+ m[8] = zaxis[0]; m[9] = zaxis[1]; m[10] = zaxis[2];
+ invertMatrix(m);
+ m[3] = 0; m[7] = 0; m[11] = 0;
+ this.origin = origin;
+ this.directions = new Array(4);
+ this.directions[0] = normalise([-0.7, 0.7, 1]);
+ this.directions[1] = normalise([ 0.7, 0.7, 1]);
+ this.directions[2] = normalise([ 0.7, -0.7, 1]);
+ this.directions[3] = normalise([-0.7, -0.7, 1]);
+ this.directions[0] = transformMatrix(m, this.directions[0]);
+ this.directions[1] = transformMatrix(m, this.directions[1]);
+ this.directions[2] = transformMatrix(m, this.directions[2]);
+ this.directions[3] = transformMatrix(m, this.directions[3]);
+}
+
+Camera.prototype.generateRayPair = function(y) {
+ rays = new Array(new Object(), new Object());
+ rays[0].origin = this.origin;
+ rays[1].origin = this.origin;
+ rays[0].dir = addVector(scale(this.directions[0], y), scale(this.directions[3], 1 - y));
+ rays[1].dir = addVector(scale(this.directions[1], y), scale(this.directions[2], 1 - y));
+ return rays;
+}
+
+function renderRows(camera, scene, pixels, width, height, starty, stopy) {
+ for (var y = starty; y < stopy; y++) {
+ var rays = camera.generateRayPair(y / height);
+ for (var x = 0; x < width; x++) {
+ var xp = x / width;
+ var origin = addVector(scale(rays[0].origin, xp), scale(rays[1].origin, 1 - xp));
+ var dir = normaliseVector(addVector(scale(rays[0].dir, xp), scale(rays[1].dir, 1 - xp)));
+ var l = scene.intersect(origin, dir);
+ pixels[y][x] = l;
+ }
+ }
+}
+
+Camera.prototype.render = function(scene, pixels, width, height) {
+ var cam = this;
+ var row = 0;
+ renderRows(cam, scene, pixels, width, height, 0, height);
+}
+
+
+
+function raytraceScene()
+{
+ var startDate = new Date().getTime();
+ var numTriangles = 2 * 6;
+ var triangles = new Array();//numTriangles);
+ var tfl = createVector(-10, 10, -10);
+ var tfr = createVector( 10, 10, -10);
+ var tbl = createVector(-10, 10, 10);
+ var tbr = createVector( 10, 10, 10);
+ var bfl = createVector(-10, -10, -10);
+ var bfr = createVector( 10, -10, -10);
+ var bbl = createVector(-10, -10, 10);
+ var bbr = createVector( 10, -10, 10);
+
+ // cube!!!
+ // front
+ var i = 0;
+
+ triangles[i++] = new Triangle(tfl, tfr, bfr);
+ triangles[i++] = new Triangle(tfl, bfr, bfl);
+ // back
+ triangles[i++] = new Triangle(tbl, tbr, bbr);
+ triangles[i++] = new Triangle(tbl, bbr, bbl);
+ // triangles[i-1].material = [0.7,0.2,0.2];
+ // triangles[i-1].material.reflection = 0.8;
+ // left
+ triangles[i++] = new Triangle(tbl, tfl, bbl);
+ // triangles[i-1].reflection = 0.6;
+ triangles[i++] = new Triangle(tfl, bfl, bbl);
+ // triangles[i-1].reflection = 0.6;
+ // right
+ triangles[i++] = new Triangle(tbr, tfr, bbr);
+ triangles[i++] = new Triangle(tfr, bfr, bbr);
+ // top
+ triangles[i++] = new Triangle(tbl, tbr, tfr);
+ triangles[i++] = new Triangle(tbl, tfr, tfl);
+ // bottom
+ triangles[i++] = new Triangle(bbl, bbr, bfr);
+ triangles[i++] = new Triangle(bbl, bfr, bfl);
+
+ //Floor!!!!
+ var green = createVector(0.0, 0.4, 0.0);
+ var grey = createVector(0.4, 0.4, 0.4);
+ grey.reflection = 1.0;
+ var floorShader = function(tri, pos, view) {
+ var x = ((pos[0]/32) % 2 + 2) % 2;
+ var z = ((pos[2]/32 + 0.3) % 2 + 2) % 2;
+ if (x < 1 != z < 1) {
+ //in the real world we use the fresnel term...
+ // var angle = 1-dot(view, tri.normal);
+ // angle *= angle;
+ // angle *= angle;
+ // angle *= angle;
+ //grey.reflection = angle;
+ return grey;
+ } else
+ return green;
+ }
+ var ffl = createVector(-1000, -30, -1000);
+ var ffr = createVector( 1000, -30, -1000);
+ var fbl = createVector(-1000, -30, 1000);
+ var fbr = createVector( 1000, -30, 1000);
+ triangles[i++] = new Triangle(fbl, fbr, ffr);
+ triangles[i-1].shader = floorShader;
+ triangles[i++] = new Triangle(fbl, ffr, ffl);
+ triangles[i-1].shader = floorShader;
+
+ var _scene = new Scene(triangles);
+ _scene.lights[0] = createVector(20, 38, -22);
+ _scene.lights[0].colour = createVector(0.7, 0.3, 0.3);
+ _scene.lights[1] = createVector(-23, 40, 17);
+ _scene.lights[1].colour = createVector(0.7, 0.3, 0.3);
+ _scene.lights[2] = createVector(23, 20, 17);
+ _scene.lights[2].colour = createVector(0.7, 0.7, 0.7);
+ _scene.ambient = createVector(0.1, 0.1, 0.1);
+ // _scene.background = createVector(0.7, 0.7, 1.0);
+
+ var size = 30;
+ var pixels = new Array();
+ for (var y = 0; y < size; y++) {
+ pixels[y] = new Array();
+ for (var x = 0; x < size; x++) {
+ pixels[y][x] = 0;
+ }
+ }
+
+ var _camera = new Camera(createVector(-40, 40, 40), createVector(0, 0, 0), createVector(0, 1, 0));
+ _camera.render(_scene, pixels, size, size);
+
+ return pixels;
+}
+
+function arrayToCanvasCommands(pixels)
+{
+ var s = '<canvas id="renderCanvas" width="30px" height="30px"></canvas><scr' + 'ipt>\nvar pixels = [';
+ var size = 30;
+ for (var y = 0; y < size; y++) {
+ s += "[";
+ for (var x = 0; x < size; x++) {
+ s += "[" + pixels[y][x] + "],";
+ }
+ s+= "],";
+ }
+ s += '];\n var canvas = document.getElementById("renderCanvas").getContext("2d");\n\
+\n\
+\n\
+ var size = 30;\n\
+ canvas.fillStyle = "red";\n\
+ canvas.fillRect(0, 0, size, size);\n\
+ canvas.scale(1, -1);\n\
+ canvas.translate(0, -size);\n\
+\n\
+ if (!canvas.setFillColor)\n\
+ canvas.setFillColor = function(r, g, b, a) {\n\
+ this.fillStyle = "rgb("+[Math.floor(r * 255), Math.floor(g * 255), Math.floor(b * 255)]+")";\n\
+ }\n\
+\n\
+for (var y = 0; y < size; y++) {\n\
+ for (var x = 0; x < size; x++) {\n\
+ var l = pixels[y][x];\n\
+ canvas.setFillColor(l[0], l[1], l[2], 1);\n\
+ canvas.fillRect(x, y, 1, 1);\n\
+ }\n\
+}</scr' + 'ipt>';
+
+ return s;
+}
+
+testOutput = arrayToCanvasCommands(raytraceScene());
diff --git a/tests/benchmarks/script/sunspider/tests/VERSION b/tests/benchmarks/script/sunspider/tests/VERSION
new file mode 100644
index 0000000000..6aa91fb0f5
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/VERSION
@@ -0,0 +1 @@
+SunSpider 0.9.1
diff --git a/tests/benchmarks/script/sunspider/tests/access-binary-trees.js b/tests/benchmarks/script/sunspider/tests/access-binary-trees.js
new file mode 100644
index 0000000000..2f24e7db1f
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/access-binary-trees.js
@@ -0,0 +1,50 @@
+/* The Great Computer Language Shootout
+ http://shootout.alioth.debian.org/
+ contributed by Isaac Gouy */
+
+function TreeNode(left,right,item){
+ this.left = left;
+ this.right = right;
+ this.item = item;
+}
+
+TreeNode.prototype.itemCheck = function(){
+ if (this.left==null) return this.item;
+ else return this.item + this.left.itemCheck() - this.right.itemCheck();
+}
+
+function bottomUpTree(item,depth){
+ if (depth>0){
+ return new TreeNode(
+ bottomUpTree(2*item-1, depth-1)
+ ,bottomUpTree(2*item, depth-1)
+ ,item
+ );
+ }
+ else {
+ return new TreeNode(null,null,item);
+ }
+}
+
+var ret;
+
+for ( var n = 4; n <= 7; n += 1 ) {
+ var minDepth = 4;
+ var maxDepth = Math.max(minDepth + 2, n);
+ var stretchDepth = maxDepth + 1;
+
+ var check = bottomUpTree(0,stretchDepth).itemCheck();
+
+ var longLivedTree = bottomUpTree(0,maxDepth);
+ for (var depth=minDepth; depth<=maxDepth; depth+=2){
+ var iterations = 1 << (maxDepth - depth + minDepth);
+
+ check = 0;
+ for (var i=1; i<=iterations; i++){
+ check += bottomUpTree(i,depth).itemCheck();
+ check += bottomUpTree(-i,depth).itemCheck();
+ }
+ }
+
+ ret = longLivedTree.itemCheck();
+}
diff --git a/tests/benchmarks/script/sunspider/tests/access-fannkuch.js b/tests/benchmarks/script/sunspider/tests/access-fannkuch.js
new file mode 100644
index 0000000000..1ea87b4948
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/access-fannkuch.js
@@ -0,0 +1,66 @@
+/* The Great Computer Language Shootout
+ http://shootout.alioth.debian.org/
+ contributed by Isaac Gouy */
+
+function fannkuch(n) {
+ var check = 0;
+ var perm = Array(n);
+ var perm1 = Array(n);
+ var count = Array(n);
+ var maxPerm = Array(n);
+ var maxFlipsCount = 0;
+ var m = n - 1;
+
+ for (var i = 0; i < n; i++) perm1[i] = i;
+ var r = n;
+
+ while (true) {
+ // write-out the first 30 permutations
+ if (check < 30){
+ var s = "";
+ for(var i=0; i<n; i++) s += (perm1[i]+1).toString();
+ check++;
+ }
+
+ while (r != 1) { count[r - 1] = r; r--; }
+ if (!(perm1[0] == 0 || perm1[m] == m)) {
+ for (var i = 0; i < n; i++) perm[i] = perm1[i];
+
+ var flipsCount = 0;
+ var k;
+
+ while (!((k = perm[0]) == 0)) {
+ var k2 = (k + 1) >> 1;
+ for (var i = 0; i < k2; i++) {
+ var temp = perm[i]; perm[i] = perm[k - i]; perm[k - i] = temp;
+ }
+ flipsCount++;
+ }
+
+ if (flipsCount > maxFlipsCount) {
+ maxFlipsCount = flipsCount;
+ for (var i = 0; i < n; i++) maxPerm[i] = perm1[i];
+ }
+ }
+
+ while (true) {
+ if (r == n) return maxFlipsCount;
+ var perm0 = perm1[0];
+ var i = 0;
+ while (i < r) {
+ var j = i + 1;
+ perm1[i] = perm1[j];
+ i = j;
+ }
+ perm1[r] = perm0;
+
+ count[r] = count[r] - 1;
+ if (count[r] > 0) break;
+ r++;
+ }
+ }
+}
+
+var n = 8;
+var ret = fannkuch(n);
+
diff --git a/tests/benchmarks/script/sunspider/tests/access-nbody.js b/tests/benchmarks/script/sunspider/tests/access-nbody.js
new file mode 100644
index 0000000000..f0d080d12d
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/access-nbody.js
@@ -0,0 +1,169 @@
+/* The Great Computer Language Shootout
+ http://shootout.alioth.debian.org/
+ contributed by Isaac Gouy */
+
+var PI = 3.141592653589793;
+var SOLAR_MASS = 4 * PI * PI;
+var DAYS_PER_YEAR = 365.24;
+
+function Body(x,y,z,vx,vy,vz,mass){
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.vx = vx;
+ this.vy = vy;
+ this.vz = vz;
+ this.mass = mass;
+}
+
+Body.prototype.offsetMomentum = function(px,py,pz) {
+ this.vx = -px / SOLAR_MASS;
+ this.vy = -py / SOLAR_MASS;
+ this.vz = -pz / SOLAR_MASS;
+ return this;
+}
+
+function Jupiter(){
+ return new Body(
+ 4.84143144246472090e+00,
+ -1.16032004402742839e+00,
+ -1.03622044471123109e-01,
+ 1.66007664274403694e-03 * DAYS_PER_YEAR,
+ 7.69901118419740425e-03 * DAYS_PER_YEAR,
+ -6.90460016972063023e-05 * DAYS_PER_YEAR,
+ 9.54791938424326609e-04 * SOLAR_MASS
+ );
+}
+
+function Saturn(){
+ return new Body(
+ 8.34336671824457987e+00,
+ 4.12479856412430479e+00,
+ -4.03523417114321381e-01,
+ -2.76742510726862411e-03 * DAYS_PER_YEAR,
+ 4.99852801234917238e-03 * DAYS_PER_YEAR,
+ 2.30417297573763929e-05 * DAYS_PER_YEAR,
+ 2.85885980666130812e-04 * SOLAR_MASS
+ );
+}
+
+function Uranus(){
+ return new Body(
+ 1.28943695621391310e+01,
+ -1.51111514016986312e+01,
+ -2.23307578892655734e-01,
+ 2.96460137564761618e-03 * DAYS_PER_YEAR,
+ 2.37847173959480950e-03 * DAYS_PER_YEAR,
+ -2.96589568540237556e-05 * DAYS_PER_YEAR,
+ 4.36624404335156298e-05 * SOLAR_MASS
+ );
+}
+
+function Neptune(){
+ return new Body(
+ 1.53796971148509165e+01,
+ -2.59193146099879641e+01,
+ 1.79258772950371181e-01,
+ 2.68067772490389322e-03 * DAYS_PER_YEAR,
+ 1.62824170038242295e-03 * DAYS_PER_YEAR,
+ -9.51592254519715870e-05 * DAYS_PER_YEAR,
+ 5.15138902046611451e-05 * SOLAR_MASS
+ );
+}
+
+function Sun(){
+ return new Body(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SOLAR_MASS);
+}
+
+
+function NBodySystem(bodies){
+ this.bodies = bodies;
+ var px = 0.0;
+ var py = 0.0;
+ var pz = 0.0;
+ var size = this.bodies.length;
+ for (var i=0; i<size; i++){
+ var b = this.bodies[i];
+ var m = b.mass;
+ px += b.vx * m;
+ py += b.vy * m;
+ pz += b.vz * m;
+ }
+ this.bodies[0].offsetMomentum(px,py,pz);
+}
+
+NBodySystem.prototype.advance = function(dt){
+ var dx, dy, dz, distance, mag;
+ var size = this.bodies.length;
+
+ for (var i=0; i<size; i++) {
+ var bodyi = this.bodies[i];
+ for (var j=i+1; j<size; j++) {
+ var bodyj = this.bodies[j];
+ dx = bodyi.x - bodyj.x;
+ dy = bodyi.y - bodyj.y;
+ dz = bodyi.z - bodyj.z;
+
+ distance = Math.sqrt(dx*dx + dy*dy + dz*dz);
+ mag = dt / (distance * distance * distance);
+
+ bodyi.vx -= dx * bodyj.mass * mag;
+ bodyi.vy -= dy * bodyj.mass * mag;
+ bodyi.vz -= dz * bodyj.mass * mag;
+
+ bodyj.vx += dx * bodyi.mass * mag;
+ bodyj.vy += dy * bodyi.mass * mag;
+ bodyj.vz += dz * bodyi.mass * mag;
+ }
+ }
+
+ for (var i=0; i<size; i++) {
+ var body = this.bodies[i];
+ body.x += dt * body.vx;
+ body.y += dt * body.vy;
+ body.z += dt * body.vz;
+ }
+}
+
+NBodySystem.prototype.energy = function(){
+ var dx, dy, dz, distance;
+ var e = 0.0;
+ var size = this.bodies.length;
+
+ for (var i=0; i<size; i++) {
+ var bodyi = this.bodies[i];
+
+ e += 0.5 * bodyi.mass *
+ ( bodyi.vx * bodyi.vx
+ + bodyi.vy * bodyi.vy
+ + bodyi.vz * bodyi.vz );
+
+ for (var j=i+1; j<size; j++) {
+ var bodyj = this.bodies[j];
+ dx = bodyi.x - bodyj.x;
+ dy = bodyi.y - bodyj.y;
+ dz = bodyi.z - bodyj.z;
+
+ distance = Math.sqrt(dx*dx + dy*dy + dz*dz);
+ e -= (bodyi.mass * bodyj.mass) / distance;
+ }
+ }
+ return e;
+}
+
+var ret;
+
+for ( var n = 3; n <= 24; n *= 2 ) {
+ (function(){
+ var bodies = new NBodySystem( Array(
+ Sun(),Jupiter(),Saturn(),Uranus(),Neptune()
+ ));
+ var max = n * 100;
+
+ ret = bodies.energy();
+ for (var i=0; i<max; i++){
+ bodies.advance(0.01);
+ }
+ ret = bodies.energy();
+ })();
+}
diff --git a/tests/benchmarks/script/sunspider/tests/access-nsieve.js b/tests/benchmarks/script/sunspider/tests/access-nsieve.js
new file mode 100644
index 0000000000..70fdf1aaf3
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/access-nsieve.js
@@ -0,0 +1,38 @@
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org/
+//
+// modified by Isaac Gouy
+
+function pad(number,width){
+ var s = number.toString();
+ var prefixWidth = width - s.length;
+ if (prefixWidth>0){
+ for (var i=1; i<=prefixWidth; i++) s = " " + s;
+ }
+ return s;
+}
+
+function nsieve(m, isPrime){
+ var i, k, count;
+
+ for (i=2; i<=m; i++) { isPrime[i] = true; }
+ count = 0;
+
+ for (i=2; i<=m; i++){
+ if (isPrime[i]) {
+ for (k=i+i; k<=m; k+=i) isPrime[k] = false;
+ count++;
+ }
+ }
+ return count;
+}
+
+function sieve() {
+ for (var i = 1; i <= 3; i++ ) {
+ var m = (1<<i)*10000;
+ var flags = Array(m+1);
+ nsieve(m, flags);
+ }
+}
+
+sieve();
diff --git a/tests/benchmarks/script/sunspider/tests/bitops-3bit-bits-in-byte.js b/tests/benchmarks/script/sunspider/tests/bitops-3bit-bits-in-byte.js
new file mode 100644
index 0000000000..1d85406809
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/bitops-3bit-bits-in-byte.js
@@ -0,0 +1,32 @@
+// Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com
+
+// 1 op = 6 ANDs, 3 SHRs, 3 SHLs, 4 assigns, 2 ADDs
+// O(1)
+function fast3bitlookup(b) {
+var c, bi3b = 0xE994; // 0b1110 1001 1001 0100; // 3 2 2 1 2 1 1 0
+c = 3 & (bi3b >> ((b << 1) & 14));
+c += 3 & (bi3b >> ((b >> 2) & 14));
+c += 3 & (bi3b >> ((b >> 5) & 6));
+return c;
+
+/*
+lir4,0xE994; 9 instructions, no memory access, minimal register dependence, 6 shifts, 2 adds, 1 inline assign
+rlwinmr5,r3,1,28,30
+rlwinmr6,r3,30,28,30
+rlwinmr7,r3,27,29,30
+rlwnmr8,r4,r5,30,31
+rlwnmr9,r4,r6,30,31
+rlwnmr10,r4,r7,30,31
+addr3,r8,r9
+addr3,r3,r10
+*/
+}
+
+
+function TimeFunc(func) {
+var x, y, t;
+for(var x=0; x<500; x++)
+for(var y=0; y<256; y++) func(y);
+}
+
+TimeFunc(fast3bitlookup);
diff --git a/tests/benchmarks/script/sunspider/tests/bitops-bits-in-byte.js b/tests/benchmarks/script/sunspider/tests/bitops-bits-in-byte.js
new file mode 100644
index 0000000000..9a3acd4f77
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/bitops-bits-in-byte.js
@@ -0,0 +1,21 @@
+// Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com)
+
+
+// 1 op = 2 assigns, 16 compare/branches, 8 ANDs, (0-8) ADDs, 8 SHLs
+// O(n)
+function bitsinbyte(b) {
+var m = 1, c = 0;
+while(m<0x100) {
+if(b & m) c++;
+m <<= 1;
+}
+return c;
+}
+
+function TimeFunc(func) {
+var x, y, t;
+for(var x=0; x<350; x++)
+for(var y=0; y<256; y++) func(y);
+}
+
+TimeFunc(bitsinbyte);
diff --git a/tests/benchmarks/script/sunspider/tests/bitops-bitwise-and.js b/tests/benchmarks/script/sunspider/tests/bitops-bitwise-and.js
new file mode 100644
index 0000000000..7c80e696d9
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/bitops-bitwise-and.js
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+bitwiseAndValue = 4294967296;
+for (var i = 0; i < 600000; i++)
+ bitwiseAndValue = bitwiseAndValue & i;
diff --git a/tests/benchmarks/script/sunspider/tests/bitops-nsieve-bits.js b/tests/benchmarks/script/sunspider/tests/bitops-nsieve-bits.js
new file mode 100644
index 0000000000..6ef0ddb11b
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/bitops-nsieve-bits.js
@@ -0,0 +1,32 @@
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org
+//
+// Contributed by Ian Osgood
+
+function pad(n,width) {
+ var s = n.toString();
+ while (s.length < width) s = ' ' + s;
+ return s;
+}
+
+function primes(isPrime, n) {
+ var i, count = 0, m = 10000<<n, size = m+31>>5;
+
+ for (i=0; i<size; i++) isPrime[i] = 0xffffffff;
+
+ for (i=2; i<m; i++)
+ if (isPrime[i>>5] & 1<<(i&31)) {
+ for (var j=i+i; j<m; j+=i)
+ isPrime[j>>5] &= ~(1<<(j&31));
+ count++;
+ }
+}
+
+function sieve() {
+ for (var i = 4; i <= 4; i++) {
+ var isPrime = new Array((10000<<i)+31>>5);
+ primes(isPrime, i);
+ }
+}
+
+sieve();
diff --git a/tests/benchmarks/script/sunspider/tests/controlflow-recursive.js b/tests/benchmarks/script/sunspider/tests/controlflow-recursive.js
new file mode 100644
index 0000000000..fcfe1c40e2
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/controlflow-recursive.js
@@ -0,0 +1,25 @@
+// The Computer Language Shootout
+// http://shootout.alioth.debian.org/
+// contributed by Isaac Gouy
+
+function ack(m,n){
+ if (m==0) { return n+1; }
+ if (n==0) { return ack(m-1,1); }
+ return ack(m-1, ack(m,n-1) );
+}
+
+function fib(n) {
+ if (n < 2){ return 1; }
+ return fib(n-2) + fib(n-1);
+}
+
+function tak(x,y,z) {
+ if (y >= x) return z;
+ return tak(tak(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y));
+}
+
+for ( var i = 3; i <= 5; i++ ) {
+ ack(3,i);
+ fib(17.0+i);
+ tak(3*i+3,2*i+2,i+1);
+}
diff --git a/tests/benchmarks/script/sunspider/tests/crypto-aes.js b/tests/benchmarks/script/sunspider/tests/crypto-aes.js
new file mode 100644
index 0000000000..93a5969353
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/crypto-aes.js
@@ -0,0 +1,422 @@
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+/*
+ * AES Cipher function: encrypt 'input' with Rijndael algorithm
+ *
+ * takes byte-array 'input' (16 bytes)
+ * 2D byte-array key schedule 'w' (Nr+1 x Nb bytes)
+ *
+ * applies Nr rounds (10/12/14) using key schedule w for 'add round key' stage
+ *
+ * returns byte-array encrypted value (16 bytes)
+ */
+function Cipher(input, w) { // main Cipher function [§5.1]
+ var Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES)
+ var Nr = w.length/Nb - 1; // no of rounds: 10/12/14 for 128/192/256-bit keys
+
+ var state = [[],[],[],[]]; // initialise 4xNb byte-array 'state' with input [§3.4]
+ for (var i=0; i<4*Nb; i++) state[i%4][Math.floor(i/4)] = input[i];
+
+ state = AddRoundKey(state, w, 0, Nb);
+
+ for (var round=1; round<Nr; round++) {
+ state = SubBytes(state, Nb);
+ state = ShiftRows(state, Nb);
+ state = MixColumns(state, Nb);
+ state = AddRoundKey(state, w, round, Nb);
+ }
+
+ state = SubBytes(state, Nb);
+ state = ShiftRows(state, Nb);
+ state = AddRoundKey(state, w, Nr, Nb);
+
+ var output = new Array(4*Nb); // convert state to 1-d array before returning [§3.4]
+ for (var i=0; i<4*Nb; i++) output[i] = state[i%4][Math.floor(i/4)];
+ return output;
+}
+
+
+function SubBytes(s, Nb) { // apply SBox to state S [§5.1.1]
+ for (var r=0; r<4; r++) {
+ for (var c=0; c<Nb; c++) s[r][c] = Sbox[s[r][c]];
+ }
+ return s;
+}
+
+
+function ShiftRows(s, Nb) { // shift row r of state S left by r bytes [§5.1.2]
+ var t = new Array(4);
+ for (var r=1; r<4; r++) {
+ for (var c=0; c<4; c++) t[c] = s[r][(c+r)%Nb]; // shift into temp copy
+ for (var c=0; c<4; c++) s[r][c] = t[c]; // and copy back
+ } // note that this will work for Nb=4,5,6, but not 7,8 (always 4 for AES):
+ return s; // see fp.gladman.plus.com/cryptography_technology/rijndael/aes.spec.311.pdf
+}
+
+
+function MixColumns(s, Nb) { // combine bytes of each col of state S [§5.1.3]
+ for (var c=0; c<4; c++) {
+ var a = new Array(4); // 'a' is a copy of the current column from 's'
+ var b = new Array(4); // 'b' is a•{02} in GF(2^8)
+ for (var i=0; i<4; i++) {
+ a[i] = s[i][c];
+ b[i] = s[i][c]&0x80 ? s[i][c]<<1 ^ 0x011b : s[i][c]<<1;
+ }
+ // a[n] ^ b[n] is a•{03} in GF(2^8)
+ s[0][c] = b[0] ^ a[1] ^ b[1] ^ a[2] ^ a[3]; // 2*a0 + 3*a1 + a2 + a3
+ s[1][c] = a[0] ^ b[1] ^ a[2] ^ b[2] ^ a[3]; // a0 * 2*a1 + 3*a2 + a3
+ s[2][c] = a[0] ^ a[1] ^ b[2] ^ a[3] ^ b[3]; // a0 + a1 + 2*a2 + 3*a3
+ s[3][c] = a[0] ^ b[0] ^ a[1] ^ a[2] ^ b[3]; // 3*a0 + a1 + a2 + 2*a3
+ }
+ return s;
+}
+
+
+function AddRoundKey(state, w, rnd, Nb) { // xor Round Key into state S [§5.1.4]
+ for (var r=0; r<4; r++) {
+ for (var c=0; c<Nb; c++) state[r][c] ^= w[rnd*4+c][r];
+ }
+ return state;
+}
+
+
+function KeyExpansion(key) { // generate Key Schedule (byte-array Nr+1 x Nb) from Key [§5.2]
+ var Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES)
+ var Nk = key.length/4 // key length (in words): 4/6/8 for 128/192/256-bit keys
+ var Nr = Nk + 6; // no of rounds: 10/12/14 for 128/192/256-bit keys
+
+ var w = new Array(Nb*(Nr+1));
+ var temp = new Array(4);
+
+ for (var i=0; i<Nk; i++) {
+ var r = [key[4*i], key[4*i+1], key[4*i+2], key[4*i+3]];
+ w[i] = r;
+ }
+
+ for (var i=Nk; i<(Nb*(Nr+1)); i++) {
+ w[i] = new Array(4);
+ for (var t=0; t<4; t++) temp[t] = w[i-1][t];
+ if (i % Nk == 0) {
+ temp = SubWord(RotWord(temp));
+ for (var t=0; t<4; t++) temp[t] ^= Rcon[i/Nk][t];
+ } else if (Nk > 6 && i%Nk == 4) {
+ temp = SubWord(temp);
+ }
+ for (var t=0; t<4; t++) w[i][t] = w[i-Nk][t] ^ temp[t];
+ }
+
+ return w;
+}
+
+function SubWord(w) { // apply SBox to 4-byte word w
+ for (var i=0; i<4; i++) w[i] = Sbox[w[i]];
+ return w;
+}
+
+function RotWord(w) { // rotate 4-byte word w left by one byte
+ w[4] = w[0];
+ for (var i=0; i<4; i++) w[i] = w[i+1];
+ return w;
+}
+
+
+// Sbox is pre-computed multiplicative inverse in GF(2^8) used in SubBytes and KeyExpansion [§5.1.1]
+var Sbox = [0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76,
+ 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0,
+ 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15,
+ 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a,0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75,
+ 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0,0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84,
+ 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b,0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf,
+ 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85,0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8,
+ 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5,0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2,
+ 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17,0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73,
+ 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88,0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb,
+ 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c,0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79,
+ 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9,0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08,
+ 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6,0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a,
+ 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e,0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e,
+ 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94,0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf,
+ 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68,0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16];
+
+// Rcon is Round Constant used for the Key Expansion [1st col is 2^(r-1) in GF(2^8)] [§5.2]
+var Rcon = [ [0x00, 0x00, 0x00, 0x00],
+ [0x01, 0x00, 0x00, 0x00],
+ [0x02, 0x00, 0x00, 0x00],
+ [0x04, 0x00, 0x00, 0x00],
+ [0x08, 0x00, 0x00, 0x00],
+ [0x10, 0x00, 0x00, 0x00],
+ [0x20, 0x00, 0x00, 0x00],
+ [0x40, 0x00, 0x00, 0x00],
+ [0x80, 0x00, 0x00, 0x00],
+ [0x1b, 0x00, 0x00, 0x00],
+ [0x36, 0x00, 0x00, 0x00] ];
+
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+/*
+ * Use AES to encrypt 'plaintext' with 'password' using 'nBits' key, in 'Counter' mode of operation
+ * - see http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+ * for each block
+ * - outputblock = cipher(counter, key)
+ * - cipherblock = plaintext xor outputblock
+ */
+function AESEncryptCtr(plaintext, password, nBits) {
+ if (!(nBits==128 || nBits==192 || nBits==256)) return ''; // standard allows 128/192/256 bit keys
+
+ // for this example script, generate the key by applying Cipher to 1st 16/24/32 chars of password;
+ // for real-world applications, a more secure approach would be to hash the password e.g. with SHA-1
+ var nBytes = nBits/8; // no bytes in key
+ var pwBytes = new Array(nBytes);
+ for (var i=0; i<nBytes; i++) pwBytes[i] = password.charCodeAt(i) & 0xff;
+ var key = Cipher(pwBytes, KeyExpansion(pwBytes));
+ key = key.concat(key.slice(0, nBytes-16)); // key is now 16/24/32 bytes long
+
+ // initialise counter block (NIST SP800-38A §B.2): millisecond time-stamp for nonce in 1st 8 bytes,
+ // block counter in 2nd 8 bytes
+ var blockSize = 16; // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
+ var counterBlock = new Array(blockSize); // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
+ var nonce = (new Date()).getTime(); // milliseconds since 1-Jan-1970
+
+ // encode nonce in two stages to cater for JavaScript 32-bit limit on bitwise ops
+ for (var i=0; i<4; i++) counterBlock[i] = (nonce >>> i*8) & 0xff;
+ for (var i=0; i<4; i++) counterBlock[i+4] = (nonce/0x100000000 >>> i*8) & 0xff;
+
+ // generate key schedule - an expansion of the key into distinct Key Rounds for each round
+ var keySchedule = KeyExpansion(key);
+
+ var blockCount = Math.ceil(plaintext.length/blockSize);
+ var ciphertext = new Array(blockCount); // ciphertext as array of strings
+
+ for (var b=0; b<blockCount; b++) {
+ // set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)
+ // again done in two stages for 32-bit ops
+ for (var c=0; c<4; c++) counterBlock[15-c] = (b >>> c*8) & 0xff;
+ for (var c=0; c<4; c++) counterBlock[15-c-4] = (b/0x100000000 >>> c*8)
+
+ var cipherCntr = Cipher(counterBlock, keySchedule); // -- encrypt counter block --
+
+ // calculate length of final block:
+ var blockLength = b<blockCount-1 ? blockSize : (plaintext.length-1)%blockSize+1;
+
+ var ct = '';
+ for (var i=0; i<blockLength; i++) { // -- xor plaintext with ciphered counter byte-by-byte --
+ var plaintextByte = plaintext.charCodeAt(b*blockSize+i);
+ var cipherByte = plaintextByte ^ cipherCntr[i];
+ ct += String.fromCharCode(cipherByte);
+ }
+ // ct is now ciphertext for this block
+
+ ciphertext[b] = escCtrlChars(ct); // escape troublesome characters in ciphertext
+ }
+
+ // convert the nonce to a string to go on the front of the ciphertext
+ var ctrTxt = '';
+ for (var i=0; i<8; i++) ctrTxt += String.fromCharCode(counterBlock[i]);
+ ctrTxt = escCtrlChars(ctrTxt);
+
+ // use '-' to separate blocks, use Array.join to concatenate arrays of strings for efficiency
+ return ctrTxt + '-' + ciphertext.join('-');
+}
+
+
+/*
+ * Use AES to decrypt 'ciphertext' with 'password' using 'nBits' key, in Counter mode of operation
+ *
+ * for each block
+ * - outputblock = cipher(counter, key)
+ * - cipherblock = plaintext xor outputblock
+ */
+function AESDecryptCtr(ciphertext, password, nBits) {
+ if (!(nBits==128 || nBits==192 || nBits==256)) return ''; // standard allows 128/192/256 bit keys
+
+ var nBytes = nBits/8; // no bytes in key
+ var pwBytes = new Array(nBytes);
+ for (var i=0; i<nBytes; i++) pwBytes[i] = password.charCodeAt(i) & 0xff;
+ var pwKeySchedule = KeyExpansion(pwBytes);
+ var key = Cipher(pwBytes, pwKeySchedule);
+ key = key.concat(key.slice(0, nBytes-16)); // key is now 16/24/32 bytes long
+
+ var keySchedule = KeyExpansion(key);
+
+ ciphertext = ciphertext.split('-'); // split ciphertext into array of block-length strings
+
+ // recover nonce from 1st element of ciphertext
+ var blockSize = 16; // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
+ var counterBlock = new Array(blockSize);
+ var ctrTxt = unescCtrlChars(ciphertext[0]);
+ for (var i=0; i<8; i++) counterBlock[i] = ctrTxt.charCodeAt(i);
+
+ var plaintext = new Array(ciphertext.length-1);
+
+ for (var b=1; b<ciphertext.length; b++) {
+ // set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)
+ for (var c=0; c<4; c++) counterBlock[15-c] = ((b-1) >>> c*8) & 0xff;
+ for (var c=0; c<4; c++) counterBlock[15-c-4] = ((b/0x100000000-1) >>> c*8) & 0xff;
+
+ var cipherCntr = Cipher(counterBlock, keySchedule); // encrypt counter block
+
+ ciphertext[b] = unescCtrlChars(ciphertext[b]);
+
+ var pt = '';
+ for (var i=0; i<ciphertext[b].length; i++) {
+ // -- xor plaintext with ciphered counter byte-by-byte --
+ var ciphertextByte = ciphertext[b].charCodeAt(i);
+ var plaintextByte = ciphertextByte ^ cipherCntr[i];
+ pt += String.fromCharCode(plaintextByte);
+ }
+ // pt is now plaintext for this block
+
+ plaintext[b-1] = pt; // b-1 'cos no initial nonce block in plaintext
+ }
+
+ return plaintext.join('');
+}
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+function escCtrlChars(str) { // escape control chars which might cause problems handling ciphertext
+ return str.replace(/[\0\t\n\v\f\r\xa0'"!-]/g, function(c) { return '!' + c.charCodeAt(0) + '!'; });
+} // \xa0 to cater for bug in Firefox; include '-' to leave it free for use as a block marker
+
+function unescCtrlChars(str) { // unescape potentially problematic control characters
+ return str.replace(/!\d\d?\d?!/g, function(c) { return String.fromCharCode(c.slice(1,-1)); });
+}
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+/*
+ * if escCtrlChars()/unescCtrlChars() still gives problems, use encodeBase64()/decodeBase64() instead
+ */
+var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+
+function encodeBase64(str) { // http://tools.ietf.org/html/rfc4648
+ var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='';
+
+ str = encodeUTF8(str); // encode multi-byte chars into UTF-8 for byte-array
+
+ do { // pack three octets into four hexets
+ o1 = str.charCodeAt(i++);
+ o2 = str.charCodeAt(i++);
+ o3 = str.charCodeAt(i++);
+
+ bits = o1<<16 | o2<<8 | o3;
+
+ h1 = bits>>18 & 0x3f;
+ h2 = bits>>12 & 0x3f;
+ h3 = bits>>6 & 0x3f;
+ h4 = bits & 0x3f;
+
+ // end of string? index to '=' in b64
+ if (isNaN(o3)) h4 = 64;
+ if (isNaN(o2)) h3 = 64;
+
+ // use hexets to index into b64, and append result to encoded string
+ enc += b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
+ } while (i < str.length);
+
+ return enc;
+}
+
+function decodeBase64(str) {
+ var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='';
+
+ do { // unpack four hexets into three octets using index points in b64
+ h1 = b64.indexOf(str.charAt(i++));
+ h2 = b64.indexOf(str.charAt(i++));
+ h3 = b64.indexOf(str.charAt(i++));
+ h4 = b64.indexOf(str.charAt(i++));
+
+ bits = h1<<18 | h2<<12 | h3<<6 | h4;
+
+ o1 = bits>>16 & 0xff;
+ o2 = bits>>8 & 0xff;
+ o3 = bits & 0xff;
+
+ if (h3 == 64) enc += String.fromCharCode(o1);
+ else if (h4 == 64) enc += String.fromCharCode(o1, o2);
+ else enc += String.fromCharCode(o1, o2, o3);
+ } while (i < str.length);
+
+ return decodeUTF8(enc); // decode UTF-8 byte-array back to Unicode
+}
+
+function encodeUTF8(str) { // encode multi-byte string into utf-8 multiple single-byte characters
+ str = str.replace(
+ /[\u0080-\u07ff]/g, // U+0080 - U+07FF = 2-byte chars
+ function(c) {
+ var cc = c.charCodeAt(0);
+ return String.fromCharCode(0xc0 | cc>>6, 0x80 | cc&0x3f); }
+ );
+ str = str.replace(
+ /[\u0800-\uffff]/g, // U+0800 - U+FFFF = 3-byte chars
+ function(c) {
+ var cc = c.charCodeAt(0);
+ return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); }
+ );
+ return str;
+}
+
+function decodeUTF8(str) { // decode utf-8 encoded string back into multi-byte characters
+ str = str.replace(
+ /[\u00c0-\u00df][\u0080-\u00bf]/g, // 2-byte chars
+ function(c) {
+ var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;
+ return String.fromCharCode(cc); }
+ );
+ str = str.replace(
+ /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g, // 3-byte chars
+ function(c) {
+ var cc = (c.charCodeAt(0)&0x0f)<<12 | (c.charCodeAt(1)&0x3f<<6) | c.charCodeAt(2)&0x3f;
+ return String.fromCharCode(cc); }
+ );
+ return str;
+}
+
+
+function byteArrayToHexStr(b) { // convert byte array to hex string for displaying test vectors
+ var s = '';
+ for (var i=0; i<b.length; i++) s += b[i].toString(16) + ' ';
+ return s;
+}
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+
+var plainText = "ROMEO: But, soft! what light through yonder window breaks?\n\
+It is the east, and Juliet is the sun.\n\
+Arise, fair sun, and kill the envious moon,\n\
+Who is already sick and pale with grief,\n\
+That thou her maid art far more fair than she:\n\
+Be not her maid, since she is envious;\n\
+Her vestal livery is but sick and green\n\
+And none but fools do wear it; cast it off.\n\
+It is my lady, O, it is my love!\n\
+O, that she knew she were!\n\
+She speaks yet she says nothing: what of that?\n\
+Her eye discourses; I will answer it.\n\
+I am too bold, 'tis not to me she speaks:\n\
+Two of the fairest stars in all the heaven,\n\
+Having some business, do entreat her eyes\n\
+To twinkle in their spheres till they return.\n\
+What if her eyes were there, they in her head?\n\
+The brightness of her cheek would shame those stars,\n\
+As daylight doth a lamp; her eyes in heaven\n\
+Would through the airy region stream so bright\n\
+That birds would sing and think it were not night.\n\
+See, how she leans her cheek upon her hand!\n\
+O, that I were a glove upon that hand,\n\
+That I might touch that cheek!\n\
+JULIET: Ay me!\n\
+ROMEO: She speaks:\n\
+O, speak again, bright angel! for thou art\n\
+As glorious to this night, being o'er my head\n\
+As is a winged messenger of heaven\n\
+Unto the white-upturned wondering eyes\n\
+Of mortals that fall back to gaze on him\n\
+When he bestrides the lazy-pacing clouds\n\
+And sails upon the bosom of the air.";
+
+var password = "O Romeo, Romeo! wherefore art thou Romeo?";
+
+var cipherText = AESEncryptCtr(plainText, password, 256);
+var decryptedText = AESDecryptCtr(cipherText, password, 256);
diff --git a/tests/benchmarks/script/sunspider/tests/crypto-md5.js b/tests/benchmarks/script/sunspider/tests/crypto-md5.js
new file mode 100644
index 0000000000..cc7a896533
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/crypto-md5.js
@@ -0,0 +1,286 @@
+/*
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
+ * Digest Algorithm, as defined in RFC 1321.
+ * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for more info.
+ */
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
+var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
+var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
+
+/*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
+function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
+function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
+function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
+function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
+function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
+
+/*
+ * Perform a simple self-test to see if the VM is working
+ */
+function md5_vm_test()
+{
+ return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
+}
+
+/*
+ * Calculate the MD5 of an array of little-endian words, and a bit length
+ */
+function core_md5(x, len)
+{
+ /* append padding */
+ x[len >> 5] |= 0x80 << ((len) % 32);
+ x[(((len + 64) >>> 9) << 4) + 14] = len;
+
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+
+ for(var i = 0; i < x.length; i += 16)
+ {
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+
+ a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
+ d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
+ c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
+ b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
+ a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
+ d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
+ c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
+ b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
+ a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
+ d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
+ c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
+ b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
+ a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
+ d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
+ c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
+ b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
+
+ a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
+ d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
+ c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
+ b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
+ a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
+ d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
+ c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
+ b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
+ a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
+ d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
+ c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
+ b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
+ a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
+ d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
+ c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
+ b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
+
+ a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
+ d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
+ c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
+ b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
+ a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
+ d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
+ c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
+ b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
+ a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
+ d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
+ c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
+ b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
+ a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
+ d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
+ c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
+ b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
+
+ a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
+ d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
+ c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
+ b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
+ a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
+ d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
+ c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
+ b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
+ a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
+ d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
+ c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
+ b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
+ a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
+ d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
+ c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
+ b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
+
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ }
+ return Array(a, b, c, d);
+
+}
+
+/*
+ * These functions implement the four basic operations the algorithm uses.
+ */
+function md5_cmn(q, a, b, x, s, t)
+{
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
+}
+function md5_ff(a, b, c, d, x, s, t)
+{
+ return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+}
+function md5_gg(a, b, c, d, x, s, t)
+{
+ return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+}
+function md5_hh(a, b, c, d, x, s, t)
+{
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t);
+}
+function md5_ii(a, b, c, d, x, s, t)
+{
+ return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+}
+
+/*
+ * Calculate the HMAC-MD5, of a key and some data
+ */
+function core_hmac_md5(key, data)
+{
+ var bkey = str2binl(key);
+ if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
+
+ var ipad = Array(16), opad = Array(16);
+ for(var i = 0; i < 16; i++)
+ {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5C5C5C5C;
+ }
+
+ var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
+ return core_md5(opad.concat(hash), 512 + 128);
+}
+
+/*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+function safe_add(x, y)
+{
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+}
+
+/*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+function bit_rol(num, cnt)
+{
+ return (num << cnt) | (num >>> (32 - cnt));
+}
+
+/*
+ * Convert a string to an array of little-endian words
+ * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
+ */
+function str2binl(str)
+{
+ var bin = Array();
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < str.length * chrsz; i += chrsz)
+ bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
+ return bin;
+}
+
+/*
+ * Convert an array of little-endian words to a string
+ */
+function binl2str(bin)
+{
+ var str = "";
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < bin.length * 32; i += chrsz)
+ str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
+ return str;
+}
+
+/*
+ * Convert an array of little-endian words to a hex string.
+ */
+function binl2hex(binarray)
+{
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i++)
+ {
+ str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
+ hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
+ }
+ return str;
+}
+
+/*
+ * Convert an array of little-endian words to a base-64 string
+ */
+function binl2b64(binarray)
+{
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i += 3)
+ {
+ var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
+ | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
+ | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
+ for(var j = 0; j < 4; j++)
+ {
+ if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
+ else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
+ }
+ }
+ return str;
+}
+
+var plainText = "Rebellious subjects, enemies to peace,\n\
+Profaners of this neighbour-stained steel,--\n\
+Will they not hear? What, ho! you men, you beasts,\n\
+That quench the fire of your pernicious rage\n\
+With purple fountains issuing from your veins,\n\
+On pain of torture, from those bloody hands\n\
+Throw your mistemper'd weapons to the ground,\n\
+And hear the sentence of your moved prince.\n\
+Three civil brawls, bred of an airy word,\n\
+By thee, old Capulet, and Montague,\n\
+Have thrice disturb'd the quiet of our streets,\n\
+And made Verona's ancient citizens\n\
+Cast by their grave beseeming ornaments,\n\
+To wield old partisans, in hands as old,\n\
+Canker'd with peace, to part your canker'd hate:\n\
+If ever you disturb our streets again,\n\
+Your lives shall pay the forfeit of the peace.\n\
+For this time, all the rest depart away:\n\
+You Capulet; shall go along with me:\n\
+And, Montague, come you this afternoon,\n\
+To know our further pleasure in this case,\n\
+To old Free-town, our common judgment-place.\n\
+Once more, on pain of death, all men depart."
+
+for (var i = 0; i <4; i++) {
+ plainText += plainText;
+}
+
+var md5Output = hex_md5(plainText);
diff --git a/tests/benchmarks/script/sunspider/tests/crypto-sha1.js b/tests/benchmarks/script/sunspider/tests/crypto-sha1.js
new file mode 100644
index 0000000000..ca8d901a12
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/crypto-sha1.js
@@ -0,0 +1,224 @@
+/*
+ * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
+ * in FIPS PUB 180-1
+ * Version 2.1a Copyright Paul Johnston 2000 - 2002.
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for details.
+ */
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
+var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
+var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
+
+/*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
+function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
+function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
+function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
+function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
+function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
+
+/*
+ * Perform a simple self-test to see if the VM is working
+ */
+function sha1_vm_test()
+{
+ return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
+}
+
+/*
+ * Calculate the SHA-1 of an array of big-endian words, and a bit length
+ */
+function core_sha1(x, len)
+{
+ /* append padding */
+ x[len >> 5] |= 0x80 << (24 - len % 32);
+ x[((len + 64 >> 9) << 4) + 15] = len;
+
+ var w = Array(80);
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+ var e = -1009589776;
+
+ for(var i = 0; i < x.length; i += 16)
+ {
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+ var olde = e;
+
+ for(var j = 0; j < 80; j++)
+ {
+ if(j < 16) w[j] = x[i + j];
+ else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
+ var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
+ safe_add(safe_add(e, w[j]), sha1_kt(j)));
+ e = d;
+ d = c;
+ c = rol(b, 30);
+ b = a;
+ a = t;
+ }
+
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ e = safe_add(e, olde);
+ }
+ return Array(a, b, c, d, e);
+
+}
+
+/*
+ * Perform the appropriate triplet combination function for the current
+ * iteration
+ */
+function sha1_ft(t, b, c, d)
+{
+ if(t < 20) return (b & c) | ((~b) & d);
+ if(t < 40) return b ^ c ^ d;
+ if(t < 60) return (b & c) | (b & d) | (c & d);
+ return b ^ c ^ d;
+}
+
+/*
+ * Determine the appropriate additive constant for the current iteration
+ */
+function sha1_kt(t)
+{
+ return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
+ (t < 60) ? -1894007588 : -899497514;
+}
+
+/*
+ * Calculate the HMAC-SHA1 of a key and some data
+ */
+function core_hmac_sha1(key, data)
+{
+ var bkey = str2binb(key);
+ if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
+
+ var ipad = Array(16), opad = Array(16);
+ for(var i = 0; i < 16; i++)
+ {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5C5C5C5C;
+ }
+
+ var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
+ return core_sha1(opad.concat(hash), 512 + 160);
+}
+
+/*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+function safe_add(x, y)
+{
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+}
+
+/*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+function rol(num, cnt)
+{
+ return (num << cnt) | (num >>> (32 - cnt));
+}
+
+/*
+ * Convert an 8-bit or 16-bit string to an array of big-endian words
+ * In 8-bit function, characters >255 have their hi-byte silently ignored.
+ */
+function str2binb(str)
+{
+ var bin = Array();
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < str.length * chrsz; i += chrsz)
+ bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
+ return bin;
+}
+
+/*
+ * Convert an array of big-endian words to a string
+ */
+function binb2str(bin)
+{
+ var str = "";
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < bin.length * 32; i += chrsz)
+ str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
+ return str;
+}
+
+/*
+ * Convert an array of big-endian words to a hex string.
+ */
+function binb2hex(binarray)
+{
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i++)
+ {
+ str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
+ hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
+ }
+ return str;
+}
+
+/*
+ * Convert an array of big-endian words to a base-64 string
+ */
+function binb2b64(binarray)
+{
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i += 3)
+ {
+ var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
+ | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
+ | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
+ for(var j = 0; j < 4; j++)
+ {
+ if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
+ else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
+ }
+ }
+ return str;
+}
+
+
+var plainText = "Two households, both alike in dignity,\n\
+In fair Verona, where we lay our scene,\n\
+From ancient grudge break to new mutiny,\n\
+Where civil blood makes civil hands unclean.\n\
+From forth the fatal loins of these two foes\n\
+A pair of star-cross'd lovers take their life;\n\
+Whole misadventured piteous overthrows\n\
+Do with their death bury their parents' strife.\n\
+The fearful passage of their death-mark'd love,\n\
+And the continuance of their parents' rage,\n\
+Which, but their children's end, nought could remove,\n\
+Is now the two hours' traffic of our stage;\n\
+The which if you with patient ears attend,\n\
+What here shall miss, our toil shall strive to mend.";
+
+for (var i = 0; i <4; i++) {
+ plainText += plainText;
+}
+
+var sha1Output = hex_sha1(plainText);
diff --git a/tests/benchmarks/script/sunspider/tests/date-format-tofte.js b/tests/benchmarks/script/sunspider/tests/date-format-tofte.js
new file mode 100644
index 0000000000..66e2cef875
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/date-format-tofte.js
@@ -0,0 +1,299 @@
+function arrayExists(array, x) {
+ for (var i = 0; i < array.length; i++) {
+ if (array[i] == x) return true;
+ }
+ return false;
+}
+
+Date.prototype.formatDate = function (input,time) {
+ // formatDate :
+ // a PHP date like function, for formatting date strings
+ // See: http://www.php.net/date
+ //
+ // input : format string
+ // time : epoch time (seconds, and optional)
+ //
+ // if time is not passed, formatting is based on
+ // the current "this" date object's set time.
+ //
+ // supported:
+ // a, A, B, d, D, F, g, G, h, H, i, j, l (lowercase L), L,
+ // m, M, n, O, r, s, S, t, U, w, W, y, Y, z
+ //
+ // unsupported:
+ // I (capital i), T, Z
+
+ var switches = ["a", "A", "B", "d", "D", "F", "g", "G", "h", "H",
+ "i", "j", "l", "L", "m", "M", "n", "O", "r", "s",
+ "S", "t", "U", "w", "W", "y", "Y", "z"];
+ var daysLong = ["Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"];
+ var daysShort = ["Sun", "Mon", "Tue", "Wed",
+ "Thu", "Fri", "Sat"];
+ var monthsShort = ["Jan", "Feb", "Mar", "Apr",
+ "May", "Jun", "Jul", "Aug", "Sep",
+ "Oct", "Nov", "Dec"];
+ var monthsLong = ["January", "February", "March", "April",
+ "May", "June", "July", "August", "September",
+ "October", "November", "December"];
+ var daysSuffix = ["st", "nd", "rd", "th", "th", "th", "th", // 1st - 7th
+ "th", "th", "th", "th", "th", "th", "th", // 8th - 14th
+ "th", "th", "th", "th", "th", "th", "st", // 15th - 21st
+ "nd", "rd", "th", "th", "th", "th", "th", // 22nd - 28th
+ "th", "th", "st"]; // 29th - 31st
+
+ function a() {
+ // Lowercase Ante meridiem and Post meridiem
+ return self.getHours() > 11? "pm" : "am";
+ }
+ function A() {
+ // Uppercase Ante meridiem and Post meridiem
+ return self.getHours() > 11? "PM" : "AM";
+ }
+
+ function B(){
+ // Swatch internet time. code simply grabbed from ppk,
+ // since I was feeling lazy:
+ // http://www.xs4all.nl/~ppk/js/beat.html
+ var off = (self.getTimezoneOffset() + 60)*60;
+ var theSeconds = (self.getHours() * 3600) +
+ (self.getMinutes() * 60) +
+ self.getSeconds() + off;
+ var beat = Math.floor(theSeconds/86.4);
+ if (beat > 1000) beat -= 1000;
+ if (beat < 0) beat += 1000;
+ if ((""+beat).length == 1) beat = "00"+beat;
+ if ((""+beat).length == 2) beat = "0"+beat;
+ return beat;
+ }
+
+ function d() {
+ // Day of the month, 2 digits with leading zeros
+ return new String(self.getDate()).length == 1?
+ "0"+self.getDate() : self.getDate();
+ }
+ function D() {
+ // A textual representation of a day, three letters
+ return daysShort[self.getDay()];
+ }
+ function F() {
+ // A full textual representation of a month
+ return monthsLong[self.getMonth()];
+ }
+ function g() {
+ // 12-hour format of an hour without leading zeros
+ return self.getHours() > 12? self.getHours()-12 : self.getHours();
+ }
+ function G() {
+ // 24-hour format of an hour without leading zeros
+ return self.getHours();
+ }
+ function h() {
+ // 12-hour format of an hour with leading zeros
+ if (self.getHours() > 12) {
+ var s = new String(self.getHours()-12);
+ return s.length == 1?
+ "0"+ (self.getHours()-12) : self.getHours()-12;
+ } else {
+ var s = new String(self.getHours());
+ return s.length == 1?
+ "0"+self.getHours() : self.getHours();
+ }
+ }
+ function H() {
+ // 24-hour format of an hour with leading zeros
+ return new String(self.getHours()).length == 1?
+ "0"+self.getHours() : self.getHours();
+ }
+ function i() {
+ // Minutes with leading zeros
+ return new String(self.getMinutes()).length == 1?
+ "0"+self.getMinutes() : self.getMinutes();
+ }
+ function j() {
+ // Day of the month without leading zeros
+ return self.getDate();
+ }
+ function l() {
+ // A full textual representation of the day of the week
+ return daysLong[self.getDay()];
+ }
+ function L() {
+ // leap year or not. 1 if leap year, 0 if not.
+ // the logic should match iso's 8601 standard.
+ var y_ = Y();
+ if (
+ (y_ % 4 == 0 && y_ % 100 != 0) ||
+ (y_ % 4 == 0 && y_ % 100 == 0 && y_ % 400 == 0)
+ ) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ function m() {
+ // Numeric representation of a month, with leading zeros
+ return self.getMonth() < 9?
+ "0"+(self.getMonth()+1) :
+ self.getMonth()+1;
+ }
+ function M() {
+ // A short textual representation of a month, three letters
+ return monthsShort[self.getMonth()];
+ }
+ function n() {
+ // Numeric representation of a month, without leading zeros
+ return self.getMonth()+1;
+ }
+ function O() {
+ // Difference to Greenwich time (GMT) in hours
+ var os = Math.abs(self.getTimezoneOffset());
+ var h = ""+Math.floor(os/60);
+ var m = ""+(os%60);
+ h.length == 1? h = "0"+h:1;
+ m.length == 1? m = "0"+m:1;
+ return self.getTimezoneOffset() < 0 ? "+"+h+m : "-"+h+m;
+ }
+ function r() {
+ // RFC 822 formatted date
+ var r; // result
+ // Thu , 21 Dec 2000
+ r = D() + ", " + j() + " " + M() + " " + Y() +
+ // 16 : 01 : 07 +0200
+ " " + H() + ":" + i() + ":" + s() + " " + O();
+ return r;
+ }
+ function S() {
+ // English ordinal suffix for the day of the month, 2 characters
+ return daysSuffix[self.getDate()-1];
+ }
+ function s() {
+ // Seconds, with leading zeros
+ return new String(self.getSeconds()).length == 1?
+ "0"+self.getSeconds() : self.getSeconds();
+ }
+ function t() {
+
+ // thanks to Matt Bannon for some much needed code-fixes here!
+ var daysinmonths = [null,31,28,31,30,31,30,31,31,30,31,30,31];
+ if (L()==1 && n()==2) return 29; // leap day
+ return daysinmonths[n()];
+ }
+ function U() {
+ // Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
+ return Math.round(self.getTime()/1000);
+ }
+ function W() {
+ // Weeknumber, as per ISO specification:
+ // http://www.cl.cam.ac.uk/~mgk25/iso-time.html
+
+ // if the day is three days before newyears eve,
+ // there's a chance it's "week 1" of next year.
+ // here we check for that.
+ var beforeNY = 364+L() - z();
+ var afterNY = z();
+ var weekday = w()!=0?w()-1:6; // makes sunday (0), into 6.
+ if (beforeNY <= 2 && weekday <= 2-beforeNY) {
+ return 1;
+ }
+ // similarly, if the day is within threedays of newyears
+ // there's a chance it belongs in the old year.
+ var ny = new Date("January 1 " + Y() + " 00:00:00");
+ var nyDay = ny.getDay()!=0?ny.getDay()-1:6;
+ if (
+ (afterNY <= 2) &&
+ (nyDay >=4) &&
+ (afterNY >= (6-nyDay))
+ ) {
+ // Since I'm not sure we can just always return 53,
+ // i call the function here again, using the last day
+ // of the previous year, as the date, and then just
+ // return that week.
+ var prevNY = new Date("December 31 " + (Y()-1) + " 00:00:00");
+ return prevNY.formatDate("W");
+ }
+
+ // week 1, is the week that has the first thursday in it.
+ // note that this value is not zero index.
+ if (nyDay <= 3) {
+ // first day of the year fell on a thursday, or earlier.
+ return 1 + Math.floor( ( z() + nyDay ) / 7 );
+ } else {
+ // first day of the year fell on a friday, or later.
+ return 1 + Math.floor( ( z() - ( 7 - nyDay ) ) / 7 );
+ }
+ }
+ function w() {
+ // Numeric representation of the day of the week
+ return self.getDay();
+ }
+
+ function Y() {
+ // A full numeric representation of a year, 4 digits
+
+ // we first check, if getFullYear is supported. if it
+ // is, we just use that. ppks code is nice, but wont
+ // work with dates outside 1900-2038, or something like that
+ if (self.getFullYear) {
+ var newDate = new Date("January 1 2001 00:00:00 +0000");
+ var x = newDate .getFullYear();
+ if (x == 2001) {
+ // i trust the method now
+ return self.getFullYear();
+ }
+ }
+ // else, do this:
+ // codes thanks to ppk:
+ // http://www.xs4all.nl/~ppk/js/introdate.html
+ var x = self.getYear();
+ var y = x % 100;
+ y += (y < 38) ? 2000 : 1900;
+ return y;
+ }
+ function y() {
+ // A two-digit representation of a year
+ var y = Y()+"";
+ return y.substring(y.length-2,y.length);
+ }
+ function z() {
+ // The day of the year, zero indexed! 0 through 366
+ var t = new Date("January 1 " + Y() + " 00:00:00");
+ var diff = self.getTime() - t.getTime();
+ return Math.floor(diff/1000/60/60/24);
+ }
+
+ var self = this;
+ if (time) {
+ // save time
+ var prevTime = self.getTime();
+ self.setTime(time);
+ }
+
+ var ia = input.split("");
+ var ij = 0;
+ while (ia[ij]) {
+ if (ia[ij] == "\\") {
+ // this is our way of allowing users to escape stuff
+ ia.splice(ij,1);
+ } else {
+ if (arrayExists(switches,ia[ij])) {
+ ia[ij] = eval(ia[ij] + "()");
+ }
+ }
+ ij++;
+ }
+ // reset time, back to what it was
+ if (prevTime) {
+ self.setTime(prevTime);
+ }
+ return ia.join("");
+}
+
+var date = new Date("1/1/2007 1:11:11");
+
+for (i = 0; i < 500; ++i) {
+ var shortFormat = date.formatDate("Y-m-d");
+ var longFormat = date.formatDate("l, F d, Y g:i:s A");
+ date.setTime(date.getTime() + 84266956);
+}
+
diff --git a/tests/benchmarks/script/sunspider/tests/date-format-xparb.js b/tests/benchmarks/script/sunspider/tests/date-format-xparb.js
new file mode 100644
index 0000000000..1f0955649e
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/date-format-xparb.js
@@ -0,0 +1,417 @@
+/*
+ * Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation, version 2.1.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+Date.parseFunctions = {count:0};
+Date.parseRegexes = [];
+Date.formatFunctions = {count:0};
+
+Date.prototype.dateFormat = function(format) {
+ if (Date.formatFunctions[format] == null) {
+ Date.createNewFormat(format);
+ }
+ var func = Date.formatFunctions[format];
+ return this[func]();
+}
+
+Date.createNewFormat = function(format) {
+ var funcName = "format" + Date.formatFunctions.count++;
+ Date.formatFunctions[format] = funcName;
+ var code = "Date.prototype." + funcName + " = function(){return ";
+ var special = false;
+ var ch = '';
+ for (var i = 0; i < format.length; ++i) {
+ ch = format.charAt(i);
+ if (!special && ch == "\\") {
+ special = true;
+ }
+ else if (special) {
+ special = false;
+ code += "'" + String.escape(ch) + "' + ";
+ }
+ else {
+ code += Date.getFormatCode(ch);
+ }
+ }
+ eval(code.substring(0, code.length - 3) + ";}");
+}
+
+Date.getFormatCode = function(character) {
+ switch (character) {
+ case "d":
+ return "String.leftPad(this.getDate(), 2, '0') + ";
+ case "D":
+ return "Date.dayNames[this.getDay()].substring(0, 3) + ";
+ case "j":
+ return "this.getDate() + ";
+ case "l":
+ return "Date.dayNames[this.getDay()] + ";
+ case "S":
+ return "this.getSuffix() + ";
+ case "w":
+ return "this.getDay() + ";
+ case "z":
+ return "this.getDayOfYear() + ";
+ case "W":
+ return "this.getWeekOfYear() + ";
+ case "F":
+ return "Date.monthNames[this.getMonth()] + ";
+ case "m":
+ return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
+ case "M":
+ return "Date.monthNames[this.getMonth()].substring(0, 3) + ";
+ case "n":
+ return "(this.getMonth() + 1) + ";
+ case "t":
+ return "this.getDaysInMonth() + ";
+ case "L":
+ return "(this.isLeapYear() ? 1 : 0) + ";
+ case "Y":
+ return "this.getFullYear() + ";
+ case "y":
+ return "('' + this.getFullYear()).substring(2, 4) + ";
+ case "a":
+ return "(this.getHours() < 12 ? 'am' : 'pm') + ";
+ case "A":
+ return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
+ case "g":
+ return "((this.getHours() %12) ? this.getHours() % 12 : 12) + ";
+ case "G":
+ return "this.getHours() + ";
+ case "h":
+ return "String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";
+ case "H":
+ return "String.leftPad(this.getHours(), 2, '0') + ";
+ case "i":
+ return "String.leftPad(this.getMinutes(), 2, '0') + ";
+ case "s":
+ return "String.leftPad(this.getSeconds(), 2, '0') + ";
+ case "O":
+ return "this.getGMTOffset() + ";
+ case "T":
+ return "this.getTimezone() + ";
+ case "Z":
+ return "(this.getTimezoneOffset() * -60) + ";
+ default:
+ return "'" + String.escape(character) + "' + ";
+ }
+}
+
+Date.parseDate = function(input, format) {
+ if (Date.parseFunctions[format] == null) {
+ Date.createParser(format);
+ }
+ var func = Date.parseFunctions[format];
+ return Date[func](input);
+}
+
+Date.createParser = function(format) {
+ var funcName = "parse" + Date.parseFunctions.count++;
+ var regexNum = Date.parseRegexes.length;
+ var currentGroup = 1;
+ Date.parseFunctions[format] = funcName;
+
+ var code = "Date." + funcName + " = function(input){\n"
+ + "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1;\n"
+ + "var d = new Date();\n"
+ + "y = d.getFullYear();\n"
+ + "m = d.getMonth();\n"
+ + "d = d.getDate();\n"
+ + "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
+ + "if (results && results.length > 0) {"
+ var regex = "";
+
+ var special = false;
+ var ch = '';
+ for (var i = 0; i < format.length; ++i) {
+ ch = format.charAt(i);
+ if (!special && ch == "\\") {
+ special = true;
+ }
+ else if (special) {
+ special = false;
+ regex += String.escape(ch);
+ }
+ else {
+ obj = Date.formatCodeToRegex(ch, currentGroup);
+ currentGroup += obj.g;
+ regex += obj.s;
+ if (obj.g && obj.c) {
+ code += obj.c;
+ }
+ }
+ }
+
+ code += "if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"
+ + "{return new Date(y, m, d, h, i, s);}\n"
+ + "else if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"
+ + "{return new Date(y, m, d, h, i);}\n"
+ + "else if (y > 0 && m >= 0 && d > 0 && h >= 0)\n"
+ + "{return new Date(y, m, d, h);}\n"
+ + "else if (y > 0 && m >= 0 && d > 0)\n"
+ + "{return new Date(y, m, d);}\n"
+ + "else if (y > 0 && m >= 0)\n"
+ + "{return new Date(y, m);}\n"
+ + "else if (y > 0)\n"
+ + "{return new Date(y);}\n"
+ + "}return null;}";
+
+ Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$");
+ eval(code);
+}
+
+Date.formatCodeToRegex = function(character, currentGroup) {
+ switch (character) {
+ case "D":
+ return {g:0,
+ c:null,
+ s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};
+ case "j":
+ case "d":
+ return {g:1,
+ c:"d = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{1,2})"};
+ case "l":
+ return {g:0,
+ c:null,
+ s:"(?:" + Date.dayNames.join("|") + ")"};
+ case "S":
+ return {g:0,
+ c:null,
+ s:"(?:st|nd|rd|th)"};
+ case "w":
+ return {g:0,
+ c:null,
+ s:"\\d"};
+ case "z":
+ return {g:0,
+ c:null,
+ s:"(?:\\d{1,3})"};
+ case "W":
+ return {g:0,
+ c:null,
+ s:"(?:\\d{2})"};
+ case "F":
+ return {g:1,
+ c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "].substring(0, 3)], 10);\n",
+ s:"(" + Date.monthNames.join("|") + ")"};
+ case "M":
+ return {g:1,
+ c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "]], 10);\n",
+ s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};
+ case "n":
+ case "m":
+ return {g:1,
+ c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n",
+ s:"(\\d{1,2})"};
+ case "t":
+ return {g:0,
+ c:null,
+ s:"\\d{1,2}"};
+ case "L":
+ return {g:0,
+ c:null,
+ s:"(?:1|0)"};
+ case "Y":
+ return {g:1,
+ c:"y = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{4})"};
+ case "y":
+ return {g:1,
+ c:"var ty = parseInt(results[" + currentGroup + "], 10);\n"
+ + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
+ s:"(\\d{1,2})"};
+ case "a":
+ return {g:1,
+ c:"if (results[" + currentGroup + "] == 'am') {\n"
+ + "if (h == 12) { h = 0; }\n"
+ + "} else { if (h < 12) { h += 12; }}",
+ s:"(am|pm)"};
+ case "A":
+ return {g:1,
+ c:"if (results[" + currentGroup + "] == 'AM') {\n"
+ + "if (h == 12) { h = 0; }\n"
+ + "} else { if (h < 12) { h += 12; }}",
+ s:"(AM|PM)"};
+ case "g":
+ case "G":
+ case "h":
+ case "H":
+ return {g:1,
+ c:"h = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{1,2})"};
+ case "i":
+ return {g:1,
+ c:"i = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{2})"};
+ case "s":
+ return {g:1,
+ c:"s = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{2})"};
+ case "O":
+ return {g:0,
+ c:null,
+ s:"[+-]\\d{4}"};
+ case "T":
+ return {g:0,
+ c:null,
+ s:"[A-Z]{3}"};
+ case "Z":
+ return {g:0,
+ c:null,
+ s:"[+-]\\d{1,5}"};
+ default:
+ return {g:0,
+ c:null,
+ s:String.escape(character)};
+ }
+}
+
+Date.prototype.getTimezone = function() {
+ return this.toString().replace(
+ /^.*? ([A-Z]{3}) [0-9]{4}.*$/, "$1").replace(
+ /^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, "$1$2$3");
+}
+
+Date.prototype.getGMTOffset = function() {
+ return (this.getTimezoneOffset() > 0 ? "-" : "+")
+ + String.leftPad(Math.floor(this.getTimezoneOffset() / 60), 2, "0")
+ + String.leftPad(this.getTimezoneOffset() % 60, 2, "0");
+}
+
+Date.prototype.getDayOfYear = function() {
+ var num = 0;
+ Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
+ for (var i = 0; i < this.getMonth(); ++i) {
+ num += Date.daysInMonth[i];
+ }
+ return num + this.getDate() - 1;
+}
+
+Date.prototype.getWeekOfYear = function() {
+ // Skip to Thursday of this week
+ var now = this.getDayOfYear() + (4 - this.getDay());
+ // Find the first Thursday of the year
+ var jan1 = new Date(this.getFullYear(), 0, 1);
+ var then = (7 - jan1.getDay() + 4);
+ document.write(then);
+ return String.leftPad(((now - then) / 7) + 1, 2, "0");
+}
+
+Date.prototype.isLeapYear = function() {
+ var year = this.getFullYear();
+ return ((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));
+}
+
+Date.prototype.getFirstDayOfMonth = function() {
+ var day = (this.getDay() - (this.getDate() - 1)) % 7;
+ return (day < 0) ? (day + 7) : day;
+}
+
+Date.prototype.getLastDayOfMonth = function() {
+ var day = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this.getDate())) % 7;
+ return (day < 0) ? (day + 7) : day;
+}
+
+Date.prototype.getDaysInMonth = function() {
+ Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
+ return Date.daysInMonth[this.getMonth()];
+}
+
+Date.prototype.getSuffix = function() {
+ switch (this.getDate()) {
+ case 1:
+ case 21:
+ case 31:
+ return "st";
+ case 2:
+ case 22:
+ return "nd";
+ case 3:
+ case 23:
+ return "rd";
+ default:
+ return "th";
+ }
+}
+
+String.escape = function(string) {
+ return string.replace(/('|\\)/g, "\\$1");
+}
+
+String.leftPad = function (val, size, ch) {
+ var result = new String(val);
+ if (ch == null) {
+ ch = " ";
+ }
+ while (result.length < size) {
+ result = ch + result;
+ }
+ return result;
+}
+
+Date.daysInMonth = [31,28,31,30,31,30,31,31,30,31,30,31];
+Date.monthNames =
+ ["January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"];
+Date.dayNames =
+ ["Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"];
+Date.y2kYear = 50;
+Date.monthNumbers = {
+ Jan:0,
+ Feb:1,
+ Mar:2,
+ Apr:3,
+ May:4,
+ Jun:5,
+ Jul:6,
+ Aug:7,
+ Sep:8,
+ Oct:9,
+ Nov:10,
+ Dec:11};
+Date.patterns = {
+ ISO8601LongPattern:"Y-m-d H:i:s",
+ ISO8601ShortPattern:"Y-m-d",
+ ShortDatePattern: "n/j/Y",
+ LongDatePattern: "l, F d, Y",
+ FullDateTimePattern: "l, F d, Y g:i:s A",
+ MonthDayPattern: "F d",
+ ShortTimePattern: "g:i A",
+ LongTimePattern: "g:i:s A",
+ SortableDateTimePattern: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTimePattern: "Y-m-d H:i:sO",
+ YearMonthPattern: "F, Y"};
+
+var date = new Date("1/1/2007 1:11:11");
+
+for (i = 0; i < 4000; ++i) {
+ var shortFormat = date.dateFormat("Y-m-d");
+ var longFormat = date.dateFormat("l, F d, Y g:i:s A");
+ date.setTime(date.getTime() + 84266956);
+}
diff --git a/tests/benchmarks/script/sunspider/tests/math-cordic.js b/tests/benchmarks/script/sunspider/tests/math-cordic.js
new file mode 100644
index 0000000000..4d3833b1ef
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/math-cordic.js
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) Rich Moore. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/////. Start CORDIC
+
+var AG_CONST = 0.6072529350;
+
+function FIXED(X)
+{
+ return X * 65536.0;
+}
+
+function FLOAT(X)
+{
+ return X / 65536.0;
+}
+
+function DEG2RAD(X)
+{
+ return 0.017453 * (X);
+}
+
+var Angles = [
+ FIXED(45.0), FIXED(26.565), FIXED(14.0362), FIXED(7.12502),
+ FIXED(3.57633), FIXED(1.78991), FIXED(0.895174), FIXED(0.447614),
+ FIXED(0.223811), FIXED(0.111906), FIXED(0.055953),
+ FIXED(0.027977)
+ ];
+
+
+function cordicsincos() {
+ var X;
+ var Y;
+ var TargetAngle;
+ var CurrAngle;
+ var Step;
+
+ X = FIXED(AG_CONST); /* AG_CONST * cos(0) */
+ Y = 0; /* AG_CONST * sin(0) */
+
+ TargetAngle = FIXED(28.027);
+ CurrAngle = 0;
+ for (Step = 0; Step < 12; Step++) {
+ var NewX;
+ if (TargetAngle > CurrAngle) {
+ NewX = X - (Y >> Step);
+ Y = (X >> Step) + Y;
+ X = NewX;
+ CurrAngle += Angles[Step];
+ } else {
+ NewX = X + (Y >> Step);
+ Y = -(X >> Step) + Y;
+ X = NewX;
+ CurrAngle -= Angles[Step];
+ }
+ }
+}
+
+///// End CORDIC
+
+function cordic( runs ) {
+ var start = new Date();
+
+ for ( var i = 0 ; i < runs ; i++ ) {
+ cordicsincos();
+ }
+
+ var end = new Date();
+
+ return end.getTime() - start.getTime();
+}
+
+cordic(25000);
diff --git a/tests/benchmarks/script/sunspider/tests/math-partial-sums.js b/tests/benchmarks/script/sunspider/tests/math-partial-sums.js
new file mode 100644
index 0000000000..d082d79945
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/math-partial-sums.js
@@ -0,0 +1,33 @@
+// The Computer Language Shootout
+// http://shootout.alioth.debian.org/
+// contributed by Isaac Gouy
+
+function partial(n){
+ var a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0.0;
+ var twothirds = 2.0/3.0;
+ var alt = -1.0;
+ var k2 = k3 = sk = ck = 0.0;
+
+ for (var k = 1; k <= n; k++){
+ k2 = k*k;
+ k3 = k2*k;
+ sk = Math.sin(k);
+ ck = Math.cos(k);
+ alt = -alt;
+
+ a1 += Math.pow(twothirds,k-1);
+ a2 += Math.pow(k,-0.5);
+ a3 += 1.0/(k*(k+1.0));
+ a4 += 1.0/(k3 * sk*sk);
+ a5 += 1.0/(k3 * ck*ck);
+ a6 += 1.0/k;
+ a7 += 1.0/k2;
+ a8 += alt/k;
+ a9 += alt/(2*k -1);
+ }
+}
+
+for (var i = 1024; i <= 16384; i *= 2) {
+ partial(i);
+}
+
diff --git a/tests/benchmarks/script/sunspider/tests/math-spectral-norm.js b/tests/benchmarks/script/sunspider/tests/math-spectral-norm.js
new file mode 100644
index 0000000000..8139ef370e
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/math-spectral-norm.js
@@ -0,0 +1,51 @@
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org/
+//
+// contributed by Ian Osgood
+
+function A(i,j) {
+ return 1/((i+j)*(i+j+1)/2+i+1);
+}
+
+function Au(u,v) {
+ for (var i=0; i<u.length; ++i) {
+ var t = 0;
+ for (var j=0; j<u.length; ++j)
+ t += A(i,j) * u[j];
+ v[i] = t;
+ }
+}
+
+function Atu(u,v) {
+ for (var i=0; i<u.length; ++i) {
+ var t = 0;
+ for (var j=0; j<u.length; ++j)
+ t += A(j,i) * u[j];
+ v[i] = t;
+ }
+}
+
+function AtAu(u,v,w) {
+ Au(u,w);
+ Atu(w,v);
+}
+
+function spectralnorm(n) {
+ var i, u=[], v=[], w=[], vv=0, vBv=0;
+ for (i=0; i<n; ++i) {
+ u[i] = 1; v[i] = w[i] = 0;
+ }
+ for (i=0; i<10; ++i) {
+ AtAu(u,v,w);
+ AtAu(v,u,w);
+ }
+ for (i=0; i<n; ++i) {
+ vBv += u[i]*v[i];
+ vv += v[i]*v[i];
+ }
+ return Math.sqrt(vBv/vv);
+}
+
+for (var i = 6; i <= 48; i *= 2) {
+ spectralnorm(i);
+}
diff --git a/tests/benchmarks/script/sunspider/tests/regexp-dna.js b/tests/benchmarks/script/sunspider/tests/regexp-dna.js
new file mode 100644
index 0000000000..b500e68ad9
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/regexp-dna.js
@@ -0,0 +1,1712 @@
+// The Computer Language Shootout
+// http://shootout.alioth.debian.org/
+//
+// contributed by Jesse Millikan
+// Base on the Ruby version by jose fco. gonzalez
+
+var l;
+var dnaInput = ">ONE Homo sapiens alu\n\
+GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGA\n\
+TCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACT\n\
+AAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAG\n\
+GCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCG\n\
+CCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGT\n\
+GGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCA\n\
+GGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAA\n\
+TTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAG\n\
+AATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCA\n\
+GCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGT\n\
+AATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACC\n\
+AGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTG\n\
+GTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACC\n\
+CGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAG\n\
+AGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTT\n\
+TGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACA\n\
+TGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCT\n\
+GTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGG\n\
+TTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGT\n\
+CTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGG\n\
+CGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCG\n\
+TCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTA\n\
+CTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCG\n\
+AGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCG\n\
+GGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACC\n\
+TGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAA\n\
+TACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGA\n\
+GGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACT\n\
+GCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTC\n\
+ACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGT\n\
+TCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGC\n\
+CGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCG\n\
+CTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTG\n\
+GGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCC\n\
+CAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCT\n\
+GGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGC\n\
+GCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGA\n\
+GGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGA\n\
+GACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGA\n\
+GGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTG\n\
+AAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAAT\n\
+CCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCA\n\
+GTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAA\n\
+AAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGC\n\
+GGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCT\n\
+ACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGG\n\
+GAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATC\n\
+GCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGC\n\
+GGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGG\n\
+TCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAA\n\
+AAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAG\n\
+GAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACT\n\
+CCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCC\n\
+TGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAG\n\
+ACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGC\n\
+GTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGA\n\
+ACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGA\n\
+CAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCA\n\
+CTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCA\n\
+ACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCG\n\
+CCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGG\n\
+AGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTC\n\
+CGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCG\n\
+AGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACC\n\
+CCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAG\n\
+CTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAG\n\
+CCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGG\n\
+CCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATC\n\
+ACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAA\n\
+AAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGC\n\
+TGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCC\n\
+ACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGG\n\
+CTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGG\n\
+AGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATT\n\
+AGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAA\n\
+TCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGC\n\
+CTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAA\n\
+TCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAG\n\
+CCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGT\n\
+GGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCG\n\
+GGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAG\n\
+CGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTG\n\
+GGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATG\n\
+GTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGT\n\
+AATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTT\n\
+GCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCT\n\
+CAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCG\n\
+GGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTC\n\
+TCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACT\n\
+CGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAG\n\
+ATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGG\n\
+CGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTG\n\
+AGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATA\n\
+CAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGG\n\
+CAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGC\n\
+ACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCAC\n\
+GCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTC\n\
+GAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCG\n\
+GGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCT\n\
+TGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGG\n\
+CGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCA\n\
+GCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGG\n\
+CCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGC\n\
+GCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGG\n\
+CGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGA\n\
+CTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGG\n\
+CCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAA\n\
+ACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCC\n\
+CAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGT\n\
+GAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAA\n\
+AGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGG\n\
+ATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTAC\n\
+TAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGA\n\
+GGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGC\n\
+GCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGG\n\
+TGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTC\n\
+AGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAA\n\
+ATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGA\n\
+GAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC\n\
+AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTG\n\
+TAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGAC\n\
+CAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGT\n\
+GGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAAC\n\
+CCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACA\n\
+GAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACT\n\
+TTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAAC\n\
+ATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCC\n\
+TGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAG\n\
+GTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCG\n\
+TCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAG\n\
+GCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCC\n\
+GTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCT\n\
+ACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCC\n\
+GAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCC\n\
+GGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCAC\n\
+CTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAA\n\
+ATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTG\n\
+AGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCAC\n\
+TGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCT\n\
+CACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAG\n\
+TTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAG\n\
+CCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATC\n\
+GCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCT\n\
+GGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATC\n\
+CCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCC\n\
+TGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGG\n\
+CGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG\n\
+AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCG\n\
+AGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGG\n\
+AGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGT\n\
+GAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAA\n\
+TCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGC\n\
+AGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCA\n\
+AAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGG\n\
+CGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTC\n\
+TACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCG\n\
+GGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGAT\n\
+CGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCG\n\
+CGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAG\n\
+GTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACA\n\
+AAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCA\n\
+GGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCAC\n\
+TCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGC\n\
+CTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGA\n\
+GACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGG\n\
+CGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTG\n\
+AACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCG\n\
+ACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGC\n\
+ACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCC\n\
+AACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGC\n\
+GCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCG\n\
+GAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACT\n\
+CCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCC\n\
+GAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAAC\n\
+CCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA\n\
+GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGA\n\
+GCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAG\n\
+GCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGAT\n\
+CACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTA\n\
+AAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGG\n\
+CTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGC\n\
+CACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTG\n\
+GCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAG\n\
+GAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAAT\n\
+TAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGA\n\
+ATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAG\n\
+CCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTA\n\
+ATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCA\n\
+GCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGG\n\
+TGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCC\n\
+GGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGA\n\
+GCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTT\n\
+GGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACAT\n\
+GGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTG\n\
+TAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGT\n\
+TGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTC\n\
+TCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGC\n\
+GGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGT\n\
+CTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTAC\n\
+TCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGA\n\
+GATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGG\n\
+GCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCT\n\
+GAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT\n\
+ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAG\n\
+GCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTG\n\
+CACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCA\n\
+CGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTT\n\
+CGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCC\n\
+GGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGC\n\
+TTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGG\n\
+GCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCC\n\
+AGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTG\n\
+GCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCG\n\
+CGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAG\n\
+GCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAG\n\
+ACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAG\n\
+GCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGA\n\
+AACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATC\n\
+CCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAG\n\
+TGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAA\n\
+AAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCG\n\
+GATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTA\n\
+CTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGG\n\
+AGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCG\n\
+CGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCG\n\
+GTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGT\n\
+CAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAA\n\
+AATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGG\n\
+AGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTC\n\
+CAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCT\n\
+GTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA\n\
+CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCG\n\
+TGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAA\n\
+CCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGAC\n\
+AGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCAC\n\
+TTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAA\n\
+CATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGC\n\
+CTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGA\n\
+GGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCC\n\
+GTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGA\n\
+GGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCC\n\
+CGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGC\n\
+TACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGC\n\
+CGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGC\n\
+CGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCA\n\
+CCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAA\n\
+AATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCT\n\
+GAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCA\n\
+CTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGC\n\
+TCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGA\n\
+GTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTA\n\
+GCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAAT\n\
+CGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCC\n\
+TGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAAT\n\
+CCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGC\n\
+CTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTG\n\
+GCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGG\n\
+GAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGC\n\
+GAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG\n\
+GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGG\n\
+TGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTA\n\
+ATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTG\n\
+CAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTC\n\
+AAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGG\n\
+GCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCT\n\
+CTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTC\n\
+GGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGA\n\
+TCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGC\n\
+GCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGA\n\
+GGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATAC\n\
+AAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGC\n\
+AGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCA\n\
+CTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACG\n\
+CCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCG\n\
+AGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGG\n\
+GCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTT\n\
+GAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGC\n\
+GACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAG\n\
+CACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGC\n\
+CAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCG\n\
+CGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGC\n\
+GGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGAC\n\
+TCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGC\n\
+CGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAA\n\
+CCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCC\n\
+AGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTG\n\
+AGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA\n\
+GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGA\n\
+TCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACT\n\
+AAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAG\n\
+GCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCG\n\
+CCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGT\n\
+GGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCA\n\
+GGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAA\n\
+TTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAG\n\
+AATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCA\n\
+GCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGT\n\
+AATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACC\n\
+AGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTG\n\
+GTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACC\n\
+CGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAG\n\
+AGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTT\n\
+TGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACA\n\
+TGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCT\n\
+GTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGG\n\
+TTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGT\n\
+CTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGG\n\
+CGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCG\n\
+TCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTA\n\
+CTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCG\n\
+AGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCG\n\
+GGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACC\n\
+TGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAA\n\
+TACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGA\n\
+GGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACT\n\
+GCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTC\n\
+ACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGT\n\
+TCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGC\n\
+CGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCG\n\
+CTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTG\n\
+GGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCC\n\
+CAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCT\n\
+GGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGC\n\
+GCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGA\n\
+GGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGA\n\
+GACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGA\n\
+GGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTG\n\
+AAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAAT\n\
+CCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCA\n\
+GTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAA\n\
+AAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGC\n\
+GGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCT\n\
+ACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGG\n\
+GAGGCTGAGGCAGGAGAATC\n\
+>TWO IUB ambiguity codes\n\
+cttBtatcatatgctaKggNcataaaSatgtaaaDcDRtBggDtctttataattcBgtcg\n\
+tactDtDagcctatttSVHtHttKtgtHMaSattgWaHKHttttagacatWatgtRgaaa\n\
+NtactMcSMtYtcMgRtacttctWBacgaaatatagScDtttgaagacacatagtVgYgt\n\
+cattHWtMMWcStgttaggKtSgaYaaccWStcgBttgcgaMttBYatcWtgacaYcaga\n\
+gtaBDtRacttttcWatMttDBcatWtatcttactaBgaYtcttgttttttttYaaScYa\n\
+HgtgttNtSatcMtcVaaaStccRcctDaataataStcYtRDSaMtDttgttSagtRRca\n\
+tttHatSttMtWgtcgtatSSagactYaaattcaMtWatttaSgYttaRgKaRtccactt\n\
+tattRggaMcDaWaWagttttgacatgttctacaaaRaatataataaMttcgDacgaSSt\n\
+acaStYRctVaNMtMgtaggcKatcttttattaaaaagVWaHKYagtttttatttaacct\n\
+tacgtVtcVaattVMBcttaMtttaStgacttagattWWacVtgWYagWVRctDattBYt\n\
+gtttaagaagattattgacVatMaacattVctgtBSgaVtgWWggaKHaatKWcBScSWa\n\
+accRVacacaaactaccScattRatatKVtactatatttHttaagtttSKtRtacaaagt\n\
+RDttcaaaaWgcacatWaDgtDKacgaacaattacaRNWaatHtttStgttattaaMtgt\n\
+tgDcgtMgcatBtgcttcgcgaDWgagctgcgaggggVtaaScNatttacttaatgacag\n\
+cccccacatYScaMgtaggtYaNgttctgaMaacNaMRaacaaacaKctacatagYWctg\n\
+ttWaaataaaataRattagHacacaagcgKatacBttRttaagtatttccgatctHSaat\n\
+actcNttMaagtattMtgRtgaMgcataatHcMtaBSaRattagttgatHtMttaaKagg\n\
+YtaaBataSaVatactWtataVWgKgttaaaacagtgcgRatatacatVtHRtVYataSa\n\
+KtWaStVcNKHKttactatccctcatgWHatWaRcttactaggatctataDtDHBttata\n\
+aaaHgtacVtagaYttYaKcctattcttcttaataNDaaggaaaDYgcggctaaWSctBa\n\
+aNtgctggMBaKctaMVKagBaactaWaDaMaccYVtNtaHtVWtKgRtcaaNtYaNacg\n\
+gtttNattgVtttctgtBaWgtaattcaagtcaVWtactNggattctttaYtaaagccgc\n\
+tcttagHVggaYtgtNcDaVagctctctKgacgtatagYcctRYHDtgBattDaaDgccK\n\
+tcHaaStttMcctagtattgcRgWBaVatHaaaataYtgtttagMDMRtaataaggatMt\n\
+ttctWgtNtgtgaaaaMaatatRtttMtDgHHtgtcattttcWattRSHcVagaagtacg\n\
+ggtaKVattKYagactNaatgtttgKMMgYNtcccgSKttctaStatatNVataYHgtNa\n\
+BKRgNacaactgatttcctttaNcgatttctctataScaHtataRagtcRVttacDSDtt\n\
+aRtSatacHgtSKacYagttMHtWataggatgactNtatSaNctataVtttRNKtgRacc\n\
+tttYtatgttactttttcctttaaacatacaHactMacacggtWataMtBVacRaSaatc\n\
+cgtaBVttccagccBcttaRKtgtgcctttttRtgtcagcRttKtaaacKtaaatctcac\n\
+aattgcaNtSBaaccgggttattaaBcKatDagttactcttcattVtttHaaggctKKga\n\
+tacatcBggScagtVcacattttgaHaDSgHatRMaHWggtatatRgccDttcgtatcga\n\
+aacaHtaagttaRatgaVacttagattVKtaaYttaaatcaNatccRttRRaMScNaaaD\n\
+gttVHWgtcHaaHgacVaWtgttScactaagSgttatcttagggDtaccagWattWtRtg\n\
+ttHWHacgattBtgVcaYatcggttgagKcWtKKcaVtgaYgWctgYggVctgtHgaNcV\n\
+taBtWaaYatcDRaaRtSctgaHaYRttagatMatgcatttNattaDttaattgttctaa\n\
+ccctcccctagaWBtttHtBccttagaVaatMcBHagaVcWcagBVttcBtaYMccagat\n\
+gaaaaHctctaacgttagNWRtcggattNatcRaNHttcagtKttttgWatWttcSaNgg\n\
+gaWtactKKMaacatKatacNattgctWtatctaVgagctatgtRaHtYcWcttagccaa\n\
+tYttWttaWSSttaHcaaaaagVacVgtaVaRMgattaVcDactttcHHggHRtgNcctt\n\
+tYatcatKgctcctctatVcaaaaKaaaagtatatctgMtWtaaaacaStttMtcgactt\n\
+taSatcgDataaactaaacaagtaaVctaggaSccaatMVtaaSKNVattttgHccatca\n\
+cBVctgcaVatVttRtactgtVcaattHgtaaattaaattttYtatattaaRSgYtgBag\n\
+aHSBDgtagcacRHtYcBgtcacttacactaYcgctWtattgSHtSatcataaatataHt\n\
+cgtYaaMNgBaatttaRgaMaatatttBtttaaaHHKaatctgatWatYaacttMctctt\n\
+ttVctagctDaaagtaVaKaKRtaacBgtatccaaccactHHaagaagaaggaNaaatBW\n\
+attccgStaMSaMatBttgcatgRSacgttVVtaaDMtcSgVatWcaSatcttttVatag\n\
+ttactttacgatcaccNtaDVgSRcgVcgtgaacgaNtaNatatagtHtMgtHcMtagaa\n\
+attBgtataRaaaacaYKgtRccYtatgaagtaataKgtaaMttgaaRVatgcagaKStc\n\
+tHNaaatctBBtcttaYaBWHgtVtgacagcaRcataWctcaBcYacYgatDgtDHccta\n\
+aagacYRcaggattHaYgtKtaatgcVcaataMYacccatatcacgWDBtgaatcBaata\n\
+cKcttRaRtgatgaBDacggtaattaaYtataStgVHDtDctgactcaaatKtacaatgc\n\
+gYatBtRaDatHaactgtttatatDttttaaaKVccYcaaccNcBcgHaaVcattHctcg\n\
+attaaatBtatgcaaaaatYMctSactHatacgaWacattacMBgHttcgaatVaaaaca\n\
+BatatVtctgaaaaWtctRacgBMaatSgRgtgtcgactatcRtattaScctaStagKga\n\
+DcWgtYtDDWKRgRtHatRtggtcgaHgggcgtattaMgtcagccaBggWVcWctVaaat\n\
+tcgNaatcKWagcNaHtgaaaSaaagctcYctttRVtaaaatNtataaccKtaRgtttaM\n\
+tgtKaBtRtNaggaSattHatatWactcagtgtactaKctatttgRYYatKatgtccgtR\n\
+tttttatttaatatVgKtttgtatgtNtataRatWYNgtRtHggtaaKaYtKSDcatcKg\n\
+taaYatcSRctaVtSMWtVtRWHatttagataDtVggacagVcgKWagBgatBtaaagNc\n\
+aRtagcataBggactaacacRctKgttaatcctHgDgttKHHagttgttaatgHBtatHc\n\
+DaagtVaBaRccctVgtgDtacRHSctaagagcggWYaBtSaKtHBtaaactYacgNKBa\n\
+VYgtaacttagtVttcttaatgtBtatMtMtttaattaatBWccatRtttcatagVgMMt\n\
+agctStKctaMactacDNYgKYHgaWcgaHgagattacVgtttgtRaSttaWaVgataat\n\
+gtgtYtaStattattMtNgWtgttKaccaatagNYttattcgtatHcWtctaaaNVYKKt\n\
+tWtggcDtcgaagtNcagatacgcattaagaccWctgcagcttggNSgaNcHggatgtVt\n\
+catNtRaaBNcHVagagaaBtaaSggDaatWaatRccaVgggStctDaacataKttKatt\n\
+tggacYtattcSatcttagcaatgaVBMcttDattctYaaRgatgcattttNgVHtKcYR\n\
+aatRKctgtaaacRatVSagctgtWacBtKVatctgttttKcgtctaaDcaagtatcSat\n\
+aWVgcKKataWaYttcccSaatgaaaacccWgcRctWatNcWtBRttYaattataaNgac\n\
+acaatagtttVNtataNaYtaatRaVWKtBatKagtaatataDaNaaaaataMtaagaaS\n\
+tccBcaatNgaataWtHaNactgtcDtRcYaaVaaaaaDgtttRatctatgHtgttKtga\n\
+aNSgatactttcgagWaaatctKaaDaRttgtggKKagcDgataaattgSaacWaVtaNM\n\
+acKtcaDaaatttctRaaVcagNacaScRBatatctRatcctaNatWgRtcDcSaWSgtt\n\
+RtKaRtMtKaatgttBHcYaaBtgatSgaSWaScMgatNtctcctatttctYtatMatMt\n\
+RRtSaattaMtagaaaaStcgVgRttSVaScagtgDtttatcatcatacRcatatDctta\n\
+tcatVRtttataaHtattcYtcaaaatactttgVctagtaaYttagatagtSYacKaaac\n\
+gaaKtaaatagataatSatatgaaatSgKtaatVtttatcctgKHaatHattagaaccgt\n\
+YaaHactRcggSBNgtgctaaBagBttgtRttaaattYtVRaaaattgtaatVatttctc\n\
+ttcatgBcVgtgKgaHaaatattYatagWacNctgaaMcgaattStagWaSgtaaKagtt\n\
+ttaagaDgatKcctgtaHtcatggKttVDatcaaggtYcgccagNgtgcVttttagagat\n\
+gctaccacggggtNttttaSHaNtatNcctcatSaaVgtactgBHtagcaYggYVKNgta\n\
+KBcRttgaWatgaatVtagtcgattYgatgtaatttacDacSctgctaaaStttaWMagD\n\
+aaatcaVYctccgggcgaVtaaWtStaKMgDtttcaaMtVgBaatccagNaaatcYRMBg\n\
+gttWtaaScKttMWtYataRaDBMaDataatHBcacDaaKDactaMgagttDattaHatH\n\
+taYatDtattDcRNStgaatattSDttggtattaaNSYacttcDMgYgBatWtaMagact\n\
+VWttctttgYMaYaacRgHWaattgRtaagcattctMKVStatactacHVtatgatcBtV\n\
+NataaBttYtSttacKgggWgYDtgaVtYgatDaacattYgatggtRDaVDttNactaSa\n\
+MtgNttaacaaSaBStcDctaccacagacgcaHatMataWKYtaYattMcaMtgSttDag\n\
+cHacgatcaHttYaKHggagttccgatYcaatgatRaVRcaagatcagtatggScctata\n\
+ttaNtagcgacgtgKaaWaactSgagtMYtcttccaKtStaacggMtaagNttattatcg\n\
+tctaRcactctctDtaacWYtgaYaSaagaWtNtatttRacatgNaatgttattgWDDcN\n\
+aHcctgaaHacSgaataaRaataMHttatMtgaSDSKatatHHaNtacagtccaYatWtc\n\
+actaactatKDacSaStcggataHgYatagKtaatKagStaNgtatactatggRHacttg\n\
+tattatgtDVagDVaRctacMYattDgtttYgtctatggtKaRSttRccRtaaccttaga\n\
+gRatagSaaMaacgcaNtatgaaatcaRaagataatagatactcHaaYKBctccaagaRa\n\
+BaStNagataggcgaatgaMtagaatgtcaKttaaatgtaWcaBttaatRcggtgNcaca\n\
+aKtttScRtWtgcatagtttWYaagBttDKgcctttatMggNttattBtctagVtacata\n\
+aaYttacacaaRttcYtWttgHcaYYtaMgBaBatctNgcDtNttacgacDcgataaSat\n\
+YaSttWtcctatKaatgcagHaVaacgctgcatDtgttaSataaaaYSNttatagtaNYt\n\
+aDaaaNtggggacttaBggcHgcgtNtaaMcctggtVtaKcgNacNtatVaSWctWtgaW\n\
+cggNaBagctctgaYataMgaagatBSttctatacttgtgtKtaattttRagtDtacata\n\
+tatatgatNHVgBMtKtaKaNttDHaagatactHaccHtcatttaaagttVaMcNgHata\n\
+tKtaNtgYMccttatcaaNagctggacStttcNtggcaVtattactHaSttatgNMVatt\n\
+MMDtMactattattgWMSgtHBttStStgatatRaDaagattttctatMtaaaaaggtac\n\
+taaVttaSacNaatactgMttgacHaHRttgMacaaaatagttaatatWKRgacDgaRta\n\
+tatttattatcYttaWtgtBRtWatgHaaattHataagtVaDtWaVaWtgStcgtMSgaS\n\
+RgMKtaaataVacataatgtaSaatttagtcgaaHtaKaatgcacatcggRaggSKctDc\n\
+agtcSttcccStYtccRtctctYtcaaKcgagtaMttttcRaYDttgttatctaatcata\n\
+NctctgctatcaMatactataggDaHaaSttMtaDtcNatataattctMcStaaBYtaNa\n\
+gatgtaatHagagSttgWHVcttatKaYgDctcttggtgttMcRaVgSgggtagacaata\n\
+aDtaattSaDaNaHaBctattgNtaccaaRgaVtKNtaaYggHtaKKgHcatctWtctDt\n\
+ttctttggSDtNtaStagttataaacaattgcaBaBWggHgcaaaBtYgctaatgaaatW\n\
+cDcttHtcMtWWattBHatcatcaaatctKMagtDNatttWaBtHaaaNgMttaaStagt\n\
+tctctaatDtcRVaYttgttMtRtgtcaSaaYVgSWDRtaatagctcagDgcWWaaaBaa\n\
+RaBctgVgggNgDWStNaNBKcBctaaKtttDcttBaaggBttgaccatgaaaNgttttt\n\
+tttatctatgttataccaaDRaaSagtaVtDtcaWatBtacattaWacttaSgtattggD\n\
+gKaaatScaattacgWcagKHaaccaYcRcaRttaDttRtttHgaHVggcttBaRgtccc\n\
+tDatKaVtKtcRgYtaKttacgtatBtStaagcaattaagaRgBagSaattccSWYttta\n\
+ttVaataNctgHgttaaNBgcVYgtRtcccagWNaaaacaDNaBcaaaaRVtcWMgBagM\n\
+tttattacgDacttBtactatcattggaaatVccggttRttcatagttVYcatYaSHaHc\n\
+ttaaagcNWaHataaaRWtctVtRYtagHtaaaYMataHYtNBctNtKaatattStgaMc\n\
+BtRgctaKtgcScSttDgYatcVtggaaKtaagatWccHccgKYctaNNctacaWctttt\n\
+gcRtgtVcgaKttcMRHgctaHtVaataaDtatgKDcttatBtDttggNtacttttMtga\n\
+acRattaaNagaactcaaaBBVtcDtcgaStaDctgaaaSgttMaDtcgttcaccaaaag\n\
+gWtcKcgSMtcDtatgtttStaaBtatagDcatYatWtaaaBacaKgcaDatgRggaaYc\n\
+taRtccagattDaWtttggacBaVcHtHtaacDacYgtaatataMagaatgHMatcttat\n\
+acgtatttttatattacHactgttataMgStYaattYaccaattgagtcaaattaYtgta\n\
+tcatgMcaDcgggtcttDtKgcatgWRtataatatRacacNRBttcHtBgcRttgtgcgt\n\
+catacMtttBctatctBaatcattMttMYgattaaVYatgDaatVagtattDacaacDMa\n\
+tcMtHcccataagatgBggaccattVWtRtSacatgctcaaggggYtttDtaaNgNtaaB\n\
+atggaatgtctRtaBgBtcNYatatNRtagaacMgagSaSDDSaDcctRagtVWSHtVSR\n\
+ggaacaBVaccgtttaStagaacaMtactccagtttVctaaRaaHttNcttagcaattta\n\
+ttaatRtaaaatctaacDaBttggSagagctacHtaaRWgattcaaBtctRtSHaNtgta\n\
+cattVcaHaNaagtataccacaWtaRtaaVKgMYaWgttaKggKMtKcgWatcaDatYtK\n\
+SttgtacgaccNctSaattcDcatcttcaaaDKttacHtggttHggRRaRcaWacaMtBW\n\
+VHSHgaaMcKattgtaRWttScNattBBatYtaNRgcggaagacHSaattRtttcYgacc\n\
+BRccMacccKgatgaacttcgDgHcaaaaaRtatatDtatYVtttttHgSHaSaatagct\n\
+NYtaHYaVYttattNtttgaaaYtaKttWtctaNtgagaaaNctNDctaaHgttagDcRt\n\
+tatagccBaacgcaRBtRctRtggtaMYYttWtgataatcgaataattattataVaaaaa\n\
+ttacNRVYcaaMacNatRttcKatMctgaagactaattataaYgcKcaSYaatMNctcaa\n\
+cgtgatttttBacNtgatDccaattattKWWcattttatatatgatBcDtaaaagttgaa\n\
+VtaHtaHHtBtataRBgtgDtaataMttRtDgDcttattNtggtctatctaaBcatctaR\n\
+atgNacWtaatgaagtcMNaacNgHttatactaWgcNtaStaRgttaaHacccgaYStac\n\
+aaaatWggaYaWgaattattcMaactcBKaaaRVNcaNRDcYcgaBctKaacaaaaaSgc\n\
+tccYBBHYaVagaatagaaaacagYtctVccaMtcgtttVatcaatttDRtgWctagtac\n\
+RttMctgtDctttcKtWttttataaatgVttgBKtgtKWDaWagMtaaagaaattDVtag\n\
+gttacatcatttatgtcgMHaVcttaBtVRtcgtaYgBRHatttHgaBcKaYWaatcNSc\n\
+tagtaaaaatttacaatcactSWacgtaatgKttWattagttttNaggtctcaagtcact\n\
+attcttctaagKggaataMgtttcataagataaaaatagattatDgcBVHWgaBKttDgc\n\
+atRHaagcaYcRaattattatgtMatatattgHDtcaDtcaaaHctStattaatHaccga\n\
+cNattgatatattttgtgtDtRatagSacaMtcRtcattcccgacacSattgttKaWatt\n\
+NHcaacttccgtttSRtgtctgDcgctcaaMagVtBctBMcMcWtgtaacgactctcttR\n\
+ggRKSttgYtYatDccagttDgaKccacgVatWcataVaaagaataMgtgataaKYaaat\n\
+cHDaacgataYctRtcYatcgcaMgtNttaBttttgatttaRtStgcaacaaaataccVg\n\
+aaDgtVgDcStctatatttattaaaaRKDatagaaagaKaaYYcaYSgKStctccSttac\n\
+agtcNactttDVttagaaagMHttRaNcSaRaMgBttattggtttaRMggatggcKDgWR\n\
+tNaataataWKKacttcKWaaagNaBttaBatMHtccattaacttccccYtcBcYRtaga\n\
+ttaagctaaYBDttaNtgaaaccHcaRMtKtaaHMcNBttaNaNcVcgVttWNtDaBatg\n\
+ataaVtcWKcttRggWatcattgaRagHgaattNtatttctctattaattaatgaDaaMa\n\
+tacgttgggcHaYVaaNaDDttHtcaaHtcVVDgBVagcMacgtgttaaBRNtatRtcag\n\
+taagaggtttaagacaVaaggttaWatctccgtVtaDtcDatttccVatgtacNtttccg\n\
+tHttatKgScBatgtVgHtYcWagcaKtaMYaaHgtaattaSaHcgcagtWNaatNccNN\n\
+YcacgVaagaRacttctcattcccRtgtgtaattagcSttaaStWaMtctNNcSMacatt\n\
+ataaactaDgtatWgtagtttaagaaaattgtagtNagtcaataaatttgatMMYactaa\n\
+tatcggBWDtVcYttcDHtVttatacYaRgaMaacaStaatcRttttVtagaDtcacWat\n\
+ttWtgaaaagaaagNRacDtttStVatBaDNtaactatatcBSMcccaSttccggaMatg\n\
+attaaWatKMaBaBatttgataNctgttKtVaagtcagScgaaaDggaWgtgttttKtWt\n\
+atttHaatgtagttcactaaKMagttSYBtKtaYgaactcagagRtatagtVtatcaaaW\n\
+YagcgNtaDagtacNSaaYDgatBgtcgataacYDtaaactacagWDcYKaagtttatta\n\
+gcatcgagttKcatDaattgattatDtcagRtWSKtcgNtMaaaaacaMttKcaWcaaSV\n\
+MaaaccagMVtaMaDtMaHaBgaacataBBVtaatVYaNSWcSgNtDNaaKacacBttta\n\
+tKtgtttcaaHaMctcagtaacgtcgYtactDcgcctaNgagagcYgatattttaaattt\n\
+ccattttacatttDaaRctattttWctttacgtDatYtttcagacgcaaVttagtaaKaa\n\
+aRtgVtccataBggacttatttgtttaWNtgttVWtaWNVDaattgtatttBaagcBtaa\n\
+BttaaVatcHcaVgacattccNggtcgacKttaaaRtagRtctWagaYggtgMtataatM\n\
+tgaaRttattttgWcttNtDRRgMDKacagaaaaggaaaRStcccagtYccVattaNaaK\n\
+StNWtgacaVtagaagcttSaaDtcacaacgDYacWDYtgtttKatcVtgcMaDaSKStV\n\
+cgtagaaWaKaagtttcHaHgMgMtctataagBtKaaaKKcactggagRRttaagaBaaN\n\
+atVVcgRcKSttDaactagtSttSattgttgaaRYatggttVttaataaHttccaagDtg\n\
+atNWtaagHtgcYtaactRgcaatgMgtgtRaatRaNaacHKtagactactggaatttcg\n\
+ccataacgMctRgatgttaccctaHgtgWaYcactcacYaattcttaBtgacttaaacct\n\
+gYgaWatgBttcttVttcgttWttMcNYgtaaaatctYgMgaaattacNgaHgaacDVVM\n\
+tttggtHtctaaRgtacagacgHtVtaBMNBgattagcttaRcttacaHcRctgttcaaD\n\
+BggttKaacatgKtttYataVaNattccgMcgcgtagtRaVVaattaKaatggttRgaMc\n\
+agtatcWBttNtHagctaatctagaaNaaacaYBctatcgcVctBtgcaaagDgttVtga\n\
+HtactSNYtaaNccatgtgDacgaVtDcgKaRtacDcttgctaagggcagMDagggtBWR\n\
+tttSgccttttttaacgtcHctaVtVDtagatcaNMaVtcVacatHctDWNaataRgcgt\n\
+aVHaggtaaaaSgtttMtattDgBtctgatSgtRagagYtctSaKWaataMgattRKtaa\n\
+catttYcgtaacacattRWtBtcggtaaatMtaaacBatttctKagtcDtttgcBtKYYB\n\
+aKttctVttgttaDtgattttcttccacttgSaaacggaaaNDaattcYNNaWcgaaYat\n\
+tttMgcBtcatRtgtaaagatgaWtgaccaYBHgaatagataVVtHtttVgYBtMctaMt\n\
+cctgaDcYttgtccaaaRNtacagcMctKaaaggatttacatgtttaaWSaYaKttBtag\n\
+DacactagctMtttNaKtctttcNcSattNacttggaacaatDagtattRtgSHaataat\n\
+gccVgacccgatactatccctgtRctttgagaSgatcatatcgDcagWaaHSgctYYWta\n\
+tHttggttctttatVattatcgactaagtgtagcatVgtgHMtttgtttcgttaKattcM\n\
+atttgtttWcaaStNatgtHcaaaDtaagBaKBtRgaBgDtSagtatMtaacYaatYtVc\n\
+KatgtgcaacVaaaatactKcRgtaYtgtNgBBNcKtcttaccttKgaRaYcaNKtactt\n\
+tgagSBtgtRagaNgcaaaNcacagtVtttHWatgttaNatBgtttaatNgVtctgaata\n\
+tcaRtattcttttttttRaaKcRStctcggDgKagattaMaaaKtcaHacttaataataK\n\
+taRgDtKVBttttcgtKaggHHcatgttagHggttNctcgtatKKagVagRaaaggaaBt\n\
+NatttVKcRttaHctaHtcaaatgtaggHccaBataNaNaggttgcWaatctgatYcaaa\n\
+HaatWtaVgaaBttagtaagaKKtaaaKtRHatMaDBtBctagcatWtatttgWttVaaa\n\
+ScMNattRactttgtYtttaaaagtaagtMtaMaSttMBtatgaBtttaKtgaatgagYg\n\
+tNNacMtcNRacMMHcttWtgtRtctttaacaacattattcYaMagBaacYttMatcttK\n\
+cRMtgMNccattaRttNatHaHNaSaaHMacacaVaatacaKaSttHatattMtVatWga\n\
+ttttttaYctttKttHgScWaacgHtttcaVaaMgaacagNatcgttaacaaaaagtaca\n\
+HBNaattgttKtcttVttaaBtctgctacgBgcWtttcaggacacatMgacatcccagcg\n\
+gMgaVKaBattgacttaatgacacacaaaaaatRKaaBctacgtRaDcgtagcVBaacDS\n\
+BHaaaaSacatatacagacRNatcttNaaVtaaaataHattagtaaaaSWccgtatWatg\n\
+gDttaactattgcccatcttHaSgYataBttBaactattBtcHtgatcaataSttaBtat\n\
+KSHYttWggtcYtttBttaataccRgVatStaHaKagaatNtagRMNgtcttYaaSaact\n\
+cagDSgagaaYtMttDtMRVgWKWtgMaKtKaDttttgactatacataatcNtatNaHat\n\
+tVagacgYgatatatttttgtStWaaatctWaMgagaRttRatacgStgattcttaagaD\n\
+taWccaaatRcagcagaaNKagtaaDggcgccBtYtagSBMtactaaataMataBSacRM\n\
+gDgattMMgtcHtcaYDtRaDaacggttDaggcMtttatgttaNctaattaVacgaaMMt\n\
+aatDccSgtattgaRtWWaccaccgagtactMcgVNgctDctaMScatagcgtcaactat\n\
+acRacgHRttgctatttaatgaattataYKttgtaagWgtYttgcHgMtaMattWaWVta\n\
+RgcttgYgttBHtYataSccStBtgtagMgtDtggcVaaSBaatagDttgBgtctttctc\n\
+attttaNagtHKtaMWcYactVcgcgtatMVtttRacVagDaatcttgctBBcRDgcaac\n\
+KttgatSKtYtagBMagaRtcgBattHcBWcaactgatttaatttWDccatttatcgagS\n\
+KaWttataHactaHMttaatHtggaHtHagaatgtKtaaRactgtttMatacgatcaagD\n\
+gatKaDctataMggtHDtggHacctttRtatcttYattttgacttgaaSaataaatYcgB\n\
+aaaaccgNatVBttMacHaKaataagtatKgtcaagactcttaHttcggaattgttDtct\n\
+aaccHttttWaaatgaaatataaaWattccYDtKtaaaacggtgaggWVtctattagtga\n\
+ctattaagtMgtttaagcatttgSgaaatatccHaaggMaaaattttcWtatKctagDtY\n\
+tMcctagagHcactttactatacaaacattaacttaHatcVMYattYgVgtMttaaRtga\n\
+aataaDatcaHgtHHatKcDYaatcttMtNcgatYatgSaMaNtcttKcWataScKggta\n\
+tcttacgcttWaaagNatgMgHtctttNtaacVtgttcMaaRatccggggactcMtttaY\n\
+MtcWRgNctgNccKatcttgYDcMgattNYaRagatHaaHgKctcataRDttacatBatc\n\
+cattgDWttatttaWgtcggagaaaaatacaatacSNtgggtttccttacSMaagBatta\n\
+caMaNcactMttatgaRBacYcYtcaaaWtagctSaacttWgDMHgaggatgBVgcHaDt\n\
+ggaactttggtcNatNgtaKaBcccaNtaagttBaacagtatacDYttcctNgWgcgSMc\n\
+acatStctHatgRcNcgtacacaatRttMggaNKKggataaaSaYcMVcMgtaMaHtgat\n\
+tYMatYcggtcttcctHtcDccgtgRatcattgcgccgatatMaaYaataaYSggatagc\n\
+gcBtNtaaaScaKgttBgagVagttaKagagtatVaactaSacWactSaKatWccaKaaa\n\
+atBKgaaKtDMattttgtaaatcRctMatcaaMagMttDgVatggMaaWgttcgaWatga\n\
+aatttgRtYtattaWHKcRgctacatKttctaccaaHttRatctaYattaaWatVNccat\n\
+NgagtcKttKataStRaatatattcctRWatDctVagttYDgSBaatYgttttgtVaatt\n\
+taatagcagMatRaacttBctattgtMagagattaaactaMatVtHtaaatctRgaaaaa\n\
+aaatttWacaacaYccYDSaattMatgaccKtaBKWBattgtcaagcHKaagttMMtaat\n\
+ttcKcMagNaaKagattggMagaggtaatttYacatcWaaDgatMgKHacMacgcVaaca\n\
+DtaDatatYggttBcgtatgWgaSatttgtagaHYRVacaRtctHaaRtatgaactaata\n\
+tctSSBgggaaHMWtcaagatKgagtDaSatagttgattVRatNtctMtcSaagaSHaat\n\
+aNataataRaaRgattctttaataaagWaRHcYgcatgtWRcttgaaggaMcaataBRaa\n\
+ccagStaaacNtttcaatataYtaatatgHaDgcStcWttaacctaRgtYaRtataKtgM\n\
+ttttatgactaaaatttacYatcccRWtttHRtattaaatgtttatatttgttYaatMca\n\
+RcSVaaDatcgtaYMcatgtagacatgaaattgRtcaaYaaYtRBatKacttataccaNa\n\
+aattVaBtctggacaagKaaYaaatatWtMtatcYaaVNtcgHaactBaagKcHgtctac\n\
+aatWtaDtSgtaHcataHtactgataNctRgttMtDcDttatHtcgtacatcccaggStt\n\
+aBgtcacacWtccNMcNatMVaVgtccDYStatMaccDatggYaRKaaagataRatttHK\n\
+tSaaatDgataaacttaHgttgVBtcttVttHgDacgaKatgtatatNYataactctSat\n\
+atatattgcHRRYttStggaactHgttttYtttaWtatMcttttctatctDtagVHYgMR\n\
+BgtHttcctaatYRttKtaagatggaVRataKDctaMtKBNtMtHNtWtttYcVtattMc\n\
+gRaacMcctNSctcatttaaagDcaHtYccSgatgcaatYaaaaDcttcgtaWtaattct\n\
+cgttttScttggtaatctttYgtctaactKataHacctMctcttacHtKataacacagcN\n\
+RatgKatttttSaaatRYcgDttaMRcgaaattactMtgcgtaagcgttatBtttttaat\n\
+taagtNacatHgttcRgacKcBBtVgatKttcgaBaatactDRgtRtgaNacWtcacYtt\n\
+aaKcgttctHaKttaNaMgWgWaggtctRgaKgWttSttBtDcNtgtttacaaatYcDRt\n\
+gVtgcctattcNtctaaaDMNttttNtggctgagaVctDaacVtWccaagtaacacaNct\n\
+gaScattccDHcVBatcgatgtMtaatBgHaatDctMYgagaatgYWKcctaatNaStHa\n\
+aaKccgHgcgtYaaYtattgtStgtgcaaRtattaKatattagaWVtcaMtBagttatta\n\
+gNaWHcVgcaattttDcMtgtaRHVYtHtctgtaaaaHVtMKacatcgNaatttMatatg\n\
+ttgttactagWYtaRacgataKagYNKcattataNaRtgaacKaYgcaaYYacaNccHat\n\
+MatDcNgtHttRaWttagaaDcaaaaaatagggtKDtStaDaRtaVtHWKNtgtattVct\n\
+SVgRgataDaRaWataBgaagaaKtaataaYgDcaStaNgtaDaaggtattHaRaWMYaY\n\
+aWtggttHYgagVtgtgcttttcaaDKcagVcgttagacNaaWtagtaataDttctggtt\n\
+VcatcataaagtgKaaaNaMtaBBaattaatWaattgctHaVKaSgDaaVKaHtatatat\n\
+HatcatSBagNgHtatcHYMHgttDgtaHtBttWatcgtttaRaattgStKgSKNWKatc\n\
+agDtctcagatttctRtYtBatBgHHtKaWtgYBgacVVWaKtacKcDttKMaKaVcggt\n\
+gttataagaataaHaatattagtataatMHgttYgaRttagtaRtcaaVatacggtcMcg\n\
+agtaaRttacWgactKRYataaaagSattYaWgagatYagKagatgSaagKgttaatMgg\n\
+tataatgttWYttatgagaaacctNVataatHcccKtDctcctaatactggctHggaSag\n\
+gRtKHaWaattcgSatMatttagaggcYtctaMcgctcataSatatgRagacNaaDagga\n\
+VBagaYttKtacNaKgtSYtagttggaWcatcWttaatctatgaVtcgtgtMtatcaYcg\n\
+tRccaaYgDctgcMgtgtWgacWtgataacacgcgctBtgttaKtYDtatDcatcagKaV\n\
+MctaatcttgVcaaRgcRMtDcgattaHttcaNatgaatMtactacVgtRgatggaWttt\n\
+actaaKatgagSaaKggtaNtactVaYtaaKRagaacccacaMtaaMtKtatBcttgtaa\n\
+WBtMctaataaVcDaaYtcRHBtcgttNtaaHatttBNgRStVDattBatVtaagttaYa\n\
+tVattaagaBcacggtSgtVtatttaRattgatgtaHDKgcaatattKtggcctatgaWD\n\
+KRYcggattgRctatNgatacaatMNttctgtcRBYRaaaHctNYattcHtaWcaattct\n\
+BtMKtVgYataatMgYtcagcttMDataVtggRtKtgaatgccNcRttcaMtRgattaac\n\
+attRcagcctHtWMtgtDRagaKaBtgDttYaaaaKatKgatctVaaYaacWcgcatagB\n\
+VtaNtRtYRaggBaaBtgKgttacataagagcatgtRattccacttaccatRaaatgWgD\n\
+aMHaYVgVtaSctatcgKaatatattaDgacccYagtgtaYNaaatKcagtBRgagtcca\n\
+tgKgaaaccBgaagBtgSttWtacgatWHaYatcgatttRaaNRgcaNaKVacaNtDgat\n\
+tgHVaatcDaagcgtatgcNttaDataatcSataaKcaataaHWataBtttatBtcaKtK\n\
+tatagttaDgSaYctacaRatNtaWctSaatatttYaKaKtaccWtatcRagacttaYtt\n\
+VcKgSDcgagaagatccHtaattctSttatggtKYgtMaHagVaBRatttctgtRgtcta\n\
+tgggtaHKgtHacHtSYacgtacacHatacKaaBaVaccaDtatcSaataaHaagagaat\n\
+ScagactataaRttagcaaVcaHataKgDacatWccccaagcaBgagWatctaYttgaaa\n\
+tctVNcYtttWagHcgcgcDcVaaatgttKcHtNtcaatagtgtNRaactttttcaatgg\n\
+WgBcgDtgVgtttctacMtaaataaaRggaaacWaHttaRtNtgctaaRRtVBctYtVta\n\
+tDcattDtgaccYatagatYRKatNYKttNgcctagtaWtgaactaMVaacctgaStttc\n\
+tgaKVtaaVaRKDttVtVctaDNtataaaDtccccaagtWtcgatcactDgYaBcatcct\n\
+MtVtacDaaBtYtMaKNatNtcaNacgDatYcatcgcaRatWBgaacWttKttagYtaat\n\
+tcggttgSWttttDWctttacYtatatWtcatDtMgtBttgRtVDggttaacYtacgtac\n\
+atgaattgaaWcttMStaDgtatattgaDtcRBcattSgaaVBRgagccaaKtttcDgcg\n\
+aSMtatgWattaKttWtgDBMaggBBttBaatWttRtgcNtHcgttttHtKtcWtagHSt\n\
+aacagttgatatBtaWSaWggtaataaMttaKacDaatactcBttcaatatHttcBaaSa\n\
+aatYggtaRtatNtHcaatcaHtagVtgtattataNggaMtcttHtNagctaaaggtaga\n\
+YctMattNaMVNtcKtactBKcaHHcBttaSagaKacataYgctaKaYgttYcgacWVtt\n\
+WtSagcaacatcccHaccKtcttaacgaKttcacKtNtacHtatatRtaaatacactaBt\n\
+ttgaHaRttggttWtatYagcatYDatcggagagcWBataagRtacctataRKgtBgatg\n\
+aDatataSttagBaHtaatNtaDWcWtgtaattacagKttcNtMagtattaNgtctcgtc\n\
+ctcttBaHaKcKccgtRcaaYagSattaagtKataDatatatagtcDtaacaWHcaKttD\n\
+gaaRcgtgYttgtcatatNtatttttatggccHtgDtYHtWgttatYaacaattcaWtat\n\
+NgctcaaaSttRgctaatcaaatNatcgtttaBtNNVtgttataagcaaagattBacgtD\n\
+atttNatttaaaDcBgtaSKgacgtagataatttcHMVNttgttBtDtgtaWKaaRMcKM\n\
+tHtaVtagataWctccNNaSWtVaHatctcMgggDgtNHtDaDttatatVWttgttattt\n\
+aacctttcacaaggaSaDcggttttttatatVtctgVtaacaStDVaKactaMtttaSNa\n\
+gtgaaattaNacttSKctattcctctaSagKcaVttaagNaVcttaVaaRNaHaaHttat\n\
+gtHttgtgatMccaggtaDcgaccgtWgtWMtttaHcRtattgScctatttKtaaccaag\n\
+tYagaHgtWcHaatgccKNRtttagtMYSgaDatctgtgaWDtccMNcgHgcaaacNDaa\n\
+aRaStDWtcaaaaHKtaNBctagBtgtattaactaattttVctagaatggcWSatMaccc\n\
+ttHttaSgSgtgMRcatRVKtatctgaaaccDNatYgaaVHNgatMgHRtacttaaaRta\n\
+tStRtDtatDttYatattHggaBcttHgcgattgaKcKtttcRataMtcgaVttWacatN\n\
+catacctRataDDatVaWNcggttgaHtgtMacVtttaBHtgagVttMaataattatgtt\n\
+cttagtttgtgcDtSatttgBtcaacHattaaBagVWcgcaSYttMgcttacYKtVtatc\n\
+aYaKctgBatgcgggcYcaaaaacgNtctagKBtattatctttKtaVttatagtaYtRag\n\
+NtaYataaVtgaatatcHgcaaRataHtacacatgtaNtgtcgYatWMatttgaactacR\n\
+ctaWtWtatacaatctBatatgYtaagtatgtgtatSttactVatcttYtaBcKgRaSgg\n\
+RaaaaatgcagtaaaWgtaRgcgataatcBaataccgtatttttccatcNHtatWYgatH\n\
+SaaaDHttgctgtccHtggggcctaataatttttctatattYWtcattBtgBRcVttaVM\n\
+RSgctaatMagtYtttaaaaatBRtcBttcaaVtaacagctccSaaSttKNtHtKYcagc\n\
+agaaaccccRtttttaaDcDtaStatccaagcgctHtatcttaDRYgatDHtWcaaaBcW\n\
+gKWHttHataagHacgMNKttMKHccaYcatMVaacgttaKgYcaVaaBtacgcaacttt\n\
+MctaaHaatgtBatgagaSatgtatgSRgHgWaVWgataaatatttccKagVgataattW\n\
+aHNcYggaaatgctHtKtaDtctaaagtMaatVDVactWtSaaWaaMtaHtaSKtcBRaN\n\
+cttStggtBttacNagcatagRgtKtgcgaacaacBcgKaatgataagatgaaaattgta\n\
+ctgcgggtccHHWHaaNacaBttNKtKtcaaBatatgctaHNgtKcDWgtttatNgVDHg\n\
+accaacWctKaaggHttgaRgYaatHcaBacaatgagcaaattactgtaVaaYaDtagat\n\
+tgagNKggtggtgKtWKaatacagDRtatRaMRtgattDggtcaaYRtatttNtagaDtc\n\
+acaaSDctDtataatcgtactaHttatacaatYaacaaHttHatHtgcgatRRttNgcat\n\
+SVtacWWgaaggagtatVMaVaaattScDDKNcaYBYaDatHgtctatBagcaacaagaa\n\
+tgagaaRcataaKNaRtBDatcaaacgcattttttaaBtcSgtacaRggatgtMNaattg\n\
+gatatWtgagtattaaaVctgcaYMtatgatttttYgaHtgtcttaagWBttHttgtctt\n\
+attDtcgtatWtataataSgctaHagcDVcNtaatcaagtaBDaWaDgtttagYctaNcc\n\
+DtaKtaHcttaataacccaRKtacaVaatNgcWRaMgaattatgaBaaagattVYaHMDc\n\
+aDHtcRcgYtcttaaaWaaaVKgatacRtttRRKYgaatacaWVacVcRtatMacaBtac\n\
+tggMataaattttHggNagSctacHgtBagcgtcgtgattNtttgatSaaggMttctttc\n\
+ttNtYNagBtaaacaaatttMgaccttacataattgYtcgacBtVMctgStgMDtagtaR\n\
+ctHtatgttcatatVRNWataDKatWcgaaaaagttaaaagcacgHNacgtaatctttMR\n\
+tgacttttDacctataaacgaaatatgattagaactccSYtaBctttaataacWgaaaYa\n\
+tagatgWttcatKtNgatttttcaagHtaYgaaRaDaagtaggagcttatVtagtctttc\n\
+attaaaatcgKtattaRttacagVaDatgcatVgattgggtctttHVtagKaaRBtaHta\n\
+aggccccaaaaKatggtttaMWgtBtaaacttcactttKHtcgatctccctaYaBacMgt\n\
+cttBaBaNgcgaaacaatctagtHccHtKttcRtRVttccVctttcatacYagMVtMcag\n\
+aMaaacaataBctgYtaatRaaagattaaccatVRatHtaRagcgcaBcgDttStttttc\n\
+VtttaDtKgcaaWaaaaatSccMcVatgtKgtaKgcgatatgtagtSaaaDttatacaaa\n\
+catYaRRcVRHctKtcgacKttaaVctaDaatgttMggRcWaacttttHaDaKaDaBctg\n\
+taggcgtttaHBccatccattcNHtDaYtaataMttacggctNVaacDattgatatttta\n\
+cVttSaattacaaRtataNDgacVtgaacataVRttttaDtcaaacataYDBtttaatBa\n\
+DtttYDaDaMccMttNBttatatgagaaMgaNtattHccNataattcaHagtgaaggDga\n\
+tgtatatatgYatgaStcataaBStWacgtcccataRMaaDattggttaaattcMKtctM\n\
+acaBSactcggaatDDgatDgcWctaacaccgggaVcacWKVacggtaNatatacctMta\n\
+tgatagtgcaKagggVaDtgtaacttggagtcKatatcgMcttRaMagcattaBRaStct\n\
+YSggaHYtacaactMBaagDcaBDRaaacMYacaHaattagcattaaaHgcgctaaggSc\n\
+cKtgaaKtNaBtatDDcKBSaVtgatVYaagVtctSgMctacgttaacWaaattctSgtD\n\
+actaaStaaattgcagBBRVctaatatacctNttMcRggctttMttagacRaHcaBaacV\n\
+KgaataHttttMgYgattcYaNRgttMgcVaaacaVVcDHaatttgKtMYgtatBtVVct\n\
+WgVtatHtacaaHttcacgatagcagtaaNattBatatatttcVgaDagcggttMaagtc\n\
+ScHagaaatgcYNggcgtttttMtStggtRatctacttaaatVVtBacttHNttttaRca\n\
+aatcacagHgagagtMgatcSWaNRacagDtatactaaDKaSRtgattctccatSaaRtt\n\
+aaYctacacNtaRtaactggatgaccYtacactttaattaattgattYgttcagDtNKtt\n\
+agDttaaaaaaaBtttaaNaYWKMBaaaacVcBMtatWtgBatatgaacVtattMtYatM\n\
+NYDKNcKgDttDaVtaaaatgggatttctgtaaatWtctcWgtVVagtcgRgacttcccc\n\
+taDcacagcRcagagtgtWSatgtacatgttaaSttgtaaHcgatgggMagtgaacttat\n\
+RtttaVcaccaWaMgtactaatSSaHtcMgaaYtatcgaaggYgggcgtgaNDtgttMNg\n\
+aNDMtaattcgVttttaacatgVatgtWVMatatcaKgaaattcaBcctccWcttgaaWH\n\
+tWgHtcgNWgaRgctcBgSgaattgcaaHtgattgtgNagtDttHHgBttaaWcaaWagc\n\
+aSaHHtaaaVctRaaMagtaDaatHtDMtcVaWMtagSagcttHSattaacaaagtRacM\n\
+tRtctgttagcMtcaBatVKtKtKacgagaSNatSactgtatatcBctgagVtYactgta\n\
+aattaaaggcYgDHgtaacatSRDatMMccHatKgttaacgactKtgKagtcttcaaHRV\n\
+tccttKgtSataatttacaactggatDNgaacttcaRtVaagDcaWatcBctctHYatHa\n\
+DaaatttagYatSatccaWtttagaaatVaacBatHcatcgtacaatatcgcNYRcaata\n\
+YaRaYtgattVttgaatgaVaactcRcaNStgtgtattMtgaggtNttBaDRcgaaaagc\n\
+tNgBcWaWgtSaDcVtgVaatMKBtttcgtttctaaHctaaagYactgMtatBDtcStga\n\
+ccgtSDattYaataHctgggaYYttcggttaWaatctggtRagWMaDagtaacBccacta\n\
+cgHWMKaatgatWatcctgHcaBaSctVtcMtgtDttacctaVgatYcWaDRaaaaRtag\n\
+atcgaMagtggaRaWctctgMgcWttaagKBRtaaDaaWtctgtaagYMttactaHtaat\n\
+cttcataacggcacBtSgcgttNHtgtHccatgttttaaagtatcgaKtMttVcataYBB\n\
+aKtaMVaVgtattNDSataHcagtWMtaggtaSaaKgttgBtVtttgttatcatKcgHac\n\
+acRtctHatNVagSBgatgHtgaRaSgttRcctaacaaattDNttgacctaaYtBgaaaa\n\
+tagttattactcttttgatgtNNtVtgtatMgtcttRttcatttgatgacacttcHSaaa\n\
+ccaWWDtWagtaRDDVNacVaRatgttBccttaatHtgtaaacStcVNtcacaSRttcYa\n\
+gacagaMMttttgMcNttBcgWBtactgVtaRttctccaaYHBtaaagaBattaYacgat\n\
+ttacatctgtaaMKaRYtttttactaaVatWgctBtttDVttctggcDaHaggDaagtcg\n\
+aWcaagtagtWttHtgKtVataStccaMcWcaagataagatcactctHatgtcYgaKcat\n\
+cagatactaagNSStHcctRRNtattgtccttagttagMVgtatagactaactctVcaat\n\
+MctgtttgtgttgccttatWgtaBVtttctggMcaaKgDWtcgtaaYStgSactatttHg\n\
+atctgKagtagBtVacRaagRtMctatgggcaaaKaaaatacttcHctaRtgtDcttDat\n\
+taggaaatttcYHaRaaBttaatggcacKtgctHVcaDcaaaVDaaaVcgMttgtNagcg\n\
+taDWgtcgttaatDgKgagcSatatcSHtagtagttggtgtHaWtaHKtatagctgtVga\n\
+ttaBVaatgaataagtaatVatSttaHctttKtttgtagttaccttaatcgtagtcctgB\n\
+cgactatttVcMacHaaaggaatgDatggKtaHtgStatattaaSagctWcctccRtata\n\
+BaDYcgttgcNaagaggatRaaaYtaWgNtSMcaatttactaacatttaaWttHtatBat\n\
+tgtcgacaatNgattgcNgtMaaaKaBDattHacttggtRtttaYaacgVactBtaBaKt\n\
+gBttatgVttgtVttcaatcWcNctDBaaBgaDHacBttattNtgtDtatttVSaaacag\n\
+gatgcRatSgtaSaNtgBatagttcHBgcBBaaattaHgtDattatDaKaatBaaYaaMa\n\
+ataaataKtttYtagtBgMatNcatgtttgaNagtgttgtgKaNaSagtttgaSMaYBca\n\
+aaacDStagttVacaaaaactaaWttBaagtctgtgcgtMgtaattctcctacctcaNtt\n\
+taaccaaaaVtBcacataacaccccBcWMtatVtggaatgaWtcaaWaaaaaaaaWtDta\n\
+atatRcctDWtcctaccMtVVatKttaWaaKaaatataaagScHBagaggBaSMtaWaVt\n\
+atattactSaaaKNaactatNatccttgaYctattcaaaVgatttYHcRagattttaSat\n\
+aggttattcVtaaagaKgtattattKtRttNcggcRgtgtgtWYtaacHgKatKgatYta\n\
+cYagDtWcHBDctctgRaYKaYagcactKcacSaRtBttttBHKcMtNtcBatttatttt\n\
+tgSatVgaaagaWtcDtagDatatgMacaacRgatatatgtttgtKtNRaatatNatgYc\n\
+aHtgHataacKtgagtagtaacYttaNccaaatHcacaacaVDtagtaYtccagcattNt\n\
+acKtBtactaaagaBatVtKaaHBctgStgtBgtatgaSNtgDataaccctgtagcaBgt\n\
+gatcttaDataStgaMaccaSBBgWagtacKcgattgaDgNNaaaacacagtSatBacKD\n\
+gcgtataBKcatacactaSaatYtYcDaactHttcatRtttaatcaattataRtttgtaa\n\
+gMcgNttcatcBtYBagtNWNMtSHcattcRctttttRWgaKacKttgggagBcgttcgc\n\
+MaWHtaatactgtctctatttataVgtttaBScttttaBMaNaatMacactYtBMggtHa\n\
+cMagtaRtctgcatttaHtcaaaatttgagKtgNtactBacaHtcgtatttctMaSRagc\n\
+agttaatgtNtaaattgagagWcKtaNttagVtacgatttgaatttcgRtgtWcVatcgt\n\
+taaDVctgtttBWgaccagaaagtcSgtVtatagaBccttttcctaaattgHtatcggRa\n\
+ttttcaaggcYSKaagWaWtRactaaaacccBatMtttBaatYtaagaactSttcgaaSc\n\
+aatagtattgaccaagtgttttctaacatgtttNVaatcaaagagaaaNattaaRtttta\n\
+VaaaccgcaggNMtatattVctcaagaggaacgBgtttaacaagttcKcYaatatactaa\n\
+ccBaaaSggttcNtattctagttRtBacgScVctcaatttaatYtaaaaaaatgSaatga\n\
+tagaMBRatgRcMcgttgaWHtcaVYgaatYtaatctttYttatRaWtctgBtDcgatNa\n\
+tcKaBaDgatgtaNatWKctccgatattaacattNaaacDatgBgttctgtDtaaaMggt\n\
+gaBaSHataacgccSctaBtttaRBtcNHcDatcDcctagagtcRtaBgWttDRVHagat\n\
+tYatgtatcWtaHtttYcattWtaaagtctNgtStggRNcgcggagSSaaagaaaatYcH\n\
+DtcgctttaatgYcKBVSgtattRaYBaDaaatBgtatgaHtaaRaRgcaSWNtagatHa\n\
+acttNctBtcaccatctMcatattccaSatttgcgaDagDgtatYtaaaVDtaagtttWV\n\
+aagtagYatRttaagDcNgacKBcScagHtattatcDaDactaaaaaYgHttBcgaDttg\n\
+gataaaKSRcBMaBcgaBSttcWtgNBatRaccgattcatttataacggHVtaattcaca\n\
+agagVttaaRaatVVRKcgWtVgacctgDgYaaHaWtctttcacMagggatVgactagMa\n\
+aataKaaNWagKatagNaaWtaaaatttgaattttatttgctaaVgaHatBatcaaBWcB\n\
+gttcMatcgBaaNgttcgSNaggSaRtttgHtRtattaNttcDcatSaVttttcgaaaaa\n\
+ttgHatctaRaggSaNatMDaaatDcacgattttagaHgHaWtYgattaatHNSttatMS\n\
+gggNtcKtYatRggtttgtMWVtttaYtagcagBagHaYagttatatggtBacYcattaR\n\
+SataBatMtttaaatctHcaaaSaaaagttNSaaWcWRccRtKaagtBWtcaaattSttM\n\
+tattggaaaccttaacgttBtWatttatatWcDaatagattcctScacctaagggRaaYt\n\
+aNaatgVtBcttaaBaacaMVaaattatStYgRcctgtactatcMcVKatttcgSgatRH\n\
+MaaaHtagtaaHtVgcaaataatatcgKKtgccaatBNgaaWcVttgagttaKatagttc\n\
+aggKDatDtattgaKaVcaKtaataDataataHSaHcattagttaatRVYcNaHtaRcaa\n\
+ggtNHcgtcaaccaBaaagYtHWaaaRcKgaYaaDttgcWYtataRgaatatgtYtgcKt\n\
+aNttWacatYHctRaDtYtattcBttttatcSataYaYgttWaRagcacHMgtttHtYtt\n\
+YaatcggtatStttcgtRSattaaDaKMaatatactaNBaWgctacacYtgaYVgtgHta\n\
+aaRaaRgHtagtWattataaaSDaaWtgMattatcgaaaagtaYRSaWtSgNtBgagcRY\n\
+aMDtactaacttaWgtatctagacaagNtattHggataatYttYatcataDcgHgttBtt\n\
+ctttVttgccgaaWtaaaacgKgtatctaaaaaNtccDtaDatBMaMggaatNKtatBaa\n\
+atVtccRaHtaSacataHattgtttKVYattcataVaattWtcgtgMttcttKtgtctaa\n\
+cVtatctatatBRataactcgKatStatattcatHHRttKtccaacgtgggtgRgtgaMt\n\
+attattggctatcgtgacMtRcBDtcttgtactaatRHttttaagatcgVMDStattatY\n\
+BtttDttgtBtNttgRcMtYtgBacHaWaBaatDKctaagtgaaactaatgRaaKgatcc\n\
+aagNaaaatattaggWNtaagtatacttttKcgtcggSYtcttgRctataYcttatataa\n\
+agtatattaatttataVaacacaDHatctatttttKYVatHRactttaBHccaWagtact\n\
+BtcacgaVgcgttRtttttttSVgtSagtBaaattctgaHgactcttgMcattttagVta\n\
+agaattHctHtcaDaaNtaacRggWatagttcgtSttgaDatcNgNagctagDgatcNtt\n\
+KgttgtaDtctttRaaYStRatDtgMggactSttaDtagSaVtBDttgtDgccatcacaM\n\
+attaaaMtNacaVcgSWcVaaDatcaHaatgaattaMtatccVtctBtaattgtWattat\n\
+BRcWcaatgNNtactWYtDaKttaaatcactcagtRaaRgatggtKgcgccaaHgaggat\n\
+StattYcaNMtcaBttacttatgagDaNtaMgaaWtgtttcttctaHtMNgttatctaWW\n\
+atMtBtaaatagDVatgtBYtatcggcttaagacMRtaHScgatatYgRDtcattatSDa\n\
+HggaaataNgaWSRRaaaBaatagBattaDctttgHWNttacaataaaaaaatacggttt\n\
+gHgVtaHtWMttNtBtctagtMcgKMgHgYtataHaNagWtcaacYattaataYRgtaWK\n\
+gaBctataaccgatttaHaNBRaRaMtccggtNgacMtctcatttgcaattcWgMactta\n\
+caaDaaNtactWatVtttagccttMaatcagVaagtctVaaDaBtattaattaYtNaYtg\n\
+gattaKtaKctYaMtattYgatattataatKtVgDcttatatNBtcgttgtStttttMag\n\
+aggttaHYSttcKgtcKtDNtataagttataagSgttatDtRttattgttttSNggRtca\n\
+aKMNatgaatattgtBWtaMacctgggYgaSgaagYataagattacgagaatBtggtRcV\n\
+HtgYggaDgaYaKagWagctatagacgaaHgtWaNgacttHRatVaWacKYtgRVNgVcS\n\
+gRWctacatcKSactctgWYtBggtataagcttNRttVtgRcaWaaatDMatYattaact\n\
+ttcgaagRatSctgccttgcRKaccHtttSNVagtagHagBagttagaccaRtataBcca\n\
+taatSHatRtcHagacBWatagcaMtacaRtgtgaaBatctKRtScttccaNaatcNgta\n\
+atatWtcaMgactctBtWtaaNactHaaaaRctcgcatggctMcaaNtcagaaaaacaca\n\
+gtggggWttRttagtaagaVctVMtcgaatcttcMaaaHcaHBttcgattatgtcaDagc\n\
+YRtBtYcgacMgtDcagcgaNgttaataatagcagKYYtcgtaBtYctMaRtaRtDagaa\n\
+aacacatgYaBttgattattcgaaNttBctSataaMataWRgaHtttccgtDgaYtatgg\n\
+tDgHKgMtatttVtMtVagttaRatMattRagataaccctKctMtSttgaHagtcStcta\n\
+tttccSagatgttccacgaggYNttHRacgattcDatatDcataaaatBBttatcgaHtN\n\
+HaaatatDNaggctgaNcaaggagttBttMgRagVatBcRtaWgatgBtSgaKtcgHttt\n\
+gaatcaaDaHttcSBgHcagtVaaSttDcagccgttNBtgttHagYtattctttRWaaVt\n\
+SttcatatKaaRaaaNacaVtVctMtSDtDtRHRcgtaatgctcttaaatSacacaatcg\n\
+HattcaWcttaaaatHaaatcNctWttaNMcMtaKctVtcctaagYgatgatcYaaaRac\n\
+tctaRDaYagtaacgtDgaggaaatctcaaacatcaScttcKttNtaccatNtaNataca\n\
+tttHaaDHgcaDatMWaaBttcRggctMaagctVYcacgatcaDttatYtaatcKatWat\n\
+caatVYtNagatttgattgaYttttYgacttVtcKaRagaaaHVgDtaMatKYagagttN\n\
+atWttaccNtYtcDWgSatgaRgtMatgKtcgacaagWtacttaagtcgKtgatccttNc\n\
+ttatagMatHVggtagcgHctatagccctYttggtaattKNaacgaaYatatVctaataM\n\
+aaaYtgVtcKaYtaataacagaatHcacVagatYWHttagaaSMaatWtYtgtaaagNaa\n\
+acaVgaWtcacNWgataNttcaSagctMDaRttgNactaccgataMaaatgtttattDtc\n\
+aagacgctDHYYatggttcaagccNctccttcMctttagacBtaaWtaWVHggaaaaNat\n\
+ttaDtDtgctaaHHtMtatNtMtagtcatttgcaaaRatacagRHtatDNtgtDgaatVg\n\
+tVNtcaaatYBMaaaagcaKgtgatgatMgWWMaHttttMgMagatDtataaattaacca\n\
+actMtacataaattgRataatacgBtKtaataattRgtatDagDtcRDacctatRcagag\n\
+cSHatNtcaScNtttggacNtaaggaccgtgKNttgttNcttgaaRgYgRtNtcagttBc\n\
+ttttcHtKtgcttYaaNgYagtaaatgaatggWaMattBHtatctatSgtcYtgcHtaat\n\
+tHgaaMtHcagaaSatggtatgccaHBtYtcNattWtgtNgctttaggtttgtWatNtgH\n\
+tgcDttactttttttgcNtactKtWRaVcttcatagtgSNKaNccgaataaBttataata\n\
+YtSagctttaaatSttggctaaKSaatRccgWHgagDttaaatcatgagMtcgagtVtaD\n\
+ggaBtatttgDacataaacgtagYRagBWtgDStKDgatgaagttcattatttaKWcata\n\
+aatWRgatataRgttRacaaNKttNtKagaaYaStaactScattattaacgatttaaatg\n\
+DtaattagatHgaYataaactatggggatVHtgccgtNgatNYcaStRtagaccacWcaM\n\
+tatRagHgVactYtWHtcttcatgatWgagaKggagtatgaWtDtVtNaNtcgYYgtaaa\n\
+ctttaDtBactagtaDctatagtaatatttatatataacgHaaaRagKattSagttYtSt\n\
+>THREE Homo sapiens frequency\n\
+agagagacgatgaaaattaatcgtcaatacgctggcgaacactgagggggacccaatgct\n\
+cttctcggtctaaaaaggaatgtgtcagaaattggtcagttcaaaagtagaccggatctt\n\
+tgcggagaacaattcacggaacgtagcgttgggaaatatcctttctaccacacatcggat\n\
+tttcgccctctcccattatttattgtgttctcacatagaattattgtttagacatccctc\n\
+gttgtatggagagttgcccgagcgtaaaggcataatccatataccgccgggtgagtgacc\n\
+tgaaattgtttttagttgggatttcgctatggattagcttacacgaagagattctaatgg\n\
+tactataggataattataatgctgcgtggcgcagtacaccgttacaaacgtcgttcgcat\n\
+atgtggctaacacggtgaaaatacctacatcgtatttgcaatttcggtcgtttcatagag\n\
+cgcattgaattactcaaaaattatatatgttgattatttgattagactgcgtggaaagaa\n\
+ggggtactcaagccatttgtaaaagctgcatctcgcttaagtttgagagcttacattagt\n\
+ctatttcagtcttctaggaaatgtctgtgtgagtggttgtcgtccataggtcactggcat\n\
+atgcgattcatgacatgctaaactaagaaagtagattactattaccggcatgcctaatgc\n\
+gattgcactgctatgaaggtgcggacgtcgcgcccatgtagccctgataataccaatact\n\
+tacatttggtcagcaattctgacattatacctagcacccataaatttactcagacttgag\n\
+gacaggctcttggagtcgatcttctgtttgtatgcatgtgatcatatagatgaataagcg\n\
+atgcgactagttagggcatagtatagatctgtgtatacagttcagctgaacgtccgcgag\n\
+tggaagtacagctgagatctatcctaaaatgcaaccatatcgttcacacatgatatgaac\n\
+ccagggggaaacattgagttcagttaaattggcagcgaatcccccaagaagaaggcggag\n\
+tgacgttgaacgggcttatggtttttcagtacttcctccgtataagttgagcgaaatgta\n\
+aacagaataatcgttgtgttaacaacattaaaatcgcggaatatgatgagaatacacagt\n\
+gtgagcatttcacttgtaaaatatctttggtagaacttactttgctttaaatatgttaaa\n\
+ccgatctaataatctacaaaacggtagattttgcctagcacattgcgtccttctctattc\n\
+agatagaggcaatactcagaaggttttatccaaagcactgtgttgactaacctaagtttt\n\
+agtctaataatcatgattgattataggtgccgtggactacatgactcgtccacaaataat\n\
+acttagcagatcagcaattggccaagcacccgacttttatttaatggttgtgcaatagtc\n\
+cagattcgtattcgggactctttcaaataatagtttcctggcatctaagtaagaaaagct\n\
+cataaggaagcgatattatgacacgctcttccgccgctgttttgaaacttgagtattgct\n\
+cgtccgaaattgagggtcacttcaaaatttactgagaagacgaagatcgactaaagttaa\n\
+aatgctagtccacagttggtcaagttgaattcatccacgagttatatagctattttaatt\n\
+tatagtcgagtgtacaaaaaacatccacaataagatttatcttagaataacaacccccgt\n\
+atcatcgaaatcctccgttatggcctgactcctcgagcttatagcatttgtgctggcgct\n\
+cttgccaggaacttgctcgcgaggtggtgacgagtgagatgatcagtttcattatgatga\n\
+tacgattttatcgcgactagttaatcatcatagcaagtaaaatttgaattatgtcattat\n\
+catgctccattaacaggttatttaattgatactgacgaaattttttcacaatgggttttc\n\
+tagaatttaatatcagtaattgaagccttcataggggtcctactagtatcctacacgacg\n\
+caggtccgcagtatcctggagggacgtgttactgattaaaagggtcaaaggaatgaaggc\n\
+tcacaatgttacctgcttcaccatagtgagccgatgagttttacattagtactaaatccc\n\
+aaatcatactttacgatgaggcttgctagcgctaaagagaatacatacaccaccacatag\n\
+aattgttagcgatgatatcaaatagactcctggaagtgtcagggggaaactgttcaatat\n\
+ttcgtccacaggactgaccaggcatggaaaagactgacgttggaaactataccatctcac\n\
+gcccgacgcttcactaattgatgatccaaaaaatatagcccggattcctgattagcaaag\n\
+ggttcacagagaaagatattatcgacgtatatcccaaaaaacagacgtaatgtgcatctt\n\
+cgaatcgggatgaatacttgtatcataaaaatgtgacctctagtatacaggttaatgtta\n\
+gtgatacacaatactcgtgggccatgggttctcaaataaaatgtaatattgcgtcgatca\n\
+ctcacccacgtatttggtctaattatgttttatttagtgacaatccaatagataaccggt\n\
+cctattaagggctatatttttagcgaccacgcgtttaaacaaaggattgtatgtagatgg\n\
+taccagtttaattgccagtgggcaatcctaagcaaaatgagattctatcctaaagtttgg\n\
+gcttgatataagatttcggatgtatgggttttataatcgttggagagctcaatcatgagc\n\
+taatacatggatttcgctacctcaccgagagaccttgcatgaagaattctaaccaaaagt\n\
+ttaataggccggattggattgagttaattaagaccttgttcagtcatagtaaaaaccctt\n\
+aaattttaccgattgacaaagtgagcagtcgcaataccctatgcgaaacgcctcgatagt\n\
+gactaggtatacaaggtttttgagttcctttgaaatagttaactaatttaaaattaatta\n\
+acgacatggaaatcacagaacctaatgctttgtaggagttatttatgctgtttactgcct\n\
+ctacaaccctaataaagcagtcctaagaatgaaacgcatcttttagttcagaaagtggta\n\
+tccagggtggtcaatttaataaattcaacatcgggtctcaggatattcggtcatataatt\n\
+tattaagggctcttcgagtcttactctgagtgaaattggaaacagtcatccttttcgttg\n\
+tgaggcatcttacaccgctatcgatatacaatgcattccaccgcggtgtcccgtacacaa\n\
+ggaaacttgttaccttggggatataagaaaactcacacgtctcattattaaactgagtac\n\
+aatttttgcacgagaaagtaatgcaatacaatatgatgaaagccagctaatgaaaaggga\n\
+tggaacgcacctcggatctgttgcactggattaaaatccgattatttttaaaaatattca\n\
+gtgctagagcatatcaggtctacttttttatctggtatgtaaagcccacggagcgatagt\n\
+gagatccttacgactcaacgaaaagttataacataactcccgttagccaaagcccaatcc\n\
+cgattactgccctaccctaacgtctgccatctaaatatcgaacttgttatgatcaatgtg\n\
+actacctcccaccctttccccttcatttgttccactggggataagctagcgttttcagaa\n\
+tcaatgcaataagaatagccaattgtctcacttcatcagagctcttggcaattccaggcg\n\
+ctacgtggttctggaatatattcatttttcaaatagtaatacgtttagtgttgctattgt\n\
+ctacacgtttggatattacgttatgtgagcggacatcaatagttgtctaactctttagta\n\
+agccagagatagcactcttagcgaatggataccatcttccataagtttagttaatagtcc\n\
+gaaacaactgcttcgagcatatttgaacctccttgtaggcaaatagcctcttcaaagcaa\n\
+tcttactaatagatagagtttgttttaagggactactagaaatgggacaatcttaatagt\n\
+atgacctaaactgacatttaaagatatatccaggtggcaagcataaagatcattgcgcca\n\
+cctccaccgtgggattacttatcagtcgatatcctatatgctaagtttgcgacggcagaa\n\
+tacaaactaagctgagttgatgctaaccttacctatgataccccattggaccggttaaca\n\
+gccctacttattccaaataaaagaacttttatgctgtagaagctattatagtgatgcctg\n\
+gtaacttcagtatattaaaatgacacacatacgccatatagagctcctggaactttgaat\n\
+aatgagcgaacttcgaagttgaagagcaagaaaccatatgtcacggttgcctaaagcccg\n\
+gtaaccagacatgtgctatcattgatcattatcgaggttttcataaccttgacccattat\n\
+cggctgtgcgcggacaagtacttaaatcactagtttcttcacctgcttatcggtaagaaa\n\
+taaggttggcaaagaatcgcataagacggacgtagagccgcagcgttgtgcgagtccagg\n\
+tgcatgcgcagcaataggattttaaattttgttccatttttaatttagccgtaaggatgt\n\
+ccgtaaatgattgaaaattggattcaatctttgggcctatgctactggaacctgatcgac\n\
+aaaatttcaaacatacgttaactccgaaagaccgtatttttgcggctagaatagtcagtc\n\
+gcttggagccatataccttaccacttaaacgacgtgctcctgtagttgaaatataaacag\n\
+aacacaaagactaccgatcatatcaactgaagatctttgtaactttgaggcgaagcaccc\n\
+tcttcgagacaactaagagtaaagtaccgggcgccgcaaggagtcgattgggaccctaaa\n\
+tcttgacgaattgctaagaggctcagagctaccactgtaatttctctagagcccataata\n\
+aatgaacgatacatccgtaggtagcacctaagggattataatggaagccaaatgcagtta\n\
+ataatattatatactggcgtacacgattcgacggatctctcacatagtgattcacgaccc\n\
+ccccctttgattgacacagcgtcagcattttgcaagaacgatcttctgcatagggtgcgc\n\
+caccgtaaggatgacgtcgaagctacaactgggtataatttaccatgcttccctgatgct\n\
+gagtgcaatacactaagaatgagtttttaccccatatcaccagtatttgttctgttattg\n\
+cgaagaaatggctatgctgagttggcgactaaagtcacccatcctttttattaggtaacc\n\
+ccctcccttaaactaactgatttgctggagctgccctgcatacatatactttatcattta\n\
+tggacgtccgtgacgcttattatccaccatagtcgatatgctacacggattcattaatgg\n\
+atcgtaggagtttaagttatatttactaagatcggtctcggctactatcccgccttaccc\n\
+ggcgctatttacggccatttttaatatattgacggtaattattcctatggtttcgaccgc\n\
+acgtccttggacaagaaagaatggcaaaaaaaatgtaaaagaaaaaaaatattgagtccc\n\
+taccatcatataaaaaatatgtgatgagtaacttgacgaaatgttagtggttattaaaga\n\
+ctatctattacaccttttgttttctgtcgtagtatattaaagtctagaagccttacagga\n\
+aaatcagggttatacagccgatactccgcagcatgaatcatcgaggaggtgtcctaccat\n\
+cgcgccttgtaatcttgtctgtgtatactgtatttagaccttttatacaaagtaaatatc\n\
+tcggctttatgtgattgggaggggcctactcaaacatgatgacttgacctaataatcact\n\
+gtgcgggcgtcttatgactagctattccttgaaatccaccaccaaatggttaatatgtaa\n\
+aaactttgacgatgaaacaaggtgaatgtgtagttactttgtgtaattagctgcgtcgag\n\
+cattgcttgtaaaaccgtcaatcgcacacgttacttccataaaatttctacgaatacacc\n\
+cttcttaaaaaaaacgtaggaattcacgagtttaacaaacgataactgtataaagtggaa\n\
+gtccgaagaaagcagatgcccgaactactcgaagatgtttcgttttcttaaccatagggg\n\
+cttcttaatggcccactacgcacattttgttcaagcccgagagggacatccccattacgg\n\
+gagtattactaaaactgttccgtaatacgttcagcaagggatgaaaaaggccactgctca\n\
+agttattgacgtgggagtattacatcggaagcctgaatcccacactatgatggtctgtac\n\
+aggcctagggactgcgtctagacggtattaccggcttctaatcatacgatcgtgagtctt\n\
+aacgggaagtaaggctcacacctaccccaaaccatttatctatgtaagtataaaattgtg\n\
+cgtaagtgttcaaagtggacaataaagacgtggcaaaaacccccgcacataagccgcttt\n\
+agatttcacaaataccaatgcggttaaaaacatccttgagtcgtacatacaccatactcg\n\
+cgttaaacggatataacagaagataataaatccggatgtggagtcggtgtaactatagaa\n\
+agccaagtgaaataatgcttaccagtcatttagctatacggctttcatttcatgtcaaga\n\
+gggtggagtttgacctgtacagttgatatatcaccgatacttagaactcacctaaagcta\n\
+aaattgctcgcagcgtgtaatccgcatattacaaacaatagatgggattcattatacata\n\
+agacacgatgatctgctttttcaggttgcgagatgttgcctatcgtcaatcgagtcctgc\n\
+cttacaccacttaaacaaaagtattgacagggaacctattttcgaggtattatatagtcc\n\
+agcttgaatatcaatttgacagttaacctagtgaaaatcagtaagaggaaatacgccaca\n\
+ttctccagtgaaattctacgggttatcgtctagtccaactatcaattataactcacgaga\n\
+tataagtaaattctcgtacttggcctgatttttattatactttggatccttagtaaacag\n\
+gaagggagaaaccttcaacgaaaaacactggattttgttttactctcaaagctcttatat\n\
+gacggaaataccctgtcaagtcttaactttattactagactaatgaaatgggcttggggt\n\
+ggccagaatcatagtacaatttagcggatacactattcggactttcctatcggctgtctg\n\
+gttggataagtatggggactaataggctagacatacctatacttaaactatacaggcgtc\n\
+atctatctctgcaactttggagttccctgatgttctcccgccctttgggttcacatcttc\n\
+tataccgacacccctaataacgattagtttgtgggttagagtaaattaatacggttaata\n\
+ttaatgtatcgttgaaaagctggtgtcgccaataaggtaaccggctaggcagagtatatg\n\
+tcacgaagtataactaccctaatgataagctgtaggaataaaattaatgctgtctctaag\n\
+cgaagagatatttccgactctgttttaatgacgaatctcattacttctgacttgcaaatg\n\
+ttcaatatggcacggtttcacggcacctttgtgacgcatataatgaacttagaagattat\n\
+aacgacggaactttatatgataatccgttacgattaaagaatctgttaaatatcataatg\n\
+gcattcagttctagaccgtgcatcatggtaaacttactttctctgcatggcgacatacat\n\
+ttcgctattcaaattcgcgtgtggttacacccactcgcacctttggaatattaagagaag\n\
+atgatcagaaaatccattcgctcaatttttctgacgtacgtctaatttatcctaggagac\n\
+aaatcgttttatgtctctcacatttttgaagaaaggttcgagagacaatactcaggtcct\n\
+gaactgctagaagatactcggtggagcgtggcaacaatgaaaaactcgtgacataaatga\n\
+atgatacttttccaagttcagttaagtgaatatgtttaacatacccggcttttcgatctt\n\
+aagctgacgctggacgtgcgagtaatgtcagtctcttacatacactagtgactccaagtt\n\
+tcgtcaaaaacgccccctcccttctcgagcccactcacgctatgtattgacgcgaacttg\n\
+ttcgggatcagacttttcaggagttcggtcgcgtgtccctatgtgctaatatataagtta\n\
+gatcgcattagatgctaatctgaatacttatagacgaccttcaacgagaacgggtaccac\n\
+cttgaggctagagttaggtgtgaaacgacaggtagggacatataaaatttgagtgcggct\n\
+ttagttaagggtttaattacctactcaaacatcacgctcgcgcccttcgtacgtaatcga\n\
+ccatctagaggctaaggggactgtactaggtagtgattaatgatatcctagacgcacgtg\n\
+ccttagatcttcagactctgatggtccgcgatcaccgtaattgtagtcctccaactcgat\n\
+cactttgttggcgtcaaagaaattacgatatctaaatacttataatacaataaccaagga\n\
+tgagaatgactcatcgcgttggagttatattgcttgaagttctatggaatgaaagcacgt\n\
+tatctgccgtcccaatatctccagtgagctaattcattggacggtccactttgatcaatc\n\
+cccgaggagatgttcggacactttagtctgtaacacttagcgttgagaccacgaacaatt\n\
+gattactcagtcttgaaggtgttttccaaagttcattttaaataagactacgataggcct\n\
+ttcctattgatataaactacccggctctgttgttcgtgtgagtcgtacttctctgtgttt\n\
+ttctgattatagcaagattcgattcttagtgtaaacagcgatttttatttgacccgtcaa\n\
+tgagaagcgcataggatctaagcaaaattatcaagttgtgccacaaggtaagatctttcc\n\
+agttattgcaggtaggatgtatcccacgttgatagtatgaggtctgacgtcaactgtcta\n\
+ggagagttgaccgcgtgcgggtacaccggatttgcatcgatgttgagaacgcagaactcc\n\
+cactgtcgtggcggcgttcctgatatttagcaagaggcgttgataaagccctcatcatct\n\
+agatctcgacctcatctgccctcttgctccatcattttctacacagactactttcctatc\n\
+tacgttagtataattgctttctatcttagtatcatttagagcttctccgtcaacaggttc\n\
+gtgctattaaagttagtacgaaagggacaacttgtagcaacgcatttaatcggttttcga\n\
+ctacttcgcacaaaatcagataaagaagtttgtcattctattagacattgaattgcgcaa\n\
+ttgacttgtaccacttatgatcgaacactgaatcaagactgtgattaactaaaatagaca\n\
+agccactatatcaactaataaaaacgcccctggtggtcgaacatagttgactacaggata\n\
+attaattggactggagccattacattctctacaatcgtatcacttcccaagtagacaact\n\
+ttgaccttgtagtttcatgtacaaaaaaatgctttcgcaggagcacattggtagttcaat\n\
+agtttcatgggaacctcttgagccgtcttctgtgggtgtgttcggatagtaggtactgat\n\
+aaagtcgtgtcgctttcgatgagagggaattcaccggaaaacaccttggttaacaggata\n\
+gtctatgtaaacttcgagacatgtttaagagttaccagcttaatccacggtgctctacta\n\
+gtatcatcagctgtcttgcctcgcctagaaatatgcattctatcgttatcctatcaacgg\n\
+ttgccgtactgagcagccttattgtggaagagtaatatataaatgtagtcttgtctttac\n\
+gaagcagacgtaagtaataatgacttggaataccaaaactaaacatagtggattatcata\n\
+ctcaagaactctccagataaataacagtttttacgatacgtcaccaatgagcttaaagat\n\
+taggatcctcaaaactgatacaaacgctaattcatttgttattggatccagtatcagtta\n\
+aactgaatggagtgaagattgtagaatgttgttctggcctcgcatggggtctaggtgata\n\
+tacaatttctcatacttacacggtagtggaaatctgattctagcttcgtagctgactata\n\
+ctcaaggaaccactgctcaaggtaggagactagttccgaccctacagtcaaagtggccga\n\
+agcttaaactatagactagttgttaaatgctgatttcaagatatcatctatatacagttt\n\
+ggacaattatgtgtgcgaaactaaaattcatgctattcagatggatttcacttatgcctt\n\
+agaaacagatattgcccgagctcaatcaacagttttagccggaaacaatcgaagcatagg\n\
+gacaatgtatcttttcctaaattgccatgtgcagatttctgagtgtcacgaagcgcataa\n\
+tagaatcttgtgttgcctcaactcgttgaaaagtttaaaacaatcgcagcagtctttttg\n\
+gggtctactgtgtgtttgcaaaataactgaaagaaacgcttgaacaactctgaagtagct\n\
+cgagtactcattaaagtgtaacacattagtgaatatcggccaatgaaccaaacgcttccc\n\
+ggtacgctatctctctcatcgggaggcgatgtgcaggttatctacgaaagcatcccttta\n\
+cgttgagagtgtcgatgcatgaacctcattgtaacaatagcccagcaaattctcatacgt\n\
+gcctcagggtccgggcgtactcctccatggaagggcgcgcatctagtgttataccaactc\n\
+gctttttaactactatgctgtagttctacaggcatagtggccagtattttctaacttctc\n\
+tggatagatgctctcactcctcatccatcacggcttcagtttacgtcttacttgcttgtt\n\
+cagcaacggatggaggcattaagtatcttcactgttccctaaaattgctgttcaatatca\n\
+aagtaaggacgatacagggaaagctcaagcacactcattgaatactgccccagttgcaac\n\
+ctcacttaatctgacaaaaataatgactactctaagtgttgcggaagcagtctcttccac\n\
+gagcttgtctgtatcacttcgtataggcatgtaactcgatagacacgaacaccgagtgag\n\
+aaactatattcttgcttccgtgtgtgtgacaccaggtaattgatgcggatataagctgga\n\
+gatcactcacgcccacacaaggcgctgctacctctttattccaatgtgtaagaatttgct\n\
+aacttcatttctagaccgcagctttgcggtcataatttcacggtacggacccttgggtta\n\
+gagacttgataacacacttcgcagtttccaccgcgcacatgttttagtggcttctaacat\n\
+agaatttttgttgtgacataaagagtgcgtgggagacttgcccgaccgttaagccataat\n\
+caattgaaagccccgtgagtcacatctaattggttgtactgcgcatttagctatccttta\n\
+gctgactcgaagagattcgattcctaatataggttaattagatggctgccgcgcgaagta\n\
+aaacgtgaaaaacgtagtgcgcagatctgcataactcgcgcttaattacttatgagtagt\n\
+tccaagttcgctacgttatgagagagattggaattaagcaaatatgttttatggtgattt\n\
+tgggatgagaaggactgctaagtacggctactaaacaaatttctaaaaccgccatctacc\n\
+ttatcttggagacatttaagttgtatatgtcactagtctagcttttgtctgtgggacgcg\n\
+ttctcggaatgagggaaatgcaagagccgattcatcaaatgcttatctaagaaagtagtg\n\
+gactattacaccaagcacgaatgccagggaactgctttcttgctcaggacctcgcgacaa\n\
+ggtaccccgcataagtcctagaattacatttggtcagcaatgctgacatttgaccgtgaa\n\
+aacataattttaatcagaaggcagctcacccgcttgctctagatcttatctttgtatgaa\n\
+tgtcagaatttactgcaatatccgttccgaatagtgagggcttagtatagttctctgtat\n\
+acaggtcacatcaaactccccctgtcctagtacagctctgagctttaattaattgcatac\n\
+atttccttcaatcatcagatgaaaacaccgcgaatcatgctcttctcgtatagggcaaga\n\
+gaagcaacaaacaactagcccgactcacgttcatccgccgtatccttgttcagttcttac\n\
+tccgtattaggtcagcgaaatctaatcagaataatcggtcgcgtatcaaaattaaaatcc\n\
+cgcttgaggttgacaattaaaacgctgagcagttatcggctattagatagtggggtgaaa\n\
+gtaattggctggaattatgttaaaacgtgatattaagctaaaatacgctacttgttgccg\n\
+acctaattcagtcattcgatattcagttagagccaagaataacaagcttgtataaattga\n\
+acggggtgcactaaacgatgtgttactctaatattcagcttggagtatacctgaaggcga\n\
+attcatgtatcggccaataataagacgttgaagatcacaatttggactagcaaaagaagg\n\
+tgatttatgcgtggggattgagtccactgtacgagtacggtctctggaaaattataggtt\n\
+cagggaatataaggaagtaaagataattaccaagagatttttggtatcgctatgacccag\n\
+aggtgttctaacgtctgttttgatccgcagaatttctgcctcaatgcatatttgacggac\n\
+ttgaactagagcctctaaagttaaatggcgacgcaactgttcctaaacttcaattattac\n\
+tactctttttttcctagggtattgtagaggccagtggacaaaataaatcaaatttaagat\n\
+gtttcggacattaacatcccccgtagcatagaaatcatcagttatccaatctctcatcga\n\
+gcttttacaatttctgctggcgctatggacagcatatgccgcgagacctccgcaagactc\n\
+acttgatcactgtaagtatcttcattagaggttagagcctatagttaagctgctgaccta\n\
+gtaaaattggtattttctaattttattgctcaagttaaaggttagtgaagggataatgac\n\
+gttatttttgaacaatgggttgtattcaattttatatcacgaatggaacccttcattccc\n\
+ggcataatactagacgacacgaacaagctccgatctatcagccaggcacgtgttaaggtt\n\
+taattccggcaaaccaatgaagcatcaaaaggtgacctgatgcaacttagggtcacgatg\n\
+agtttttcaggactacttattacctattaataagttaacatgagccttcataccccgtaa\n\
+gacaatacatactccaccaattagaattctgagccatcttatctttttgtatcatcgaag\n\
+ggtatggccgaataggttaattagttactcctaacgtctctacaggcatgcatttgacgc\n\
+accttcgaaaatagtcaatctctcgccacacgcgtctagtatgcagcatcaaaaatatag\n\
+tccacggtttccggattaccaaacgcggcaaagagaaacattgtatcgacggagataact\n\
+taatacagaaggaaggggcatcttcgaatacggatgaataattctatctgtttattctga\n\
+catcttgttttcaggttaatcttacgcattcaaatgacgcctgccccatgcgtgcgcaat\n\
+tattttctaatattgacgagagcaatctcactccttttgggtctatttatgttttattga\n\
+ggcacaagcctatacagaacaggtactattaaggccgtgagtgtgagactcaaaccgtgg\n\
+aaacaaaggatgggttgttcttggtacaagttttagtgcatgtgggcaatccttaccaaa\n\
+atcagatgctatccttaactttgggctgcatttaagatggcggttggaggcctgtgagaa\n\
+tcctgcgtgtcatctttaatgaccgaattcatccatgtagattcagatcacacactcatt\n\
+ccttgatgttgtctaaacaaaagttgttgtggacgcattggagggagttaagtaacaact\n\
+tgggatcgcatacttataaaaattatatgttaaactttcacaaacgctgaagtccaaagt\n\
+aactagcccaaacgcctcgagagtcactaggtattaatggtgtttgagttcctgtgaaat\n\
+agtgttcgaaggtaaaatttatgtaccaaatcgaaagaacacttaataaggcttgcttgc\n\
+acggaggtatgatgtttactgactctacaaccctaattttccagtacgtacattcattcc\n\
+aataggttagttctcaaagtgctatacaggctcctcaattgatgatatgcttcagccgct\n\
+ctatggatattagctcattttatttaggaagcccgcttagaggcttactatgagggaaat\n\
+gccaaaatgtcatacttttcggtgtgtcccatatgacaccgctttacatagaatttgaat\n\
+taaaacgcgctctcccgttcactaccatacttggtaccgtgcgcatattacatatagata\n\
+taggatcattttttaaagctgtactaggtttgatcgacaatcttatgctatactatatga\n\
+tgtaaccctcataatcaataccgatcgtacgatcctagcataggtggcaagcgattttat\n\
+gccgattattgtgttaaatagtctgtgagtgtgattatcagggctacgttggtagagggg\n\
+ttgtatagacctcgcacacattgtgacatacttaacaatatacgaaaactgatataataa\n\
+atccccttacccaaacaccaatcccgttgaatcaactaccataacgtctcccatataaat\n\
+tgcctacttgtttgcataaatctgaatacataacaccattgcaccttcttgtgttccaat\n\
+cccgttaagattgccttgtcagatgatatgcaagaacaatagcatttgctagcaattatt\n\
+aacagctcttcgaattgcctccacataacgcgggagggtatattttaatttggcaaatac\n\
+taagtactgttggcgtcatatgctattaacggttggatattaagttatgtcagccgtaag\n\
+caagagtgggcgaaatattttgttacccagtgagagcactcttagagtttggatacaata\n\
+ggccatatgttgacttaagaggacgtaactacgccgtacaccattgttcaaccgacttct\n\
+tggcaaatagaatcgtattagcaatcttaagaatagagacacgttcgtgttagggtatac\n\
+tacaaatccgaaaatcttaagaggatcacctaaactgaaatttatacatatttcaacgtg\n\
+gatagatttaacataattcagccacctccaacctgggagtaattttcagtagatttacta\n\
+gatgattagtggcccaacgcacttgactatataagatctggggatcctaacctgacctat\n\
+gagacaaaattggaaacgttaacagcccttatgtgtacaaagaaaagtaagttgttgctg\n\
+ttcaacagatgatagtcatgacgcgtaacttcactatagtaaattgaaacaaatacgcaa\n\
+tttagacagaatggtacggtcatgaatgacagtaattcgaagtgctagaccaacttaaaa\n\
+taggtaaacgtgcccgaaaccccccttaacagaaagctgctatcatggtgcagtatcgac\n\
+gtgttcagaaacttgtaacttttgagcaggtccgagcacatggaagtatatcacgtgttt\n\
+ctgaaccggcttatccctaagatatatccgtcgcaaactttcgatttagtcccacgtaga\n\
+gcccaagcgttgtgcgactccacgtgcatgcccagaaatacgagtttaaatttggttaca\n\
+tggttaattttgaccgaagcatcgcactttatgattgataattggattcaatatgtcgcc\n\
+ctatgcgaatgcaacatgatccacaatttggctataagacgtttaatccgtatcacactt\n\
+tgtttgcggctagtatagtaacgcccgtgcaccaagagtcagtaacaattataagtactc\n\
+cgcaggtacttcaaatataaaaactaatcaaacacgacccatatgatcatctgaagatat\n\
+ttggaactttctcgacaaccaccctcgtactcaatacttacactaatcgacaggcacacg\n\
+caacgtgtacagtcgcaccatattgagtcaagatttgcttagtggcgatgagcgtacacg\n\
+cttatttctctagtcacaattagttatctacgagacatcacgagggagcaaataagcgat\n\
+gttatggctacacataggcacgtatgaatatgatataagccagttaaacagtcgaaccat\n\
+cgagcaaattctcatgcaccaacccacacgttgaggcacaaagagtaagctgtttgaatg\n\
+taacttcttctgctgagcgggccccaacgtaaggatcaactagaagagaaaactcggtat\n\
+tagtttaaatgcgtcacggagcatgagtgcatttcactaagaatgtctgtgtaaccaata\n\
+taacatctatttgttatctgattgcctacttatggctttgcggtcgtggcgactaatgtc\n\
+tccaatccttttgaggtcggtaccaactccctttaaattacgctgtgcaggctcatgcac\n\
+tgcatacatatacggtagcaggtagggacctcacgcacccttattataatcaatagtagt\n\
+tatcagtcaacgaggcaggaatgctgaggtcgaggtgttggtatattttctatgtgccgt\n\
+ctaggcgactatcacgcattaccaggcgagatttaagccaattttgaatatagtcaacgt\n\
+aatttttactatgggttccaccgaaacgccttgcacaactaagaatcccataaaatatcg\n\
+atatcaaataaaagattgtgtcaataccttcatatatattttttcggttgactaacgtga\n\
+actaaggttaggggttttgtatgtctatataggaaacagtttcttttctgtcctacttta\n\
+gtaaagtcttcaagccttactccaaaatcacggtgattaagccgttactcagcagcatga\n\
+ttctgcctgctcgggtcctaaaatccagccttgtaagagtcgctgtgtattagctaggga\n\
+gacctttgttaaaaaggatatatcgcggcgggatgtgagtgcgtggcgcatactcaatct\n\
+tcagctcgtgtcattataatatctctcccccacgcttttcactagatatgccgtgtaagc\n\
+aaacaccttatgcttaatttcgaaaatattggtacttgaaaaaagctgtaggggtactta\n\
+atgtctggtaggagatcaggagagaattgagtgtaaaaccgtaaagccctcacctgactt\n\
+catgtaaatggcttagaagactccatgatttaataaatactacgaaggaaagactggatc\n\
+taaagataactctagtaaggccaactcccttcaatgctgttgccagttataatccaagag\n\
+ctgtccttttctgaaccatagcggcttctgaagcgaactagaagcaaagttggttctagc\n\
+cagacagccacataccctgtacgggtgtattactaaaactggtccggtattagttcacca\n\
+agggaggaattaggcaaaggatctaggtatgcaagtcggagtattacatccctaccctga\n\
+atccatcaataggttcctctgtactggccttcgcaatgagtattcaaggttgtacagccg\n\
+tataataataagatagtgactatgaacgggaagtaacccgctcaccttccccaaaacatt\n\
+gttatatctaagtattaaagtctgccgtagtgttaatactcgaaaataaacaactggcaa\n\
+attacaccgcacttaagccgcttttgatttatatttttccaatgcgcttttaaaaataat\n\
+tcagtcctacatactaattaagacccttaaacggagatatcacaagttaagttttaacca\n\
+tctcgactaggtggaactatagatacccaactcaatttatcattacctgtaatgttccta\n\
+gaaggattgcatttcatgtcaagacggtggagtttcacagcgaaacttcagtgtgaacag\n\
+attctgagaaatcacctaaacctattagtcagagcacccggttagaaccagttgtcaaaa\n\
+aatagagcggttgcatgagacagaagtaacgatgagatccgttgtaacgttgagacatct\n\
+ggcctatcgtcaatacagtcctcccttaaaaatatttttaaatactaggcaaacccaaca\n\
+taggttagtcctatgtgatacgccacatggtatatcattttgtaacgttacctagggata\n\
+atcaggaagtggaattacgcaaaagtagacagtgaaatgcttagggttatagtctagtcc\n\
+aaagataaaggataaagcacgtcagagaactatattagccgaatgggaatcattgttagg\n\
+agactgtggatcatgtctaaaaagcaacgcagaaacagtcatcgaaaaaatctcgttttt\n\
+gtttgaatctaaaagagctttgatgaccgatagtacctgtatactagttactgtattacg\n\
+tgtctaatgatttcggattggggtccccagaatcagacgtcattgtagacgattcaagtt\n\
+taccaatttaatttcccagctctccttggagaactatcgccaataattgcagtcactttc\n\
+cttttctgaaacgataaagccgtcagagttctctgcaacgttggacttacctgaggttct\n\
+aacccactttcggttctaatagtagttaacgacacaacgaataacctttactgtggggct\n\
+ttcacgatattttttcgcttattattaatggttacgtcataagctggtgtccaaattaag\n\
+gttaccggcttcgcagagtagttgtatccaagtataacttccctaatcataagatcgagg\n\
+tagaaaattaatgctgtctctaaccgaacagatatgtcccactatgtggtatggacgttg\n\
+ctaattacttctgaagggaaattggtcattatggatacgtgtctaccatcaggtcggacg\n\
+cagatatggttctgtcttcagttgatccaccgttctttataggataataactgacgatta\n\
+aagattatggtaaatagattaagccaattctcttcttgtcagtgaagcatccttaactga\n\
+cttgctctgcagcccctcatacatttagctattcaaagtaccggctcgtttcaaactctc\n\
+ccacctttggaagaggttgtcaacttgataagtatatcatttacagcattttttcggacg\n\
+tacctctaatgtttcattgcagaaaattagttttttctatcgcacattttgcaagtaacg\n\
+ttagagacacaattatctgcgaatgaactgctagatctgacgaccgggagcctcgcaaat\n\
+atcaaaaaagactgacatatatcaaggagtcgttgacaagtgctggtaagtcaattggtt\n\
+tatctgtcccggcgtttcgatcttaagctgaccatgcacggcagagtaatgtcactctcg\n\
+ttcttacaagtctgtctccaagggtcggcaaaaaagacccctccattctcgagcccactc\n\
+acgatatgtagggacgacaacttgtgcggcttatgaattgtctggactgcgggcgagggt\n\
+ccatatctccgaagttagaagggacatacctttagatgataagatcaattcttattgacg\n\
+aaattcatccacaacggggaacaacttcaccctagacttacgtctgaaaagacacctagc\n\
+gtcttataaaaggtcagtgccccgtttcgtaaggctggaattacctacgcaaacttaaac\n\
+ctcgcgcccttccttacgtatcgacaagatagaggctatcgcgaatgtactacggaggca\n\
+tgaatcatatactagaaccaagtgcctgtgatattaacaagatgatccgacgcgagcacc\n\
+gtaattctaggcataaaactccagcaatttgggggccgaaaacaaatgacgttagctaat\n\
+taattatatgacatgatcaaaggaggtcaatcacgcatcgagttcgacgtatattcattg\n\
+aacttcgtgcgtttgaaagaaacttttatgaaggcaaaattgatcctgtctcctatttca\n\
+tgcgtacctcctagttgataattccccgagcagtggttaggacacttttgtcggtatcaa\n\
+gttccggtctcaaaacgtaaaattctgtaatctgtatggatggtctgtgaattagttaat\n\
+ttttatgaagtcgtcgagacgcagttcctattgatttattctaaacggagatgtgcttcg\n\
+tgggactcggaagtagatctgtgtttatgattattgctactttagatgctgactgttaac\n\
+tccgtgttgtttttcaaccgtatatcacaaccgaattggatagaacctatagtttcaagt\n\
+tctgccacaaggtatcatatttacagttagtgctggttgcttctttcaaacgtggtgagt\n\
+ttgtgctatcacgtcaacggtagagctcagtggaccgagtgcgcgttcaaccctgttcca\n\
+gagagggtgtgatagcacatataccacgctcgtcgaggcgttcatgatagtttgcaagag\n\
+ccggtgttaaacacatattattattgttatccaactaatcggacctatgcataaagcatt\n\
+gtctaaacagaataattgcctatatacggtagttttagtgatttatatcttagtatcagt\n\
+tagagcttcgaactcttcaggttcctcatatttaacgttcttcgaaagcgaaaacttcta\n\
+caaacgaatgtaagcggttttccaagtagtacctataaatcacagaaagatctgtctcag\n\
+tatagttgaaatggtattcagctagtgacgtgtaccaattatcatagttcactcaagcaa\n\
+gacgctcattaacgaatatagacaagacactatatcatataataaaaaagaacatggtgc\n\
+tcgaacatagttgaattcaccatattgaaggggaatgctgacatgtaattcgctactaga\n\
+cgatcaattccctacttgtcaaagttgaactggtacgttcttggaattaaatatgattgc\n\
+gctggaccaaattgcgacttcttgagtttcagggcaaacgattgagccggaggatgtccg\n\
+tctcttacctttcttgcttatgataaacgacggtccctgtacatcactgggaattctcag\n\
+caaaaataattgggtaaatcgagactcgatgtattcggccacaaaggtgttagacgttaa\n\
+agattattcaacggggcgataataggatcataaccggtatgcaagcgcattgaaagagcc\n\
+atgagatccttatccgataaacgctgcacggtatgtgcagccttattgtcgatcacgaat\n\
+ttataaatgtagtctgggctgtaagttgaagacctaagttataatgaagtgcaataccaa\n\
+atcgattcatagtggattatcagactcaagatatctcctgataaattacagttgttaaga\n\
+tacggataaaatgagatttaagattagcagcctctaatctgtttcaatcccgttggaatg\n\
+tggtatgcgatcaaggttaagttaaaatcaagcctgtcttcagtcttgattcttgttctg\n\
+ccatcgcatgcggtctacgtgagttaatatgtagcttacgttctagcttgtgctaatctg\n\
+agtatagattcgtagaggaatattatcaagcttccacgcctcaacgtacgtgtattggtc\n\
+acacaagacactaaaagtggaagtagcgtaaactatagtctagttgttaaatgctcagtt\n\
+cttgttatattcgatatactcttggctaatttatgtctgagtatataaaattaatgatat\n\
+taacttgcatttcacggatcccttagaaaaagattttgaccgagcgcattataaacggtt\n\
+acaccgaatcaatagaagcatacccaatagctttctttgaatttattgcctgcgcaactt\n\
+ggctgactctctagatccgaataattctatatggtcgtgacgaaactagttcattactgt\n\
+ttaaaatgccaacatgtcttttgggccgataatggctctttgcaaaattactcaatgata\n\
+cgattgatcaaagcggtagttgctagtggtagcatgtaagtctatcaaatgtctgattat\n\
+ccgaaaatcttccaaaagagtccacgtaccatatctatctcatagcgacgcgaggggaac\n\
+cttatctaactatcattccatttaccgggtgactctcgatgcaggatccgattgggataa\n\
+attgcccagaaatggctcattcctgactaagggtaaggccgttctcagcaagggaacccc\n\
+gcgaatctaggcttataccatctagattgttaactacttgcctgtagttctacagccata\n\
+ctggacagttgtttctaaatgatcgggattcatgctagcactcctctgaatgcaccgcgt\n\
+aagtttaactattacgtccgtgggcagataaggatggaggctgtatgtatcttaactgtt\n\
+acctaatatggctggtaattatcaaagtaaggaccttaatgccatagcgctagcaatcgc\n\
+tttgtatactgaccatgtgccaacctctcttaatctgtaaaatataatgtcttagctaac\n\
+tgtggacgatcatgtctctgcctagagcttcgctgtatcaattcctatagccagcgtact\n\
+agtgacacaacaacaccgtgtgagaaaagatattagtccttacgtctgtctctctacagc\n\
+ttattgatgaggattgaacatggacatatagctccccctcaaaagcagatgctacctctt\n\
+tattccattctcgaacatttgccgaacttaatttcgacaaacctgaggtcacgtcttaat\n\
+ttatcggtaacgtcacgtccctttgagactggataaatatattaccaggggccaacgagc\n\
+aattgttggaggcgcttctataatacaaggtgtcttgtcaaagaaagacggcgtgcgtct\n\
+cgtgcaactcacttaaccaatattaatgtgaaacccccctctctcacatcttatgcggtg\n\
+tactgccctggtacatttcctgtacaggactccaacagtgtagattcctaagatagctgt\n\
+tggagttgcctcacgccagatcgaaaaactgaataaactagtgagctgagctgcagaaat\n\
+accgcttaattacttatgactagttcaaagggacctacgtgatgtcagacattgcaagga\n\
+agaaattaggtttgtgcgtcattttggctggactagcactccttacttcccctactattc\n\
+aaatgtcgtaaacagcatgagacaggatcgtgctgacatttaaggtctattgggaacgag\n\
+gctacctttggtcgcgcgctcgcgttctccgaatgaccgaaatgcatgagcacagtatgc\n\
+aattgcttatagatctaaggtctggtcgttgaaaccaagcacgtaggcctgggaaatcag\n\
+ttcttcctcagcaactacacaaaagcgtccaagcattagtacttgtagtaaatgtccgaa\n\
+cctatgcgctcatttgaaagtcaaaaaatatttttaagcagtaggcacctaacccgattc\n\
+ctctacttagtagctttctttgattctcagaattgactgcaatatcactgcacaattctg\n\
+tgccattactagacttctctgtattaacgtctcatcttactaacactcgcctaggacaca\n\
+tctgagagtgaagtatttcaatacatttactgaaatcttcagttctaaaatccccgaata\n\
+aggctcttatcggtttggccaacacaagaaaaaaacttcttgcaccactcaccttcatac\n\
+gcaggagcctggggaacttagtaataactatttcggcagacaaagcttataacaagttgc\n\
+cggcgcgtataatatttaaaagaccccttgagctgctcaattaaaacgctcacctggtat\n\
+aggctattagatagtgccgtcttagtaaggggcgggaattatcggataaactgatatttt\n\
+gataaaataaccgacttgttcacgacataagtcactaaggagattttatctttctccaaa\n\
+gtatatcttccttggataatttcaaagcgctgcaatttaagttctgttactagtttatgc\n\
+tgctgggaggtgaccggaaggcgtagtaatctagaggcaaattataagaagttcatcata\n\
+tcattttcgactacaaaaacaaggtgttgtatgccggcgcattgtgtaaactggacgagt\n\
+accctagatggaaaattatacgttaagccaagatttcgatgtaatgataattacctacac\n\
+atttttgctatccataggaacaagagctgttctataggctcgtggcatacgaacatttgc\n\
+tgccgctatgaatattggaagctcttcaactacagactctattcttaattgccgtcgaaa\n\
+atgggccgaatcggctattattaatactcggtttttccgaggggattgttgtcgacagtc\n\
+gtaattattattaatattgatgttggtgaggtcatttaaatacaaccttgcagacaatga\n\
+ataagggatccaatctctcatactccttttacaattgctcatgcccctatgcaaacctta\n\
+tgccgccacacctccgcaactctctcttctgaactgtaagtagcttcattactggtttga\n\
+gactatactgaagctgatgacattctaaaatggctattttcgaatgtgattcataatgtt\n\
+tatcgtttgggatggcagaatcacgttatttttgatatagcccgggtattctattgtata\n\
+gaacgtatgctacaagtcattccccgaagaagactagaagtaaacaacatgcgaccatcg\n\
+ttaagccacgcaaggctgtagctttatttcccgataacctatcttccataaatagcggac\n\
+agcaggatactgacgctcaacatcagtggttatggtctaatttttaacttttaataaggt\n\
+aacttcagcaggcatacacagtaactctttaatttataatcaaattagaagtctgacact\n\
+tcttatatttttctatcatccaacgcgatcgcccattagcttattgtgttactaataacg\n\
+tatctaaaccaatccttttcaagctactgcctatattgtcaatatatacaaacaacagga\n\
+tagtaggctgcttaaaaaatattgtcaaccgtgtacgctttacaatacccggaaatcaca\n\
+aactttgtagacaacgagtgaaatttatacactacgaagggccagcgtacaagacccatg\n\
+aattaggcgatatgtttattctgacatattggtttatccttaatctgtcgctgtaaaatg\n\
+aagccgcccccatccctgcgaattttttttcgaagattcacgactgaaatataaatacgt\n\
+ttggctatatttatgttggagggaggcaatagcctttactgttaaccgaagatttagcca\n\
+gtgagtgtgacactaaaacactggaataaatgcaggcgttcttctgggtaaaaggtttag\n\
+tcaatctcgcctataagttcatatagctctggatataattatctggcccatgcatttatc\n\
+atggcgcttggtgccctgtgtgaagccggcctctcatattgaaggtccgaagtattccat\n\
+gtacattaagatcactctctcattcatgcatcttggcttaacaaatctggttgtccaagc\n\
+tttccaggcacgtatggtacaaattcggatcgaatacttataaaaatgatatgttaaact\n\
+gtctaaaacgctcatctacaaagtaaagtgcactaaccaatagagtctcaagaccgtgta\n\
+atgctggtgcactgaatgtgtaatacggttagaagggattagttatgttacaaatccatt\n\
+gaaaacttaagaagcattgcgtgctcggagggtgcatcttttatcaagagactaacatta\n\
+ttttcaacgacgtacatgctttacaatagggtacttatcaaacgccgagaaacgcgccta\n\
+tagtgatgttatgattatgacccgatatccattggaccgaattttatgtaggttcccagc\n\
+gtactcgcgtaatatctcggtattgccataatgtaatacttgtcggtctctcccagatga\n\
+aaaagcgttacagagtatttcaatgaaaaacagcgcgcaacgtcaatacctttaggggta\n\
+acggccgctgatttcatatagatatacgataagttggtatagctctactaggtggcatcc\n\
+acaatcgttgcatttactatagctggttacaatcataatctataccgttccttacatact\n\
+accatagcgggatagcgtttttttgccgttgattgggtttaagaggatgtcagtctcatt\n\
+atatccgattcggtgggagagccgttgttttcaaatcgcacactttgtgacataatgtac\n\
+aagataacaaaactgatataagatataaactgtcaatatcaccttgacacttgaatcaaa\n\
+gtaaattaactcgcaaatataatttgactaattgggtgcagatttctcaattaataaaaa\n\
+aatggcaccggatgggcttacaagccccttatcattcacttgtatcatgatttccaagaa\n\
+caatagaatttgctagcaagtatgaacagagattcgaattgcatccacagtacgccggag\n\
+cgtttattttaatgtggatatgacgatgtactgttggcggcatttgctagtaaccggtcc\n\
+ttatttacgtagcgcacacgtaagcatgtctgggagaaatatggtggtacaatctcagag\n\
+aaagattacagtttggtttaaataggacttatcgggtcggaagtggaacttaataagcag\n\
+tacacaattgggcaacagacgtcttgcctattacaataggattacaatgcgttagatttc\n\
+agacacgttcgtgtttggctattcgtcaattccctaaatagttagacgatcaactattat\n\
+caaagtgattctttgttcatcctccattcatgtaacagatggcacactacgcataacgcc\n\
+gaggaattttaacgagatttaagagagcagttcgggcacaacccacttgactttataaca\n\
+gctcggcagcataaacggtaatatgtgacaaatttccaaacgttataagaacgtatgtgt\n\
+acttagaaaactaagtggttcatgttcaacagatgtgacgcagcaagcctaacttatcta\n\
+ttggttttgctataaaagaacaaagttacacagaatcctaagggcttgtttcacacttat\n\
+gcctagtgcttcaccatcttaaaatagcgaaaccggcacgaatcaaaccttaaaacaatg\n\
+cgcagatattggtgatggtgactccgggtatgataatggtaactgttgaccagcgcccac\n\
+ctcatcgaagtatagaaagtggttaggataaggatgagaccgaacttatttccggccata\n\
+actttagattttctacctagtacacaacatcagggcggacacgaaaccgccatcacatca\n\
+tataccaggtttaatttgcttaatgggggaagtgtcaacgaaccttcgaactttagcagg\n\
+catatggccattatatatggccccagagcagaatgctacagcagacaaaatttggattta\n\
+tgtagtttaatacctatcaaacttggtgtgaccatacttgtctaacgacagtgcacaaag\n\
+tgtaagttacaattattactactcagcagcttctgcaatgataaaatcttatcatacacg\n\
+tcacatatgataatatctacttagggggaacgggctccacaacctacatagtactcaata\n\
+cttacactattcgacaggcacaccaaacctgtacagtcccaaaagattgagtcaactttg\n\
+cagtactgcagatcacagtaatagcttagttagcgagtcaaaattagttttctacgagac\n\
+tgcacgaccgtgcaaatttccgatgtgttggctacaaatagcaacgtatgaatttgtttg\n\
+aagccacgtaaactgtacaaccttagagataagtctcaggctactaaaaacacgttgtgg\n\
+cactaacaggatcatggttgattcttacttattcggctgaccggcccaataagtaacctt\n\
+caactagaacagaataatcgggagtagtttaattcagtcaaggtgcaggtctcattgtaa\n\
+ctaacaagctctgtgtaaccaagttaaaatcgttttcttagcggattccctacttatgga\n\
+tttgagctcgtccacaatattcgatacaagaagtttgtggtccgtaacaacgaaatttta\n\
+attacgctgtgcagcctcatccaaggaattaatagaaggttgatggtaggctccgaacgc\n\
+tccatgattataatcaagtggactgtgcagtaaacgaggaaggtatcctgacgtcgtggt\n\
+gttcgtttttgttatttgtgccctatacgagtagataaaccatgaacagcacagtgtgaa\n\
+cccatggttgattttaggctaccttatttttaatttccgttacacagaaacgaattccac\n\
+aactaacatgccattaatttttcgatatcttataaaagatggtcgaaattcattcattta\n\
+ttttttttcggttctcgaaagtcaactaagctgtcgcgttttgtttctctttagaggtaa\n\
+aagtggctttgatctcctacgtttggatactagtcaaccattactccatttgatccgtga\n\
+gtatcacctgtctaacatccagcattatgactcctcggcgaagaaaagacacacttctta\n\
+gagtcgatgtgtattagctagggacacagttgtttaatacgatagtgagcccagggaggg\n\
+cagtgcgtcccccagtagatttattcagctagtgtaagtataagatatctcacccacgag\n\
+gttcaagtgatatgcagtcttagaataatacttatcctgaatttcgatattatgggtact\n\
+tcaataatccgctagcgctactttatgtctcgttggacagcaggacacatggcagtctta\n\
+aacactaaagacatcacctgaatgaatgtaatgggattacaagaatcaatgaggtattat\n\
+atacgacgtaggaaactctggatatatacagtaatctagttacgccatcgcacttcattc\n\
+ctctggaaacttagaagacatcagctgtacgtggaggaaccagacccccgtatgtagcca\n\
+aatagaaccaaagttgcttatacaaacacacccaatgacaatggaccgctggagttcgta\n\
+aactcggaacgtagtactgcacaaacccagcatttagcaataggagctacgtatgcaact\n\
+cccacgtggtaataccttcaagctatcaatatataggtgcctagctaatcgcattcgcaa\n\
+gcagtattcaagcttgtaaaccagtataataattacagaggctctatgaaacccaacttt\n\
+ccagctaaaagtcccaattaaatggttatttcgtacttttaaagtcgcccgttctgttat\n\
+tacgcgaattgattctactccaaaattaaacacaaattatcaaccgtttcatttatattt\n\
+gtcaatgcagctgtttaaaataaggctctactaaattataattaagacacttattaccag\n\
+atttctctagttaagtttgaaccagctcgactaccgcgaaagatacattcccttctctat\n\
+ttttcagttcatctatgggtcagagaagcattgaatttattctattcaccctcgtcgttc\n\
+acagcgaatcgtcagtgtgatcagtgtatgagaaatatcctaaaccgtttagtcagacca\n\
+cacgcttagaacaagtggtctaaaaagactgccctggaaggagtaagaagtatacagctg\n\
+atccggtgtatccttcagtcatctgccctatactaattacacgacgcaaggaaaaatagg\n\
+tttattttctaggcaaacccttcataggtgactccgatgtgttacgaatcatgcttgaga\n\
+atgtgctatcgttaccgacggataataacgatctccaatgaaccaaatgtagaatgtcta\n\
+ttgattacccttttactattcgacttagagataggagatagaacctcagtgtactttttt\n\
+agccgaatgggaatctttgggaggtgaatggccataaggtcgtaaatccaaccctcttaa\n\
+agtcttccatattatatcgttgttcgtggaatcgataacagatttgttgacccatagtaa\n\
+atgtatactagtttatgttgtaagtgtagattgttttccgattgccgtccaaactttatg\n\
+tcgtaattgtagaccagtaaagttgaccaaggtaagtgcccagcgatcctgcgagatcga\n\
+tcgccaatttttccagtcactgtaagtgtaggtttagataaagccgtatgagttatatca\n\
+taagggcctcggaaagcagcttcgaaccaaagttcccttataatagtagtttaactataa\n\
+aagtatatactggtctgtcgccctttcacgatttgttttaccggtttatgaagcgttacg\n\
+tcattagagcggctccaatttaaggttaacggcttccatgtgtagttgtatacaaggata\n\
+acttaaagtatctgttcagcgagctagttaagttatcctcgatagaacacaactcagagg\n\
+tcccaagatcgggtttgcaacttgctaatttattctcaaggcaaattgggaattatcgat\n\
+acctgtataccataaggtcgctcgatgtgatgcttatgtcttctggtgatcctaccttag\n\
+ttagtgctgattaacggaacattaatgtttatcgttttgagatttagccaattctctgat\n\
+tctaactcaagatgccttatctgacgtgctatgcagcccctaagtattttacattgtaat\n\
+aggacacgctcctttaaaactcgccaaaaggtcgttgtggttctctactggttaactata\n\
+taatttacagctttgttgagctagttcctctttggtttaagtcctcaatattagttggtt\n\
+cgagcgataagttggctagttaccttagtcactatattagatccgaatgttatgcttcat\n\
+ctgaagaccgccaccctccaaaatttcttttaagactcacttattgcaaggtgtaggtga\n\
+attcggctcgtttctcaagtggtgtatctgtacacgagtttccatattttcatcaacagc\n\
+caccgcacacttatgtcactctaggtattaaaagtcgctctacaaggggacgcaattaag\n\
+aaacagacatgctagtcaaaaataaacatagcgaggcaccactaattcggccgcttatca\n\
+atgggatgctctgcgcgagacgcgccagagctcagtagttagttcggacatacatttact\n\
+tcagatgatcaattagttttctacaaatgcttactctaccccgaaaaaagtcaccagact\n\
+cttacgtctctttagtatccttccgtcttatataaggtcagtcccccgtttcggtaccct\n\
+ggaatttactaagaataatgaaacagcccccaaggacgtacgtttacaaatgatagacca\n\
+gatcgcctagcttattccgacgcatgttgcatagaattgaaccaacggaatgtgagagta\n\
+actagatgagccgaccacagcacccgtttgcgtcgcagaatacgcctgatagttcggcca\n\
+cgaaatcatatgtcctttgagtattaagtatttgtaatgatcaatcgagctcaagcaagc\n\
+ttacacttcctcggatattcagggaacttagtgcctttgaaagatacgttgatcaacgaa\n\
+aaattgataatggctcatatggaatgcctacctcatagtgctgaattaacacagcactgc\n\
+ggacctaacttttcgaggtttcaagttcacgtctcaaaacctaataggctggaatatgta\n\
+gggatcctcggtgaatttgtgattgggtttgttgtagtactgaccaagtgaatattcttt\n\
+ttttctaaaagcagatctgctgccgggcactacgaaggagatctctgtgtatcattattg\n\
+cttcttgacatgatgactcttaaatcactgtgggtgtgcaaaacgatagcacaacccaat\n\
+tcgatagtacatattgttgatacttcgcactaaaccgttcatatttaaaggttgtgctcc\n\
+ttccttcgttaaatactggtgacttggtcctatctactattagctagacctctggggaac\n\
+cacgcccccgtaaaacctgtgcaagagagggggtcatacatcttagacatcgcgcctcca\n\
+ccagggaagcattgggtgattgaccaggtgtgtaacaaatatgattattcttatactaat\n\
+attagcaaagatgcataatgatttgtattaaatgtataattgaattgataagggtctttt\n\
+agtcagtgatagagtagtataaggtagacattagaactcttaaccggacgcagatttttc\n\
+ggtcttagtaagccaattagtcgacaaaacaaggtaagagcggttactagtagtacctat\n\
+aatgcactgaatcttcggtcgaagtatagttctaatgctatgcagattgtgacggcgaca\n\
+aatgttcagacttatatcatgaaacaagctcttgtaagtattgacaaatgaaaagattga\n\
+atatttttaaatacaaaatgcgcctacttattaggggaattaaccagattgaaggccaat\n\
+cctcacatgtaatgagataatagacgataaatgaaattcttgtaatagttgaactgctac\n\
+gtgatgggtattatatatgattgagatcctccaattgccgacgtcttgtcttgatgccca\n\
+aaagattgtcaacgaggagctccctcgcgtacctgtcgtccgtatcataaacgacgcgac\n\
+atgtacagcactccgaagtataagcaataataatgcgggtaatccagactagatcttttc\n\
+ggactcaatgcggtttcacggtaaacatgattaataccggagagtagtcgagcttatcag\n\
+cgatgcaagcgaattcattgtgccaggagatacgttgcagataaaaccggcaacgtatgt\n\
+caacaagttttggcgatctcgttgtttgtattcgacgaggcgcgggaacttcaagaacta\n\
+tcgtatattcaagtccattaccttttagtttcagactggtggagctgactaaagttatat\n\
+catcattttgtacactggtttagttaacgataatttcagatttaacatgaccagacgata\n\
+atcgctgtatatccagttggaatgtggtttgccagaaaggttaacttataatcaagcctc\n\
+tcttcagtcttgattcgtcgtatcccatccattgcgctatacctcagtgtatttggagct\n\
+gtagttataccgtgtgctaagatcagtagacatgacgagagcaatattatctaccttaca\n\
+agcatcaacggacgtctagtcggaacaaaagactctaaaactcgaacttcaggttaatat\n\
+actatagttctgtattcagcagttattcttatattcgatattatcttgcctattggatgt\n\
+ctgactttagtatattaatcatagtatctgccatgtaaaggtgccagtactaaatctgtt\n\
+tcacagtgcgaattataaacggttacaaccattaaagacaacaagaccctatagctttat\n\
+ttgaattttgtcaatgcgcaacttggagctcgcgatacatcccaattagtctatagggtc\n\
+gggacgattctacggcatttctggttataatgacaacatggattgtggcccgagaatcgc\n\
+tctttcattaattaagcaatcattacagtcttataagcgctacttccgagtggtagcagg\n\
+taactcgatataaggtcgcatgagccgaatagcttaaaaaacaggccaccgaacattgat\n\
+agagaataccgaccacagcgcaacctttgattactttcattaaattgtacggctcactcg\n\
+acatcaagcttaagattgcgataatgtgaactcaaatggatcagtactgaagaaccgtaa\n\
+cccacttcgcagaaagcgtacccagagaagatacgctgttacaatatacagggtgaaatt\n\
+attgcctgttcttcgtaaccatttcgccaaacttggttagaaatgatagccattcatgat\n\
+agaaataagctgaatgataccagtatctttaactatgtagtcagggggaagataacgatg\n\
+gtccatgtatgtttctgatatgtgacagtattggccgcgtaatttgctaacgaagctact\n\
+taatgcctttgagcttcatatagatttctttaatcaaaatcggcaaaaagatagtatgag\n\
+ctataatatatgctagtagagaactctggaccatcatctatatgaatactgattcgagcg\n\
+tgcaattactttagcctgcgtactactgactctacaaaacactctgagataagtttgtag\n\
+tcagtaagtcgctctctataaaccttttggatgaccattgtacagccacttatagatccc\n\
+aataaatagcacaggagacagagtttttcaatgctcgatcatttgccgatagtattttcg\n\
+tctaacctcagggcacctattatttgatacctaacctaacggccctttcacaatggagaa\n\
+atatatgacatcgggacaaacacaaatggtgggtggccaggagatatgacatggtggcgt\n\
+ctctaagaaacacggactccctctaggcaaactcacgtaaccaattttaatgtcaaacaa\n\
+aacgctcgaaaagattttgccgtgtaatgacctggtacattgactggtcaggaatacatc\n\
+actgtagttgccgtagtgtcctgttggtgttccatcaagacacatcgtataacgcaattt\n\
+acgacggacatcagatcaagttatacagattatttaagtatcacgtgtgcattgggacat\n\
+aagggatctcacacatgccttggaacatttttgctttgtgccgctttttcgctgcactac\n\
+caatccttacttaccagtatattcaaaggtcgttaacagaatgagaaaggttagggctct\n\
+aagttatcgtcgattgggatagacgagacatttgcgagcgccctccacggatacgaatct\n\
+cccatatcaatgtgaactggatgctatgcagtttagttcttacgtctcctagtggtaaaa\n\
+atcaaagtagcactcgcatagcagttattcagaacctaatacacaaaaccgtcaaacatt\n\
+ttctaattctaggtatgggccgatcataggagctaaggtgaaactcataaatgttttgtt\n\
+agatctagcatcctaaaaagatgcatatactgagtagctggcgtgcattctctcaattgt\n\
+atcctttttaactgaactagtcggtcccatttcgtgactgagatctattaaccgataaga\n\
+ttaataacactcgcattcgtatcagctcagagtgaagtttttcaataatttgactgatat\n\
+attaacttctaaaataaccctttaagcctcggatccgtttcccaatcacatcaaaaattc\n\
+ttattccaactatctacggattaacaacgtgcatggggatcgtagtaagaacttgttccg\n\
+atcactttgagtatatcaagttgacggcccggttattattgaatagaaacattcacctgc\n\
+taaattaaataccgcacatcggatacccgatttcagagggccgtcttactaagggcaggc\n\
+tttgttcggtttaactgagatgttcattattttacagtatgcttcaactaatatgtaacg\n\
+aaggacagtggatctgtctccatagtagatcttcagtcgtgaatttcataccgctcctat\n\
+ttaagttcgcgttcgagttgttgatcatggcacgtgaaagcaacccctagtattctagac\n\
+gaaaattttttctagttcatctgataatttgccaattcaaaaacaaccgctggtttcccg\n\
+gcgcattctctaaaatggaagtcgaacctagagccattatttgtcggtaacccatgagtt\n\
+ccttcttttcagaagttaatacactgtggtcctatacagaggaaaaacagcggttatata\n\
+cgatcgtggcataacaacattggatcaagatagcaatttggctacctattctaattctca\n\
+ctagattcggtattccactacaatatcggcagattaggattggatgaataatcggtgttt\n\
+aagtccggttgcgtctccaatctcctaatttttattaatattgatcttggtgacctattg\n\
+taaataaaaacttcaagactttgaataacggtgaaaagatagaagactcatttgaaaatg\n\
+gatcatccacagatccaaacattagcaagacactaatccccaactagctattctgatcgc\n\
+gatcgtgctgcagtactcctgtcacaatagtctgttcatgatctaattctttttgggctt\n\
+tgttcgatggtgattcagaatctttatccggtcgcttccctgtagctactttgtggggat\n\
+attgcccggggattatagggttgagatcgtttcctaaaagtatttaaaccaagtagactt\n\
+caactaaactacatcagaacatcgtgaagacaccatacgcggtacctttatttaccgata\n\
+acatttcttcaagaaataccggtaagcagcataatgaccctaaacagctcggggtatcgt\n\
+cgtagttttaaattttatttaggttactgctcaaggaataaaaactaactatttaattta\n\
+taataatattacaaggctcacactgattagatttgtctataagacttcgcgatcccccat\n\
+taccggattgtcttaagaataaactagataaaccatgcattttctagataaggcctttag\n\
+tctaattagatacaaaaaacacgatagttgcatccttaatttattgtgtcaaacctggaa\n\
+ccttttaattacccgcaaatcactttatgtcgagactacctctgaaatttattatctacc\n\
+taccgcatgaggacttgaaccatcttgtaggagttatgtttattagctaagattcgttta\n\
+tcctgtagcggtccatgtatattcaacaagcaaaaagcactcagaattgtttttagttga\n\
+gtcaagactgatatataaataagtttccctagttttttcgtggtgggacgatattgaatt\n\
+gaatcttaaccgaagagtttcccactctgtcgcacaataatacacgccaatatttccagc\n\
+cctgcttatgccttaatcggttactcaatctcccattgaagttcattttgatctgcatag\n\
+aagtttcgggcccagccttttttctgccaccttcctccaagctctgtagacgcactctaa\n\
+gattgatgctcacatgtattaattctacattaacataaatatataagtcatgcatcttcg\n\
+agtaaaatatctggttctccaacatgtcctggcacgtatcgttataatgcccatacatgt\n\
+agtattaaaatgattgggttaactggatattaagatcatcgaaattgtaaagtcaaatta\n\
+acaatactgtctcaagaccgtgtattcctcgtgctcggaagggctattacgcttacttcc\n\
+gttttggtatcttaatatgactttcaaaaattaagttgcagtgagtcctacctgcgtgca\n\
+tcggttagcaagagtataaaagttgtttaaacgaactacttgctttacaataccggtcgt\n\
+atatatcgccgtgaatccagaagattgtcttctttggattatcaaccgagatcctgtgga\n\
+ccgatgttttgggaccttcacagaggactccaggtagagctcgcttttgcattaatctaa\n\
+gaattgtacctctctaaaagatctaaaacagtgaatgtgtatttcatggaaaaacacaga\n\
+gaaacgtaaattactttaggccgaaaggcacatgagttattatacatatacgagatggtg\n\
+gtatacatcgaattcggggcatacactatagttgcattgtatttagctgctttaaataat\n\
+atgatattaccttccttacataagacattaccggcataccctggttttcaacttgtgggg\n\
+ctttttgacgatcgcactctcatttgatccgagtagggcggtgacccctgcttttcaaat\n\
+acaaaaatttcgctatgaaggtaatagattacttttcgctgttatgatagaaacggtaaa\n\
+tttaaaattgaaacttctagaaaagtaaagtaacgagaaatgattttgtgaataatgcgg\n\
+tcatgattgcgcaagtaagaaaaaaaggcaaaaggatgcgcggaatagaaacttatcagt\n\
+cacgggtatcttgatttcattcttcttgtcaattgccgacataggatgaaatcagattcc\n\
+aatgcaatacacagtaacccccacccttgattgtaatgtcgatttgaagttgtacgcgtc\n\
+gacgaagtggatagtatacgggccttttgtacggtgcgatcaactatgaatctcggcgag\n\
+ttagatggtcgtacaatctcacacatagaggtcacttgcctgtaatgacgaattttcggc\n\
+taggtactcgaactttattagaagtaaaaatgtgggcaaaagaaggattccattttacaa\n\
+gacgattacaatgagttacatgtctctcaacgtagtctttccctagtagtctttgaacta\n\
+tttaggtactccagaaaattttagcaaagggtttctgtgtgaatccgccattcatgttta\n\
+tgatggaacaataagaataacgccctcgtatgttatcgacagtgaagtcagcagttcggc\n\
+caaaaacatattcaatttagtacagatccccagaagttaagctaagtgctctaaaatggc\n\
+ctaaacggttatcaaagtaggtctaattactatactaacgggtgcatcgtaataactgct\n\
+gtcgatgcaacactatatgatagtgtcgttttgctatatatgtacaatgtgacaaagaag\n\
+ccttagcgattcttgcaaacttaggacttcggattctcaatcttaaatgtccgaaaacgc\n\
+aaagattcaaaaatttaatctatgagcagatatgcctgatggtgactacgcgtatgttaa\n\
+ggctaaatgttgacaaccgcacacataatcgaactattgatagtcgggagcataaccagg\n\
+tgaacgtactttgttcacgacatttattgacatgttctaaatacgtctcaaaatcacggc\n\
+gcactagaaaacgcaatcaaatcattgtcctggtttaagggccgtaatgccggtagtgtc\n\
+aaacttcatgagaactttagctggcttttggccagtatttagggaccaagagcactagcc\n\
+ttaagctgaatattttgccatttatctactgttataactttaaaacttggtggcaccaga\n\
+cttgtcgatacacacgcatcaatctgtaacgtaaaaggtttactaagaacaagcgtagga\n\
+attgagtttatattatatttaaactaaaagatgatattagcttctgagggcgatagggct\n\
+ccaaatcataaagaggaatatattattacacgattagaaacccacaacatacctcgaatc\n\
+gcccaaaagtttgacgaaacttggcagtactccacatctcagtaatacagttgggagagt\n\
+ctcaaatgttgttttattactcaatgaaccaccctcataatttcactgctgttccattaa\n\
+atttgcaaacgatcatttgctttgaagaaacgtaaaatcgacaaaattacagataagtag\n\
+atgcataataaaaaaaactgctcgctataacacgatcatcgtgcattcttacttaggagc\n\
+atcacccgcacaataacgtaccttaaactacaacactattagaccgagtactgtaattca\n\
+cgaaagctcaagctcgcattgtaaagaacttgctctctcgtaaaatgtgataatagtttg\n\
+cggagaggattcaattattttccattgcacctactccactagattcgataaaagaaggtg\n\
+gtcctcccttaaaaagaaatgttaagtaacatcggaaccataagcaaagcatgtaagtga\n\
+accgtcatccttccctaagaaacataaaggtttttaataatgtcgactgtgaactataac\n\
+tgcatcctttcctgacctactccggttccttgttgttatttctgaacgagaccagtagat\n\
+aaacaatgtaaaccacagtgggtaccaatggtgcatgtgacgctaccgttgttttaagtg\n\
+cccgtacaaacataagaagtcataatcttacttgaaattaattttgccttttattttttt\n\
+tcaggctcgaaattaatgatttgttttttttgaccttctagttacgctaatatgcggtcg\n\
+cctgtggtttctattgagtcctataacgggatgggatctaatacgtttggttactagtaa\n\
+acaaggtataaatttgataccggagtatcaactgtataacatcaagctttatgactcata\n\
+cgcgaagtaatgacacaaggctttcaggagatcgcgagtacagagccactaaggggtgta\n\
+ttacgatagtgacaccaccgagcgcactcactccccaagtagatttatgatcctacgcta\n\
+agtattagatatataaccaaagaggttctagtcagtgcaactcttagaataataattagc\n\
+cggttttgcctttttaggcctaatgcaatattcagctagcccttatgtatctcgcgttcc\n\
+acagcaccactcatggcacgcgtttaaactaatcaaatataatctatgaatgttatgcca\n\
+gtacttgaataaatcaggttttttataagtccttgcatactctcgttatatactgttaga\n\
+gtcttaccccatagaaattctttcatctgcaaacttagaagaattctcagctacggggag\n\
+cataaagtccccaggatgttgacaaatacaacaaatgtggcttatacaaacactccatat\n\
+gaaaatcgaaccctcgtggtagttttagccgaaccttgtacggataaatccctccatttt\n\
+ccaatagcagatacctatcctactacctcgtggtattaaattaaagcttgaaatatagag\n\
+ctgcatagcttatccaattcccaagcacgagtctaccgtcgtaaccacgatttgatttac\n\
+agacgctagagcaaacccatctttaaacatataagtaaaaattaaagggtgagtgcgtac\n\
+gtgtttactagcaacttcgcttattaagacaattgtttataagccataattaaaaacata\n\
+tgttcaacaggttcattgatatttgtaattgcacaggtttttaataaggatctacgtaag\n\
+tataatgaacaaactttttaccagagttatattctgtactttgaaaatgctcctctaccg\n\
+ccttagagactttcaattagattttttgcagttaatctatgcgtaagtgaaccatgcaag\n\
+ggatgcgattcaaccgcctcgtgctaaccctatcgtctgtctcataactgtaggtctaat\n\
+ataattttcagttttcgaacacataaccctttgaaaatctgctatttaatgtctcacctg\n\
+catgcactatcttctatactgctcagaacggctatacgtcactatgctccaagtgacgat\n\
+ttaaacgaagcaaggaataataggtttattttagtgcaaaacaattaagtgcggactacg\n\
+tgctctttacaataagccttgtgattgggctataggttaagtcccatattaacgatctcc\n\
+aatgtacaaaatcgacaatcgctttgcattacccggttactagtcgaattacagatagct\n\
+gttagatactcactctaattttggacaacaatcccaatcttggggtcgtctatcgcctga\n\
+agctcgtaaatccttccatcttaaacgattacatattatagacttgttcggggtagagat\n\
+atcacagttgtgcaaacattgtaaatcgatactagtttatgttggtagtctagttgcttt\n\
+taccattccccgaaaaacttgatctactatttcgacaacagtaaacttgaactaggtaag\n\
+tgaaaacagagaatgcctcatagtgccactatttgtccactatatgtaagtgtagcttta\n\
+cataatccactatgactgagatcattacggcctaggaaagcagcgtagaaaaaaagggcc\n\
+cggatattacgactgtaactataaaactagttactggtagcgcgccatgtatagatttgt\n\
+tttaccggttgtggttgcgttaacgaatttcagccgcgaaaattgatccgttaaccagtc\n\
+catctcgacttctataaaacgataaagtaaagttgatgttcagcctccttcttatggttg\n\
+catcgagagtacactactcagtgggaaatagatcggggttcctacttcagattgtattat\n\
+ctaggcaattgccgattgtgccatacctggataaaataagctacctacatgtgatgctta\n\
+tctattatcgtcatactaccttagggtgtcctgttgaacgctacattaatctttagccgt\n\
+ttgagatgttccaatggataggagtctaacgcatgatgaagtttaggaaggcagagcatc\n\
+ccactaagtatgtgacagtgtatttcgaaacgagacgttataaatagaaaaaaggtcctt\n\
+ctggttctattctgctgaactattgaatggaaagattggttgacctacgtactatttgct\n\
+tgaagtcatcaatttgacggggtgagagacatatggtgcatactttacggactctatatt\n\
+ttagatcagaagcttagcagtcttctctacaccccctcacgacataattgcttttaagaa\n\
+tctatgtttgattcctctacgggaattcggatccgttcgcatgtgcggtttatctaaacc\n\
+aggggacatatgttcagctaaagcatacgaacactttgctaactagacgtatgtatagta\n\
+gctataaatcccgacgatatttacaaaaagaaatgagactcaaatatatacatagcgacc\n\
+ctacacttattcgcaccctgatctaggcgatcctagcacccacacccgaaagtgagcact\n\
+agtgtcttccgtattaaatttactgcagttgagattttagttgtctactaaggattactc\n\
+taacccgtaataaggatcaagactcggtactagctttactatcattccctatgtgttttc\n\
+ctaactcacaagggtacgtaccagcctatgtaattacaataatgataaagacacaaagga\n\
+agtaactttacaaatgagtctccagttacactagcttagtccctcccatcttgctttgaa\n\
+gtctaaatacgcaatctctgaggatatacagcagaagaacactcataacgttggagtcca\n\
+agaattagactcatagggcccccaacatttaatatgtactgtgagtttgaaggtgttcta\n\
+ttgttaattcctgctcttgatacatgacacgtactccgtgtttaaggcttcggactgact\n\
+ttctttcataagttgagcaacgaaaatttcagaatcgataagttggattcactaactaat\n\
+acggctgattgaaaactccactccggacctatatggtcgacctttatacgtaaccgatat\n\
+aaaacttataggctggtatatcgagccttcctagcgcaatttcggatggggtttcttcta\n\
+ctactcaacaacggaatagtctttgtttagtaaaccagagctcaggacgcccaatacgta\n\
+ggagagcgctgtggagcatgtgtcattatggactggagcactcttaaatcactctgcgtg\n\
+tgctaaacgatagatcataacatgtcctgagtaaattttcttgatacgtcgcaatatacc\n\
+gttattagttaaacgttctcatccgtcatgcgtgaaatacggctgtcgtgctcagatata\n\
+ctattagcgactcatctcgcctaacacgcacacgtataaactcggaatgactgccgctct\n\
+tacatattagaaatacagactacaccacggaagcattgggtcattctcaaccgctgtata\n\
+aaagatgattagtcttataataagattaccaaagaggcagaatcatgggtagtaaatcta\n\
+ttattcaagtgattaccgtcgtgtaggcagggagtgaggacgagatggtactcaggacaa\n\
+atattaaccggacgaagtggtttacgtcgtactttcactattagtagtaaatacaaggta\n\
+acaccggggaatagtactaaatataatgatatctatcttcgggagaacgagtcgtctatt\n\
+gctttgaacattctcaaggcgtaaaatgtgctgacttatagcatgatacaaccgattgtt\n\
+acttttgtctattcaaaagattgaatagttttttatacaaaagccgcatacttatgacgg\n\
+ctagtatacagtttcatcccctagcatcaatgctatggacagtattgaacttataggaaa\n\
+ttcttctaatagggcaaatccgtcgtgatgcctattttttttcagtcacatcctcaaatg\n\
+gcactagtattgtcgggatcccattaacaggctcaaccacgagctcacgcgaggacatgt\n\
+agtccgtatctttaacgaagcgacagcgacagaactcccatggataaccaattataaggc\n\
+ccgtaatcctctagacatcgtttaccaataaatccgctttctccgtaatcatgttgaata\n\
+ccccagagtagtccagatgataaccgatgaaacacaagtctttctcaatgcacttacggt\n\
+gaacttattaccgccaacgtagctcatcaaggttgcgacatctagttgtgtgtttgcgac\n\
+gagcccagcgaacttcatcaactttcgtatattcaacgccttgtaattttactttaagac\n\
+gcctggtgatgtagattcttagataatcagtttgttatcggctgtactttaccataattt\n\
+cacaggtttcaggtcaagaagattatagctgtatatacagttccatgctcggtgcacaga\n\
+aacgtgatcggataataatcaatcgcttatgtcgtctttaggcgtatccaatacatgccc\n\
+cgataccgcagtgtatttcgacatgtaggtataccgtcgcatttgagctcgagtcaggac\n\
+gtcagctagattagattccttaatagaatataccgacctctagtccgaactaaactatag\n\
+ataacgccaacttcaggttaattgtctagtcgtctgtttgcagatgggattcttagatga\n\
+gtgagtatcggccatattggttcgagcactttagtttttgatgcataggatatgcaatgt\n\
+atagctgaaagtactttatctgtttcaaactcacattgattaaaccggtaaacctttaaa\n\
+gactacaagaaaatattcagtgagggcaattttgtcaatcacaatcttccagctagagat\n\
+acttcacaatttgtcttgaggctacgcaacattagacggattttcgcgttttattgaaat\n\
+aatcgaggggcccaagagtatccatagttcattttgtaagatttctttacaggcttatta\n\
+cagcttcttcagactcctacatgcttacgagttatatgctagcatgtgaacaatagatta\n\
+atatacaggaaaacgtacattgagagagatgaccctacacagcgcaaccgttgagtactt\n\
+tcattaaagggtaacgctctcgagacagcatccttaagatggccttattgtcaaatcatt\n\
+tgcagaagtacgcaagatccctaaccaacgtagaagaatccctacaaacacatgagacgc\n\
+ggtgaaaatagacagggtgttagtattcaatcttcggagtatcaatttcgccaatcttgg\n\
+tgagaaagcataccctttcttcagagaaagaagatcaatcataacactatctttaacgag\n\
+gtacgcacgcgcatcattacctgcctccatggatctttaggatagcggaaagtattggca\n\
+gcgtattgtgatttcgttcctactttatcaatttcacattcatatacatgtcttttatca\n\
+aaatcgccaataagataggatgagctatattagatgctagtagagttcgcgccaacatca\n\
+tcgataggaatactcaggacagcgtgataggacttttcaatccctaatactctctataat\n\
+tataactctctcttaagtttggaggcagtaacgcgctctatataatcagtttgctgcacc\n\
+attcttcagcctctgatacatacaaataaattccacagcagtaagagggtttaattgaga\n\
+catcttgggaacttaggattttactctaacatcaccgaaacgattattggataccgtacc\n\
+taaacgaactttctcaaggcagtaatataggacatccgcaataacacaaatgctgcctcc\n\
+ccaggagttatgtcttcctggaggctatatcttacacccactcactataggcaaactaaa\n\
+gtttaaatgttgattgtctaaaaaaaagatagataagagttggccggcgtagcacatgcg\n\
+aaagtgaatcgtaagctataattctctggacttgaagttctgtcctgttcctctgcaaga\n\
+aacaaacttcctttaaagctatttacgacgcacatctcagcaagttataaacatgttgga\n\
+agtttctagtcggaattcccaaagaacggatctatctaatgcattcctacatttttcctg\n\
+tctgccgatggtgccatcctattcaaagaatttcttaaaagtagattaaatgggactttt\n\
+aacaatgagtaaccttacgcctctaagggttcctcgagtgccatacaccagtcaggtccg\n\
+agccacatacacggagaacattctaacatagcattctcaactcgatcatttgcaggttac\n\
+ttctttcctatcctagtgctaaaaatcatacttgcaatcccatagcacggattaagaacc\n\
+taagaaacaattcagtaaaacatgttcgaattcttggtatgggaacatcattgcagctat\n\
+ggtctaacgcattaatgtttgggtacatcttccatcatataaacaggaagagtctgacga\n\
+cagggagtgcttgcgatcatgtctatcattgtgaaatcaaattgtagctcacatgtcgtc\n\
+tatgagagcgtgtatccgataagatttagaaaaatagaagtcgtataagatctcactgaa\n\
+cttttgaatgaatgtgaagcatatatgatctgctttaataaaactttatccataggatac\n\
+gtttccaaatcaattcaataattattagtcaaaatagataaggatgaacaacctgaaggc\n\
+cgatcggacgtagaaagtggtcccatcactttgagttgatattgttgaaccacacgttat\n\
+tatggttttcaaacagtctcaggatattgtatatacagataatccgataccagttgtctg\n\
+acgcccctcttacgtaccccaccctttgtgacgtttaaagcagttgttcagtattttaaa\n\
+ctaggcggcaactaatttggaaagaagcacagtggatatgtctaaattcttgttattcag\n\
+gcctgaatttaatacaccgcatagttaacttcgcggtagagttgttcatcatgcctcctc\n\
+taagctaccacttctatgatacaccaatagttgttctacggaatctgataattggccaag\n\
+tcataaacttccgctgcgttcaacccccttgctcgaatatccaactcgaaaagacagcct\n\
+tttggtgtccggaacaaatcagttacttcttttctgatgttaattctctgtggtcagata\n\
+cagaccaaaaactccgcggatttaccatcctccaagaacaaatttgcatcaacatagcat\n\
+tttggctacatattctaagtctcaatagtttaggttttcaactacattatcccaacatta\n\
+ggattggaggaataatagctgggtaagtccccttgcgtctacaatcgactattttttatg\n\
+aatatgcttctgccgcacctatggttattaaaaaagtcatgactttgaagaaccctgaaa\n\
+agatagatgaatcaggtgtaatggcagcagccaaagagcatataattagcaacactctaa\n\
+gaacattatagatatgatgatagcgatcgtcatgatgttatccggtcacaatagtagctt\n\
+catcagctaattcgttttgccagtggtgacttgcgctggaagaatcgttatacggtccct\n\
+tccctcttgatacggtgggggcttattcaaccgcgtggattgggttgtcatacttgcatt\n\
+aaacgatgtaaaccatctagtagtcaactatactaaatcacaaaatagtgatcaatacat\n\
+acccgcttcatggttttaaccatttaattgattaaagatattccgctaagaaccattatc\n\
+tacctaaactgatcgccgtatcctagtagtttgaaatttgatgtaccgtaatgatcaacg\n\
+aagtaaaacgttatattgtatgtagaataataggtcttggagctaaatgatgtgattggt\n\
+agtgaagacttacccttacaactttaccggtttctcggaagaatatactagagaatcaat\n\
+gcatgggctacataagcactttagtctaatgagataaaaaatacacgagtcttccatcat\n\
+gaattttttgtcgaaaaactcgaacctggtaatttaaaccatatatctttatgtcgtcaa\n\
+taactctcatatgttttatataacttcccaatcacgacttgtaactgcttgttcgactga\n\
+gctgtttgagctatgaggccgggatccggttgagctacatctatttgctacaagaaaaat\n\
+gaaagcacatttgttgggagttctggctacactcatagagaaataagtggcccgagtggg\n\
+tgcggcctgcctccatattcaagtgtatcttaaaccaagtggttccaacgctcgcgctaa\n\
+agaattaaagcctttatttcctccacggagtagcccgtaatccggttcgaaagagaccat\n\
+tgaagttaattttcatatccagtgaagtttaggcacaagcatgtgttctgccacatgcct\n\
+caaagcgctcttcaaccaagatatgattcatcctaacttcgatgaatgcgtctgtaacat\n\
+aaatatagaaggaatgattcggcgagttaattttcgccttctccaacatggcatccctac\n\
+gttcgttataaggaccatacatgtaggttttaaaggtttgcggttaatcgatatttacat\n\
+catagaaattctatagtcaaatttacaagactctagatactcactcgttgcagccggcta\n\
+ggaagcgctttgtaccttacttcccttttcgttgcgtaatatgaatttcatatagtaagt\n\
+tcaaggcactcatacctccgtgaagagggtagatagactattaaagttgtttaatagtac\n\
+gtattgatggaaatgacccgtaggagatttaccactcaatccacaagattcgctgctgtg\n\
+cattatcaaaacagtgcatgtcgaaacatgggttgggtccttcaaacacgaatccaggta\n\
+gagatacctttgcaattttt\n";
+
+dnaInput = dnaInput + dnaInput + dnaInput;
+
+var ilen, clen,
+ seqs = [
+ /agggtaaa|tttaccct/ig,
+ /[cgt]gggtaaa|tttaccc[acg]/ig,
+ /a[act]ggtaaa|tttacc[agt]t/ig,
+ /ag[act]gtaaa|tttac[agt]ct/ig,
+ /agg[act]taaa|ttta[agt]cct/ig,
+ /aggg[acg]aaa|ttt[cgt]ccct/ig,
+ /agggt[cgt]aa|tt[acg]accct/ig,
+ /agggta[cgt]a|t[acg]taccct/ig,
+ /agggtaa[cgt]|[acg]ttaccct/ig],
+ subs = {
+ B: '(c|g|t)', D: '(a|g|t)', H: '(a|c|t)', K: '(g|t)',
+ M: '(a|c)', N: '(a|c|g|t)', R: '(a|g)', S: '(c|t)',
+ V: '(a|c|g)', W: '(a|t)', Y: '(c|t)' }
+
+ilen = dnaInput.length;
+
+// There is no in-place substitution
+dnaInput = dnaInput.replace(/>.*\n|\n/g,"")
+clen = dnaInput.length
+
+var dnaOutputString;
+
+for(i in seqs)
+ dnaOutputString += seqs[i].source + " " + (dnaInput.match(seqs[i]) || []).length + "\n";
+ // match returns null if no matches, so replace with empty
+
+for(k in subs)
+ dnaInput = dnaInput.replace(k, subs[k]) // FIXME: Would like this to be a global substitution in a future version of SunSpider.
+ // search string, replacement string, flags
diff --git a/tests/benchmarks/script/sunspider/tests/string-base64.js b/tests/benchmarks/script/sunspider/tests/string-base64.js
new file mode 100644
index 0000000000..dfc949f70f
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/string-base64.js
@@ -0,0 +1,135 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla XML-RPC Client component.
+ *
+ * The Initial Developer of the Original Code is
+ * Digital Creations 2, Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Martijn Pieters <mj@digicool.com> (original author)
+ * Samuel Sieb <samuel@sieb.net>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+// From: http://lxr.mozilla.org/mozilla/source/extensions/xml-rpc/src/nsXmlRpcClient.js#956
+
+/* Convert data (an array of integers) to a Base64 string. */
+var toBase64Table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+var base64Pad = '=';
+
+function toBase64(data) {
+ var result = '';
+ var length = data.length;
+ var i;
+ // Convert every three bytes to 4 ascii characters.
+ for (i = 0; i < (length - 2); i += 3) {
+ result += toBase64Table[data.charCodeAt(i) >> 2];
+ result += toBase64Table[((data.charCodeAt(i) & 0x03) << 4) + (data.charCodeAt(i+1) >> 4)];
+ result += toBase64Table[((data.charCodeAt(i+1) & 0x0f) << 2) + (data.charCodeAt(i+2) >> 6)];
+ result += toBase64Table[data.charCodeAt(i+2) & 0x3f];
+ }
+
+ // Convert the remaining 1 or 2 bytes, pad out to 4 characters.
+ if (length%3) {
+ i = length - (length%3);
+ result += toBase64Table[data.charCodeAt(i) >> 2];
+ if ((length%3) == 2) {
+ result += toBase64Table[((data.charCodeAt(i) & 0x03) << 4) + (data.charCodeAt(i+1) >> 4)];
+ result += toBase64Table[(data.charCodeAt(i+1) & 0x0f) << 2];
+ result += base64Pad;
+ } else {
+ result += toBase64Table[(data.charCodeAt(i) & 0x03) << 4];
+ result += base64Pad + base64Pad;
+ }
+ }
+
+ return result;
+}
+
+/* Convert Base64 data to a string */
+var toBinaryTable = [
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
+ 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
+ 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
+ -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+ 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
+];
+
+function base64ToString(data) {
+ var result = '';
+ var leftbits = 0; // number of bits decoded, but yet to be appended
+ var leftdata = 0; // bits decoded, but yet to be appended
+
+ // Convert one by one.
+ for (var i = 0; i < data.length; i++) {
+ var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
+ var padding = (data.charCodeAt(i) == base64Pad.charCodeAt(0));
+ // Skip illegal characters and whitespace
+ if (c == -1) continue;
+
+ // Collect data into leftdata, update bitcount
+ leftdata = (leftdata << 6) | c;
+ leftbits += 6;
+
+ // If we have 8 or more bits, append 8 bits to the result
+ if (leftbits >= 8) {
+ leftbits -= 8;
+ // Append if not padding.
+ if (!padding)
+ result += String.fromCharCode((leftdata >> leftbits) & 0xff);
+ leftdata &= (1 << leftbits) - 1;
+ }
+ }
+
+ // If there are any bits left, the base64 string was corrupted
+ if (leftbits)
+ throw Components.Exception('Corrupted base64 string');
+
+ return result;
+}
+
+var str = "";
+
+for ( var i = 0; i < 8192; i++ )
+ str += String.fromCharCode( (25 * Math.random()) + 97 );
+
+for ( var i = 8192; i <= 16384; i *= 2 ) {
+
+ var base64;
+
+ base64 = toBase64(str);
+ base64ToString(base64);
+
+ // Double the string
+ str += str;
+}
+
+toBinaryTable = null;
diff --git a/tests/benchmarks/script/sunspider/tests/string-fasta.js b/tests/benchmarks/script/sunspider/tests/string-fasta.js
new file mode 100644
index 0000000000..14a81f3922
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/string-fasta.js
@@ -0,0 +1,85 @@
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org
+//
+// Contributed by Ian Osgood
+
+var last = 42, A = 3877, C = 29573, M = 139968;
+
+function rand(max) {
+ last = (last * A + C) % M;
+ return max * last / M;
+}
+
+var ALU =
+ "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG" +
+ "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA" +
+ "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT" +
+ "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA" +
+ "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG" +
+ "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC" +
+ "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA";
+
+var IUB = {
+ a:0.27, c:0.12, g:0.12, t:0.27,
+ B:0.02, D:0.02, H:0.02, K:0.02,
+ M:0.02, N:0.02, R:0.02, S:0.02,
+ V:0.02, W:0.02, Y:0.02
+}
+
+var HomoSap = {
+ a: 0.3029549426680,
+ c: 0.1979883004921,
+ g: 0.1975473066391,
+ t: 0.3015094502008
+}
+
+function makeCumulative(table) {
+ var last = null;
+ for (var c in table) {
+ if (last) table[c] += table[last];
+ last = c;
+ }
+}
+
+function fastaRepeat(n, seq) {
+ var seqi = 0, lenOut = 60;
+ while (n>0) {
+ if (n<lenOut) lenOut = n;
+ if (seqi + lenOut < seq.length) {
+ ret = seq.substring(seqi, seqi+lenOut);
+ seqi += lenOut;
+ } else {
+ var s = seq.substring(seqi);
+ seqi = lenOut - s.length;
+ ret = s + seq.substring(0, seqi);
+ }
+ n -= lenOut;
+ }
+}
+
+function fastaRandom(n, table) {
+ var line = new Array(60);
+ makeCumulative(table);
+ while (n>0) {
+ if (n<line.length) line = new Array(n);
+ for (var i=0; i<line.length; i++) {
+ var r = rand(1);
+ for (var c in table) {
+ if (r < table[c]) {
+ line[i] = c;
+ break;
+ }
+ }
+ }
+ ret = line.join('');
+ n -= line.length;
+ }
+}
+
+var ret;
+
+var count = 7;
+ret = fastaRepeat(2*count*100000, ALU);
+ret = fastaRandom(3*count*1000, IUB);
+ret = fastaRandom(5*count*1000, HomoSap);
+
diff --git a/tests/benchmarks/script/sunspider/tests/string-tagcloud.js b/tests/benchmarks/script/sunspider/tests/string-tagcloud.js
new file mode 100644
index 0000000000..d3e5a1fb19
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/string-tagcloud.js
@@ -0,0 +1,265 @@
+
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ Portions from:
+ json.js
+ 2007-10-10
+
+ Public Domain
+*/
+
+// This test parses a JSON string giving tag names and popularity, and
+// generates html markup for a "tagcloud" view.
+
+if (!Object.prototype.toJSONString) {
+
+ Array.prototype.toJSONString = function (w) {
+ var a = [], // The array holding the partial texts.
+ i, // Loop counter.
+ l = this.length,
+ v; // The value to be stringified.
+
+ for (i = 0; i < l; i += 1) {
+ v = this[i];
+ switch (typeof v) {
+ case 'object':
+
+ if (v && typeof v.toJSONString === 'function') {
+ a.push(v.toJSONString(w));
+ } else {
+ a.push('null');
+ }
+ break;
+
+ case 'string':
+ case 'number':
+ case 'boolean':
+ a.push(v.toJSONString());
+ break;
+ default:
+ a.push('null');
+ }
+ }
+
+ return '[' + a.join(',') + ']';
+ };
+
+
+ Boolean.prototype.toJSONString = function () {
+ return String(this);
+ };
+
+
+ Date.prototype.toJSONString = function () {
+
+ function f(n) {
+
+ return n < 10 ? '0' + n : n;
+ }
+
+ return '"' + this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z"';
+ };
+
+
+ Number.prototype.toJSONString = function () {
+
+ return isFinite(this) ? String(this) : 'null';
+ };
+
+
+ Object.prototype.toJSONString = function (w) {
+ var a = [], // The array holding the partial texts.
+ k, // The current key.
+ i, // The loop counter.
+ v; // The current value.
+
+ if (w) {
+ for (i = 0; i < w.length; i += 1) {
+ k = w[i];
+ if (typeof k === 'string') {
+ v = this[k];
+ switch (typeof v) {
+ case 'object':
+
+ if (v) {
+ if (typeof v.toJSONString === 'function') {
+ a.push(k.toJSONString() + ':' +
+ v.toJSONString(w));
+ }
+ } else {
+ a.push(k.toJSONString() + ':null');
+ }
+ break;
+
+ case 'string':
+ case 'number':
+ case 'boolean':
+ a.push(k.toJSONString() + ':' + v.toJSONString());
+
+ }
+ }
+ }
+ } else {
+
+ for (k in this) {
+ if (typeof k === 'string' &&
+ Object.prototype.hasOwnProperty.apply(this, [k])) {
+ v = this[k];
+ switch (typeof v) {
+ case 'object':
+
+ if (v) {
+ if (typeof v.toJSONString === 'function') {
+ a.push(k.toJSONString() + ':' +
+ v.toJSONString());
+ }
+ } else {
+ a.push(k.toJSONString() + ':null');
+ }
+ break;
+
+ case 'string':
+ case 'number':
+ case 'boolean':
+ a.push(k.toJSONString() + ':' + v.toJSONString());
+
+ }
+ }
+ }
+ }
+
+ return '{' + a.join(',') + '}';
+ };
+
+
+ (function (s) {
+
+ var m = {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ };
+
+
+ s.parseJSON = function (filter) {
+ var j;
+
+ function walk(k, v) {
+ var i, n;
+ if (v && typeof v === 'object') {
+ for (i in v) {
+ if (Object.prototype.hasOwnProperty.apply(v, [i])) {
+ n = walk(i, v[i]);
+ if (n !== undefined) {
+ v[i] = n;
+ }
+ }
+ }
+ }
+ return filter(k, v);
+ }
+
+ if (/^[\],:{}\s]*$/.test(this.replace(/\\./g, '@').
+ replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g, ']').
+ replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+ j = eval('(' + this + ')');
+
+ return typeof filter === 'function' ? walk('', j) : j;
+ }
+
+ throw new SyntaxError('parseJSON');
+ };
+
+
+ s.toJSONString = function () {
+
+ if (/["\\\x00-\x1f]/.test(this)) {
+ return '"' + this.replace(/[\x00-\x1f\\"]/g, function (a) {
+ var c = m[a];
+ if (c) {
+ return c;
+ }
+ c = a.charCodeAt();
+ return '\\u00' + Math.floor(c / 16).toString(16) +
+ (c % 16).toString(16);
+ }) + '"';
+ }
+ return '"' + this + '"';
+ };
+ })(String.prototype);
+}
+
+var tagInfoJSON = '[\n {\n \"tag\": "titillation",\n \"popularity\": 4294967296\n },\n {\n \"tag\": "foamless",\n \"popularity\": 1257718401\n },\n {\n \"tag\": "snarler",\n \"popularity\": 613166183\n },\n {\n \"tag\": "multangularness",\n \"popularity\": 368304452\n },\n {\n \"tag\": "Fesapo unventurous",\n \"popularity\": 248026512\n },\n {\n \"tag\": "esthesioblast",\n \"popularity\": 179556755\n },\n {\n \"tag\": "echeneidoid",\n \"popularity\": 136641578\n },\n {\n \"tag\": "embryoctony",\n \"popularity\": 107852576\n },\n {\n \"tag\": "undilatory",\n \"popularity\": 87537981\n },\n {\n \"tag\": "predisregard",\n \"popularity\": 72630939\n },\n {\n \"tag\": "allergenic",\n \"popularity\": 61345190\n },\n {\n \"tag\": "uncloudy",\n \"popularity\": 52580571\n },\n {\n \"tag\": "unforeseeably",\n \"popularity\": 45628109\n },\n {\n \"tag\": "sturniform",\n \"popularity\": 40013489\n },\n {\n \"tag\": "anesthetize",\n \"popularity\": 35409226\n },\n {\n \"tag\": "ametabolia",\n \"popularity\": 31583050\n },\n {\n \"tag\": "angiopathy",\n \"popularity\": 28366350\n },\n {\n \"tag\": "sultanaship",\n \"popularity\": 25634218\n },\n {\n \"tag\": "Frenchwise",\n \"popularity\": 23292461\n },\n {\n \"tag\": "cerviconasal",\n \"popularity\": 21268909\n },\n {\n \"tag\": "mercurialness",\n \"popularity\": 19507481\n },\n {\n \"tag\": "glutelin venditate",\n \"popularity\": 17964042\n },\n {\n \"tag\": "acred overblack",\n \"popularity\": 16603454\n },\n {\n \"tag\": "Atik",\n \"popularity\": 15397451\n },\n {\n \"tag\": "puncturer",\n \"popularity\": 14323077\n },\n {\n \"tag\": "pukatea",\n \"popularity\": 13361525\n },\n {\n \"tag\": "suberize",\n \"popularity\": 12497261\n },\n {\n \"tag\": "Godfrey",\n \"popularity\": 11717365\n },\n {\n \"tag\": "tetraptote",\n \"popularity\": 11011011\n },\n {\n \"tag\": "lucidness",\n \"popularity\": 10369074\n },\n {\n \"tag\": "tartness",\n \"popularity\": 9783815\n },\n {\n \"tag\": "axfetch",\n \"popularity\": 9248634\n },\n {\n \"tag\": "preacquittal",\n \"popularity\": 8757877\n },\n {\n \"tag\": "matris",\n \"popularity\": 8306671\n },\n {\n \"tag\": "hyphenate",\n \"popularity\": 7890801\n },\n {\n \"tag\": "semifabulous",\n \"popularity\": 7506606\n },\n {\n \"tag\": "oppressiveness",\n \"popularity\": 7150890\n },\n {\n \"tag\": "Protococcales",\n \"popularity\": 6820856\n },\n {\n \"tag\": "unpreventive",\n \"popularity\": 6514045\n },\n {\n \"tag\": "Cordia",\n \"popularity\": 6228289\n },\n {\n \"tag\": "Wakamba leaflike",\n \"popularity\": 5961668\n },\n {\n \"tag\": "dacryoma",\n \"popularity\": 5712480\n },\n {\n \"tag\": "inguinal",\n \"popularity\": 5479211\n },\n {\n \"tag\": "responseless",\n \"popularity\": 5260507\n },\n {\n \"tag\": "supplementarily",\n \"popularity\": 5055158\n },\n {\n \"tag\": "emu",\n \"popularity\": 4862079\n },\n {\n \"tag\": "countermeet",\n \"popularity\": 4680292\n },\n {\n \"tag\": "purrer",\n \"popularity\": 4508918\n },\n {\n \"tag\": "Corallinaceae",\n \"popularity\": 4347162\n },\n {\n \"tag\": "speculum",\n \"popularity\": 4194304\n },\n {\n \"tag\": "crimpness",\n \"popularity\": 4049690\n },\n {\n \"tag\": "antidetonant",\n \"popularity\": 3912727\n },\n {\n \"tag\": "topeewallah",\n \"popularity\": 3782875\n },\n {\n \"tag\": "fidalgo ballant",\n \"popularity\": 3659640\n },\n {\n \"tag\": "utriculose",\n \"popularity\": 3542572\n },\n {\n \"tag\": "testata",\n \"popularity\": 3431259\n },\n {\n \"tag\": "beltmaking",\n \"popularity\": 3325322\n },\n {\n \"tag\": "necrotype",\n \"popularity\": 3224413\n },\n {\n \"tag\": "ovistic",\n \"popularity\": 3128215\n },\n {\n \"tag\": "swindlership",\n \"popularity\": 3036431\n },\n {\n \"tag\": "augustal",\n \"popularity\": 2948792\n },\n {\n \"tag\": "Titoist",\n \"popularity\": 2865047\n },\n {\n \"tag\": "trisoctahedral",\n \"popularity\": 2784963\n },\n {\n \"tag\": "sequestrator",\n \"popularity\": 2708327\n },\n {\n \"tag\": "sideburns",\n \"popularity\": 2634939\n },\n {\n \"tag\": "paraphrasia",\n \"popularity\": 2564616\n },\n {\n \"tag\": "graminology unbay",\n \"popularity\": 2497185\n },\n {\n \"tag\": "acaridomatium emargination",\n \"popularity\": 2432487\n },\n {\n \"tag\": "roofward",\n \"popularity\": 2370373\n },\n {\n \"tag\": "lauder",\n \"popularity\": 2310705\n },\n {\n \"tag\": "subjunctive",\n \"popularity\": 2253354\n },\n {\n \"tag\": "subelongate",\n \"popularity\": 2198199\n },\n {\n \"tag\": "guacimo",\n \"popularity\": 2145128\n },\n {\n \"tag\": "cockade",\n \"popularity\": 2094033\n },\n {\n \"tag\": "misgauge",\n \"popularity\": 2044818\n },\n {\n \"tag\": "unexpensive",\n \"popularity\": 1997388\n },\n {\n \"tag\": "chebel",\n \"popularity\": 1951657\n },\n {\n \"tag\": "unpursuing",\n \"popularity\": 1907543\n },\n {\n \"tag\": "kilobar",\n \"popularity\": 1864969\n },\n {\n \"tag\": "obsecration",\n \"popularity\": 1823863\n },\n {\n \"tag\": "nacarine",\n \"popularity\": 1784157\n },\n {\n \"tag\": "spirituosity",\n \"popularity\": 1745787\n },\n {\n \"tag\": "movableness deity",\n \"popularity\": 1708692\n },\n {\n \"tag\": "exostracism",\n \"popularity\": 1672816\n },\n {\n \"tag\": "archipterygium",\n \"popularity\": 1638104\n },\n {\n \"tag\": "monostrophic",\n \"popularity\": 1604506\n },\n {\n \"tag\": "gynecide",\n \"popularity\": 1571974\n },\n {\n \"tag\": "gladden",\n \"popularity\": 1540462\n },\n {\n \"tag\": "throughbred",\n \"popularity\": 1509927\n },\n {\n \"tag\": "groper",\n \"popularity\": 1480329\n },\n {\n \"tag\": "Xenosaurus",\n \"popularity\": 1451628\n },\n {\n \"tag\": "photoetcher",\n \"popularity\": 1423788\n },\n {\n \"tag\": "glucosid",\n \"popularity\": 1396775\n },\n {\n \"tag\": "Galtonian",\n \"popularity\": 1370555\n },\n {\n \"tag\": "mesosporic",\n \"popularity\": 1345097\n },\n {\n \"tag\": "theody",\n \"popularity\": 1320370\n },\n {\n \"tag\": "zaffer",\n \"popularity\": 1296348\n },\n {\n \"tag\": "probiology",\n \"popularity\": 1273003\n },\n {\n \"tag\": "rhizomic",\n \"popularity\": 1250308\n },\n {\n \"tag\": "superphosphate",\n \"popularity\": 1228240\n },\n {\n \"tag\": "Hippolytan",\n \"popularity\": 1206776\n },\n {\n \"tag\": "garget",\n \"popularity\": 1185892\n },\n {\n \"tag\": "diploplacula",\n \"popularity\": 1165568\n },\n {\n \"tag\": "orohydrographical",\n \"popularity\": 1145785\n },\n {\n \"tag\": "enhypostatize",\n \"popularity\": 1126521\n },\n {\n \"tag\": "polisman",\n \"popularity\": 1107759\n },\n {\n \"tag\": "acetometer",\n \"popularity\": 1089482\n },\n {\n \"tag\": "unsnatched",\n \"popularity\": 1071672\n },\n {\n \"tag\": "yabber",\n \"popularity\": 1054313\n },\n {\n \"tag\": "demiwolf",\n \"popularity\": 1037390\n },\n {\n \"tag\": "chromascope",\n \"popularity\": 1020888\n },\n {\n \"tag\": "seamanship",\n \"popularity\": 1004794\n },\n {\n \"tag\": "nonfenestrated",\n \"popularity\": 989092\n },\n {\n \"tag\": "hydrophytism",\n \"popularity\": 973771\n },\n {\n \"tag\": "dotter",\n \"popularity\": 958819\n },\n {\n \"tag\": "thermoperiodism",\n \"popularity\": 944222\n },\n {\n \"tag\": "unlawyerlike",\n \"popularity\": 929970\n },\n {\n \"tag\": "enantiomeride citywards",\n \"popularity\": 916052\n },\n {\n \"tag\": "unmetallurgical",\n \"popularity\": 902456\n },\n {\n \"tag\": "prickled",\n \"popularity\": 889174\n },\n {\n \"tag\": "strangerwise manioc",\n \"popularity\": 876195\n },\n {\n \"tag\": "incisorial",\n \"popularity\": 863510\n },\n {\n \"tag\": "irrationalize",\n \"popularity\": 851110\n },\n {\n \"tag\": "nasology",\n \"popularity\": 838987\n },\n {\n \"tag\": "fatuism",\n \"popularity\": 827131\n },\n {\n \"tag\": "Huk",\n \"popularity\": 815535\n },\n {\n \"tag\": "properispomenon",\n \"popularity\": 804192\n },\n {\n \"tag\": "unpummelled",\n \"popularity\": 793094\n },\n {\n \"tag\": "technographically",\n \"popularity\": 782233\n },\n {\n \"tag\": "underfurnish",\n \"popularity\": 771603\n },\n {\n \"tag\": "sinter",\n \"popularity\": 761198\n },\n {\n \"tag\": "lateroanterior",\n \"popularity\": 751010\n },\n {\n \"tag\": "nonpersonification",\n \"popularity\": 741034\n },\n {\n \"tag\": "Sitophilus",\n \"popularity\": 731264\n },\n {\n \"tag\": "unstudded overexerted",\n \"popularity\": 721694\n },\n {\n \"tag\": "tracheation",\n \"popularity\": 712318\n },\n {\n \"tag\": "thirteenth begloze",\n \"popularity\": 703131\n },\n {\n \"tag\": "bespice",\n \"popularity\": 694129\n },\n {\n \"tag\": "doppia",\n \"popularity\": 685305\n },\n {\n \"tag\": "unadorned",\n \"popularity\": 676656\n },\n {\n \"tag\": "dovelet engraff",\n \"popularity\": 668176\n },\n {\n \"tag\": "diphyozooid",\n \"popularity\": 659862\n },\n {\n \"tag\": "mure",\n \"popularity\": 651708\n },\n {\n \"tag\": "Tripitaka",\n \"popularity\": 643710\n },\n {\n \"tag\": "Billjim",\n \"popularity\": 635865\n },\n {\n \"tag\": "pyramidical",\n \"popularity\": 628169\n },\n {\n \"tag\": "circumlocutionist",\n \"popularity\": 620617\n },\n {\n \"tag\": "slapstick",\n \"popularity\": 613207\n },\n {\n \"tag\": "preobedience",\n \"popularity\": 605934\n },\n {\n \"tag\": "unfriarlike",\n \"popularity\": 598795\n },\n {\n \"tag\": "microchromosome",\n \"popularity\": 591786\n },\n {\n \"tag\": "Orphicism",\n \"popularity\": 584905\n },\n {\n \"tag\": "peel",\n \"popularity\": 578149\n },\n {\n \"tag\": "obediential",\n \"popularity\": 571514\n },\n {\n \"tag\": "Peripatidea",\n \"popularity\": 564997\n },\n {\n \"tag\": "undoubtful",\n \"popularity\": 558596\n },\n {\n \"tag\": "lodgeable",\n \"popularity\": 552307\n },\n {\n \"tag\": "pustulated woodchat",\n \"popularity\": 546129\n },\n {\n \"tag\": "antepast",\n \"popularity\": 540057\n },\n {\n \"tag\": "sagittoid matrimoniously",\n \"popularity\": 534091\n },\n {\n \"tag\": "Albizzia",\n \"popularity\": 528228\n },\n {\n \"tag\": "Elateridae unnewness",\n \"popularity\": 522464\n },\n {\n \"tag\": "convertingness",\n \"popularity\": 516798\n },\n {\n \"tag\": "Pelew",\n \"popularity\": 511228\n },\n {\n \"tag\": "recapitulation",\n \"popularity\": 505751\n },\n {\n \"tag\": "shack",\n \"popularity\": 500365\n },\n {\n \"tag\": "unmellowed",\n \"popularity\": 495069\n },\n {\n \"tag\": "pavis capering",\n \"popularity\": 489859\n },\n {\n \"tag\": "fanfare",\n \"popularity\": 484735\n },\n {\n \"tag\": "sole",\n \"popularity\": 479695\n },\n {\n \"tag\": "subarcuate",\n \"popularity\": 474735\n },\n {\n \"tag\": "multivious",\n \"popularity\": 469856\n },\n {\n \"tag\": "squandermania",\n \"popularity\": 465054\n },\n {\n \"tag\": "scintle",\n \"popularity\": 460329\n },\n {\n \"tag\": "hash chirognomic",\n \"popularity\": 455679\n },\n {\n \"tag\": "linseed",\n \"popularity\": 451101\n },\n {\n \"tag\": "redoubtable",\n \"popularity\": 446596\n },\n {\n \"tag\": "poachy reimpact",\n \"popularity\": 442160\n },\n {\n \"tag\": "limestone",\n \"popularity\": 437792\n },\n {\n \"tag\": "serranid",\n \"popularity\": 433492\n },\n {\n \"tag\": "pohna",\n \"popularity\": 429258\n },\n {\n \"tag\": "warwolf",\n \"popularity\": 425088\n },\n {\n \"tag\": "ruthenous",\n \"popularity\": 420981\n },\n {\n \"tag\": "dover",\n \"popularity\": 416935\n },\n {\n \"tag\": "deuteroalbumose",\n \"popularity\": 412950\n },\n {\n \"tag\": "pseudoprophetic",\n \"popularity\": 409025\n },\n {\n \"tag\": "dissoluteness",\n \"popularity\": 405157\n },\n {\n \"tag\": "preinvention",\n \"popularity\": 401347\n },\n {\n \"tag\": "swagbellied",\n \"popularity\": 397592\n },\n {\n \"tag\": "Ophidia",\n \"popularity\": 393892\n },\n {\n \"tag\": "equanimity",\n \"popularity\": 390245\n },\n {\n \"tag\": "troutful",\n \"popularity\": 386651\n },\n {\n \"tag\": "uke",\n \"popularity\": 383108\n },\n {\n \"tag\": "preacquaint",\n \"popularity\": 379616\n },\n {\n \"tag\": "shoq",\n \"popularity\": 376174\n },\n {\n \"tag\": "yox",\n \"popularity\": 372780\n },\n {\n \"tag\": "unelemental",\n \"popularity\": 369434\n },\n {\n \"tag\": "Yavapai",\n \"popularity\": 366134\n },\n {\n \"tag\": "joulean",\n \"popularity\": 362880\n },\n {\n \"tag\": "dracontine",\n \"popularity\": 359672\n },\n {\n \"tag\": "hardmouth",\n \"popularity\": 356507\n },\n {\n \"tag\": "sylvanize",\n \"popularity\": 353386\n },\n {\n \"tag\": "intraparenchymatous meadowbur",\n \"popularity\": 350308\n },\n {\n \"tag\": "uncharily",\n \"popularity\": 347271\n },\n {\n \"tag\": "redtab flexibly",\n \"popularity\": 344275\n },\n {\n \"tag\": "centervelic",\n \"popularity\": 341319\n },\n {\n \"tag\": "unravellable",\n \"popularity\": 338403\n },\n {\n \"tag\": "infortunately",\n \"popularity\": 335526\n },\n {\n \"tag\": "cannel",\n \"popularity\": 332687\n },\n {\n \"tag\": "oxyblepsia",\n \"popularity\": 329885\n },\n {\n \"tag\": "Damon",\n \"popularity\": 327120\n },\n {\n \"tag\": "etherin",\n \"popularity\": 324391\n },\n {\n \"tag\": "luminal",\n \"popularity\": 321697\n },\n {\n \"tag\": "interrogatorily presbyte",\n \"popularity\": 319038\n },\n {\n \"tag\": "hemiclastic",\n \"popularity\": 316414\n },\n {\n \"tag\": "poh flush",\n \"popularity\": 313823\n },\n {\n \"tag\": "Psoroptes",\n \"popularity\": 311265\n },\n {\n \"tag\": "dispirit",\n \"popularity\": 308740\n },\n {\n \"tag\": "nashgab",\n \"popularity\": 306246\n },\n {\n \"tag\": "Aphidiinae",\n \"popularity\": 303784\n },\n {\n \"tag\": "rhapsody nonconstruction",\n \"popularity\": 301353\n },\n {\n \"tag\": "Osmond",\n \"popularity\": 298952\n },\n {\n \"tag\": "Leonis",\n \"popularity\": 296581\n },\n {\n \"tag\": "Lemnian",\n \"popularity\": 294239\n },\n {\n \"tag\": "acetonic gnathonic",\n \"popularity\": 291926\n },\n {\n \"tag\": "surculus",\n \"popularity\": 289641\n },\n {\n \"tag\": "diagonally",\n \"popularity\": 287384\n },\n {\n \"tag\": "counterpenalty",\n \"popularity\": 285154\n },\n {\n \"tag\": "Eugenie",\n \"popularity\": 282952\n },\n {\n \"tag\": "hornbook",\n \"popularity\": 280776\n },\n {\n \"tag\": "miscoin",\n \"popularity\": 278626\n },\n {\n \"tag\": "admi",\n \"popularity\": 276501\n },\n {\n \"tag\": "Tarmac",\n \"popularity\": 274402\n },\n {\n \"tag\": "inexplicable",\n \"popularity\": 272328\n },\n {\n \"tag\": "rascallion",\n \"popularity\": 270278\n },\n {\n \"tag\": "dusterman",\n \"popularity\": 268252\n },\n {\n \"tag\": "osteostomous unhoroscopic",\n \"popularity\": 266250\n },\n {\n \"tag\": "spinibulbar",\n \"popularity\": 264271\n },\n {\n \"tag\": "phototelegraphically",\n \"popularity\": 262315\n },\n {\n \"tag\": "Manihot",\n \"popularity\": 260381\n },\n {\n \"tag\": "neighborhood",\n \"popularity\": 258470\n },\n {\n \"tag\": "Vincetoxicum",\n \"popularity\": 256581\n },\n {\n \"tag\": "khirka",\n \"popularity\": 254713\n },\n {\n \"tag\": "conscriptive",\n \"popularity\": 252866\n },\n {\n \"tag\": "synechthran",\n \"popularity\": 251040\n },\n {\n \"tag\": "Guttiferales",\n \"popularity\": 249235\n },\n {\n \"tag\": "roomful",\n \"popularity\": 247450\n },\n {\n \"tag\": "germinal",\n \"popularity\": 245685\n },\n {\n \"tag\": "untraitorous",\n \"popularity\": 243939\n },\n {\n \"tag\": "nondissenting",\n \"popularity\": 242213\n },\n {\n \"tag\": "amotion",\n \"popularity\": 240506\n },\n {\n \"tag\": "badious",\n \"popularity\": 238817\n },\n {\n \"tag\": "sumpit",\n \"popularity\": 237147\n },\n {\n \"tag\": "ectozoic",\n \"popularity\": 235496\n },\n {\n \"tag\": "elvet",\n \"popularity\": 233862\n },\n {\n \"tag\": "underclerk",\n \"popularity\": 232246\n },\n {\n \"tag\": "reticency",\n \"popularity\": 230647\n },\n {\n \"tag\": "neutroclusion",\n \"popularity\": 229065\n },\n {\n \"tag\": "unbelieving",\n \"popularity\": 227500\n },\n {\n \"tag\": "histogenetic",\n \"popularity\": 225952\n },\n {\n \"tag\": "dermamyiasis",\n \"popularity\": 224421\n },\n {\n \"tag\": "telenergy",\n \"popularity\": 222905\n },\n {\n \"tag\": "axiomatic",\n \"popularity\": 221406\n },\n {\n \"tag\": "undominoed",\n \"popularity\": 219922\n },\n {\n \"tag\": "periosteoma",\n \"popularity\": 218454\n },\n {\n \"tag\": "justiciaryship",\n \"popularity\": 217001\n },\n {\n \"tag\": "autoluminescence",\n \"popularity\": 215563\n },\n {\n \"tag\": "osmous",\n \"popularity\": 214140\n },\n {\n \"tag\": "borgh",\n \"popularity\": 212731\n },\n {\n \"tag\": "bedebt",\n \"popularity\": 211337\n },\n {\n \"tag\": "considerableness adenoidism",\n \"popularity\": 209957\n },\n {\n \"tag\": "sailorizing",\n \"popularity\": 208592\n },\n {\n \"tag\": "Montauk",\n \"popularity\": 207240\n },\n {\n \"tag\": "Bridget",\n \"popularity\": 205901\n },\n {\n \"tag\": "Gekkota",\n \"popularity\": 204577\n },\n {\n \"tag\": "subcorymbose",\n \"popularity\": 203265\n },\n {\n \"tag\": "undersap",\n \"popularity\": 201967\n },\n {\n \"tag\": "poikilothermic",\n \"popularity\": 200681\n },\n {\n \"tag\": "enneatical",\n \"popularity\": 199409\n },\n {\n \"tag\": "martinetism",\n \"popularity\": 198148\n },\n {\n \"tag\": "sustanedly",\n \"popularity\": 196901\n },\n {\n \"tag\": "declaration",\n \"popularity\": 195665\n },\n {\n \"tag\": "myringoplasty",\n \"popularity\": 194442\n },\n {\n \"tag\": "Ginkgo",\n \"popularity\": 193230\n },\n {\n \"tag\": "unrecurrent",\n \"popularity\": 192031\n },\n {\n \"tag\": "proprecedent",\n \"popularity\": 190843\n },\n {\n \"tag\": "roadman",\n \"popularity\": 189666\n },\n {\n \"tag\": "elemin",\n \"popularity\": 188501\n },\n {\n \"tag\": "maggot",\n \"popularity\": 187347\n },\n {\n \"tag\": "alitrunk",\n \"popularity\": 186204\n },\n {\n \"tag\": "introspection",\n \"popularity\": 185071\n },\n {\n \"tag\": "batiker",\n \"popularity\": 183950\n },\n {\n \"tag\": "backhatch oversettle",\n \"popularity\": 182839\n },\n {\n \"tag\": "thresherman",\n \"popularity\": 181738\n },\n {\n \"tag\": "protemperance",\n \"popularity\": 180648\n },\n {\n \"tag\": "undern",\n \"popularity\": 179568\n },\n {\n \"tag\": "tweeg",\n \"popularity\": 178498\n },\n {\n \"tag\": "crosspath",\n \"popularity\": 177438\n },\n {\n \"tag\": "Tangaridae",\n \"popularity\": 176388\n },\n {\n \"tag\": "scrutation",\n \"popularity\": 175348\n },\n {\n \"tag\": "piecemaker",\n \"popularity\": 174317\n },\n {\n \"tag\": "paster",\n \"popularity\": 173296\n },\n {\n \"tag\": "unpretendingness",\n \"popularity\": 172284\n },\n {\n \"tag\": "inframundane",\n \"popularity\": 171281\n },\n {\n \"tag\": "kiblah",\n \"popularity\": 170287\n },\n {\n \"tag\": "playwrighting",\n \"popularity\": 169302\n },\n {\n \"tag\": "gonepoiesis snowslip",\n \"popularity\": 168326\n },\n {\n \"tag\": "hoodwise",\n \"popularity\": 167359\n },\n {\n \"tag\": "postseason",\n \"popularity\": 166401\n },\n {\n \"tag\": "equivocality",\n \"popularity\": 165451\n },\n {\n \"tag\": "Opiliaceae nuclease",\n \"popularity\": 164509\n },\n {\n \"tag\": "sextipara",\n \"popularity\": 163576\n },\n {\n \"tag\": "weeper",\n \"popularity\": 162651\n },\n {\n \"tag\": "frambesia",\n \"popularity\": 161735\n },\n {\n \"tag\": "answerable",\n \"popularity\": 160826\n },\n {\n \"tag\": "Trichosporum",\n \"popularity\": 159925\n },\n {\n \"tag\": "cajuputol",\n \"popularity\": 159033\n },\n {\n \"tag\": "pleomorphous",\n \"popularity\": 158148\n },\n {\n \"tag\": "aculeolate",\n \"popularity\": 157270\n },\n {\n \"tag\": "wherever",\n \"popularity\": 156400\n },\n {\n \"tag\": "collapse",\n \"popularity\": 155538\n },\n {\n \"tag\": "porky",\n \"popularity\": 154683\n },\n {\n \"tag\": "perule",\n \"popularity\": 153836\n },\n {\n \"tag\": "Nevada",\n \"popularity\": 152996\n },\n {\n \"tag\": "conalbumin",\n \"popularity\": 152162\n },\n {\n \"tag\": "tsunami",\n \"popularity\": 151336\n },\n {\n \"tag\": "Gulf",\n \"popularity\": 150517\n },\n {\n \"tag\": "hertz",\n \"popularity\": 149705\n },\n {\n \"tag\": "limmock",\n \"popularity\": 148900\n },\n {\n \"tag\": "Tartarize",\n \"popularity\": 148101\n },\n {\n \"tag\": "entosphenoid",\n \"popularity\": 147310\n },\n {\n \"tag\": "ibis",\n \"popularity\": 146524\n },\n {\n \"tag\": "unyeaned",\n \"popularity\": 145746\n },\n {\n \"tag\": "tritural",\n \"popularity\": 144973\n },\n {\n \"tag\": "hundredary",\n \"popularity\": 144207\n },\n {\n \"tag\": "stolonlike",\n \"popularity\": 143448\n },\n {\n \"tag\": "chorister",\n \"popularity\": 142694\n },\n {\n \"tag\": "mismove",\n \"popularity\": 141947\n },\n {\n \"tag\": "Andine",\n \"popularity\": 141206\n },\n {\n \"tag\": "Annette proneur escribe",\n \"popularity\": 140471\n },\n {\n \"tag\": "exoperidium",\n \"popularity\": 139742\n },\n {\n \"tag\": "disedge",\n \"popularity\": 139019\n },\n {\n \"tag\": "hypochloruria",\n \"popularity\": 138302\n },\n {\n \"tag\": "prepupa",\n \"popularity\": 137590\n },\n {\n \"tag\": "assent",\n \"popularity\": 136884\n },\n {\n \"tag\": "hydrazobenzene",\n \"popularity\": 136184\n },\n {\n \"tag\": "emballonurid",\n \"popularity\": 135489\n },\n {\n \"tag\": "roselle",\n \"popularity\": 134800\n },\n {\n \"tag\": "unifiedly",\n \"popularity\": 134117\n },\n {\n \"tag\": "clang",\n \"popularity\": 133439\n },\n {\n \"tag\": "acetolytic",\n \"popularity\": 132766\n },\n {\n \"tag\": "cladodont",\n \"popularity\": 132098\n },\n {\n \"tag\": "recoast",\n \"popularity\": 131436\n },\n {\n \"tag\": "celebrated tydie Eocarboniferous",\n \"popularity\": 130779\n },\n {\n \"tag\": "superconsciousness",\n \"popularity\": 130127\n },\n {\n \"tag\": "soberness",\n \"popularity\": 129480\n },\n {\n \"tag\": "panoramist",\n \"popularity\": 128838\n },\n {\n \"tag\": "Orbitolina",\n \"popularity\": 128201\n },\n {\n \"tag\": "overlewd",\n \"popularity\": 127569\n },\n {\n \"tag\": "demiquaver",\n \"popularity\": 126942\n },\n {\n \"tag\": "kamelaukion",\n \"popularity\": 126319\n },\n {\n \"tag\": "flancard",\n \"popularity\": 125702\n },\n {\n \"tag\": "tricuspid",\n \"popularity\": 125089\n },\n {\n \"tag\": "bepelt",\n \"popularity\": 124480\n },\n {\n \"tag\": "decuplet",\n \"popularity\": 123877\n },\n {\n \"tag\": "Rockies",\n \"popularity\": 123278\n },\n {\n \"tag\": "unforgeability",\n \"popularity\": 122683\n },\n {\n \"tag\": "mocha",\n \"popularity\": 122093\n },\n {\n \"tag\": "scrunge",\n \"popularity\": 121507\n },\n {\n \"tag\": "delighter",\n \"popularity\": 120926\n },\n {\n \"tag\": "willey Microtinae",\n \"popularity\": 120349\n },\n {\n \"tag\": "unhuntable",\n \"popularity\": 119777\n },\n {\n \"tag\": "historically",\n \"popularity\": 119208\n },\n {\n \"tag\": "vicegerentship",\n \"popularity\": 118644\n },\n {\n \"tag\": "hemangiosarcoma",\n \"popularity\": 118084\n },\n {\n \"tag\": "harpago",\n \"popularity\": 117528\n },\n {\n \"tag\": "unionoid",\n \"popularity\": 116976\n },\n {\n \"tag\": "wiseman",\n \"popularity\": 116429\n },\n {\n \"tag\": "diclinism",\n \"popularity\": 115885\n },\n {\n \"tag\": "Maud",\n \"popularity\": 115345\n },\n {\n \"tag\": "scaphocephalism",\n \"popularity\": 114809\n },\n {\n \"tag\": "obtenebration",\n \"popularity\": 114277\n },\n {\n \"tag\": "cymar predreadnought",\n \"popularity\": 113749\n },\n {\n \"tag\": "discommend",\n \"popularity\": 113225\n },\n {\n \"tag\": "crude",\n \"popularity\": 112704\n },\n {\n \"tag\": "upflash",\n \"popularity\": 112187\n },\n {\n \"tag\": "saltimbank",\n \"popularity\": 111674\n },\n {\n \"tag\": "posthysterical",\n \"popularity\": 111165\n },\n {\n \"tag\": "trample",\n \"popularity\": 110659\n },\n {\n \"tag\": "ungirthed",\n \"popularity\": 110157\n },\n {\n \"tag\": "unshakable",\n \"popularity\": 109658\n },\n {\n \"tag\": "hepatocystic",\n \"popularity\": 109163\n },\n {\n \"tag\": "psammophyte",\n \"popularity\": 108671\n },\n {\n \"tag\": "millionfold",\n \"popularity\": 108183\n },\n {\n \"tag\": "outtaste",\n \"popularity\": 107698\n },\n {\n \"tag\": "poppycockish",\n \"popularity\": 107217\n },\n {\n \"tag\": "viduine",\n \"popularity\": 106739\n },\n {\n \"tag\": "pleasureman",\n \"popularity\": 106264\n },\n {\n \"tag\": "cholesterolemia",\n \"popularity\": 105792\n },\n {\n \"tag\": "hostlerwife",\n \"popularity\": 105324\n },\n {\n \"tag\": "figure undergrass",\n \"popularity\": 104859\n },\n {\n \"tag\": "bedrape",\n \"popularity\": 104398\n },\n {\n \"tag\": "nuttishness",\n \"popularity\": 103939\n },\n {\n \"tag\": "fow",\n \"popularity\": 103484\n },\n {\n \"tag\": "rachianesthesia",\n \"popularity\": 103031\n },\n {\n \"tag\": "recruitable",\n \"popularity\": 102582\n },\n {\n \"tag\": "semianatomical Oenotheraceae",\n \"popularity\": 102136\n },\n {\n \"tag\": "extracapsular",\n \"popularity\": 101693\n },\n {\n \"tag\": "unsigneted",\n \"popularity\": 101253\n },\n {\n \"tag\": "fissural",\n \"popularity\": 100816\n },\n {\n \"tag\": "ayous",\n \"popularity\": 100381\n },\n {\n \"tag\": "crestfallenness odontograph",\n \"popularity\": 99950\n },\n {\n \"tag\": "monopodium",\n \"popularity\": 99522\n },\n {\n \"tag\": "germfree",\n \"popularity\": 99096\n },\n {\n \"tag\": "dauphin",\n \"popularity\": 98673\n },\n {\n \"tag\": "nonagesimal",\n \"popularity\": 98254\n },\n {\n \"tag\": "waterchat",\n \"popularity\": 97836\n },\n {\n \"tag\": "Entelodon",\n \"popularity\": 97422\n },\n {\n \"tag\": "semischolastic",\n \"popularity\": 97010\n },\n {\n \"tag\": "somata",\n \"popularity\": 96602\n },\n {\n \"tag\": "expositorily",\n \"popularity\": 96195\n },\n {\n \"tag\": "bass",\n \"popularity\": 95792\n },\n {\n \"tag\": "calorimetry",\n \"popularity\": 95391\n },\n {\n \"tag\": "entireness",\n \"popularity\": 94993\n },\n {\n \"tag\": "ratline soppiness",\n \"popularity\": 94597\n },\n {\n \"tag\": "shor",\n \"popularity\": 94204\n },\n {\n \"tag\": "coprecipitation",\n \"popularity\": 93813\n },\n {\n \"tag\": "unblushingly",\n \"popularity\": 93425\n },\n {\n \"tag\": "macarize",\n \"popularity\": 93040\n },\n {\n \"tag\": "scruplesomeness",\n \"popularity\": 92657\n },\n {\n \"tag\": "offsaddle",\n \"popularity\": 92276\n },\n {\n \"tag\": "hypertragical",\n \"popularity\": 91898\n },\n {\n \"tag\": "uncassock loined",\n \"popularity\": 91522\n },\n {\n \"tag\": "interlobate",\n \"popularity\": 91149\n },\n {\n \"tag\": "releasor orrisroot stoloniferously",\n \"popularity\": 90778\n },\n {\n \"tag\": "elementoid",\n \"popularity\": 90410\n },\n {\n \"tag\": "Lentilla",\n \"popularity\": 90043\n },\n {\n \"tag\": "distressing",\n \"popularity\": 89679\n },\n {\n \"tag\": "hydrodrome",\n \"popularity\": 89318\n },\n {\n \"tag\": "Jeannette",\n \"popularity\": 88958\n },\n {\n \"tag\": "Kuli",\n \"popularity\": 88601\n },\n {\n \"tag\": "taxinomist",\n \"popularity\": 88246\n },\n {\n \"tag\": "southwestwardly",\n \"popularity\": 87894\n },\n {\n \"tag\": "polyparia",\n \"popularity\": 87543\n },\n {\n \"tag\": "exmeridian",\n \"popularity\": 87195\n },\n {\n \"tag\": "splenius regimentaled",\n \"popularity\": 86849\n },\n {\n \"tag\": "Sphaeropsidaceae",\n \"popularity\": 86505\n },\n {\n \"tag\": "unbegun",\n \"popularity\": 86163\n },\n {\n \"tag\": "something",\n \"popularity\": 85823\n },\n {\n \"tag\": "contaminable nonexpulsion",\n \"popularity\": 85486\n },\n {\n \"tag\": "douser",\n \"popularity\": 85150\n },\n {\n \"tag\": "prostrike",\n \"popularity\": 84817\n },\n {\n \"tag\": "worky",\n \"popularity\": 84485\n },\n {\n \"tag\": "folliful",\n \"popularity\": 84156\n },\n {\n \"tag\": "prioracy",\n \"popularity\": 83828\n },\n {\n \"tag\": "undermentioned",\n \"popularity\": 83503\n },\n {\n \"tag\": "Judaica",\n \"popularity\": 83179\n },\n {\n \"tag\": "multifarious",\n \"popularity\": 82858\n },\n {\n \"tag\": "poogye",\n \"popularity\": 82538\n },\n {\n \"tag\": "Sparganium",\n \"popularity\": 82221\n },\n {\n \"tag\": "thurrock",\n \"popularity\": 81905\n },\n {\n \"tag\": "outblush",\n \"popularity\": 81591\n },\n {\n \"tag\": "Strophanthus supraordination",\n \"popularity\": 81279\n },\n {\n \"tag\": "gingerroot",\n \"popularity\": 80969\n },\n {\n \"tag\": "unconscient",\n \"popularity\": 80661\n },\n {\n \"tag\": "unconstitutionally",\n \"popularity\": 80354\n },\n {\n \"tag\": "plaguily",\n \"popularity\": 80050\n },\n {\n \"tag\": "waterily equatorwards",\n \"popularity\": 79747\n },\n {\n \"tag\": "nondeposition",\n \"popularity\": 79446\n },\n {\n \"tag\": "dronishly",\n \"popularity\": 79147\n },\n {\n \"tag\": "gateado",\n \"popularity\": 78849\n },\n {\n \"tag\": "dislink",\n \"popularity\": 78553\n },\n {\n \"tag\": "Joceline",\n \"popularity\": 78259\n },\n {\n \"tag\": "amphiboliferous",\n \"popularity\": 77967\n },\n {\n \"tag\": "bushrope",\n \"popularity\": 77676\n },\n {\n \"tag\": "plumicorn sulphosalicylic",\n \"popularity\": 77387\n },\n {\n \"tag\": "nonefficiency",\n \"popularity\": 77100\n },\n {\n \"tag\": "hieroscopy",\n \"popularity\": 76815\n },\n {\n \"tag\": "causativeness",\n \"popularity\": 76531\n },\n {\n \"tag\": "swird paleoeremology",\n \"popularity\": 76249\n },\n {\n \"tag\": "camphoric",\n \"popularity\": 75968\n },\n {\n \"tag\": "retaining",\n \"popularity\": 75689\n },\n {\n \"tag\": "thyreoprotein",\n \"popularity\": 75411\n },\n {\n \"tag\": "carbona",\n \"popularity\": 75136\n },\n {\n \"tag\": "protectively",\n \"popularity\": 74861\n },\n {\n \"tag\": "mosasaur",\n \"popularity\": 74589\n },\n {\n \"tag\": "reciprocator",\n \"popularity\": 74317\n },\n {\n \"tag\": "detentive",\n \"popularity\": 74048\n },\n {\n \"tag\": "supravital",\n \"popularity\": 73780\n },\n {\n \"tag\": "Vespertilionidae",\n \"popularity\": 73513\n },\n {\n \"tag\": "parka",\n \"popularity\": 73248\n },\n {\n \"tag\": "pickaway",\n \"popularity\": 72984\n },\n {\n \"tag\": "oleaceous",\n \"popularity\": 72722\n },\n {\n \"tag\": "anticogitative",\n \"popularity\": 72462\n },\n {\n \"tag\": "woe",\n \"popularity\": 72203\n },\n {\n \"tag\": "skeuomorph",\n \"popularity\": 71945\n },\n {\n \"tag\": "helpmeet",\n \"popularity\": 71689\n },\n {\n \"tag\": "Hexactinellida brickmaking",\n \"popularity\": 71434\n },\n {\n \"tag\": "resink",\n \"popularity\": 71180\n },\n {\n \"tag\": "diluter",\n \"popularity\": 70928\n },\n {\n \"tag\": "micromicron",\n \"popularity\": 70677\n },\n {\n \"tag\": "parentage",\n \"popularity\": 70428\n },\n {\n \"tag\": "galactorrhoea",\n \"popularity\": 70180\n },\n {\n \"tag\": "gey",\n \"popularity\": 69934\n },\n {\n \"tag\": "gesticulatory",\n \"popularity\": 69689\n },\n {\n \"tag\": "wergil",\n \"popularity\": 69445\n },\n {\n \"tag\": "Lecanora",\n \"popularity\": 69202\n },\n {\n \"tag\": "malanders karst",\n \"popularity\": 68961\n },\n {\n \"tag\": "vibetoite",\n \"popularity\": 68721\n },\n {\n \"tag\": "unrequitedness",\n \"popularity\": 68483\n },\n {\n \"tag\": "outwash",\n \"popularity\": 68245\n },\n {\n \"tag\": "unsacred",\n \"popularity\": 68009\n },\n {\n \"tag\": "unabetted dividend",\n \"popularity\": 67775\n },\n {\n \"tag\": "untraveling",\n \"popularity\": 67541\n },\n {\n \"tag\": "thermobattery",\n \"popularity\": 67309\n },\n {\n \"tag\": "polypragmist",\n \"popularity\": 67078\n },\n {\n \"tag\": "irrefutableness",\n \"popularity\": 66848\n },\n {\n \"tag\": "remiges",\n \"popularity\": 66620\n },\n {\n \"tag\": "implode",\n \"popularity\": 66393\n },\n {\n \"tag\": "superfluousness",\n \"popularity\": 66166\n },\n {\n \"tag\": "croakily unalleviated",\n \"popularity\": 65942\n },\n {\n \"tag\": "edicule",\n \"popularity\": 65718\n },\n {\n \"tag\": "entophytous",\n \"popularity\": 65495\n },\n {\n \"tag\": "benefactorship Toryish",\n \"popularity\": 65274\n },\n {\n \"tag\": "pseudoamateurish",\n \"popularity\": 65054\n },\n {\n \"tag\": "flueless Iguanodontoidea snipnose",\n \"popularity\": 64835\n },\n {\n \"tag\": "zealotical Zamicrus interpole",\n \"popularity\": 64617\n },\n {\n \"tag\": "whereabout",\n \"popularity\": 64401\n },\n {\n \"tag\": "benzazide",\n \"popularity\": 64185\n },\n {\n \"tag\": "pokeweed",\n \"popularity\": 63971\n },\n {\n \"tag\": "calamitoid",\n \"popularity\": 63757\n },\n {\n \"tag\": "sporozoal",\n \"popularity\": 63545\n },\n {\n \"tag\": "physcioid Welshwoman",\n \"popularity\": 63334\n },\n {\n \"tag\": "wanting",\n \"popularity\": 63124\n },\n {\n \"tag\": "unencumbering",\n \"popularity\": 62915\n },\n {\n \"tag\": "Tupi",\n \"popularity\": 62707\n },\n {\n \"tag\": "potbank",\n \"popularity\": 62501\n },\n {\n \"tag\": "bulked",\n \"popularity\": 62295\n },\n {\n \"tag\": "uparise",\n \"popularity\": 62090\n },\n {\n \"tag\": "Sudra",\n \"popularity\": 61887\n },\n {\n \"tag\": "hyperscrupulosity",\n \"popularity\": 61684\n },\n {\n \"tag\": "subterraneously unmaid",\n \"popularity\": 61483\n },\n {\n \"tag\": "poisonousness",\n \"popularity\": 61282\n },\n {\n \"tag\": "phare",\n \"popularity\": 61083\n },\n {\n \"tag\": "dicynodont",\n \"popularity\": 60884\n },\n {\n \"tag\": "chewer",\n \"popularity\": 60687\n },\n {\n \"tag\": "uliginous",\n \"popularity\": 60490\n },\n {\n \"tag\": "tinman",\n \"popularity\": 60295\n },\n {\n \"tag\": "coconut",\n \"popularity\": 60100\n },\n {\n \"tag\": "phryganeoid",\n \"popularity\": 59907\n },\n {\n \"tag\": "bismillah",\n \"popularity\": 59714\n },\n {\n \"tag\": "tautomeric",\n \"popularity\": 59523\n },\n {\n \"tag\": "jerquer",\n \"popularity\": 59332\n },\n {\n \"tag\": "Dryopithecinae",\n \"popularity\": 59143\n },\n {\n \"tag\": "ghizite",\n \"popularity\": 58954\n },\n {\n \"tag\": "unliveable",\n \"popularity\": 58766\n },\n {\n \"tag\": "craftsmaster",\n \"popularity\": 58579\n },\n {\n \"tag\": "semiscenic",\n \"popularity\": 58394\n },\n {\n \"tag\": "danaid",\n \"popularity\": 58209\n },\n {\n \"tag\": "flawful",\n \"popularity\": 58025\n },\n {\n \"tag\": "risibleness",\n \"popularity\": 57841\n },\n {\n \"tag\": "Muscovite",\n \"popularity\": 57659\n },\n {\n \"tag\": "snaringly",\n \"popularity\": 57478\n },\n {\n \"tag\": "brilliantwise",\n \"popularity\": 57297\n },\n {\n \"tag\": "plebeity",\n \"popularity\": 57118\n },\n {\n \"tag\": "historicalness",\n \"popularity\": 56939\n },\n {\n \"tag\": "piecemeal",\n \"popularity\": 56761\n },\n {\n \"tag\": "maxillipedary",\n \"popularity\": 56584\n },\n {\n \"tag\": "Hypenantron",\n \"popularity\": 56408\n },\n {\n \"tag\": "quaintness avigate",\n \"popularity\": 56233\n },\n {\n \"tag\": "ave",\n \"popularity\": 56059\n },\n {\n \"tag\": "mediaevally",\n \"popularity\": 55885\n },\n {\n \"tag\": "brucite",\n \"popularity\": 55712\n },\n {\n \"tag\": "Schwendenerian",\n \"popularity\": 55541\n },\n {\n \"tag\": "julole",\n \"popularity\": 55370\n },\n {\n \"tag\": "palaeolith",\n \"popularity\": 55199\n },\n {\n \"tag\": "cotyledonary",\n \"popularity\": 55030\n },\n {\n \"tag\": "rond",\n \"popularity\": 54861\n },\n {\n \"tag\": "boomster tassoo",\n \"popularity\": 54694\n },\n {\n \"tag\": "cattishly",\n \"popularity\": 54527\n },\n {\n \"tag\": "tonguefence",\n \"popularity\": 54360\n },\n {\n \"tag\": "hexastylar triskele",\n \"popularity\": 54195\n },\n {\n \"tag\": "ariot",\n \"popularity\": 54030\n },\n {\n \"tag\": "intarsist",\n \"popularity\": 53867\n },\n {\n \"tag\": "Oscines",\n \"popularity\": 53704\n },\n {\n \"tag\": "Spaniolize",\n \"popularity\": 53541\n },\n {\n \"tag\": "smellfungus",\n \"popularity\": 53380\n },\n {\n \"tag\": "redisplay",\n \"popularity\": 53219\n },\n {\n \"tag\": "phosphene",\n \"popularity\": 53059\n },\n {\n \"tag\": "phycomycete",\n \"popularity\": 52900\n },\n {\n \"tag\": "prophetic",\n \"popularity\": 52741\n },\n {\n \"tag\": "overtrustful",\n \"popularity\": 52584\n },\n {\n \"tag\": "pinitol",\n \"popularity\": 52427\n },\n {\n \"tag\": "asthmatic",\n \"popularity\": 52270\n },\n {\n \"tag\": "convulsive",\n \"popularity\": 52115\n },\n {\n \"tag\": "draughtswoman",\n \"popularity\": 51960\n },\n {\n \"tag\": "unetymologizable",\n \"popularity\": 51806\n },\n {\n \"tag\": "centrarchoid",\n \"popularity\": 51652\n },\n {\n \"tag\": "mesioincisal",\n \"popularity\": 51500\n },\n {\n \"tag\": "transbaikal",\n \"popularity\": 51348\n },\n {\n \"tag\": "silveriness",\n \"popularity\": 51196\n },\n {\n \"tag\": "costotomy",\n \"popularity\": 51046\n },\n {\n \"tag\": "caracore",\n \"popularity\": 50896\n },\n {\n \"tag\": "depotentiation",\n \"popularity\": 50747\n },\n {\n \"tag\": "glossoepiglottidean",\n \"popularity\": 50598\n },\n {\n \"tag\": "upswell",\n \"popularity\": 50450\n },\n {\n \"tag\": "flecnodal",\n \"popularity\": 50303\n },\n {\n \"tag\": "coventrate",\n \"popularity\": 50157\n },\n {\n \"tag\": "duchesse",\n \"popularity\": 50011\n },\n {\n \"tag\": "excisemanship trophied",\n \"popularity\": 49866\n },\n {\n \"tag\": "cytinaceous",\n \"popularity\": 49721\n },\n {\n \"tag\": "assuringly",\n \"popularity\": 49577\n },\n {\n \"tag\": "unconducted upliftitis",\n \"popularity\": 49434\n },\n {\n \"tag\": "rachicentesis",\n \"popularity\": 49292\n },\n {\n \"tag\": "antiangular",\n \"popularity\": 49150\n },\n {\n \"tag\": "advisal",\n \"popularity\": 49008\n },\n {\n \"tag\": "birdcatcher",\n \"popularity\": 48868\n },\n {\n \"tag\": "secularistic",\n \"popularity\": 48728\n },\n {\n \"tag\": "grandeeism superinformal",\n \"popularity\": 48588\n },\n {\n \"tag\": "unapprehension",\n \"popularity\": 48449\n },\n {\n \"tag\": "excipulum",\n \"popularity\": 48311\n },\n {\n \"tag\": "decimole",\n \"popularity\": 48174\n },\n {\n \"tag\": "semidrachm",\n \"popularity\": 48037\n },\n {\n \"tag\": "uvulotome",\n \"popularity\": 47901\n },\n {\n \"tag\": "Lemaneaceae",\n \"popularity\": 47765\n },\n {\n \"tag\": "corrade",\n \"popularity\": 47630\n },\n {\n \"tag\": "Kuroshio",\n \"popularity\": 47495\n },\n {\n \"tag\": "Araliophyllum",\n \"popularity\": 47361\n },\n {\n \"tag\": "victoriousness cardiosphygmograph",\n \"popularity\": 47228\n },\n {\n \"tag\": "reinvent",\n \"popularity\": 47095\n },\n {\n \"tag\": "Macrotolagus",\n \"popularity\": 46963\n },\n {\n \"tag\": "strenuousness",\n \"popularity\": 46831\n },\n {\n \"tag\": "deviability",\n \"popularity\": 46700\n },\n {\n \"tag\": "phyllospondylous",\n \"popularity\": 46570\n },\n {\n \"tag\": "bisect rudderhole",\n \"popularity\": 46440\n },\n {\n \"tag\": "crownwork",\n \"popularity\": 46311\n },\n {\n \"tag\": "Ascalabota",\n \"popularity\": 46182\n },\n {\n \"tag\": "prostatomyomectomy",\n \"popularity\": 46054\n },\n {\n \"tag\": "neurosyphilis",\n \"popularity\": 45926\n },\n {\n \"tag\": "tabloid scraplet",\n \"popularity\": 45799\n },\n {\n \"tag\": "nonmedullated servility",\n \"popularity\": 45673\n },\n {\n \"tag\": "melopoeic practicalization",\n \"popularity\": 45547\n },\n {\n \"tag\": "nonrhythmic",\n \"popularity\": 45421\n },\n {\n \"tag\": "deplorer",\n \"popularity\": 45296\n },\n {\n \"tag\": "Ophion",\n \"popularity\": 45172\n },\n {\n \"tag\": "subprioress",\n \"popularity\": 45048\n },\n {\n \"tag\": "semiregular",\n \"popularity\": 44925\n },\n {\n \"tag\": "praelection",\n \"popularity\": 44802\n },\n {\n \"tag\": "discinct",\n \"popularity\": 44680\n },\n {\n \"tag\": "preplace",\n \"popularity\": 44558\n },\n {\n \"tag\": "paternoster",\n \"popularity\": 44437\n },\n {\n \"tag\": "suboccipital",\n \"popularity\": 44316\n },\n {\n \"tag\": "Teutophil",\n \"popularity\": 44196\n },\n {\n \"tag\": "tracheole",\n \"popularity\": 44076\n },\n {\n \"tag\": "subsmile",\n \"popularity\": 43957\n },\n {\n \"tag\": "nonapostatizing",\n \"popularity\": 43839\n },\n {\n \"tag\": "cleidotomy",\n \"popularity\": 43720\n },\n {\n \"tag\": "hingle",\n \"popularity\": 43603\n },\n {\n \"tag\": "jocoque",\n \"popularity\": 43486\n },\n {\n \"tag\": "trundler notidanian",\n \"popularity\": 43369\n },\n {\n \"tag\": "strangling misdaub",\n \"popularity\": 43253\n },\n {\n \"tag\": "noncancellable",\n \"popularity\": 43137\n },\n {\n \"tag\": "lavabo",\n \"popularity\": 43022\n },\n {\n \"tag\": "lanterloo",\n \"popularity\": 42907\n },\n {\n \"tag\": "uncitizenly",\n \"popularity\": 42793\n },\n {\n \"tag\": "autoturning",\n \"popularity\": 42679\n },\n {\n \"tag\": "Haganah",\n \"popularity\": 42566\n },\n {\n \"tag\": "Glecoma",\n \"popularity\": 42453\n },\n {\n \"tag\": "membered",\n \"popularity\": 42341\n },\n {\n \"tag\": "consuetudinal",\n \"popularity\": 42229\n },\n {\n \"tag\": "gatehouse",\n \"popularity\": 42117\n },\n {\n \"tag\": "tetherball",\n \"popularity\": 42006\n },\n {\n \"tag\": "counterrevolutionist numismatical",\n \"popularity\": 41896\n },\n {\n \"tag\": "pagehood plateiasmus",\n \"popularity\": 41786\n },\n {\n \"tag\": "pelterer",\n \"popularity\": 41676\n },\n {\n \"tag\": "splenemphraxis",\n \"popularity\": 41567\n },\n {\n \"tag\": "Crypturidae",\n \"popularity\": 41458\n },\n {\n \"tag\": "caboodle",\n \"popularity\": 41350\n },\n {\n \"tag\": "Filaria",\n \"popularity\": 41242\n },\n {\n \"tag\": "noninvincibility",\n \"popularity\": 41135\n },\n {\n \"tag\": "preadvertisement",\n \"popularity\": 41028\n },\n {\n \"tag\": "bathrobe",\n \"popularity\": 40921\n },\n {\n \"tag\": "nitrifier",\n \"popularity\": 40815\n },\n {\n \"tag\": "furthermore",\n \"popularity\": 40709\n },\n {\n \"tag\": "recrate",\n \"popularity\": 40604\n },\n {\n \"tag\": "inexist",\n \"popularity\": 40499\n },\n {\n \"tag\": "Mocoan",\n \"popularity\": 40395\n },\n {\n \"tag\": "forint",\n \"popularity\": 40291\n },\n {\n \"tag\": "cardiomyoliposis",\n \"popularity\": 40187\n },\n {\n \"tag\": "channeling",\n \"popularity\": 40084\n },\n {\n \"tag\": "quebrachine",\n \"popularity\": 39981\n },\n {\n \"tag\": "magistery",\n \"popularity\": 39879\n },\n {\n \"tag\": "koko",\n \"popularity\": 39777\n },\n {\n \"tag\": "nobilify",\n \"popularity\": 39676\n },\n {\n \"tag\": "articulate taprooted",\n \"popularity\": 39575\n },\n {\n \"tag\": "cardiotonic Nicaragua",\n \"popularity\": 39474\n },\n {\n \"tag\": "assertiveness",\n \"popularity\": 39374\n },\n {\n \"tag\": "springtail",\n \"popularity\": 39274\n },\n {\n \"tag\": "spontoon",\n \"popularity\": 39174\n },\n {\n \"tag\": "plesiobiosis",\n \"popularity\": 39075\n },\n {\n \"tag\": "rooinek",\n \"popularity\": 38976\n },\n {\n \"tag\": "hairif falsehood",\n \"popularity\": 38878\n },\n {\n \"tag\": "synodally",\n \"popularity\": 38780\n },\n {\n \"tag\": "biodynamics",\n \"popularity\": 38683\n },\n {\n \"tag\": "trickling",\n \"popularity\": 38585\n },\n {\n \"tag\": "oxfly daystar",\n \"popularity\": 38489\n },\n {\n \"tag\": "epicycloidal",\n \"popularity\": 38392\n },\n {\n \"tag\": "shorthand",\n \"popularity\": 38296\n },\n {\n \"tag\": "herpolhode",\n \"popularity\": 38201\n },\n {\n \"tag\": "polysynthesism",\n \"popularity\": 38105\n },\n {\n \"tag\": "cany",\n \"popularity\": 38010\n },\n {\n \"tag\": "sideage",\n \"popularity\": 37916\n },\n {\n \"tag\": "strainableness",\n \"popularity\": 37822\n },\n {\n \"tag\": "superformidable",\n \"popularity\": 37728\n },\n {\n \"tag\": "slendang",\n \"popularity\": 37634\n },\n {\n \"tag\": "impropriation",\n \"popularity\": 37541\n },\n {\n \"tag\": "ficklehearted",\n \"popularity\": 37449\n },\n {\n \"tag\": "wintrify",\n \"popularity\": 37356\n },\n {\n \"tag\": "geomorphogenist",\n \"popularity\": 37264\n },\n {\n \"tag\": "smuggleable",\n \"popularity\": 37173\n },\n {\n \"tag\": "delapsion",\n \"popularity\": 37081\n },\n {\n \"tag\": "projective",\n \"popularity\": 36990\n },\n {\n \"tag\": "unglue exfoliation",\n \"popularity\": 36900\n },\n {\n \"tag\": "Acerae",\n \"popularity\": 36810\n },\n {\n \"tag\": "unstaged",\n \"popularity\": 36720\n },\n {\n \"tag\": "ranal",\n \"popularity\": 36630\n },\n {\n \"tag\": "worrier",\n \"popularity\": 36541\n },\n {\n \"tag\": "unhid",\n \"popularity\": 36452\n },\n {\n \"tag\": "adequation",\n \"popularity\": 36363\n },\n {\n \"tag\": "strongylid Sokotri",\n \"popularity\": 36275\n },\n {\n \"tag\": "fumingly",\n \"popularity\": 36187\n },\n {\n \"tag\": "gynosporangium phaenogenetic",\n \"popularity\": 36100\n },\n {\n \"tag\": "uniunguiculate",\n \"popularity\": 36012\n },\n {\n \"tag\": "prudelike",\n \"popularity\": 35926\n },\n {\n \"tag\": "seminomata",\n \"popularity\": 35839\n },\n {\n \"tag\": "trinklet",\n \"popularity\": 35753\n },\n {\n \"tag\": "risorial",\n \"popularity\": 35667\n },\n {\n \"tag\": "pericardiocentesis",\n \"popularity\": 35581\n },\n {\n \"tag\": "filmist",\n \"popularity\": 35496\n },\n {\n \"tag\": "Nana",\n \"popularity\": 35411\n },\n {\n \"tag\": "cynipoid",\n \"popularity\": 35326\n },\n {\n \"tag\": "cteniform",\n \"popularity\": 35242\n },\n {\n \"tag\": "semiflex",\n \"popularity\": 35158\n },\n {\n \"tag\": "solstitially",\n \"popularity\": 35074\n },\n {\n \"tag\": "Algarsife",\n \"popularity\": 34991\n },\n {\n \"tag\": "noncriminal",\n \"popularity\": 34908\n },\n {\n \"tag\": "compassion",\n \"popularity\": 34825\n },\n {\n \"tag\": "Buddhic",\n \"popularity\": 34743\n },\n {\n \"tag\": "vellicative dactylically hotfoot",\n \"popularity\": 34661\n },\n {\n \"tag\": "chicory",\n \"popularity\": 34579\n },\n {\n \"tag\": "transperitoneally",\n \"popularity\": 34497\n },\n {\n \"tag\": "pennae",\n \"popularity\": 34416\n },\n {\n \"tag\": "Flamandize",\n \"popularity\": 34335\n },\n {\n \"tag\": "underviewer",\n \"popularity\": 34254\n },\n {\n \"tag\": "assoil",\n \"popularity\": 34174\n },\n {\n \"tag\": "saccharobacillus",\n \"popularity\": 34094\n },\n {\n \"tag\": "biacetylene",\n \"popularity\": 34014\n },\n {\n \"tag\": "mouchardism",\n \"popularity\": 33935\n },\n {\n \"tag\": "anisomeric",\n \"popularity\": 33856\n },\n {\n \"tag\": "digestive",\n \"popularity\": 33777\n },\n {\n \"tag\": "darlingly",\n \"popularity\": 33698\n },\n {\n \"tag\": "liman",\n \"popularity\": 33620\n },\n {\n \"tag\": "soldanrie",\n \"popularity\": 33542\n },\n {\n \"tag\": "sully",\n \"popularity\": 33464\n },\n {\n \"tag\": "brightsmith",\n \"popularity\": 33387\n },\n {\n \"tag\": "inwrap antiliturgist ureterocervical",\n \"popularity\": 33309\n },\n {\n \"tag\": "discommodity",\n \"popularity\": 33232\n },\n {\n \"tag\": "typical aggrandizer",\n \"popularity\": 33156\n },\n {\n \"tag\": "xenogeny",\n \"popularity\": 33079\n },\n {\n \"tag\": "uncountrified",\n \"popularity\": 33003\n },\n {\n \"tag\": "Podarge",\n \"popularity\": 32928\n },\n {\n \"tag\": "uninterviewed",\n \"popularity\": 32852\n },\n {\n \"tag\": "underprior",\n \"popularity\": 32777\n },\n {\n \"tag\": "leiomyomatous",\n \"popularity\": 32702\n },\n {\n \"tag\": "postdysenteric",\n \"popularity\": 32627\n },\n {\n \"tag\": "Fusicladium",\n \"popularity\": 32553\n },\n {\n \"tag\": "Dulcinea",\n \"popularity\": 32478\n },\n {\n \"tag\": "interspersion",\n \"popularity\": 32404\n },\n {\n \"tag\": "preobligate",\n \"popularity\": 32331\n },\n {\n \"tag\": "subaggregate",\n \"popularity\": 32257\n },\n {\n \"tag\": "grammarianism",\n \"popularity\": 32184\n },\n {\n \"tag\": "palikar",\n \"popularity\": 32111\n },\n {\n \"tag\": "facileness",\n \"popularity\": 32039\n },\n {\n \"tag\": "deuterofibrinose",\n \"popularity\": 31966\n },\n {\n \"tag\": "pseudesthesia",\n \"popularity\": 31894\n },\n {\n \"tag\": "sedimentary",\n \"popularity\": 31822\n },\n {\n \"tag\": "typewrite",\n \"popularity\": 31751\n },\n {\n \"tag\": "immemorable",\n \"popularity\": 31679\n },\n {\n \"tag\": "Myrtus",\n \"popularity\": 31608\n },\n {\n \"tag\": "hauchecornite",\n \"popularity\": 31537\n },\n {\n \"tag\": "galleylike",\n \"popularity\": 31467\n },\n {\n \"tag\": "thimber",\n \"popularity\": 31396\n },\n {\n \"tag\": "Hegelianism",\n \"popularity\": 31326\n },\n {\n \"tag\": "strig",\n \"popularity\": 31256\n },\n {\n \"tag\": "skyre",\n \"popularity\": 31187\n },\n {\n \"tag\": "eupepticism",\n \"popularity\": 31117\n },\n {\n \"tag\": "eponymism",\n \"popularity\": 31048\n },\n {\n \"tag\": "flunkeyhood",\n \"popularity\": 30979\n },\n {\n \"tag\": "Abama",\n \"popularity\": 30911\n },\n {\n \"tag\": "adiadochokinesis",\n \"popularity\": 30842\n },\n {\n \"tag\": "spendthrifty",\n \"popularity\": 30774\n },\n {\n \"tag\": "chalcedony",\n \"popularity\": 30706\n },\n {\n \"tag\": "authorism",\n \"popularity\": 30638\n },\n {\n \"tag\": "nasturtium",\n \"popularity\": 30571\n },\n {\n \"tag\": "Acanthocereus",\n \"popularity\": 30504\n },\n {\n \"tag\": "uncollapsible",\n \"popularity\": 30437\n },\n {\n \"tag\": "excursionist",\n \"popularity\": 30370\n },\n {\n \"tag\": "fogbow",\n \"popularity\": 30303\n },\n {\n \"tag\": "overlie",\n \"popularity\": 30237\n },\n {\n \"tag\": "velours",\n \"popularity\": 30171\n },\n {\n \"tag\": "zoodendria madrigal stagbush",\n \"popularity\": 30105\n },\n {\n \"tag\": "imi",\n \"popularity\": 30039\n },\n {\n \"tag\": "cojudge",\n \"popularity\": 29974\n },\n {\n \"tag\": "depurate argal",\n \"popularity\": 29909\n },\n {\n \"tag\": "unrecognition",\n \"popularity\": 29844\n },\n {\n \"tag\": "paunchful",\n \"popularity\": 29779\n },\n {\n \"tag\": "invalued",\n \"popularity\": 29714\n },\n {\n \"tag\": "probang",\n \"popularity\": 29650\n },\n {\n \"tag\": "chetvert",\n \"popularity\": 29586\n },\n {\n \"tag\": "enactable",\n \"popularity\": 29522\n },\n {\n \"tag\": "detoxicate adhibit",\n \"popularity\": 29458\n },\n {\n \"tag\": "kullaite",\n \"popularity\": 29395\n },\n {\n \"tag\": "undazzling",\n \"popularity\": 29332\n },\n {\n \"tag\": "excalation",\n \"popularity\": 29269\n },\n {\n \"tag\": "sievings",\n \"popularity\": 29206\n },\n {\n \"tag\": "disenthral",\n \"popularity\": 29143\n },\n {\n \"tag\": "disinterestedly",\n \"popularity\": 29081\n },\n {\n \"tag\": "stanner",\n \"popularity\": 29018\n },\n {\n \"tag\": "recapitulative",\n \"popularity\": 28956\n },\n {\n \"tag\": "objectivist",\n \"popularity\": 28895\n },\n {\n \"tag\": "hypermetropia",\n \"popularity\": 28833\n },\n {\n \"tag\": "incumbency",\n \"popularity\": 28772\n },\n {\n \"tag\": "protegee",\n \"popularity\": 28711\n },\n {\n \"tag\": "zealotic",\n \"popularity\": 28650\n },\n {\n \"tag\": "predebit",\n \"popularity\": 28589\n },\n {\n \"tag\": "cupolar",\n \"popularity\": 28528\n },\n {\n \"tag\": "unattributed",\n \"popularity\": 28468\n },\n {\n \"tag\": "louisine",\n \"popularity\": 28408\n },\n {\n \"tag\": "illustrate",\n \"popularity\": 28348\n },\n {\n \"tag\": "inofficiousness",\n \"popularity\": 28288\n },\n {\n \"tag\": "Americawards",\n \"popularity\": 28228\n },\n {\n \"tag\": "foreflap",\n \"popularity\": 28169\n },\n {\n \"tag\": "eruditeness",\n \"popularity\": 28110\n },\n {\n \"tag\": "copiopsia",\n \"popularity\": 28051\n },\n {\n \"tag\": "sporuliferous",\n \"popularity\": 27992\n },\n {\n \"tag\": "muttering",\n \"popularity\": 27934\n },\n {\n \"tag\": "prepsychology adrip",\n \"popularity\": 27875\n },\n {\n \"tag\": "unfriendly",\n \"popularity\": 27817\n },\n {\n \"tag\": "sulphanilic",\n \"popularity\": 27759\n },\n {\n \"tag\": "Coelococcus",\n \"popularity\": 27701\n },\n {\n \"tag\": "undoubtfulness",\n \"popularity\": 27643\n },\n {\n \"tag\": "flaringly",\n \"popularity\": 27586\n },\n {\n \"tag\": "unordain",\n \"popularity\": 27529\n },\n {\n \"tag\": "fratchety",\n \"popularity\": 27472\n },\n {\n \"tag\": "decadentism dolefully",\n \"popularity\": 27415\n },\n {\n \"tag\": "synthronus",\n \"popularity\": 27358\n },\n {\n \"tag\": "maiid",\n \"popularity\": 27301\n },\n {\n \"tag\": "rhinobyon",\n \"popularity\": 27245\n },\n {\n \"tag\": "Didynamia",\n \"popularity\": 27189\n },\n {\n \"tag\": "millionairedom",\n \"popularity\": 27133\n },\n {\n \"tag\": "mulierine",\n \"popularity\": 27077\n },\n {\n \"tag\": "Mayo",\n \"popularity\": 27021\n },\n {\n \"tag\": "perceivedness",\n \"popularity\": 26966\n },\n {\n \"tag\": "unadoration",\n \"popularity\": 26911\n },\n {\n \"tag\": "regraft",\n \"popularity\": 26856\n },\n {\n \"tag\": "witch",\n \"popularity\": 26801\n },\n {\n \"tag\": "ungrow",\n \"popularity\": 26746\n },\n {\n \"tag\": "glossopharyngeus",\n \"popularity\": 26691\n },\n {\n \"tag\": "unstirrable",\n \"popularity\": 26637\n },\n {\n \"tag\": "synodsman",\n \"popularity\": 26583\n },\n {\n \"tag\": "placentalian",\n \"popularity\": 26529\n },\n {\n \"tag\": "corpulently",\n \"popularity\": 26475\n },\n {\n \"tag\": "photochromoscope",\n \"popularity\": 26421\n },\n {\n \"tag\": "indusiate retinasphaltum chokestrap",\n \"popularity\": 26368\n },\n {\n \"tag\": "murdrum",\n \"popularity\": 26314\n },\n {\n \"tag\": "belatedness",\n \"popularity\": 26261\n },\n {\n \"tag\": "Cochin",\n \"popularity\": 26208\n },\n {\n \"tag\": "Leonist",\n \"popularity\": 26155\n },\n {\n \"tag\": "keeker confined",\n \"popularity\": 26102\n },\n {\n \"tag\": "unintellectual",\n \"popularity\": 26050\n },\n {\n \"tag\": "nymphaline bait",\n \"popularity\": 25997\n },\n {\n \"tag\": "sarcosporidiosis",\n \"popularity\": 25945\n },\n {\n \"tag\": "catawamptiously",\n \"popularity\": 25893\n },\n {\n \"tag\": "outshame",\n \"popularity\": 25841\n },\n {\n \"tag\": "animalism",\n \"popularity\": 25790\n },\n {\n \"tag\": "epithalamial",\n \"popularity\": 25738\n },\n {\n \"tag\": "ganner",\n \"popularity\": 25687\n },\n {\n \"tag\": "desilicify",\n \"popularity\": 25635\n },\n {\n \"tag\": "dandyism",\n \"popularity\": 25584\n },\n {\n \"tag\": "hyleg",\n \"popularity\": 25533\n },\n {\n \"tag\": "photophysical",\n \"popularity\": 25483\n },\n {\n \"tag\": "underload",\n \"popularity\": 25432\n },\n {\n \"tag\": "unintrusive",\n \"popularity\": 25382\n },\n {\n \"tag\": "succinamic",\n \"popularity\": 25331\n },\n {\n \"tag\": "matchy",\n \"popularity\": 25281\n },\n {\n \"tag\": "concordal",\n \"popularity\": 25231\n },\n {\n \"tag\": "exteriority",\n \"popularity\": 25181\n },\n {\n \"tag\": "sterculiad",\n \"popularity\": 25132\n },\n {\n \"tag\": "sulfoxylic",\n \"popularity\": 25082\n },\n {\n \"tag\": "oversubscription",\n \"popularity\": 25033\n },\n {\n \"tag\": "chiasmic",\n \"popularity\": 24984\n },\n {\n \"tag\": "pseudoparthenogenesis",\n \"popularity\": 24935\n },\n {\n \"tag\": "indorse",\n \"popularity\": 24886\n },\n {\n \"tag\": "Krishnaite",\n \"popularity\": 24837\n },\n {\n \"tag\": "calcinize",\n \"popularity\": 24788\n },\n {\n \"tag\": "rhodium",\n \"popularity\": 24740\n },\n {\n \"tag\": "tragopan",\n \"popularity\": 24692\n },\n {\n \"tag\": "overwhelmingly",\n \"popularity\": 24643\n },\n {\n \"tag\": "procidence accorporate",\n \"popularity\": 24595\n },\n {\n \"tag\": "polemize speelless",\n \"popularity\": 24548\n },\n {\n \"tag\": "radiocarpal goran",\n \"popularity\": 24500\n },\n {\n \"tag\": "counteroffer Pelodytes",\n \"popularity\": 24452\n },\n {\n \"tag\": "lionhearted",\n \"popularity\": 24405\n },\n {\n \"tag\": "paramastoid",\n \"popularity\": 24358\n },\n {\n \"tag\": "murine",\n \"popularity\": 24310\n },\n {\n \"tag\": "woodbined",\n \"popularity\": 24263\n },\n {\n \"tag\": "packthread",\n \"popularity\": 24217\n },\n {\n \"tag\": "citreous",\n \"popularity\": 24170\n },\n {\n \"tag\": "unfallaciously",\n \"popularity\": 24123\n },\n {\n \"tag\": "tentwork reincarnadine",\n \"popularity\": 24077\n },\n {\n \"tag\": "verminousness",\n \"popularity\": 24030\n },\n {\n \"tag\": "sillometer",\n \"popularity\": 23984\n },\n {\n \"tag\": "jointy",\n \"popularity\": 23938\n },\n {\n \"tag\": "streptolysin",\n \"popularity\": 23892\n },\n {\n \"tag\": "Florentinism",\n \"popularity\": 23847\n },\n {\n \"tag\": "monosomatous",\n \"popularity\": 23801\n },\n {\n \"tag\": "capsulociliary",\n \"popularity\": 23756\n },\n {\n \"tag\": "organum",\n \"popularity\": 23710\n },\n {\n \"tag\": "overtly",\n \"popularity\": 23665\n },\n {\n \"tag\": "ophthalmoscopical",\n \"popularity\": 23620\n },\n {\n \"tag\": "supposititiously",\n \"popularity\": 23575\n },\n {\n \"tag\": "radiochemistry",\n \"popularity\": 23530\n },\n {\n \"tag\": "flaxtail",\n \"popularity\": 23486\n },\n {\n \"tag\": "pretympanic",\n \"popularity\": 23441\n },\n {\n \"tag\": "auscultation",\n \"popularity\": 23397\n },\n {\n \"tag\": "hairdresser",\n \"popularity\": 23352\n },\n {\n \"tag\": "chaffless",\n \"popularity\": 23308\n },\n {\n \"tag\": "polioencephalitis",\n \"popularity\": 23264\n },\n {\n \"tag\": "axolotl",\n \"popularity\": 23220\n },\n {\n \"tag\": "smous",\n \"popularity\": 23177\n },\n {\n \"tag\": "morgen disenamour toothed",\n \"popularity\": 23133\n },\n {\n \"tag\": "chaiseless",\n \"popularity\": 23089\n },\n {\n \"tag\": "frugally",\n \"popularity\": 23046\n },\n {\n \"tag\": "combustive antievolutionist cinenegative",\n \"popularity\": 23003\n },\n {\n \"tag\": "malacolite",\n \"popularity\": 22960\n },\n {\n \"tag\": "borne",\n \"popularity\": 22917\n },\n {\n \"tag\": "mercaptole",\n \"popularity\": 22874\n },\n {\n \"tag\": "judicatory",\n \"popularity\": 22831\n },\n {\n \"tag\": "noctivagation",\n \"popularity\": 22789\n },\n {\n \"tag\": "synthete",\n \"popularity\": 22746\n },\n {\n \"tag\": "tomboyism",\n \"popularity\": 22704\n },\n {\n \"tag\": "serranoid",\n \"popularity\": 22661\n },\n {\n \"tag\": "impostorism",\n \"popularity\": 22619\n },\n {\n \"tag\": "flagellosis Talitha",\n \"popularity\": 22577\n },\n {\n \"tag\": "pseudoviscous",\n \"popularity\": 22535\n },\n {\n \"tag\": "Galleriidae",\n \"popularity\": 22494\n },\n {\n \"tag\": "undulation didelph Comintern",\n \"popularity\": 22452\n },\n {\n \"tag\": "triangulopyramidal",\n \"popularity\": 22411\n },\n {\n \"tag\": "middlings",\n \"popularity\": 22369\n },\n {\n \"tag\": "piperazin",\n \"popularity\": 22328\n },\n {\n \"tag\": "endostitis",\n \"popularity\": 22287\n },\n {\n \"tag\": "swordlike",\n \"popularity\": 22246\n },\n {\n \"tag\": "forthwith",\n \"popularity\": 22205\n },\n {\n \"tag\": "menaceful",\n \"popularity\": 22164\n },\n {\n \"tag\": "explantation defective",\n \"popularity\": 22123\n },\n {\n \"tag\": "arrear",\n \"popularity\": 22083\n },\n {\n \"tag\": "engraft",\n \"popularity\": 22042\n },\n {\n \"tag\": "revolunteer",\n \"popularity\": 22002\n },\n {\n \"tag\": "foliaceous",\n \"popularity\": 21962\n },\n {\n \"tag\": "pseudograph",\n \"popularity\": 21922\n },\n {\n \"tag\": "maenaite",\n \"popularity\": 21882\n },\n {\n \"tag\": "interfinger",\n \"popularity\": 21842\n },\n {\n \"tag\": "macroscopically",\n \"popularity\": 21802\n },\n {\n \"tag\": "bluewood",\n \"popularity\": 21762\n },\n {\n \"tag\": "chikara",\n \"popularity\": 21723\n },\n {\n \"tag\": "reprehension diazeuxis nickelous",\n \"popularity\": 21683\n },\n {\n \"tag\": "vacuation",\n \"popularity\": 21644\n },\n {\n \"tag\": "Sartish",\n \"popularity\": 21605\n },\n {\n \"tag\": "pseudogyny",\n \"popularity\": 21566\n },\n {\n \"tag\": "friedcake",\n \"popularity\": 21527\n },\n {\n \"tag\": "thraw",\n \"popularity\": 21488\n },\n {\n \"tag\": "bifid",\n \"popularity\": 21449\n },\n {\n \"tag\": "truthlessly",\n \"popularity\": 21411\n },\n {\n \"tag\": "lungy",\n \"popularity\": 21372\n },\n {\n \"tag\": "fluoborite",\n \"popularity\": 21334\n },\n {\n \"tag\": "anthropolithic",\n \"popularity\": 21295\n },\n {\n \"tag\": "coachee straw",\n \"popularity\": 21257\n },\n {\n \"tag\": "dehorner Grecize",\n \"popularity\": 21219\n },\n {\n \"tag\": "spondylopyosis",\n \"popularity\": 21181\n },\n {\n \"tag\": "institutionary",\n \"popularity\": 21143\n },\n {\n \"tag\": "agentry",\n \"popularity\": 21105\n },\n {\n \"tag\": "musing bietle",\n \"popularity\": 21068\n },\n {\n \"tag\": "cormophyte",\n \"popularity\": 21030\n },\n {\n \"tag\": "semielliptic",\n \"popularity\": 20993\n },\n {\n \"tag\": "ependytes",\n \"popularity\": 20955\n },\n {\n \"tag\": "coachmaster",\n \"popularity\": 20918\n },\n {\n \"tag\": "overexuberant",\n \"popularity\": 20881\n },\n {\n \"tag\": "selectable",\n \"popularity\": 20844\n },\n {\n \"tag\": "saclike",\n \"popularity\": 20807\n },\n {\n \"tag\": "mullion",\n \"popularity\": 20770\n },\n {\n \"tag\": "pantheonize prevalency",\n \"popularity\": 20733\n },\n {\n \"tag\": "trophosperm",\n \"popularity\": 20697\n },\n {\n \"tag\": "paraphrasist",\n \"popularity\": 20660\n },\n {\n \"tag\": "undercarry",\n \"popularity\": 20624\n },\n {\n \"tag\": "thallogenic",\n \"popularity\": 20587\n },\n {\n \"tag\": "bulgy forbid",\n \"popularity\": 20551\n },\n {\n \"tag\": "proliquor gratulatory",\n \"popularity\": 20515\n },\n {\n \"tag\": "booker",\n \"popularity\": 20479\n },\n {\n \"tag\": "wizen",\n \"popularity\": 20443\n },\n {\n \"tag\": "synchondrosially",\n \"popularity\": 20407\n },\n {\n \"tag\": "herbless",\n \"popularity\": 20371\n },\n {\n \"tag\": "arfvedsonite",\n \"popularity\": 20336\n },\n {\n \"tag\": "Neuroptera",\n \"popularity\": 20300\n },\n {\n \"tag\": "fingerstone",\n \"popularity\": 20265\n },\n {\n \"tag\": "Odontoglossae",\n \"popularity\": 20229\n },\n {\n \"tag\": "transmigrator",\n \"popularity\": 20194\n },\n {\n \"tag\": "Dehaites",\n \"popularity\": 20159\n },\n {\n \"tag\": "Molinist",\n \"popularity\": 20124\n },\n {\n \"tag\": "novelistic",\n \"popularity\": 20089\n },\n {\n \"tag\": "astelic",\n \"popularity\": 20054\n },\n {\n \"tag\": "pyelometry",\n \"popularity\": 20019\n },\n {\n \"tag\": "pigmentation",\n \"popularity\": 19984\n },\n {\n \"tag\": "epinaos",\n \"popularity\": 19950\n },\n {\n \"tag\": "outdare",\n \"popularity\": 19915\n },\n {\n \"tag\": "Funje philaristocracy",\n \"popularity\": 19881\n },\n {\n \"tag\": "keddah",\n \"popularity\": 19846\n },\n {\n \"tag\": "axoidean",\n \"popularity\": 19812\n },\n {\n \"tag\": "ovule",\n \"popularity\": 19778\n },\n {\n \"tag\": "solidify",\n \"popularity\": 19744\n },\n {\n \"tag\": "noncelestial",\n \"popularity\": 19710\n },\n {\n \"tag\": "overmultiplication",\n \"popularity\": 19676\n },\n {\n \"tag\": "hexatetrahedron",\n \"popularity\": 19642\n },\n {\n \"tag\": "pliciform",\n \"popularity\": 19609\n },\n {\n \"tag\": "zimbalon",\n \"popularity\": 19575\n },\n {\n \"tag\": "annexational",\n \"popularity\": 19542\n },\n {\n \"tag\": "eurhodol",\n \"popularity\": 19508\n },\n {\n \"tag\": "yark",\n \"popularity\": 19475\n },\n {\n \"tag\": "illegality nitroalizarin",\n \"popularity\": 19442\n },\n {\n \"tag\": "quadratum",\n \"popularity\": 19409\n },\n {\n \"tag\": "saccharine",\n \"popularity\": 19376\n },\n {\n \"tag\": "unemploy",\n \"popularity\": 19343\n },\n {\n \"tag\": "uniclinal unipotent",\n \"popularity\": 19310\n },\n {\n \"tag\": "turbo",\n \"popularity\": 19277\n },\n {\n \"tag\": "sybarism",\n \"popularity\": 19244\n },\n {\n \"tag\": "motacilline",\n \"popularity\": 19212\n },\n {\n \"tag\": "weaselly",\n \"popularity\": 19179\n },\n {\n \"tag\": "plastid",\n \"popularity\": 19147\n },\n {\n \"tag\": "wasting",\n \"popularity\": 19114\n },\n {\n \"tag\": "begrime fluting",\n \"popularity\": 19082\n },\n {\n \"tag\": "Nephilinae",\n \"popularity\": 19050\n },\n {\n \"tag\": "disregardance",\n \"popularity\": 19018\n },\n {\n \"tag\": "Shakerlike",\n \"popularity\": 18986\n },\n {\n \"tag\": "uniped",\n \"popularity\": 18954\n },\n {\n \"tag\": "knap",\n \"popularity\": 18922\n },\n {\n \"tag\": "electivism undergardener",\n \"popularity\": 18890\n },\n {\n \"tag\": "hulverheaded",\n \"popularity\": 18858\n },\n {\n \"tag\": "unruptured",\n \"popularity\": 18827\n },\n {\n \"tag\": "solemnize credently",\n \"popularity\": 18795\n },\n {\n \"tag\": "pentastomoid possessingly",\n \"popularity\": 18764\n },\n {\n \"tag\": "octose",\n \"popularity\": 18733\n },\n {\n \"tag\": "psithurism indefensibility",\n \"popularity\": 18701\n },\n {\n \"tag\": "torrentuous cyanometer subcrenate",\n \"popularity\": 18670\n },\n {\n \"tag\": "photoplaywright tapaculo",\n \"popularity\": 18639\n },\n {\n \"tag\": "univalence",\n \"popularity\": 18608\n },\n {\n \"tag\": "Porthetria",\n \"popularity\": 18577\n },\n {\n \"tag\": "funambulo",\n \"popularity\": 18546\n },\n {\n \"tag\": "pedion",\n \"popularity\": 18515\n },\n {\n \"tag\": "horticulturally",\n \"popularity\": 18485\n },\n {\n \"tag\": "marennin",\n \"popularity\": 18454\n },\n {\n \"tag\": "horselaugh",\n \"popularity\": 18423\n },\n {\n \"tag\": "semiexecutive",\n \"popularity\": 18393\n },\n {\n \"tag\": "Monopteridae",\n \"popularity\": 18363\n },\n {\n \"tag\": "commonable",\n \"popularity\": 18332\n },\n {\n \"tag\": "dreariment",\n \"popularity\": 18302\n },\n {\n \"tag\": "disbud",\n \"popularity\": 18272\n },\n {\n \"tag\": "monocled",\n \"popularity\": 18242\n },\n {\n \"tag\": "hurlbarrow",\n \"popularity\": 18212\n },\n {\n \"tag\": "opiateproof",\n \"popularity\": 18182\n },\n {\n \"tag\": "Fahrenheit",\n \"popularity\": 18152\n },\n {\n \"tag\": "writhed",\n \"popularity\": 18122\n },\n {\n \"tag\": "Volstead",\n \"popularity\": 18093\n },\n {\n \"tag\": "yesternight",\n \"popularity\": 18063\n },\n {\n \"tag\": "readmittance",\n \"popularity\": 18033\n },\n {\n \"tag\": "reiterable",\n \"popularity\": 18004\n },\n {\n \"tag\": "triquetral",\n \"popularity\": 17975\n },\n {\n \"tag\": "guillotinement",\n \"popularity\": 17945\n },\n {\n \"tag\": "repermission",\n \"popularity\": 17916\n },\n {\n \"tag\": "assishly",\n \"popularity\": 17887\n },\n {\n \"tag\": "daidle",\n \"popularity\": 17858\n },\n {\n \"tag\": "prismatoid",\n \"popularity\": 17829\n },\n {\n \"tag\": "irreptitious",\n \"popularity\": 17800\n },\n {\n \"tag\": "sourdeline",\n \"popularity\": 17771\n },\n {\n \"tag\": "Austrian",\n \"popularity\": 17742\n },\n {\n \"tag\": "psychorrhagic",\n \"popularity\": 17713\n },\n {\n \"tag\": "Monumbo",\n \"popularity\": 17685\n },\n {\n \"tag\": "cloiochoanitic",\n \"popularity\": 17656\n },\n {\n \"tag\": "hant",\n \"popularity\": 17628\n },\n {\n \"tag\": "roily pulldown",\n \"popularity\": 17599\n },\n {\n \"tag\": "recongratulation",\n \"popularity\": 17571\n },\n {\n \"tag\": "Peking",\n \"popularity\": 17543\n },\n {\n \"tag\": "erdvark",\n \"popularity\": 17514\n },\n {\n \"tag\": "antimnemonic",\n \"popularity\": 17486\n },\n {\n \"tag\": "noncapillarity",\n \"popularity\": 17458\n },\n {\n \"tag\": "irrepressive",\n \"popularity\": 17430\n },\n {\n \"tag\": "Petromyzontes",\n \"popularity\": 17402\n },\n {\n \"tag\": "piscatorially",\n \"popularity\": 17374\n },\n {\n \"tag\": "cholesterosis",\n \"popularity\": 17346\n },\n {\n \"tag\": "denunciate",\n \"popularity\": 17319\n },\n {\n \"tag\": "unmetalled",\n \"popularity\": 17291\n },\n {\n \"tag\": "Tigris enruin",\n \"popularity\": 17263\n },\n {\n \"tag\": "anaspalin",\n \"popularity\": 17236\n },\n {\n \"tag\": "monodromy",\n \"popularity\": 17208\n },\n {\n \"tag\": "Canichanan",\n \"popularity\": 17181\n },\n {\n \"tag\": "mesolabe",\n \"popularity\": 17154\n },\n {\n \"tag\": "trichothallic overcunningness",\n \"popularity\": 17127\n },\n {\n \"tag\": "spinsterishly",\n \"popularity\": 17099\n },\n {\n \"tag\": "sensilla",\n \"popularity\": 17072\n },\n {\n \"tag\": "wifelkin",\n \"popularity\": 17045\n },\n {\n \"tag\": "suppositionless",\n \"popularity\": 17018\n },\n {\n \"tag\": "irksomeness",\n \"popularity\": 16991\n },\n {\n \"tag\": "sanbenito",\n \"popularity\": 16964\n },\n {\n \"tag\": "nonstatement",\n \"popularity\": 16938\n },\n {\n \"tag\": "phenoloid",\n \"popularity\": 16911\n },\n {\n \"tag\": "Steinberger",\n \"popularity\": 16884\n },\n {\n \"tag\": "replicated boom",\n \"popularity\": 16858\n },\n {\n \"tag\": "sciomachiology",\n \"popularity\": 16831\n },\n {\n \"tag\": "starwise",\n \"popularity\": 16805\n },\n {\n \"tag\": "prerich",\n \"popularity\": 16778\n },\n {\n \"tag\": "unspawned",\n \"popularity\": 16752\n },\n {\n \"tag\": "unindentable",\n \"popularity\": 16726\n },\n {\n \"tag\": "stromatic",\n \"popularity\": 16700\n },\n {\n \"tag\": "fetishize",\n \"popularity\": 16673\n },\n {\n \"tag\": "dihydroxy",\n \"popularity\": 16647\n },\n {\n \"tag\": "precaudal",\n \"popularity\": 16621\n },\n {\n \"tag\": "Madagascar",\n \"popularity\": 16595\n },\n {\n \"tag\": "repinement",\n \"popularity\": 16570\n },\n {\n \"tag\": "noncathedral wenzel",\n \"popularity\": 16544\n },\n {\n \"tag\": "corollike",\n \"popularity\": 16518\n },\n {\n \"tag\": "pubes unamortization",\n \"popularity\": 16492\n },\n {\n \"tag\": "brickcroft",\n \"popularity\": 16467\n },\n {\n \"tag\": "intertrabecular",\n \"popularity\": 16441\n },\n {\n \"tag\": "formulaic",\n \"popularity\": 16416\n },\n {\n \"tag\": "arienzo",\n \"popularity\": 16390\n },\n {\n \"tag\": "Mazzinian",\n \"popularity\": 16365\n },\n {\n \"tag\": "wallowishly",\n \"popularity\": 16339\n },\n {\n \"tag\": "sysselman",\n \"popularity\": 16314\n },\n {\n \"tag\": "seligmannite",\n \"popularity\": 16289\n },\n {\n \"tag\": "harlequinery",\n \"popularity\": 16264\n },\n {\n \"tag\": "zucchetto",\n \"popularity\": 16239\n },\n {\n \"tag\": "malonyl",\n \"popularity\": 16214\n },\n {\n \"tag\": "patwari",\n \"popularity\": 16189\n },\n {\n \"tag\": "neoholmia venturesomeness",\n \"popularity\": 16164\n },\n {\n \"tag\": "Dehwar",\n \"popularity\": 16139\n },\n {\n \"tag\": "fetiferous",\n \"popularity\": 16114\n },\n {\n \"tag\": "chromatophore",\n \"popularity\": 16090\n },\n {\n \"tag\": "reregistration",\n \"popularity\": 16065\n },\n {\n \"tag\": "alienor",\n \"popularity\": 16040\n },\n {\n \"tag\": "Hexagynia",\n \"popularity\": 16016\n },\n {\n \"tag\": "cerebrotonia",\n \"popularity\": 15991\n },\n {\n \"tag\": "deedbox",\n \"popularity\": 15967\n },\n {\n \"tag\": "staab",\n \"popularity\": 15943\n },\n {\n \"tag\": "uratemia",\n \"popularity\": 15918\n },\n {\n \"tag\": "flaunt",\n \"popularity\": 15894\n },\n {\n \"tag\": "bogy",\n \"popularity\": 15870\n },\n {\n \"tag\": "subcartilaginous",\n \"popularity\": 15846\n },\n {\n \"tag\": "protonephridial",\n \"popularity\": 15822\n },\n {\n \"tag\": "Boswellia",\n \"popularity\": 15798\n },\n {\n \"tag\": "relaxant untiaraed protoepiphyte",\n \"popularity\": 15774\n },\n {\n \"tag\": "nesslerization",\n \"popularity\": 15750\n },\n {\n \"tag\": "precession",\n \"popularity\": 15726\n },\n {\n \"tag\": "peat",\n \"popularity\": 15702\n },\n {\n \"tag\": "unbit",\n \"popularity\": 15678\n },\n {\n \"tag\": "snailish",\n \"popularity\": 15655\n },\n {\n \"tag\": "porismatical",\n \"popularity\": 15631\n },\n {\n \"tag\": "hooflike",\n \"popularity\": 15608\n },\n {\n \"tag\": "resuppose phene cranic",\n \"popularity\": 15584\n },\n {\n \"tag\": "peptonization kipskin",\n \"popularity\": 15561\n },\n {\n \"tag\": "birdstone",\n \"popularity\": 15537\n },\n {\n \"tag\": "empty inferoanterior",\n \"popularity\": 15514\n },\n {\n \"tag\": "androtauric",\n \"popularity\": 15491\n },\n {\n \"tag\": "triamide",\n \"popularity\": 15467\n },\n {\n \"tag\": "showmanry",\n \"popularity\": 15444\n },\n {\n \"tag\": "doing",\n \"popularity\": 15421\n },\n {\n \"tag\": "bouchaleen",\n \"popularity\": 15398\n },\n {\n \"tag\": "precollude",\n \"popularity\": 15375\n },\n {\n \"tag\": "finger",\n \"popularity\": 15352\n },\n {\n \"tag\": "limnetic intermessenger",\n \"popularity\": 15329\n },\n {\n \"tag\": "uncharitable picrotoxic",\n \"popularity\": 15306\n },\n {\n \"tag\": "nationalizer Phasmidae",\n \"popularity\": 15283\n },\n {\n \"tag\": "laughingstock",\n \"popularity\": 15261\n },\n {\n \"tag\": "nondeferential",\n \"popularity\": 15238\n },\n {\n \"tag\": "uproariously",\n \"popularity\": 15215\n },\n {\n \"tag\": "manzanilla",\n \"popularity\": 15193\n },\n {\n \"tag\": "khahoon",\n \"popularity\": 15170\n },\n {\n \"tag\": "olericulturally longshanks",\n \"popularity\": 15148\n },\n {\n \"tag\": "enthusiastically methionic",\n \"popularity\": 15125\n },\n {\n \"tag\": "pobs",\n \"popularity\": 15103\n },\n {\n \"tag\": "tricarpellate",\n \"popularity\": 15081\n },\n {\n \"tag\": "souterrain",\n \"popularity\": 15058\n },\n {\n \"tag\": "tethelin",\n \"popularity\": 15036\n },\n {\n \"tag\": "tartle",\n \"popularity\": 15014\n },\n {\n \"tag\": "tidelike",\n \"popularity\": 14992\n },\n {\n \"tag\": "cosmoramic",\n \"popularity\": 14970\n },\n {\n \"tag\": "pretardiness",\n \"popularity\": 14948\n },\n {\n \"tag\": "insoul",\n \"popularity\": 14926\n },\n {\n \"tag\": "anthroxan",\n \"popularity\": 14904\n },\n {\n \"tag\": "jilter",\n \"popularity\": 14882\n },\n {\n \"tag\": "pectinibranchian trematode",\n \"popularity\": 14860\n },\n {\n \"tag\": "Renaissancist",\n \"popularity\": 14838\n },\n {\n \"tag\": "imaginant",\n \"popularity\": 14817\n },\n {\n \"tag\": "supercensure",\n \"popularity\": 14795\n },\n {\n \"tag\": "festilogy",\n \"popularity\": 14773\n },\n {\n \"tag\": "regression",\n \"popularity\": 14752\n },\n {\n \"tag\": "mesobregmate languorously",\n \"popularity\": 14730\n },\n {\n \"tag\": "unsupernaturalized",\n \"popularity\": 14709\n },\n {\n \"tag\": "boobyish",\n \"popularity\": 14687\n },\n {\n \"tag\": "scopolamine",\n \"popularity\": 14666\n },\n {\n \"tag\": "reamputation unchristianly",\n \"popularity\": 14645\n },\n {\n \"tag\": "cuneatic",\n \"popularity\": 14623\n },\n {\n \"tag\": "heathberry",\n \"popularity\": 14602\n },\n {\n \"tag\": "hate",\n \"popularity\": 14581\n },\n {\n \"tag\": "redeemableness",\n \"popularity\": 14560\n },\n {\n \"tag\": "damasse",\n \"popularity\": 14539\n },\n {\n \"tag\": "thrillsome",\n \"popularity\": 14518\n },\n {\n \"tag\": "disseverment",\n \"popularity\": 14497\n },\n {\n \"tag\": "underbishopric Ostyak",\n \"popularity\": 14476\n },\n {\n \"tag\": "Exoascales",\n \"popularity\": 14455\n },\n {\n \"tag\": "soiled",\n \"popularity\": 14434\n },\n {\n \"tag\": "Cain",\n \"popularity\": 14413\n },\n {\n \"tag\": "mismanageable arenae",\n \"popularity\": 14392\n },\n {\n \"tag\": "manducate unhinderably",\n \"popularity\": 14372\n },\n {\n \"tag\": "peregrin",\n \"popularity\": 14351\n },\n {\n \"tag\": "musicianly",\n \"popularity\": 14330\n },\n {\n \"tag\": "aln",\n \"popularity\": 14310\n },\n {\n \"tag\": "intercentrum",\n \"popularity\": 14289\n },\n {\n \"tag\": "roothold",\n \"popularity\": 14269\n },\n {\n \"tag\": "jane aneurism",\n \"popularity\": 14248\n },\n {\n \"tag\": "insinuatively forefeel phytolatrous",\n \"popularity\": 14228\n },\n {\n \"tag\": "kanchil",\n \"popularity\": 14208\n },\n {\n \"tag\": "Austrophile",\n \"popularity\": 14187\n },\n {\n \"tag\": "unterrorized",\n \"popularity\": 14167\n },\n {\n \"tag\": "admeasure",\n \"popularity\": 14147\n },\n {\n \"tag\": "electrodissolution",\n \"popularity\": 14127\n },\n {\n \"tag\": "unweddedly",\n \"popularity\": 14107\n },\n {\n \"tag\": "unannoying",\n \"popularity\": 14087\n },\n {\n \"tag\": "uningenuous",\n \"popularity\": 14067\n },\n {\n \"tag\": "omnibenevolent",\n \"popularity\": 14047\n },\n {\n \"tag\": "commissure",\n \"popularity\": 14027\n },\n {\n \"tag\": "tellureted",\n \"popularity\": 14007\n },\n {\n \"tag\": "suffragan",\n \"popularity\": 13987\n },\n {\n \"tag\": "sphaeriaceous",\n \"popularity\": 13967\n },\n {\n \"tag\": "unfearing",\n \"popularity\": 13947\n },\n {\n \"tag\": "stentoriousness precounsellor",\n \"popularity\": 13928\n },\n {\n \"tag\": "haemaspectroscope",\n \"popularity\": 13908\n },\n {\n \"tag\": "teras",\n \"popularity\": 13888\n },\n {\n \"tag\": "pulicine",\n \"popularity\": 13869\n },\n {\n \"tag\": "colicystopyelitis",\n \"popularity\": 13849\n },\n {\n \"tag\": "Physalia",\n \"popularity\": 13830\n },\n {\n \"tag\": "Saxicolidae",\n \"popularity\": 13810\n },\n {\n \"tag\": "peritonital",\n \"popularity\": 13791\n },\n {\n \"tag\": "dysphotic",\n \"popularity\": 13771\n },\n {\n \"tag\": "unabandoned",\n \"popularity\": 13752\n },\n {\n \"tag\": "rashful",\n \"popularity\": 13733\n },\n {\n \"tag\": "goodyness Manobo",\n \"popularity\": 13714\n },\n {\n \"tag\": "glaring",\n \"popularity\": 13694\n },\n {\n \"tag\": "horrorful",\n \"popularity\": 13675\n },\n {\n \"tag\": "intercepting",\n \"popularity\": 13656\n },\n {\n \"tag\": "semifine",\n \"popularity\": 13637\n },\n {\n \"tag\": "Gaypoo",\n \"popularity\": 13618\n },\n {\n \"tag\": "Metrosideros",\n \"popularity\": 13599\n },\n {\n \"tag\": "thoracicolumbar",\n \"popularity\": 13580\n },\n {\n \"tag\": "unserried",\n \"popularity\": 13561\n },\n {\n \"tag\": "keeperess cauterization",\n \"popularity\": 13542\n },\n {\n \"tag\": "administrant",\n \"popularity\": 13523\n },\n {\n \"tag\": "unpropitiatedness",\n \"popularity\": 13505\n },\n {\n \"tag\": "pensileness",\n \"popularity\": 13486\n },\n {\n \"tag\": "quinaldic unreceivable",\n \"popularity\": 13467\n },\n {\n \"tag\": "Carnaria",\n \"popularity\": 13448\n },\n {\n \"tag\": "azothionium wurrus",\n \"popularity\": 13430\n },\n {\n \"tag\": "mistresshood",\n \"popularity\": 13411\n },\n {\n \"tag\": "Savara",\n \"popularity\": 13393\n },\n {\n \"tag\": "dasyurine",\n \"popularity\": 13374\n },\n {\n \"tag\": "superideal",\n \"popularity\": 13356\n },\n {\n \"tag\": "Parisianize",\n \"popularity\": 13337\n },\n {\n \"tag\": "underearth",\n \"popularity\": 13319\n },\n {\n \"tag\": "athrogenic",\n \"popularity\": 13301\n },\n {\n \"tag\": "communicate",\n \"popularity\": 13282\n },\n {\n \"tag\": "denervation enworthed",\n \"popularity\": 13264\n },\n {\n \"tag\": "subbromide",\n \"popularity\": 13246\n },\n {\n \"tag\": "stenocoriasis",\n \"popularity\": 13228\n },\n {\n \"tag\": "facetiousness",\n \"popularity\": 13209\n },\n {\n \"tag\": "twaddling",\n \"popularity\": 13191\n },\n {\n \"tag\": "tetartoconid",\n \"popularity\": 13173\n },\n {\n \"tag\": "audiophile",\n \"popularity\": 13155\n },\n {\n \"tag\": "fustigate",\n \"popularity\": 13137\n },\n {\n \"tag\": "Sorbian cacophonia",\n \"popularity\": 13119\n },\n {\n \"tag\": "fondish",\n \"popularity\": 13101\n },\n {\n \"tag\": "endomastoiditis",\n \"popularity\": 13084\n },\n {\n \"tag\": "sniptious",\n \"popularity\": 13066\n },\n {\n \"tag\": "glochidiate",\n \"popularity\": 13048\n },\n {\n \"tag\": "polycarboxylic",\n \"popularity\": 13030\n },\n {\n \"tag\": "stamp",\n \"popularity\": 13012\n },\n {\n \"tag\": "tritonymph endotoxoid",\n \"popularity\": 12995\n },\n {\n \"tag\": "wolfskin",\n \"popularity\": 12977\n },\n {\n \"tag\": "oncosimeter",\n \"popularity\": 12959\n },\n {\n \"tag\": "outward",\n \"popularity\": 12942\n },\n {\n \"tag\": "circumscribed",\n \"popularity\": 12924\n },\n {\n \"tag\": "autohemolytic",\n \"popularity\": 12907\n },\n {\n \"tag\": "isorhamnose",\n \"popularity\": 12889\n },\n {\n \"tag\": "monarchomachic",\n \"popularity\": 12872\n },\n {\n \"tag\": "phaenomenon",\n \"popularity\": 12855\n },\n {\n \"tag\": "angiopressure",\n \"popularity\": 12837\n },\n {\n \"tag\": "similarize",\n \"popularity\": 12820\n },\n {\n \"tag\": "unseeable",\n \"popularity\": 12803\n },\n {\n \"tag\": "Toryize",\n \"popularity\": 12785\n },\n {\n \"tag\": "fruitling",\n \"popularity\": 12768\n },\n {\n \"tag\": "axle",\n \"popularity\": 12751\n },\n {\n \"tag\": "priestal cocked",\n \"popularity\": 12734\n },\n {\n \"tag\": "serotoxin",\n \"popularity\": 12717\n },\n {\n \"tag\": "unmovably",\n \"popularity\": 12700\n },\n {\n \"tag\": "darbha",\n \"popularity\": 12683\n },\n {\n \"tag\": "Mongolize",\n \"popularity\": 12666\n },\n {\n \"tag\": "clusteringly",\n \"popularity\": 12649\n },\n {\n \"tag\": "tendence",\n \"popularity\": 12632\n },\n {\n \"tag\": "foziness",\n \"popularity\": 12615\n },\n {\n \"tag\": "brickkiln lithify",\n \"popularity\": 12598\n },\n {\n \"tag\": "unpriest",\n \"popularity\": 12581\n },\n {\n \"tag\": "convincer",\n \"popularity\": 12564\n },\n {\n \"tag\": "mornlike",\n \"popularity\": 12548\n },\n {\n \"tag\": "overaddiction ostentatiousness",\n \"popularity\": 12531\n },\n {\n \"tag\": "diffusively moccasin pendom",\n \"popularity\": 12514\n },\n {\n \"tag\": "boose",\n \"popularity\": 12498\n },\n {\n \"tag\": "myonosus",\n \"popularity\": 12481\n },\n {\n \"tag\": "handsome",\n \"popularity\": 12464\n },\n {\n \"tag\": "paroxysmic",\n \"popularity\": 12448\n },\n {\n \"tag\": "Ulidian",\n \"popularity\": 12431\n },\n {\n \"tag\": "heartache",\n \"popularity\": 12415\n },\n {\n \"tag\": "torporize",\n \"popularity\": 12398\n },\n {\n \"tag\": "hippish",\n \"popularity\": 12382\n },\n {\n \"tag\": "stigmal militation",\n \"popularity\": 12366\n },\n {\n \"tag\": "matmaker",\n \"popularity\": 12349\n },\n {\n \"tag\": "marantaceous bivoluminous",\n \"popularity\": 12333\n },\n {\n \"tag\": "Uraniidae",\n \"popularity\": 12317\n },\n {\n \"tag\": "risper",\n \"popularity\": 12301\n },\n {\n \"tag\": "tintinnabulation",\n \"popularity\": 12284\n },\n {\n \"tag\": "tributorian",\n \"popularity\": 12268\n },\n {\n \"tag\": "ashamedly",\n \"popularity\": 12252\n },\n {\n \"tag\": "Macrourus",\n \"popularity\": 12236\n },\n {\n \"tag\": "Chora",\n \"popularity\": 12220\n },\n {\n \"tag\": "caul",\n \"popularity\": 12204\n },\n {\n \"tag\": "exsector",\n \"popularity\": 12188\n },\n {\n \"tag\": "acutish",\n \"popularity\": 12172\n },\n {\n \"tag\": "amphichrome",\n \"popularity\": 12156\n },\n {\n \"tag\": "guarder",\n \"popularity\": 12140\n },\n {\n \"tag\": "sculpturally",\n \"popularity\": 12124\n },\n {\n \"tag\": "benightmare",\n \"popularity\": 12108\n },\n {\n \"tag\": "chucky",\n \"popularity\": 12093\n },\n {\n \"tag\": "Venetian",\n \"popularity\": 12077\n },\n {\n \"tag\": "autotheater",\n \"popularity\": 12061\n },\n {\n \"tag\": "planarioid",\n \"popularity\": 12045\n },\n {\n \"tag\": "handkerchiefful",\n \"popularity\": 12030\n },\n {\n \"tag\": "fuliginousness potentize",\n \"popularity\": 12014\n },\n {\n \"tag\": "pantheum",\n \"popularity\": 11998\n },\n {\n \"tag\": "heavyweight",\n \"popularity\": 11983\n },\n {\n \"tag\": "unbrick",\n \"popularity\": 11967\n },\n {\n \"tag\": "duomachy",\n \"popularity\": 11952\n },\n {\n \"tag\": "polyphyodont",\n \"popularity\": 11936\n },\n {\n \"tag\": "hibernacle",\n \"popularity\": 11921\n },\n {\n \"tag\": "undistend",\n \"popularity\": 11905\n },\n {\n \"tag\": "hystericky",\n \"popularity\": 11890\n },\n {\n \"tag\": "paleolimnology",\n \"popularity\": 11875\n },\n {\n \"tag\": "cedarware",\n \"popularity\": 11859\n },\n {\n \"tag\": "overwrested",\n \"popularity\": 11844\n },\n {\n \"tag\": "Syriacism",\n \"popularity\": 11829\n },\n {\n \"tag\": "pretan",\n \"popularity\": 11813\n },\n {\n \"tag\": "formant",\n \"popularity\": 11798\n },\n {\n \"tag\": "pharmacopoeist Fedia",\n \"popularity\": 11783\n },\n {\n \"tag\": "exorcist eerisome",\n \"popularity\": 11768\n },\n {\n \"tag\": "separation",\n \"popularity\": 11753\n },\n {\n \"tag\": "infancy",\n \"popularity\": 11738\n },\n {\n \"tag\": "ecrasite",\n \"popularity\": 11723\n },\n {\n \"tag\": "propolize",\n \"popularity\": 11708\n },\n {\n \"tag\": "uncram phyllin",\n \"popularity\": 11693\n },\n {\n \"tag\": "thymopathy",\n \"popularity\": 11678\n },\n {\n \"tag\": "omniscient",\n \"popularity\": 11663\n },\n {\n \"tag\": "coussinet hazer",\n \"popularity\": 11648\n },\n {\n \"tag\": "contributiveness",\n \"popularity\": 11633\n },\n {\n \"tag\": "septifluous",\n \"popularity\": 11618\n },\n {\n \"tag\": "halfness",\n \"popularity\": 11603\n },\n {\n \"tag\": "tocher",\n \"popularity\": 11589\n },\n {\n \"tag\": "monotonist",\n \"popularity\": 11574\n },\n {\n \"tag\": "headchair",\n \"popularity\": 11559\n },\n {\n \"tag\": "everywhence",\n \"popularity\": 11544\n },\n {\n \"tag\": "gerate",\n \"popularity\": 11530\n },\n {\n \"tag\": "unrepellent",\n \"popularity\": 11515\n },\n {\n \"tag\": "inidoneous",\n \"popularity\": 11500\n },\n {\n \"tag\": "Rifi",\n \"popularity\": 11486\n },\n {\n \"tag\": "unstop",\n \"popularity\": 11471\n },\n {\n \"tag\": "conformer",\n \"popularity\": 11457\n },\n {\n \"tag\": "vivisectionally",\n \"popularity\": 11442\n },\n {\n \"tag\": "nonfinishing",\n \"popularity\": 11428\n },\n {\n \"tag\": "tyranness",\n \"popularity\": 11413\n },\n {\n \"tag\": "shepherdage havoc",\n \"popularity\": 11399\n },\n {\n \"tag\": "coronale",\n \"popularity\": 11385\n },\n {\n \"tag\": "airmarker",\n \"popularity\": 11370\n },\n {\n \"tag\": "subpanel",\n \"popularity\": 11356\n },\n {\n \"tag\": "conciliation",\n \"popularity\": 11342\n },\n {\n \"tag\": "supergun",\n \"popularity\": 11327\n },\n {\n \"tag\": "photoheliography",\n \"popularity\": 11313\n },\n {\n \"tag\": "cacosmia",\n \"popularity\": 11299\n },\n {\n \"tag\": "caressant",\n \"popularity\": 11285\n },\n {\n \"tag\": "swivet",\n \"popularity\": 11270\n },\n {\n \"tag\": "coddler",\n \"popularity\": 11256\n },\n {\n \"tag\": "rakehellish",\n \"popularity\": 11242\n },\n {\n \"tag\": "recohabitation",\n \"popularity\": 11228\n },\n {\n \"tag\": "postillator",\n \"popularity\": 11214\n },\n {\n \"tag\": "receipt",\n \"popularity\": 11200\n },\n {\n \"tag\": "nonconformistical",\n \"popularity\": 11186\n },\n {\n \"tag\": "unglorified",\n \"popularity\": 11172\n },\n {\n \"tag\": "unordinariness",\n \"popularity\": 11158\n },\n {\n \"tag\": "tetrahydroxy",\n \"popularity\": 11144\n },\n {\n \"tag\": "haploperistomic corporeity",\n \"popularity\": 11130\n },\n {\n \"tag\": "varical",\n \"popularity\": 11117\n },\n {\n \"tag\": "pilferment",\n \"popularity\": 11103\n },\n {\n \"tag\": "reverentially playcraft",\n \"popularity\": 11089\n },\n {\n \"tag\": "unretentive",\n \"popularity\": 11075\n },\n {\n \"tag\": "readiness",\n \"popularity\": 11061\n },\n {\n \"tag\": "thermomagnetism",\n \"popularity\": 11048\n },\n {\n \"tag\": "spotless",\n \"popularity\": 11034\n },\n {\n \"tag\": "semishrubby",\n \"popularity\": 11020\n },\n {\n \"tag\": "metrotomy",\n \"popularity\": 11007\n },\n {\n \"tag\": "hocker",\n \"popularity\": 10993\n },\n {\n \"tag\": "anecdotal",\n \"popularity\": 10979\n },\n {\n \"tag\": "tetrabelodont",\n \"popularity\": 10966\n },\n {\n \"tag\": "Ramillied",\n \"popularity\": 10952\n },\n {\n \"tag\": "sympatheticism",\n \"popularity\": 10939\n },\n {\n \"tag\": "kiskatom",\n \"popularity\": 10925\n },\n {\n \"tag\": "concyclically",\n \"popularity\": 10912\n },\n {\n \"tag\": "tunicless",\n \"popularity\": 10899\n },\n {\n \"tag\": "formalistic",\n \"popularity\": 10885\n },\n {\n \"tag\": "thermacogenesis",\n \"popularity\": 10872\n },\n {\n \"tag\": "multimotored",\n \"popularity\": 10858\n },\n {\n \"tag\": "inversive",\n \"popularity\": 10845\n },\n {\n \"tag\": "Jatki",\n \"popularity\": 10832\n },\n {\n \"tag\": "highest",\n \"popularity\": 10818\n },\n {\n \"tag\": "rubidic",\n \"popularity\": 10805\n },\n {\n \"tag\": "acranial",\n \"popularity\": 10792\n },\n {\n \"tag\": "pulvinulus",\n \"popularity\": 10779\n },\n {\n \"tag\": "nattiness",\n \"popularity\": 10766\n },\n {\n \"tag\": "antisimoniacal",\n \"popularity\": 10752\n },\n {\n \"tag\": "tetanize",\n \"popularity\": 10739\n },\n {\n \"tag\": "spectrophobia",\n \"popularity\": 10726\n },\n {\n \"tag\": "monopolitical",\n \"popularity\": 10713\n },\n {\n \"tag\": "teallite",\n \"popularity\": 10700\n },\n {\n \"tag\": "alicyclic interpellator",\n \"popularity\": 10687\n },\n {\n \"tag\": "nonsynthesized",\n \"popularity\": 10674\n },\n {\n \"tag\": "wheelwrighting",\n \"popularity\": 10661\n },\n {\n \"tag\": "pelliculate",\n \"popularity\": 10648\n },\n {\n \"tag\": "Euphyllopoda",\n \"popularity\": 10635\n },\n {\n \"tag\": "graver",\n \"popularity\": 10622\n },\n {\n \"tag\": "automorph",\n \"popularity\": 10609\n },\n {\n \"tag\": "underhanded",\n \"popularity\": 10597\n },\n {\n \"tag\": "causal",\n \"popularity\": 10584\n },\n {\n \"tag\": "odoom",\n \"popularity\": 10571\n },\n {\n \"tag\": "apodictical",\n \"popularity\": 10558\n },\n {\n \"tag\": "foundery",\n \"popularity\": 10545\n },\n {\n \"tag\": "unneighbored",\n \"popularity\": 10533\n },\n {\n \"tag\": "woolshearing",\n \"popularity\": 10520\n },\n {\n \"tag\": "boschveld",\n \"popularity\": 10507\n },\n {\n \"tag\": "unhardened lipopod",\n \"popularity\": 10495\n },\n {\n \"tag\": "unenriching",\n \"popularity\": 10482\n },\n {\n \"tag\": "spak",\n \"popularity\": 10469\n },\n {\n \"tag\": "yogasana",\n \"popularity\": 10457\n },\n {\n \"tag\": "depoetize",\n \"popularity\": 10444\n },\n {\n \"tag\": "parousiamania",\n \"popularity\": 10432\n },\n {\n \"tag\": "longlegs",\n \"popularity\": 10419\n },\n {\n \"tag\": "gelatinizability",\n \"popularity\": 10407\n },\n {\n \"tag\": "edeology",\n \"popularity\": 10394\n },\n {\n \"tag\": "sodwork",\n \"popularity\": 10382\n },\n {\n \"tag\": "somnambule",\n \"popularity\": 10369\n },\n {\n \"tag\": "antiquing",\n \"popularity\": 10357\n },\n {\n \"tag\": "intaker",\n \"popularity\": 10344\n },\n {\n \"tag\": "Gerberia",\n \"popularity\": 10332\n },\n {\n \"tag\": "preadmit",\n \"popularity\": 10320\n },\n {\n \"tag\": "bullhorn",\n \"popularity\": 10307\n },\n {\n \"tag\": "sororal",\n \"popularity\": 10295\n },\n {\n \"tag\": "phaeophyceous",\n \"popularity\": 10283\n },\n {\n \"tag\": "omphalopsychite",\n \"popularity\": 10271\n },\n {\n \"tag\": "substantious",\n \"popularity\": 10258\n },\n {\n \"tag\": "undemonstratively",\n \"popularity\": 10246\n },\n {\n \"tag\": "corallike blackit",\n \"popularity\": 10234\n },\n {\n \"tag\": "amoebous",\n \"popularity\": 10222\n },\n {\n \"tag\": "Polypodium",\n \"popularity\": 10210\n },\n {\n \"tag\": "blodite",\n \"popularity\": 10198\n },\n {\n \"tag\": "hordarian",\n \"popularity\": 10186\n },\n {\n \"tag\": "nonmoral",\n \"popularity\": 10174\n },\n {\n \"tag\": "dredgeful",\n \"popularity\": 10162\n },\n {\n \"tag\": "nourishingly",\n \"popularity\": 10150\n },\n {\n \"tag\": "seamy",\n \"popularity\": 10138\n },\n {\n \"tag\": "vara",\n \"popularity\": 10126\n },\n {\n \"tag\": "incorruptibleness",\n \"popularity\": 10114\n },\n {\n \"tag\": "manipulator",\n \"popularity\": 10102\n },\n {\n \"tag\": "chromodiascope uncountably",\n \"popularity\": 10090\n },\n {\n \"tag\": "typhemia",\n \"popularity\": 10078\n },\n {\n \"tag\": "Smalcaldic",\n \"popularity\": 10066\n },\n {\n \"tag\": "precontrive",\n \"popularity\": 10054\n },\n {\n \"tag\": "sowarry",\n \"popularity\": 10042\n },\n {\n \"tag\": "monopodic",\n \"popularity\": 10031\n },\n {\n \"tag\": "recodify",\n \"popularity\": 10019\n },\n {\n \"tag\": "phosphowolframic rimple",\n \"popularity\": 10007\n },\n {\n \"tag\": "triconch",\n \"popularity\": 9995\n },\n {\n \"tag\": "pycnodontoid",\n \"popularity\": 9984\n },\n {\n \"tag\": "bradyspermatism",\n \"popularity\": 9972\n },\n {\n \"tag\": "extensionist",\n \"popularity\": 9960\n },\n {\n \"tag\": "characterize",\n \"popularity\": 9949\n },\n {\n \"tag\": "anatreptic proteolytic",\n \"popularity\": 9937\n },\n {\n \"tag\": "waterboard",\n \"popularity\": 9925\n },\n {\n \"tag\": "allopathically",\n \"popularity\": 9914\n },\n {\n \"tag\": "arithmetician",\n \"popularity\": 9902\n },\n {\n \"tag\": "subsist",\n \"popularity\": 9891\n },\n {\n \"tag\": "Islamitish",\n \"popularity\": 9879\n },\n {\n \"tag\": "biddy",\n \"popularity\": 9868\n },\n {\n \"tag\": "reverberation",\n \"popularity\": 9856\n },\n {\n \"tag\": "Zaporogue",\n \"popularity\": 9845\n },\n {\n \"tag\": "soapberry",\n \"popularity\": 9833\n },\n {\n \"tag\": "physiognomics",\n \"popularity\": 9822\n },\n {\n \"tag\": "hospitalization",\n \"popularity\": 9810\n },\n {\n \"tag\": "dissembler",\n \"popularity\": 9799\n },\n {\n \"tag\": "festinate",\n \"popularity\": 9788\n },\n {\n \"tag\": "angiectopia",\n \"popularity\": 9776\n },\n {\n \"tag\": "Pulicidae",\n \"popularity\": 9765\n },\n {\n \"tag\": "beslimer",\n \"popularity\": 9754\n },\n {\n \"tag\": "nontreaty",\n \"popularity\": 9743\n },\n {\n \"tag\": "unhaggled",\n \"popularity\": 9731\n },\n {\n \"tag\": "catfall",\n \"popularity\": 9720\n },\n {\n \"tag\": "stola",\n \"popularity\": 9709\n },\n {\n \"tag\": "pataco",\n \"popularity\": 9698\n },\n {\n \"tag\": "ontologistic",\n \"popularity\": 9686\n },\n {\n \"tag\": "aerosphere",\n \"popularity\": 9675\n },\n {\n \"tag\": "deobstruent",\n \"popularity\": 9664\n },\n {\n \"tag\": "threepence",\n \"popularity\": 9653\n },\n {\n \"tag\": "cyprinoid",\n \"popularity\": 9642\n },\n {\n \"tag\": "overbank",\n \"popularity\": 9631\n },\n {\n \"tag\": "prostyle",\n \"popularity\": 9620\n },\n {\n \"tag\": "photoactivation",\n \"popularity\": 9609\n },\n {\n \"tag\": "homothetic",\n \"popularity\": 9598\n },\n {\n \"tag\": "roguedom",\n \"popularity\": 9587\n },\n {\n \"tag\": "underschool",\n \"popularity\": 9576\n },\n {\n \"tag\": "tractility",\n \"popularity\": 9565\n },\n {\n \"tag\": "gardenin",\n \"popularity\": 9554\n },\n {\n \"tag\": "Micromastictora",\n \"popularity\": 9543\n },\n {\n \"tag\": "gossypine",\n \"popularity\": 9532\n },\n {\n \"tag\": "amylodyspepsia",\n \"popularity\": 9521\n },\n {\n \"tag\": "Luciana",\n \"popularity\": 9510\n },\n {\n \"tag\": "meetly nonfisherman",\n \"popularity\": 9500\n },\n {\n \"tag\": "backhanded",\n \"popularity\": 9489\n },\n {\n \"tag\": "decrustation",\n \"popularity\": 9478\n },\n {\n \"tag\": "pinrail",\n \"popularity\": 9467\n },\n {\n \"tag\": "Mahori",\n \"popularity\": 9456\n },\n {\n \"tag\": "unsizable",\n \"popularity\": 9446\n },\n {\n \"tag\": "disawa",\n \"popularity\": 9435\n },\n {\n \"tag\": "launderability inconsidered",\n \"popularity\": 9424\n },\n {\n \"tag\": "unclassical",\n \"popularity\": 9414\n },\n {\n \"tag\": "inobtrusiveness",\n \"popularity\": 9403\n },\n {\n \"tag\": "sialogenous",\n \"popularity\": 9392\n },\n {\n \"tag\": "sulphonamide",\n \"popularity\": 9382\n },\n {\n \"tag\": "diluvion",\n \"popularity\": 9371\n },\n {\n \"tag\": "deuteranope",\n \"popularity\": 9361\n },\n {\n \"tag\": "addition",\n \"popularity\": 9350\n },\n {\n \"tag\": "bockeret",\n \"popularity\": 9339\n },\n {\n \"tag\": "unidentified",\n \"popularity\": 9329\n },\n {\n \"tag\": "caryatic",\n \"popularity\": 9318\n },\n {\n \"tag\": "misattribution",\n \"popularity\": 9308\n },\n {\n \"tag\": "outray",\n \"popularity\": 9297\n },\n {\n \"tag\": "areometrical",\n \"popularity\": 9287\n },\n {\n \"tag\": "antilogism",\n \"popularity\": 9277\n },\n {\n \"tag\": "inadjustable",\n \"popularity\": 9266\n },\n {\n \"tag\": "byssus",\n \"popularity\": 9256\n },\n {\n \"tag\": "trun",\n \"popularity\": 9245\n },\n {\n \"tag\": "thereology",\n \"popularity\": 9235\n },\n {\n \"tag\": "extort",\n \"popularity\": 9225\n },\n {\n \"tag\": "bumpkin",\n \"popularity\": 9214\n },\n {\n \"tag\": "sulphobenzide",\n \"popularity\": 9204\n },\n {\n \"tag\": "hydrogeology",\n \"popularity\": 9194\n },\n {\n \"tag\": "nidulariaceous",\n \"popularity\": 9183\n },\n {\n \"tag\": "propodiale",\n \"popularity\": 9173\n },\n {\n \"tag\": "fierily",\n \"popularity\": 9163\n },\n {\n \"tag\": "aerotonometry",\n \"popularity\": 9153\n },\n {\n \"tag\": "pelobatid oversuperstitious",\n \"popularity\": 9142\n },\n {\n \"tag\": "restringent",\n \"popularity\": 9132\n },\n {\n \"tag\": "tetrapodic",\n \"popularity\": 9122\n },\n {\n \"tag\": "heroicness Vendidad",\n \"popularity\": 9112\n },\n {\n \"tag\": "Sphingurus",\n \"popularity\": 9102\n },\n {\n \"tag\": "sclerote",\n \"popularity\": 9092\n },\n {\n \"tag\": "unkeyed",\n \"popularity\": 9082\n },\n {\n \"tag\": "superparliamentary",\n \"popularity\": 9072\n },\n {\n \"tag\": "hetericism",\n \"popularity\": 9061\n },\n {\n \"tag\": "hucklebone",\n \"popularity\": 9051\n },\n {\n \"tag\": "yojan",\n \"popularity\": 9041\n },\n {\n \"tag\": "bossed",\n \"popularity\": 9031\n },\n {\n \"tag\": "spiderwork",\n \"popularity\": 9021\n },\n {\n \"tag\": "millfeed dullery",\n \"popularity\": 9011\n },\n {\n \"tag\": "adnoun",\n \"popularity\": 9001\n },\n {\n \"tag\": "mesometric",\n \"popularity\": 8992\n },\n {\n \"tag\": "doublehandedness",\n \"popularity\": 8982\n },\n {\n \"tag\": "suppurant",\n \"popularity\": 8972\n },\n {\n \"tag\": "Berlinize",\n \"popularity\": 8962\n },\n {\n \"tag\": "sontag",\n \"popularity\": 8952\n },\n {\n \"tag\": "biplane",\n \"popularity\": 8942\n },\n {\n \"tag\": "insula",\n \"popularity\": 8932\n },\n {\n \"tag\": "unbrand",\n \"popularity\": 8922\n },\n {\n \"tag\": "Basilosaurus",\n \"popularity\": 8913\n },\n {\n \"tag\": "prenomination",\n \"popularity\": 8903\n },\n {\n \"tag\": "untextual",\n \"popularity\": 8893\n },\n {\n \"tag\": "coleslaw",\n \"popularity\": 8883\n },\n {\n \"tag\": "langsyne",\n \"popularity\": 8874\n },\n {\n \"tag\": "impede",\n \"popularity\": 8864\n },\n {\n \"tag\": "irrigator",\n \"popularity\": 8854\n },\n {\n \"tag\": "deflocculation",\n \"popularity\": 8844\n },\n {\n \"tag\": "narghile",\n \"popularity\": 8835\n },\n {\n \"tag\": "unguardedly ebenaceous",\n \"popularity\": 8825\n },\n {\n \"tag\": "conversantly subocular",\n \"popularity\": 8815\n },\n {\n \"tag\": "hydroponic",\n \"popularity\": 8806\n },\n {\n \"tag\": "anthropopsychism",\n \"popularity\": 8796\n },\n {\n \"tag\": "panoptic",\n \"popularity\": 8787\n },\n {\n \"tag\": "insufferable",\n \"popularity\": 8777\n },\n {\n \"tag\": "salema",\n \"popularity\": 8768\n },\n {\n \"tag\": "Myriapoda",\n \"popularity\": 8758\n },\n {\n \"tag\": "regarrison",\n \"popularity\": 8748\n },\n {\n \"tag\": "overlearned",\n \"popularity\": 8739\n },\n {\n \"tag\": "ultraroyalist conventical bureaucratical",\n \"popularity\": 8729\n },\n {\n \"tag\": "epicaridan",\n \"popularity\": 8720\n },\n {\n \"tag\": "poetastress",\n \"popularity\": 8711\n },\n {\n \"tag\": "monophthalmus",\n \"popularity\": 8701\n },\n {\n \"tag\": "simnel",\n \"popularity\": 8692\n },\n {\n \"tag\": "compotor",\n \"popularity\": 8682\n },\n {\n \"tag\": "hydrolase",\n \"popularity\": 8673\n },\n {\n \"tag\": "attemptless",\n \"popularity\": 8663\n },\n {\n \"tag\": "visceroptosis",\n \"popularity\": 8654\n },\n {\n \"tag\": "unpreparedly",\n \"popularity\": 8645\n },\n {\n \"tag\": "mastage",\n \"popularity\": 8635\n },\n {\n \"tag\": "preinfluence",\n \"popularity\": 8626\n },\n {\n \"tag\": "Siwan",\n \"popularity\": 8617\n },\n {\n \"tag\": "ceratotheca belvedere",\n \"popularity\": 8607\n },\n {\n \"tag\": "disenablement",\n \"popularity\": 8598\n },\n {\n \"tag\": "nine",\n \"popularity\": 8589\n },\n {\n \"tag\": "spellingdown abridgment",\n \"popularity\": 8580\n },\n {\n \"tag\": "twilightless",\n \"popularity\": 8571\n },\n {\n \"tag\": "overflow",\n \"popularity\": 8561\n },\n {\n \"tag\": "mismeasurement",\n \"popularity\": 8552\n },\n {\n \"tag\": "nawabship",\n \"popularity\": 8543\n },\n {\n \"tag\": "Phrynosoma",\n \"popularity\": 8534\n },\n {\n \"tag\": "unanticipatingly",\n \"popularity\": 8525\n },\n {\n \"tag\": "blankite",\n \"popularity\": 8516\n },\n {\n \"tag\": "role",\n \"popularity\": 8506\n },\n {\n \"tag\": "peperine edelweiss",\n \"popularity\": 8497\n },\n {\n \"tag\": "unhysterical",\n \"popularity\": 8488\n },\n {\n \"tag\": "attentiveness",\n \"popularity\": 8479\n },\n {\n \"tag\": "scintillant",\n \"popularity\": 8470\n },\n {\n \"tag\": "stenostomatous",\n \"popularity\": 8461\n },\n {\n \"tag\": "pectinite",\n \"popularity\": 8452\n },\n {\n \"tag\": "herring",\n \"popularity\": 8443\n },\n {\n \"tag\": "interroom",\n \"popularity\": 8434\n },\n {\n \"tag\": "laccol",\n \"popularity\": 8425\n },\n {\n \"tag\": "unpartably kylite",\n \"popularity\": 8416\n },\n {\n \"tag\": "spirivalve",\n \"popularity\": 8407\n },\n {\n \"tag\": "hoosegow",\n \"popularity\": 8398\n },\n {\n \"tag\": "doat",\n \"popularity\": 8389\n },\n {\n \"tag\": "amphibian",\n \"popularity\": 8380\n },\n {\n \"tag\": "exposit",\n \"popularity\": 8371\n },\n {\n \"tag\": "canopy",\n \"popularity\": 8363\n },\n {\n \"tag\": "houndlike",\n \"popularity\": 8354\n },\n {\n \"tag\": "spikebill",\n \"popularity\": 8345\n },\n {\n \"tag\": "wiseacre pyrotechnic",\n \"popularity\": 8336\n },\n {\n \"tag\": "confessingly woodman",\n \"popularity\": 8327\n },\n {\n \"tag\": "overside",\n \"popularity\": 8318\n },\n {\n \"tag\": "oftwhiles",\n \"popularity\": 8310\n },\n {\n \"tag\": "Musophagidae",\n \"popularity\": 8301\n },\n {\n \"tag\": "slumberer",\n \"popularity\": 8292\n },\n {\n \"tag\": "leiotrichy",\n \"popularity\": 8283\n },\n {\n \"tag\": "Mantispidae",\n \"popularity\": 8275\n },\n {\n \"tag\": "perceptually",\n \"popularity\": 8266\n },\n {\n \"tag\": "biller",\n \"popularity\": 8257\n },\n {\n \"tag\": "eudaemonical",\n \"popularity\": 8249\n },\n {\n \"tag\": "underfiend",\n \"popularity\": 8240\n },\n {\n \"tag\": "impartible",\n \"popularity\": 8231\n },\n {\n \"tag\": "saxicavous",\n \"popularity\": 8223\n },\n {\n \"tag\": "yapster",\n \"popularity\": 8214\n },\n {\n \"tag\": "aliseptal",\n \"popularity\": 8205\n },\n {\n \"tag\": "omniparient",\n \"popularity\": 8197\n },\n {\n \"tag\": "nishiki",\n \"popularity\": 8188\n },\n {\n \"tag\": "yuzluk",\n \"popularity\": 8180\n },\n {\n \"tag\": "solderer",\n \"popularity\": 8171\n },\n {\n \"tag\": "Pinna",\n \"popularity\": 8162\n },\n {\n \"tag\": "reinterfere",\n \"popularity\": 8154\n },\n {\n \"tag\": "superepic",\n \"popularity\": 8145\n },\n {\n \"tag\": "ronquil",\n \"popularity\": 8137\n },\n {\n \"tag\": "bratstvo",\n \"popularity\": 8128\n },\n {\n \"tag\": "Thea",\n \"popularity\": 8120\n },\n {\n \"tag\": "hermaphroditical",\n \"popularity\": 8111\n },\n {\n \"tag\": "enlief",\n \"popularity\": 8103\n },\n {\n \"tag\": "Jesuate",\n \"popularity\": 8095\n },\n {\n \"tag\": "gaysome",\n \"popularity\": 8086\n },\n {\n \"tag\": "iliohypogastric",\n \"popularity\": 8078\n },\n {\n \"tag\": "regardance",\n \"popularity\": 8069\n },\n {\n \"tag\": "cumulately",\n \"popularity\": 8061\n },\n {\n \"tag\": "haustorial nucleolocentrosome",\n \"popularity\": 8053\n },\n {\n \"tag\": "cosmocrat",\n \"popularity\": 8044\n },\n {\n \"tag\": "onyxitis",\n \"popularity\": 8036\n },\n {\n \"tag\": "Cabinda",\n \"popularity\": 8028\n },\n {\n \"tag\": "coresort",\n \"popularity\": 8019\n },\n {\n \"tag\": "drusy preformant",\n \"popularity\": 8011\n },\n {\n \"tag\": "piningly",\n \"popularity\": 8003\n },\n {\n \"tag\": "bootlessly",\n \"popularity\": 7994\n },\n {\n \"tag\": "talari",\n \"popularity\": 7986\n },\n {\n \"tag\": "amidoacetal",\n \"popularity\": 7978\n },\n {\n \"tag\": "pschent",\n \"popularity\": 7970\n },\n {\n \"tag\": "consumptional scarer titivate",\n \"popularity\": 7962\n },\n {\n \"tag\": "Anserinae",\n \"popularity\": 7953\n },\n {\n \"tag\": "flaunter",\n \"popularity\": 7945\n },\n {\n \"tag\": "reindeer",\n \"popularity\": 7937\n },\n {\n \"tag\": "disparage",\n \"popularity\": 7929\n },\n {\n \"tag\": "superheat",\n \"popularity\": 7921\n },\n {\n \"tag\": "Chromatium",\n \"popularity\": 7912\n },\n {\n \"tag\": "Tina",\n \"popularity\": 7904\n },\n {\n \"tag\": "rededicatory",\n \"popularity\": 7896\n },\n {\n \"tag\": "nontransient",\n \"popularity\": 7888\n },\n {\n \"tag\": "Phocaean brinkless",\n \"popularity\": 7880\n },\n {\n \"tag\": "ventriculose",\n \"popularity\": 7872\n },\n {\n \"tag\": "upplough",\n \"popularity\": 7864\n },\n {\n \"tag\": "succorless",\n \"popularity\": 7856\n },\n {\n \"tag\": "hayrake",\n \"popularity\": 7848\n },\n {\n \"tag\": "merriness amorphia",\n \"popularity\": 7840\n },\n {\n \"tag\": "merycism",\n \"popularity\": 7832\n },\n {\n \"tag\": "checkrow",\n \"popularity\": 7824\n },\n {\n \"tag\": "scry",\n \"popularity\": 7816\n },\n {\n \"tag\": "obvolve",\n \"popularity\": 7808\n },\n {\n \"tag\": "orchard",\n \"popularity\": 7800\n },\n {\n \"tag\": "isomerize",\n \"popularity\": 7792\n },\n {\n \"tag\": "competitrix",\n \"popularity\": 7784\n },\n {\n \"tag\": "unbannered",\n \"popularity\": 7776\n },\n {\n \"tag\": "undoctrined",\n \"popularity\": 7768\n },\n {\n \"tag\": "theologian",\n \"popularity\": 7760\n },\n {\n \"tag\": "nebby",\n \"popularity\": 7752\n },\n {\n \"tag\": "Cardiazol",\n \"popularity\": 7745\n },\n {\n \"tag\": "phagedenic",\n \"popularity\": 7737\n },\n {\n \"tag\": "nostalgic",\n \"popularity\": 7729\n },\n {\n \"tag\": "orthodoxy",\n \"popularity\": 7721\n },\n {\n \"tag\": "oversanguine",\n \"popularity\": 7713\n },\n {\n \"tag\": "lish",\n \"popularity\": 7705\n },\n {\n \"tag\": "ketogenic",\n \"popularity\": 7698\n },\n {\n \"tag\": "syndicalize",\n \"popularity\": 7690\n },\n {\n \"tag\": "leeftail",\n \"popularity\": 7682\n },\n {\n \"tag\": "bulbomedullary",\n \"popularity\": 7674\n },\n {\n \"tag\": "reletter",\n \"popularity\": 7667\n },\n {\n \"tag\": "bitterly",\n \"popularity\": 7659\n },\n {\n \"tag\": "participatory",\n \"popularity\": 7651\n },\n {\n \"tag\": "baldberry",\n \"popularity\": 7643\n },\n {\n \"tag\": "prowaterpower",\n \"popularity\": 7636\n },\n {\n \"tag\": "lexicographical",\n \"popularity\": 7628\n },\n {\n \"tag\": "Anisodactyli",\n \"popularity\": 7620\n },\n {\n \"tag\": "amphipodous",\n \"popularity\": 7613\n },\n {\n \"tag\": "triglandular",\n \"popularity\": 7605\n },\n {\n \"tag\": "xanthopsin",\n \"popularity\": 7597\n },\n {\n \"tag\": "indefinitude",\n \"popularity\": 7590\n },\n {\n \"tag\": "bookworm",\n \"popularity\": 7582\n },\n {\n \"tag\": "suffocative",\n \"popularity\": 7574\n },\n {\n \"tag\": "uncongested tyrant",\n \"popularity\": 7567\n },\n {\n \"tag\": "alow harmoniously Pamir",\n \"popularity\": 7559\n },\n {\n \"tag\": "monander",\n \"popularity\": 7552\n },\n {\n \"tag\": "bagatelle",\n \"popularity\": 7544\n },\n {\n \"tag\": "membranology",\n \"popularity\": 7537\n },\n {\n \"tag\": "parturifacient",\n \"popularity\": 7529\n },\n {\n \"tag\": "excitovascular",\n \"popularity\": 7522\n },\n {\n \"tag\": "homopolar",\n \"popularity\": 7514\n },\n {\n \"tag\": "phobiac",\n \"popularity\": 7507\n },\n {\n \"tag\": "clype",\n \"popularity\": 7499\n },\n {\n \"tag\": "unsubversive",\n \"popularity\": 7492\n },\n {\n \"tag\": "bostrychoidal scorpionwort",\n \"popularity\": 7484\n },\n {\n \"tag\": "biliteralism",\n \"popularity\": 7477\n },\n {\n \"tag\": "dentatocostate",\n \"popularity\": 7469\n },\n {\n \"tag\": "Pici",\n \"popularity\": 7462\n },\n {\n \"tag\": "sideritic",\n \"popularity\": 7454\n },\n {\n \"tag\": "syntaxis",\n \"popularity\": 7447\n },\n {\n \"tag\": "ingest",\n \"popularity\": 7440\n },\n {\n \"tag\": "rigmarolish",\n \"popularity\": 7432\n },\n {\n \"tag\": "ocreaceous",\n \"popularity\": 7425\n },\n {\n \"tag\": "hyperbrachyskelic",\n \"popularity\": 7418\n },\n {\n \"tag\": "basophobia",\n \"popularity\": 7410\n },\n {\n \"tag\": "substantialness",\n \"popularity\": 7403\n },\n {\n \"tag\": "agglutinoid",\n \"popularity\": 7396\n },\n {\n \"tag\": "longleaf",\n \"popularity\": 7388\n },\n {\n \"tag\": "electroengraving",\n \"popularity\": 7381\n },\n {\n \"tag\": "laparoenterotomy",\n \"popularity\": 7374\n },\n {\n \"tag\": "oxalylurea",\n \"popularity\": 7366\n },\n {\n \"tag\": "unattaintedly",\n \"popularity\": 7359\n },\n {\n \"tag\": "pennystone",\n \"popularity\": 7352\n },\n {\n \"tag\": "Plumbaginaceae",\n \"popularity\": 7345\n },\n {\n \"tag\": "horntip",\n \"popularity\": 7337\n },\n {\n \"tag\": "begrudge",\n \"popularity\": 7330\n },\n {\n \"tag\": "bechignoned",\n \"popularity\": 7323\n },\n {\n \"tag\": "hologonidium",\n \"popularity\": 7316\n },\n {\n \"tag\": "Pulian",\n \"popularity\": 7309\n },\n {\n \"tag\": "gratulation",\n \"popularity\": 7301\n },\n {\n \"tag\": "Sebright",\n \"popularity\": 7294\n },\n {\n \"tag\": "coinstantaneous emotionally",\n \"popularity\": 7287\n },\n {\n \"tag\": "thoracostracan",\n \"popularity\": 7280\n },\n {\n \"tag\": "saurodont",\n \"popularity\": 7273\n },\n {\n \"tag\": "coseat",\n \"popularity\": 7266\n },\n {\n \"tag\": "irascibility",\n \"popularity\": 7259\n },\n {\n \"tag\": "occlude",\n \"popularity\": 7251\n },\n {\n \"tag\": "metallurgist",\n \"popularity\": 7244\n },\n {\n \"tag\": "extraviolet",\n \"popularity\": 7237\n },\n {\n \"tag\": "clinic",\n \"popularity\": 7230\n },\n {\n \"tag\": "skater",\n \"popularity\": 7223\n },\n {\n \"tag\": "linguistic",\n \"popularity\": 7216\n },\n {\n \"tag\": "attacheship",\n \"popularity\": 7209\n },\n {\n \"tag\": "Rachianectes",\n \"popularity\": 7202\n },\n {\n \"tag\": "foliolose",\n \"popularity\": 7195\n },\n {\n \"tag\": "claudetite",\n \"popularity\": 7188\n },\n {\n \"tag\": "aphidian scratching",\n \"popularity\": 7181\n },\n {\n \"tag\": "Carida",\n \"popularity\": 7174\n },\n {\n \"tag\": "tiepin polymicroscope",\n \"popularity\": 7167\n },\n {\n \"tag\": "telpherage",\n \"popularity\": 7160\n },\n {\n \"tag\": "meek",\n \"popularity\": 7153\n },\n {\n \"tag\": "swiftness",\n \"popularity\": 7146\n },\n {\n \"tag\": "gentes",\n \"popularity\": 7139\n },\n {\n \"tag\": "uncommemorated",\n \"popularity\": 7132\n },\n {\n \"tag\": "Lazarus",\n \"popularity\": 7125\n },\n {\n \"tag\": "redivive",\n \"popularity\": 7119\n },\n {\n \"tag\": "nonfebrile",\n \"popularity\": 7112\n },\n {\n \"tag\": "nymphet",\n \"popularity\": 7105\n },\n {\n \"tag\": "areologically",\n \"popularity\": 7098\n },\n {\n \"tag\": "undonkey",\n \"popularity\": 7091\n },\n {\n \"tag\": "projecting",\n \"popularity\": 7084\n },\n {\n \"tag\": "pinnigrade",\n \"popularity\": 7077\n },\n {\n \"tag\": "butylation",\n \"popularity\": 7071\n },\n {\n \"tag\": "philologistic lenticle",\n \"popularity\": 7064\n },\n {\n \"tag\": "nooky",\n \"popularity\": 7057\n },\n {\n \"tag\": "incestuousness",\n \"popularity\": 7050\n },\n {\n \"tag\": "palingenetically",\n \"popularity\": 7043\n },\n {\n \"tag\": "mitochondria",\n \"popularity\": 7037\n },\n {\n \"tag\": "truthify",\n \"popularity\": 7030\n },\n {\n \"tag\": "titanyl",\n \"popularity\": 7023\n },\n {\n \"tag\": "bestride",\n \"popularity\": 7016\n },\n {\n \"tag\": "chende",\n \"popularity\": 7010\n },\n {\n \"tag\": "Chaucerian monophote",\n \"popularity\": 7003\n },\n {\n \"tag\": "cutback",\n \"popularity\": 6996\n },\n {\n \"tag\": "unpatiently",\n \"popularity\": 6989\n },\n {\n \"tag\": "subvitreous",\n \"popularity\": 6983\n },\n {\n \"tag\": "organizable",\n \"popularity\": 6976\n },\n {\n \"tag\": "anniverse uncomprehensible",\n \"popularity\": 6969\n },\n {\n \"tag\": "hyalescence",\n \"popularity\": 6963\n },\n {\n \"tag\": "amniochorial",\n \"popularity\": 6956\n },\n {\n \"tag\": "Corybantian",\n \"popularity\": 6949\n },\n {\n \"tag\": "genocide Scaphitidae",\n \"popularity\": 6943\n },\n {\n \"tag\": "accordionist",\n \"popularity\": 6936\n },\n {\n \"tag\": "becheck",\n \"popularity\": 6930\n },\n {\n \"tag\": "overproduce",\n \"popularity\": 6923\n },\n {\n \"tag\": "unmaniac frijolillo",\n \"popularity\": 6916\n },\n {\n \"tag\": "multisulcated",\n \"popularity\": 6910\n },\n {\n \"tag\": "wennebergite",\n \"popularity\": 6903\n },\n {\n \"tag\": "tautousious mowth",\n \"popularity\": 6897\n },\n {\n \"tag\": "marigold",\n \"popularity\": 6890\n },\n {\n \"tag\": "affray",\n \"popularity\": 6884\n },\n {\n \"tag\": "nonidolatrous",\n \"popularity\": 6877\n },\n {\n \"tag\": "aphrasia",\n \"popularity\": 6871\n },\n {\n \"tag\": "muddlingly",\n \"popularity\": 6864\n },\n {\n \"tag\": "clear",\n \"popularity\": 6858\n },\n {\n \"tag\": "Clitoria",\n \"popularity\": 6851\n },\n {\n \"tag\": "apportionment underwaist",\n \"popularity\": 6845\n },\n {\n \"tag\": "kodakist",\n \"popularity\": 6838\n },\n {\n \"tag\": "Momotidae",\n \"popularity\": 6832\n },\n {\n \"tag\": "cryptovalency",\n \"popularity\": 6825\n },\n {\n \"tag\": "floe",\n \"popularity\": 6819\n },\n {\n \"tag\": "aphagia",\n \"popularity\": 6812\n },\n {\n \"tag\": "brontograph",\n \"popularity\": 6806\n },\n {\n \"tag\": "tubulous",\n \"popularity\": 6799\n },\n {\n \"tag\": "unhorse",\n \"popularity\": 6793\n },\n {\n \"tag\": "chlordane",\n \"popularity\": 6787\n },\n {\n \"tag\": "colloquy brochan",\n \"popularity\": 6780\n },\n {\n \"tag\": "sloosh",\n \"popularity\": 6774\n },\n {\n \"tag\": "battered",\n \"popularity\": 6767\n },\n {\n \"tag\": "monocularity pluriguttulate",\n \"popularity\": 6761\n },\n {\n \"tag\": "chiastoneury",\n \"popularity\": 6755\n },\n {\n \"tag\": "Sanguinaria",\n \"popularity\": 6748\n },\n {\n \"tag\": "confessionary",\n \"popularity\": 6742\n },\n {\n \"tag\": "enzymic",\n \"popularity\": 6736\n },\n {\n \"tag\": "cord",\n \"popularity\": 6729\n },\n {\n \"tag\": "oviducal",\n \"popularity\": 6723\n },\n {\n \"tag\": "crozzle outsea",\n \"popularity\": 6717\n },\n {\n \"tag\": "balladical",\n \"popularity\": 6710\n },\n {\n \"tag\": "uncollectibleness",\n \"popularity\": 6704\n },\n {\n \"tag\": "predorsal",\n \"popularity\": 6698\n },\n {\n \"tag\": "reauthenticate",\n \"popularity\": 6692\n },\n {\n \"tag\": "ravissant",\n \"popularity\": 6685\n },\n {\n \"tag\": "advantageousness",\n \"popularity\": 6679\n },\n {\n \"tag\": "rung",\n \"popularity\": 6673\n },\n {\n \"tag\": "duncedom",\n \"popularity\": 6667\n },\n {\n \"tag\": "hematolite",\n \"popularity\": 6660\n },\n {\n \"tag\": "thisness",\n \"popularity\": 6654\n },\n {\n \"tag\": "mapau",\n \"popularity\": 6648\n },\n {\n \"tag\": "Hecatic",\n \"popularity\": 6642\n },\n {\n \"tag\": "meningoencephalocele",\n \"popularity\": 6636\n },\n {\n \"tag\": "confection sorra",\n \"popularity\": 6630\n },\n {\n \"tag\": "unsedate",\n \"popularity\": 6623\n },\n {\n \"tag\": "meningocerebritis",\n \"popularity\": 6617\n },\n {\n \"tag\": "biopsychological",\n \"popularity\": 6611\n },\n {\n \"tag\": "clavicithern",\n \"popularity\": 6605\n },\n {\n \"tag\": "resun",\n \"popularity\": 6599\n },\n {\n \"tag\": "bayamo",\n \"popularity\": 6593\n },\n {\n \"tag\": "seeableness",\n \"popularity\": 6587\n },\n {\n \"tag\": "hypsidolichocephalism",\n \"popularity\": 6581\n },\n {\n \"tag\": "salivous",\n \"popularity\": 6574\n },\n {\n \"tag\": "neumatize",\n \"popularity\": 6568\n },\n {\n \"tag\": "stree",\n \"popularity\": 6562\n },\n {\n \"tag\": "markshot",\n \"popularity\": 6556\n },\n {\n \"tag\": "phraseologically",\n \"popularity\": 6550\n },\n {\n \"tag\": "yealing",\n \"popularity\": 6544\n },\n {\n \"tag\": "puggy",\n \"popularity\": 6538\n },\n {\n \"tag\": "sexadecimal",\n \"popularity\": 6532\n },\n {\n \"tag\": "unofficerlike",\n \"popularity\": 6526\n },\n {\n \"tag\": "curiosa",\n \"popularity\": 6520\n },\n {\n \"tag\": "pedomotor",\n \"popularity\": 6514\n },\n {\n \"tag\": "astrally",\n \"popularity\": 6508\n },\n {\n \"tag\": "prosomatic",\n \"popularity\": 6502\n },\n {\n \"tag\": "bulletheaded",\n \"popularity\": 6496\n },\n {\n \"tag\": "fortuned",\n \"popularity\": 6490\n },\n {\n \"tag\": "pixy",\n \"popularity\": 6484\n },\n {\n \"tag\": "protectrix",\n \"popularity\": 6478\n },\n {\n \"tag\": "arthritical",\n \"popularity\": 6472\n },\n {\n \"tag\": "coction",\n \"popularity\": 6466\n },\n {\n \"tag\": "Anthropos",\n \"popularity\": 6460\n },\n {\n \"tag\": "runer",\n \"popularity\": 6454\n },\n {\n \"tag\": "prenotify",\n \"popularity\": 6449\n },\n {\n \"tag\": "microspheric gastroparalysis",\n \"popularity\": 6443\n },\n {\n \"tag\": "Jovicentrical",\n \"popularity\": 6437\n },\n {\n \"tag\": "ceratopsid",\n \"popularity\": 6431\n },\n {\n \"tag\": "Theodoric",\n \"popularity\": 6425\n },\n {\n \"tag\": "Pactolus",\n \"popularity\": 6419\n },\n {\n \"tag\": "spawning",\n \"popularity\": 6413\n },\n {\n \"tag\": "nonconfidential",\n \"popularity\": 6407\n },\n {\n \"tag\": "halotrichite infumate",\n \"popularity\": 6402\n },\n {\n \"tag\": "undiscriminatingly",\n \"popularity\": 6396\n },\n {\n \"tag\": "unexasperated",\n \"popularity\": 6390\n },\n {\n \"tag\": "isoeugenol",\n \"popularity\": 6384\n },\n {\n \"tag\": "pressboard",\n \"popularity\": 6378\n },\n {\n \"tag\": "unshrew",\n \"popularity\": 6372\n },\n {\n \"tag\": "huffingly",\n \"popularity\": 6367\n },\n {\n \"tag\": "wagaun",\n \"popularity\": 6361\n },\n {\n \"tag\": "squirt Philistine",\n \"popularity\": 6355\n },\n {\n \"tag\": "kryptic",\n \"popularity\": 6349\n },\n {\n \"tag\": "paraform",\n \"popularity\": 6344\n },\n {\n \"tag\": "preverify",\n \"popularity\": 6338\n },\n {\n \"tag\": "dalar",\n \"popularity\": 6332\n },\n {\n \"tag\": "interdictor appraisingly",\n \"popularity\": 6326\n },\n {\n \"tag\": "chipped",\n \"popularity\": 6321\n },\n {\n \"tag\": "Pteropoda",\n \"popularity\": 6315\n },\n {\n \"tag\": "Bohairic",\n \"popularity\": 6309\n },\n {\n \"tag\": "felting",\n \"popularity\": 6303\n },\n {\n \"tag\": "compurgatorial",\n \"popularity\": 6298\n },\n {\n \"tag\": "unclead",\n \"popularity\": 6292\n },\n {\n \"tag\": "stockish",\n \"popularity\": 6286\n },\n {\n \"tag\": "mulligatawny",\n \"popularity\": 6281\n },\n {\n \"tag\": "Monotheletism",\n \"popularity\": 6275\n },\n {\n \"tag\": "lutanist",\n \"popularity\": 6269\n },\n {\n \"tag\": "gluttonize",\n \"popularity\": 6264\n },\n {\n \"tag\": "hackneyed",\n \"popularity\": 6258\n },\n {\n \"tag\": "yield",\n \"popularity\": 6253\n },\n {\n \"tag\": "sulphonamido",\n \"popularity\": 6247\n },\n {\n \"tag\": "granulative",\n \"popularity\": 6241\n },\n {\n \"tag\": "swingy",\n \"popularity\": 6236\n },\n {\n \"tag\": "Desmidiales",\n \"popularity\": 6230\n },\n {\n \"tag\": "tootlish",\n \"popularity\": 6224\n },\n {\n \"tag\": "unsatisfiedly",\n \"popularity\": 6219\n },\n {\n \"tag\": "burucha",\n \"popularity\": 6213\n },\n {\n \"tag\": "premeditatingly",\n \"popularity\": 6208\n },\n {\n \"tag\": "cowrie",\n \"popularity\": 6202\n },\n {\n \"tag\": "pleurolysis",\n \"popularity\": 6197\n },\n {\n \"tag\": "nationalist",\n \"popularity\": 6191\n },\n {\n \"tag\": "Pholadacea",\n \"popularity\": 6186\n },\n {\n \"tag\": "anakrousis",\n \"popularity\": 6180\n },\n {\n \"tag\": "proctorial",\n \"popularity\": 6175\n },\n {\n \"tag\": "cavillation",\n \"popularity\": 6169\n },\n {\n \"tag\": "cervicobregmatic",\n \"popularity\": 6163\n },\n {\n \"tag\": "interspecific",\n \"popularity\": 6158\n },\n {\n \"tag\": "Teutonity",\n \"popularity\": 6152\n },\n {\n \"tag\": "snakeholing",\n \"popularity\": 6147\n },\n {\n \"tag\": "balcony",\n \"popularity\": 6142\n },\n {\n \"tag\": "latchless",\n \"popularity\": 6136\n },\n {\n \"tag\": "Mithraea",\n \"popularity\": 6131\n },\n {\n \"tag\": "pseudepigraph",\n \"popularity\": 6125\n },\n {\n \"tag\": "flosser",\n \"popularity\": 6120\n },\n {\n \"tag\": "kotyle",\n \"popularity\": 6114\n },\n {\n \"tag\": "outdo",\n \"popularity\": 6109\n },\n {\n \"tag\": "interclerical",\n \"popularity\": 6103\n },\n {\n \"tag\": "aurar",\n \"popularity\": 6098\n },\n {\n \"tag\": "apophyseal",\n \"popularity\": 6093\n },\n {\n \"tag\": "Miro",\n \"popularity\": 6087\n },\n {\n \"tag\": "Priscillian",\n \"popularity\": 6082\n },\n {\n \"tag\": "alluvia",\n \"popularity\": 6076\n },\n {\n \"tag\": "exordize",\n \"popularity\": 6071\n },\n {\n \"tag\": "breakage",\n \"popularity\": 6066\n },\n {\n \"tag\": "unclosable",\n \"popularity\": 6060\n },\n {\n \"tag\": "monocondylous",\n \"popularity\": 6055\n },\n {\n \"tag\": "dyarchy",\n \"popularity\": 6050\n },\n {\n \"tag\": "subchelate",\n \"popularity\": 6044\n },\n {\n \"tag\": "hearsay",\n \"popularity\": 6039\n },\n {\n \"tag\": "prestigiously",\n \"popularity\": 6034\n },\n {\n \"tag\": "unimuscular",\n \"popularity\": 6028\n },\n {\n \"tag\": "lingwort",\n \"popularity\": 6023\n },\n {\n \"tag\": "jealous",\n \"popularity\": 6018\n },\n {\n \"tag\": "artilleryman",\n \"popularity\": 6012\n },\n {\n \"tag\": "phantasmagorially",\n \"popularity\": 6007\n },\n {\n \"tag\": "stagnum",\n \"popularity\": 6002\n },\n {\n \"tag\": "organotropism shatteringly",\n \"popularity\": 5997\n },\n {\n \"tag\": "Mytilus Hebraist",\n \"popularity\": 5991\n },\n {\n \"tag\": "returf",\n \"popularity\": 5986\n },\n {\n \"tag\": "townfolk",\n \"popularity\": 5981\n },\n {\n \"tag\": "propitiative",\n \"popularity\": 5976\n },\n {\n \"tag\": "Anita unsullied",\n \"popularity\": 5970\n },\n {\n \"tag\": "bandoleered",\n \"popularity\": 5965\n },\n {\n \"tag\": "cubby",\n \"popularity\": 5960\n },\n {\n \"tag\": "Hexanchus",\n \"popularity\": 5955\n },\n {\n \"tag\": "circuminsular",\n \"popularity\": 5949\n },\n {\n \"tag\": "chamberletted eumycete",\n \"popularity\": 5944\n },\n {\n \"tag\": "secure",\n \"popularity\": 5939\n },\n {\n \"tag\": "Edwardean",\n \"popularity\": 5934\n },\n {\n \"tag\": "strenth",\n \"popularity\": 5929\n },\n {\n \"tag\": "exhaustless",\n \"popularity\": 5923\n },\n {\n \"tag\": "electioneerer",\n \"popularity\": 5918\n },\n {\n \"tag\": "estoile",\n \"popularity\": 5913\n },\n {\n \"tag\": "redden",\n \"popularity\": 5908\n },\n {\n \"tag\": "solicitee",\n \"popularity\": 5903\n },\n {\n \"tag\": "nonpatented",\n \"popularity\": 5898\n },\n {\n \"tag\": "lemming",\n \"popularity\": 5893\n },\n {\n \"tag\": "marled subalate",\n \"popularity\": 5887\n },\n {\n \"tag\": "premial horizonward",\n \"popularity\": 5882\n },\n {\n \"tag\": "nonrefueling",\n \"popularity\": 5877\n },\n {\n \"tag\": "rupturewort",\n \"popularity\": 5872\n },\n {\n \"tag\": "unfed",\n \"popularity\": 5867\n },\n {\n \"tag\": "empanelment",\n \"popularity\": 5862\n },\n {\n \"tag\": "isoosmosis",\n \"popularity\": 5857\n },\n {\n \"tag\": "jipijapa",\n \"popularity\": 5852\n },\n {\n \"tag\": "Fiji",\n \"popularity\": 5847\n },\n {\n \"tag\": "interferant",\n \"popularity\": 5842\n },\n {\n \"tag\": "reconstitution",\n \"popularity\": 5837\n },\n {\n \"tag\": "dockyardman",\n \"popularity\": 5832\n },\n {\n \"tag\": "dolichopodous",\n \"popularity\": 5826\n },\n {\n \"tag\": "whiteworm",\n \"popularity\": 5821\n },\n {\n \"tag\": "atheistically",\n \"popularity\": 5816\n },\n {\n \"tag\": "nonconcern",\n \"popularity\": 5811\n },\n {\n \"tag\": "scarabaeidoid",\n \"popularity\": 5806\n },\n {\n \"tag\": "triumviri",\n \"popularity\": 5801\n },\n {\n \"tag\": "rakit",\n \"popularity\": 5796\n },\n {\n \"tag\": "leecheater",\n \"popularity\": 5791\n },\n {\n \"tag\": "Arthrostraca",\n \"popularity\": 5786\n },\n {\n \"tag\": "upknit",\n \"popularity\": 5781\n },\n {\n \"tag\": "tymbalon",\n \"popularity\": 5776\n },\n {\n \"tag\": "inventurous",\n \"popularity\": 5771\n },\n {\n \"tag\": "perradiate",\n \"popularity\": 5766\n },\n {\n \"tag\": "seer",\n \"popularity\": 5762\n },\n {\n \"tag\": "Auricularia",\n \"popularity\": 5757\n },\n {\n \"tag\": "wettish exclusivity",\n \"popularity\": 5752\n },\n {\n \"tag\": "arteriosympathectomy",\n \"popularity\": 5747\n },\n {\n \"tag\": "tunlike",\n \"popularity\": 5742\n },\n {\n \"tag\": "cephalocercal",\n \"popularity\": 5737\n },\n {\n \"tag\": "meaninglessness",\n \"popularity\": 5732\n },\n {\n \"tag\": "fountful",\n \"popularity\": 5727\n },\n {\n \"tag\": "appraisement",\n \"popularity\": 5722\n },\n {\n \"tag\": "geniculated",\n \"popularity\": 5717\n },\n {\n \"tag\": "rotator",\n \"popularity\": 5712\n },\n {\n \"tag\": "foremarch biography",\n \"popularity\": 5707\n },\n {\n \"tag\": "arid",\n \"popularity\": 5703\n },\n {\n \"tag\": "inapprehensible",\n \"popularity\": 5698\n },\n {\n \"tag\": "chlorosulphonic",\n \"popularity\": 5693\n },\n {\n \"tag\": "braguette",\n \"popularity\": 5688\n },\n {\n \"tag\": "panophthalmitis",\n \"popularity\": 5683\n },\n {\n \"tag\": "pro objurgatorily",\n \"popularity\": 5678\n },\n {\n \"tag\": "zooplasty",\n \"popularity\": 5673\n },\n {\n \"tag\": "Terebratulidae",\n \"popularity\": 5669\n },\n {\n \"tag\": "Mahran",\n \"popularity\": 5664\n },\n {\n \"tag\": "anthologize merocele",\n \"popularity\": 5659\n },\n {\n \"tag\": "firecracker chiropractic",\n \"popularity\": 5654\n },\n {\n \"tag\": "tenorist",\n \"popularity\": 5649\n },\n {\n \"tag\": "amphitene",\n \"popularity\": 5645\n },\n {\n \"tag\": "silverbush toadstone",\n \"popularity\": 5640\n },\n {\n \"tag\": "entozoological",\n \"popularity\": 5635\n },\n {\n \"tag\": "trustlessness",\n \"popularity\": 5630\n },\n {\n \"tag\": "reassay",\n \"popularity\": 5625\n },\n {\n \"tag\": "chrysalides",\n \"popularity\": 5621\n },\n {\n \"tag\": "truncation",\n \"popularity\": 5616\n },\n {\n \"tag\": "unwavered mausoleal",\n \"popularity\": 5611\n },\n {\n \"tag\": "unserrated",\n \"popularity\": 5606\n },\n {\n \"tag\": "frampler",\n \"popularity\": 5602\n },\n {\n \"tag\": "celestial",\n \"popularity\": 5597\n },\n {\n \"tag\": "depreter",\n \"popularity\": 5592\n },\n {\n \"tag\": "retaliate",\n \"popularity\": 5588\n },\n {\n \"tag\": "decempunctate",\n \"popularity\": 5583\n },\n {\n \"tag\": "submitter",\n \"popularity\": 5578\n },\n {\n \"tag\": "phenothiazine",\n \"popularity\": 5573\n },\n {\n \"tag\": "hobbledehoyish",\n \"popularity\": 5569\n },\n {\n \"tag\": "erraticness",\n \"popularity\": 5564\n },\n {\n \"tag\": "ovariodysneuria",\n \"popularity\": 5559\n },\n {\n \"tag\": "puja",\n \"popularity\": 5555\n },\n {\n \"tag\": "cesspool",\n \"popularity\": 5550\n },\n {\n \"tag\": "sonation",\n \"popularity\": 5545\n },\n {\n \"tag\": "moggan",\n \"popularity\": 5541\n },\n {\n \"tag\": "overjutting",\n \"popularity\": 5536\n },\n {\n \"tag\": "cohobate",\n \"popularity\": 5531\n },\n {\n \"tag\": "Distoma",\n \"popularity\": 5527\n },\n {\n \"tag\": "Plectognathi",\n \"popularity\": 5522\n },\n {\n \"tag\": "dumple caliphate",\n \"popularity\": 5517\n },\n {\n \"tag\": "shiko",\n \"popularity\": 5513\n },\n {\n \"tag\": "downness",\n \"popularity\": 5508\n },\n {\n \"tag\": "whippletree",\n \"popularity\": 5504\n },\n {\n \"tag\": "nymphaeum",\n \"popularity\": 5499\n },\n {\n \"tag\": "there trest",\n \"popularity\": 5494\n },\n {\n \"tag\": "psychrometer",\n \"popularity\": 5490\n },\n {\n \"tag\": "pyelograph",\n \"popularity\": 5485\n },\n {\n \"tag\": "unsalvable",\n \"popularity\": 5481\n },\n {\n \"tag\": "bescreen",\n \"popularity\": 5476\n },\n {\n \"tag\": "cushy",\n \"popularity\": 5471\n },\n {\n \"tag\": "plicatolobate",\n \"popularity\": 5467\n },\n {\n \"tag\": "lakie",\n \"popularity\": 5462\n },\n {\n \"tag\": "anthropodeoxycholic",\n \"popularity\": 5458\n },\n {\n \"tag\": "resatisfaction",\n \"popularity\": 5453\n },\n {\n \"tag\": "unravelment unaccidental",\n \"popularity\": 5449\n },\n {\n \"tag\": "telewriter monogeneous",\n \"popularity\": 5444\n },\n {\n \"tag\": "unsabred",\n \"popularity\": 5440\n },\n {\n \"tag\": "startlingly",\n \"popularity\": 5435\n },\n {\n \"tag\": "Aralia",\n \"popularity\": 5431\n },\n {\n \"tag\": "alamonti",\n \"popularity\": 5426\n },\n {\n \"tag\": "Franklinization",\n \"popularity\": 5422\n },\n {\n \"tag\": "parliament",\n \"popularity\": 5417\n },\n {\n \"tag\": "schoolkeeper",\n \"popularity\": 5413\n },\n {\n \"tag\": "nonsociety",\n \"popularity\": 5408\n },\n {\n \"tag\": "parenthetic",\n \"popularity\": 5404\n },\n {\n \"tag\": "stog",\n \"popularity\": 5399\n },\n {\n \"tag\": "Pristipomidae",\n \"popularity\": 5395\n },\n {\n \"tag\": "exocarp",\n \"popularity\": 5390\n },\n {\n \"tag\": "monaxonial",\n \"popularity\": 5386\n },\n {\n \"tag\": "tramroad",\n \"popularity\": 5381\n },\n {\n \"tag\": "hookah",\n \"popularity\": 5377\n },\n {\n \"tag\": "saccharonic",\n \"popularity\": 5372\n },\n {\n \"tag\": "perimetrium",\n \"popularity\": 5368\n },\n {\n \"tag\": "libelluloid",\n \"popularity\": 5364\n },\n {\n \"tag\": "overrunningly",\n \"popularity\": 5359\n },\n {\n \"tag\": "untwister",\n \"popularity\": 5355\n },\n {\n \"tag\": "ninnyhammer",\n \"popularity\": 5350\n },\n {\n \"tag\": "metranate",\n \"popularity\": 5346\n },\n {\n \"tag\": "sarcoblast",\n \"popularity\": 5341\n },\n {\n \"tag\": "porkish",\n \"popularity\": 5337\n },\n {\n \"tag\": "chauvinistic",\n \"popularity\": 5333\n },\n {\n \"tag\": "sexagesimal",\n \"popularity\": 5328\n },\n {\n \"tag\": "hematogenic",\n \"popularity\": 5324\n },\n {\n \"tag\": "selfpreservatory",\n \"popularity\": 5320\n },\n {\n \"tag\": "myelauxe",\n \"popularity\": 5315\n },\n {\n \"tag\": "triply",\n \"popularity\": 5311\n },\n {\n \"tag\": "metaphysicous",\n \"popularity\": 5306\n },\n {\n \"tag\": "vitrinoid",\n \"popularity\": 5302\n },\n {\n \"tag\": "glabellae",\n \"popularity\": 5298\n },\n {\n \"tag\": "moonlighter",\n \"popularity\": 5293\n },\n {\n \"tag\": "monotheistically epexegetical",\n \"popularity\": 5289\n },\n {\n \"tag\": "pseudolateral",\n \"popularity\": 5285\n },\n {\n \"tag\": "heptamethylene",\n \"popularity\": 5280\n },\n {\n \"tag\": "salvadora",\n \"popularity\": 5276\n },\n {\n \"tag\": "unjovial diphenylthiourea",\n \"popularity\": 5272\n },\n {\n \"tag\": "thievishness",\n \"popularity\": 5268\n },\n {\n \"tag\": "unridable",\n \"popularity\": 5263\n },\n {\n \"tag\": "underhandedly",\n \"popularity\": 5259\n },\n {\n \"tag\": "fungiform",\n \"popularity\": 5255\n },\n {\n \"tag\": "scruffle",\n \"popularity\": 5250\n },\n {\n \"tag\": "preindisposition",\n \"popularity\": 5246\n },\n {\n \"tag\": "Amadis",\n \"popularity\": 5242\n },\n {\n \"tag\": "Culex",\n \"popularity\": 5238\n },\n {\n \"tag\": "churning",\n \"popularity\": 5233\n },\n {\n \"tag\": "imperite",\n \"popularity\": 5229\n },\n {\n \"tag\": "levorotation",\n \"popularity\": 5225\n },\n {\n \"tag\": "barbate",\n \"popularity\": 5221\n },\n {\n \"tag\": "knotwort",\n \"popularity\": 5216\n },\n {\n \"tag\": "gypsiferous",\n \"popularity\": 5212\n },\n {\n \"tag\": "tourmalinic",\n \"popularity\": 5208\n },\n {\n \"tag\": "helleboric",\n \"popularity\": 5204\n },\n {\n \"tag\": "pneumograph",\n \"popularity\": 5199\n },\n {\n \"tag\": "Peltigeraceae",\n \"popularity\": 5195\n },\n {\n \"tag\": "busine",\n \"popularity\": 5191\n },\n {\n \"tag\": "Ailuridae",\n \"popularity\": 5187\n },\n {\n \"tag\": "azotate",\n \"popularity\": 5183\n },\n {\n \"tag\": "unlikable",\n \"popularity\": 5178\n },\n {\n \"tag\": "sloyd",\n \"popularity\": 5174\n },\n {\n \"tag\": "biblioclasm",\n \"popularity\": 5170\n },\n {\n \"tag\": "Seres",\n \"popularity\": 5166\n },\n {\n \"tag\": "unaccurateness",\n \"popularity\": 5162\n },\n {\n \"tag\": "scrollwise",\n \"popularity\": 5157\n },\n {\n \"tag\": "flandowser",\n \"popularity\": 5153\n },\n {\n \"tag\": "unblackened",\n \"popularity\": 5149\n },\n {\n \"tag\": "schistosternia",\n \"popularity\": 5145\n },\n {\n \"tag\": "fuse",\n \"popularity\": 5141\n },\n {\n \"tag\": "narthecal",\n \"popularity\": 5137\n },\n {\n \"tag\": "Cueva",\n \"popularity\": 5133\n },\n {\n \"tag\": "appositeness",\n \"popularity\": 5128\n },\n {\n \"tag\": "proindustrial",\n \"popularity\": 5124\n },\n {\n \"tag\": "dermatorrhoea",\n \"popularity\": 5120\n },\n {\n \"tag\": "oxyurous tendential",\n \"popularity\": 5116\n },\n {\n \"tag\": "isopurpurin",\n \"popularity\": 5112\n },\n {\n \"tag\": "impose",\n \"popularity\": 5108\n },\n {\n \"tag\": "wordsmanship",\n \"popularity\": 5104\n },\n {\n \"tag\": "saturator",\n \"popularity\": 5100\n },\n {\n \"tag\": "Nordicity",\n \"popularity\": 5096\n },\n {\n \"tag\": "interaccuse",\n \"popularity\": 5092\n },\n {\n \"tag\": "acridinic",\n \"popularity\": 5087\n },\n {\n \"tag\": "scholion",\n \"popularity\": 5083\n },\n {\n \"tag\": "pseudoaconitine",\n \"popularity\": 5079\n },\n {\n \"tag\": "doctorial",\n \"popularity\": 5075\n },\n {\n \"tag\": "Etchimin",\n \"popularity\": 5071\n },\n {\n \"tag\": "oliviform",\n \"popularity\": 5067\n },\n {\n \"tag\": "Pele",\n \"popularity\": 5063\n },\n {\n \"tag\": "Chiromantis Progymnasium",\n \"popularity\": 5059\n },\n {\n \"tag\": "toxosis",\n \"popularity\": 5055\n },\n {\n \"tag\": "spadilla",\n \"popularity\": 5051\n },\n {\n \"tag\": "Actinopterygii",\n \"popularity\": 5047\n },\n {\n \"tag\": "untiring",\n \"popularity\": 5043\n },\n {\n \"tag\": "butyral",\n \"popularity\": 5039\n },\n {\n \"tag\": "Gymnoderinae",\n \"popularity\": 5035\n },\n {\n \"tag\": "testudo",\n \"popularity\": 5031\n },\n {\n \"tag\": "frigorify",\n \"popularity\": 5027\n },\n {\n \"tag\": "aliency",\n \"popularity\": 5023\n },\n {\n \"tag\": "jargon",\n \"popularity\": 5019\n },\n {\n \"tag\": "counterservice",\n \"popularity\": 5015\n },\n {\n \"tag\": "isostrychnine",\n \"popularity\": 5011\n },\n {\n \"tag\": "tellership",\n \"popularity\": 5007\n },\n {\n \"tag\": "miscegenetic",\n \"popularity\": 5003\n },\n {\n \"tag\": "sorcer",\n \"popularity\": 4999\n },\n {\n \"tag\": "tilewright",\n \"popularity\": 4995\n },\n {\n \"tag\": "cyanoplastid",\n \"popularity\": 4991\n },\n {\n \"tag\": "fluxionally",\n \"popularity\": 4987\n },\n {\n \"tag\": "proudhearted",\n \"popularity\": 4983\n },\n {\n \"tag\": "blithely",\n \"popularity\": 4979\n },\n {\n \"tag\": "jestproof",\n \"popularity\": 4975\n },\n {\n \"tag\": "jestwise",\n \"popularity\": 4971\n },\n {\n \"tag\": "nonassimilable",\n \"popularity\": 4967\n },\n {\n \"tag\": "compurgation",\n \"popularity\": 4964\n },\n {\n \"tag\": "unhate",\n \"popularity\": 4960\n },\n {\n \"tag\": "haplodonty",\n \"popularity\": 4956\n },\n {\n \"tag\": "cardholder",\n \"popularity\": 4952\n },\n {\n \"tag\": "rainlight megohmmeter overstout",\n \"popularity\": 4948\n },\n {\n \"tag\": "itchless",\n \"popularity\": 4944\n },\n {\n \"tag\": "begiggle",\n \"popularity\": 4940\n },\n {\n \"tag\": "chromatosphere",\n \"popularity\": 4936\n },\n {\n \"tag\": "typicality",\n \"popularity\": 4932\n },\n {\n \"tag\": "overgrown",\n \"popularity\": 4928\n },\n {\n \"tag\": "envolume",\n \"popularity\": 4925\n },\n {\n \"tag\": "pachycholia",\n \"popularity\": 4921\n },\n {\n \"tag\": "passageable",\n \"popularity\": 4917\n },\n {\n \"tag\": "pathopoiesis",\n \"popularity\": 4913\n },\n {\n \"tag\": "overbreak",\n \"popularity\": 4909\n },\n {\n \"tag\": "satyric",\n \"popularity\": 4905\n },\n {\n \"tag\": "unaudited",\n \"popularity\": 4901\n },\n {\n \"tag\": "whimble",\n \"popularity\": 4898\n },\n {\n \"tag\": "pressureless",\n \"popularity\": 4894\n },\n {\n \"tag\": "Selene",\n \"popularity\": 4890\n },\n {\n \"tag\": "slithery",\n \"popularity\": 4886\n },\n {\n \"tag\": "nondisfigurement",\n \"popularity\": 4882\n },\n {\n \"tag\": "overdelicious",\n \"popularity\": 4878\n },\n {\n \"tag\": "Perca",\n \"popularity\": 4875\n },\n {\n \"tag\": "Palladium",\n \"popularity\": 4871\n },\n {\n \"tag\": "insagacity",\n \"popularity\": 4867\n },\n {\n \"tag\": "peristoma",\n \"popularity\": 4863\n },\n {\n \"tag\": "uncreativeness",\n \"popularity\": 4859\n },\n {\n \"tag\": "incomparability surfboarding",\n \"popularity\": 4856\n },\n {\n \"tag\": "bacillar",\n \"popularity\": 4852\n },\n {\n \"tag\": "ulcerative",\n \"popularity\": 4848\n },\n {\n \"tag\": "stychomythia",\n \"popularity\": 4844\n },\n {\n \"tag\": "sesma somatics nonentry",\n \"popularity\": 4840\n },\n {\n \"tag\": "unsepulchred",\n \"popularity\": 4837\n },\n {\n \"tag\": "cephalanthium",\n \"popularity\": 4833\n },\n {\n \"tag\": "Asiaticization",\n \"popularity\": 4829\n },\n {\n \"tag\": "killeen",\n \"popularity\": 4825\n },\n {\n \"tag\": "Pseudococcus",\n \"popularity\": 4822\n },\n {\n \"tag\": "untractable",\n \"popularity\": 4818\n },\n {\n \"tag\": "apolegamic",\n \"popularity\": 4814\n },\n {\n \"tag\": "hyperpnea",\n \"popularity\": 4810\n },\n {\n \"tag\": "martyrolatry",\n \"popularity\": 4807\n },\n {\n \"tag\": "Sarmatic",\n \"popularity\": 4803\n },\n {\n \"tag\": "nonsurface",\n \"popularity\": 4799\n },\n {\n \"tag\": "adjoined",\n \"popularity\": 4796\n },\n {\n \"tag\": "vasiform",\n \"popularity\": 4792\n },\n {\n \"tag\": "tastelessness",\n \"popularity\": 4788\n },\n {\n \"tag\": "rumbo",\n \"popularity\": 4784\n },\n {\n \"tag\": "subdititious",\n \"popularity\": 4781\n },\n {\n \"tag\": "reparticipation",\n \"popularity\": 4777\n },\n {\n \"tag\": "Yorkshireism",\n \"popularity\": 4773\n },\n {\n \"tag\": "outcrow",\n \"popularity\": 4770\n },\n {\n \"tag\": "casserole",\n \"popularity\": 4766\n },\n {\n \"tag\": "semideltaic",\n \"popularity\": 4762\n },\n {\n \"tag\": "freemason",\n \"popularity\": 4759\n },\n {\n \"tag\": "catkin",\n \"popularity\": 4755\n },\n {\n \"tag\": "conscient",\n \"popularity\": 4751\n },\n {\n \"tag\": "reliably",\n \"popularity\": 4748\n },\n {\n \"tag\": "Telembi",\n \"popularity\": 4744\n },\n {\n \"tag\": "hide",\n \"popularity\": 4740\n },\n {\n \"tag\": "social",\n \"popularity\": 4737\n },\n {\n \"tag\": "ichneutic",\n \"popularity\": 4733\n },\n {\n \"tag\": "polypotome blouse pentagrammatic",\n \"popularity\": 4729\n },\n {\n \"tag\": "airdrome pesthole",\n \"popularity\": 4726\n },\n {\n \"tag\": "unportended",\n \"popularity\": 4722\n },\n {\n \"tag\": "sheerly",\n \"popularity\": 4719\n },\n {\n \"tag\": "acardiac",\n \"popularity\": 4715\n },\n {\n \"tag\": "fetor",\n \"popularity\": 4711\n },\n {\n \"tag\": "storax",\n \"popularity\": 4708\n },\n {\n \"tag\": "syndactylic",\n \"popularity\": 4704\n },\n {\n \"tag\": "otiatrics",\n \"popularity\": 4700\n },\n {\n \"tag\": "range",\n \"popularity\": 4697\n },\n {\n \"tag\": "branchway",\n \"popularity\": 4693\n },\n {\n \"tag\": "beatific",\n \"popularity\": 4690\n },\n {\n \"tag\": "Rugosa",\n \"popularity\": 4686\n },\n {\n \"tag\": "rafty",\n \"popularity\": 4682\n },\n {\n \"tag\": "gapy",\n \"popularity\": 4679\n },\n {\n \"tag\": "heterocercal",\n \"popularity\": 4675\n },\n {\n \"tag\": "actinopterygious",\n \"popularity\": 4672\n },\n {\n \"tag\": "glauconite",\n \"popularity\": 4668\n },\n {\n \"tag\": "limbless priest",\n \"popularity\": 4665\n },\n {\n \"tag\": "chrysene",\n \"popularity\": 4661\n },\n {\n \"tag\": "isentropic",\n \"popularity\": 4658\n },\n {\n \"tag\": "lairdess",\n \"popularity\": 4654\n },\n {\n \"tag\": "butterhead choliambic",\n \"popularity\": 4650\n },\n {\n \"tag\": "hexaseme",\n \"popularity\": 4647\n },\n {\n \"tag\": "treeify",\n \"popularity\": 4643\n },\n {\n \"tag\": "coronetted fructify",\n \"popularity\": 4640\n },\n {\n \"tag\": "admiralty",\n \"popularity\": 4636\n },\n {\n \"tag\": "Flosculariidae",\n \"popularity\": 4633\n },\n {\n \"tag\": "limaceous",\n \"popularity\": 4629\n },\n {\n \"tag\": "subterconscious",\n \"popularity\": 4626\n },\n {\n \"tag\": "stayless",\n \"popularity\": 4622\n },\n {\n \"tag\": "psha",\n \"popularity\": 4619\n },\n {\n \"tag\": "Mediterraneanize",\n \"popularity\": 4615\n },\n {\n \"tag\": "impenetrably",\n \"popularity\": 4612\n },\n {\n \"tag\": "Myrmeleonidae",\n \"popularity\": 4608\n },\n {\n \"tag\": "germander",\n \"popularity\": 4605\n },\n {\n \"tag\": "Buri",\n \"popularity\": 4601\n },\n {\n \"tag\": "papyrotamia",\n \"popularity\": 4598\n },\n {\n \"tag\": "Toxylon",\n \"popularity\": 4594\n },\n {\n \"tag\": "batatilla",\n \"popularity\": 4591\n },\n {\n \"tag\": "fabella assumer",\n \"popularity\": 4587\n },\n {\n \"tag\": "macromethod",\n \"popularity\": 4584\n },\n {\n \"tag\": "Blechnum",\n \"popularity\": 4580\n },\n {\n \"tag\": "pantography",\n \"popularity\": 4577\n },\n {\n \"tag\": "seminovel",\n \"popularity\": 4574\n },\n {\n \"tag\": "disembarrassment",\n \"popularity\": 4570\n },\n {\n \"tag\": "bushmaking",\n \"popularity\": 4567\n },\n {\n \"tag\": "neurosis",\n \"popularity\": 4563\n },\n {\n \"tag\": "Animalia",\n \"popularity\": 4560\n },\n {\n \"tag\": "Bernice",\n \"popularity\": 4556\n },\n {\n \"tag\": "wisen",\n \"popularity\": 4553\n },\n {\n \"tag\": "subhymenium",\n \"popularity\": 4549\n },\n {\n \"tag\": "esophagomycosis",\n \"popularity\": 4546\n },\n {\n \"tag\": "wireworks",\n \"popularity\": 4543\n },\n {\n \"tag\": "Sabellidae",\n \"popularity\": 4539\n },\n {\n \"tag\": "fustianish",\n \"popularity\": 4536\n },\n {\n \"tag\": "professively",\n \"popularity\": 4532\n },\n {\n \"tag\": "overcorruptly",\n \"popularity\": 4529\n },\n {\n \"tag\": "overcreep",\n \"popularity\": 4526\n },\n {\n \"tag\": "Castilloa",\n \"popularity\": 4522\n },\n {\n \"tag\": "forelady Georgie",\n \"popularity\": 4519\n },\n {\n \"tag\": "outsider",\n \"popularity\": 4515\n },\n {\n \"tag\": "Enukki",\n \"popularity\": 4512\n },\n {\n \"tag\": "gypsy",\n \"popularity\": 4509\n },\n {\n \"tag\": "Passamaquoddy",\n \"popularity\": 4505\n },\n {\n \"tag\": "reposit",\n \"popularity\": 4502\n },\n {\n \"tag\": "overtenderness",\n \"popularity\": 4499\n },\n {\n \"tag\": "keratome",\n \"popularity\": 4495\n },\n {\n \"tag\": "interclavicular hypermonosyllable Susanna",\n \"popularity\": 4492\n },\n {\n \"tag\": "mispropose",\n \"popularity\": 4489\n },\n {\n \"tag\": "Membranipora",\n \"popularity\": 4485\n },\n {\n \"tag\": "lampad",\n \"popularity\": 4482\n },\n {\n \"tag\": "header",\n \"popularity\": 4479\n },\n {\n \"tag\": "triseriate",\n \"popularity\": 4475\n },\n {\n \"tag\": "distrainment",\n \"popularity\": 4472\n },\n {\n \"tag\": "staphyloplastic",\n \"popularity\": 4469\n },\n {\n \"tag\": "outscour",\n \"popularity\": 4465\n },\n {\n \"tag\": "tallowmaking",\n \"popularity\": 4462\n },\n {\n \"tag\": "plugger",\n \"popularity\": 4459\n },\n {\n \"tag\": "fashionize",\n \"popularity\": 4455\n },\n {\n \"tag\": "puzzle",\n \"popularity\": 4452\n },\n {\n \"tag\": "imbrue",\n \"popularity\": 4449\n },\n {\n \"tag\": "osteoblast",\n \"popularity\": 4445\n },\n {\n \"tag\": "Hydrocores",\n \"popularity\": 4442\n },\n {\n \"tag\": "Lutra",\n \"popularity\": 4439\n },\n {\n \"tag\": "upridge scarfy",\n \"popularity\": 4435\n },\n {\n \"tag\": "ancon taffle",\n \"popularity\": 4432\n },\n {\n \"tag\": "impest",\n \"popularity\": 4429\n },\n {\n \"tag\": "uncollatedness",\n \"popularity\": 4426\n },\n {\n \"tag\": "hypersensitize",\n \"popularity\": 4422\n },\n {\n \"tag\": "autographically",\n \"popularity\": 4419\n },\n {\n \"tag\": "louther",\n \"popularity\": 4416\n },\n {\n \"tag\": "Ollie",\n \"popularity\": 4413\n },\n {\n \"tag\": "recompensate",\n \"popularity\": 4409\n },\n {\n \"tag\": "Shan",\n \"popularity\": 4406\n },\n {\n \"tag\": "brachycnemic",\n \"popularity\": 4403\n },\n {\n \"tag\": "Carinatae",\n \"popularity\": 4399\n },\n {\n \"tag\": "geotherm",\n \"popularity\": 4396\n },\n {\n \"tag\": "sawback",\n \"popularity\": 4393\n },\n {\n \"tag\": "Novatianist",\n \"popularity\": 4390\n },\n {\n \"tag\": "reapproach",\n \"popularity\": 4387\n },\n {\n \"tag\": "myelopoietic",\n \"popularity\": 4383\n },\n {\n \"tag\": "cyanin",\n \"popularity\": 4380\n },\n {\n \"tag\": "unsmutted",\n \"popularity\": 4377\n },\n {\n \"tag\": "nonpapist",\n \"popularity\": 4374\n },\n {\n \"tag\": "transbaikalian",\n \"popularity\": 4370\n },\n {\n \"tag\": "connately",\n \"popularity\": 4367\n },\n {\n \"tag\": "tenderize iterance",\n \"popularity\": 4364\n },\n {\n \"tag\": "hydrostatical",\n \"popularity\": 4361\n },\n {\n \"tag\": "unflag",\n \"popularity\": 4358\n },\n {\n \"tag\": "translate",\n \"popularity\": 4354\n },\n {\n \"tag\": "Scorzonera",\n \"popularity\": 4351\n },\n {\n \"tag\": "uncomforted",\n \"popularity\": 4348\n },\n {\n \"tag\": "risser varied",\n \"popularity\": 4345\n },\n {\n \"tag\": "plumbate",\n \"popularity\": 4342\n },\n {\n \"tag\": "Usneaceae",\n \"popularity\": 4338\n },\n {\n \"tag\": "fohat",\n \"popularity\": 4335\n },\n {\n \"tag\": "slagging",\n \"popularity\": 4332\n },\n {\n \"tag\": "superserious",\n \"popularity\": 4329\n },\n {\n \"tag\": "theocracy",\n \"popularity\": 4326\n },\n {\n \"tag\": "valonia",\n \"popularity\": 4323\n },\n {\n \"tag\": "Sapindales",\n \"popularity\": 4319\n },\n {\n \"tag\": "palaeozoologist",\n \"popularity\": 4316\n },\n {\n \"tag\": "yalb",\n \"popularity\": 4313\n },\n {\n \"tag\": "unviewed",\n \"popularity\": 4310\n },\n {\n \"tag\": "polyarteritis",\n \"popularity\": 4307\n },\n {\n \"tag\": "vectorial",\n \"popularity\": 4304\n },\n {\n \"tag\": "skimpingly",\n \"popularity\": 4301\n },\n {\n \"tag\": "athort",\n \"popularity\": 4297\n },\n {\n \"tag\": "tribofluorescence",\n \"popularity\": 4294\n },\n {\n \"tag\": "benzonitrol",\n \"popularity\": 4291\n },\n {\n \"tag\": "swiller subobtuse subjacency",\n \"popularity\": 4288\n },\n {\n \"tag\": "uncompassed",\n \"popularity\": 4285\n },\n {\n \"tag\": "cacochymia",\n \"popularity\": 4282\n },\n {\n \"tag\": "commensalist butadiene",\n \"popularity\": 4279\n },\n {\n \"tag\": "culpable",\n \"popularity\": 4276\n },\n {\n \"tag\": "contributive",\n \"popularity\": 4273\n },\n {\n \"tag\": "attemperately",\n \"popularity\": 4269\n },\n {\n \"tag\": "spelt",\n \"popularity\": 4266\n },\n {\n \"tag\": "exoneration",\n \"popularity\": 4263\n },\n {\n \"tag\": "antivivisectionist",\n \"popularity\": 4260\n },\n {\n \"tag\": "granitification",\n \"popularity\": 4257\n },\n {\n \"tag\": "palladize",\n \"popularity\": 4254\n },\n {\n \"tag\": "marksmanship",\n \"popularity\": 4251\n },\n {\n \"tag\": "bullydom",\n \"popularity\": 4248\n },\n {\n \"tag\": "spirality",\n \"popularity\": 4245\n },\n {\n \"tag\": "caliginous",\n \"popularity\": 4242\n },\n {\n \"tag\": "reportedly",\n \"popularity\": 4239\n },\n {\n \"tag\": "polyad",\n \"popularity\": 4236\n },\n {\n \"tag\": "arthroempyesis",\n \"popularity\": 4233\n },\n {\n \"tag\": "semibay facultatively",\n \"popularity\": 4229\n },\n {\n \"tag\": "metastatically",\n \"popularity\": 4226\n },\n {\n \"tag\": "prophetically",\n \"popularity\": 4223\n },\n {\n \"tag\": "Linguatula elapid",\n \"popularity\": 4220\n },\n {\n \"tag\": "pyknatom",\n \"popularity\": 4217\n },\n {\n \"tag\": "centimeter",\n \"popularity\": 4214\n },\n {\n \"tag\": "mensurate",\n \"popularity\": 4211\n },\n {\n \"tag\": "migraine",\n \"popularity\": 4208\n },\n {\n \"tag\": "pentagamist",\n \"popularity\": 4205\n },\n {\n \"tag\": "querken",\n \"popularity\": 4202\n },\n {\n \"tag\": "ambulance",\n \"popularity\": 4199\n },\n {\n \"tag\": "Stokavian",\n \"popularity\": 4196\n },\n {\n \"tag\": "malvasian",\n \"popularity\": 4193\n },\n {\n \"tag\": "uncouthsome",\n \"popularity\": 4190\n },\n {\n \"tag\": "readable",\n \"popularity\": 4187\n },\n {\n \"tag\": "enlodge",\n \"popularity\": 4184\n },\n {\n \"tag\": "plasterwise Appendiculariidae perspectograph",\n \"popularity\": 4181\n },\n {\n \"tag\": "inkweed",\n \"popularity\": 4178\n },\n {\n \"tag\": "streep",\n \"popularity\": 4175\n },\n {\n \"tag\": "diadelphian cultured",\n \"popularity\": 4172\n },\n {\n \"tag\": "hymenopterous",\n \"popularity\": 4169\n },\n {\n \"tag\": "unexorableness",\n \"popularity\": 4166\n },\n {\n \"tag\": "cascaron",\n \"popularity\": 4163\n },\n {\n \"tag\": "undaintiness",\n \"popularity\": 4160\n },\n {\n \"tag\": "Curtana",\n \"popularity\": 4157\n },\n {\n \"tag\": "scurvied",\n \"popularity\": 4154\n },\n {\n \"tag\": "molluscoidal",\n \"popularity\": 4151\n },\n {\n \"tag\": "yurt",\n \"popularity\": 4148\n },\n {\n \"tag\": "deciduitis",\n \"popularity\": 4145\n },\n {\n \"tag\": "creephole",\n \"popularity\": 4142\n },\n {\n \"tag\": "quatrefeuille",\n \"popularity\": 4139\n },\n {\n \"tag\": "bicapitate adenomatome",\n \"popularity\": 4136\n },\n {\n \"tag\": "damassin",\n \"popularity\": 4134\n },\n {\n \"tag\": "planching",\n \"popularity\": 4131\n },\n {\n \"tag\": "dashedly inferential",\n \"popularity\": 4128\n },\n {\n \"tag\": "lobe",\n \"popularity\": 4125\n },\n {\n \"tag\": "Hyrachyus",\n \"popularity\": 4122\n },\n {\n \"tag\": "knab",\n \"popularity\": 4119\n },\n {\n \"tag\": "discohexaster",\n \"popularity\": 4116\n },\n {\n \"tag\": "malign",\n \"popularity\": 4113\n },\n {\n \"tag\": "pedagoguism",\n \"popularity\": 4110\n },\n {\n \"tag\": "shrubbery",\n \"popularity\": 4107\n },\n {\n \"tag\": "undershrub",\n \"popularity\": 4104\n },\n {\n \"tag\": "bureaucrat",\n \"popularity\": 4101\n },\n {\n \"tag\": "pantaleon",\n \"popularity\": 4098\n },\n {\n \"tag\": "mesoventral",\n \"popularity\": 4096\n }]';
+
+var log2 = Math.log(2);
+var tagInfo = tagInfoJSON.parseJSON(function(a, b) { if (a == "popularity") { return Math.log(b) / log2; } else {return b; } });
+
+function makeTagCloud(tagInfo)
+{
+ var output = '<div class="tagCloud" style="width: 100%">';
+
+ tagInfo.sort(function(a, b) { if (a.tag < b.tag) { return -1; } else if (a.tag == b.tag) { return 0; } else return 1; });
+
+ for (var i = 0; i < tagInfo.length; i++) {
+ var tag = tagInfo[i].tag;
+
+ var validates = true;
+ for (var j = 0; j < tag.length; j++) {
+ var ch = tag.charCodeAt(j);
+ if (ch < 0x20 || ch >= 0x7f) {
+ validates = false;
+ break;
+ }
+ }
+
+ if (!validates)
+ continue;
+
+ var url = "http://example.com/tag/" + tag.replace(" ", "").toLowerCase();
+ var popularity = tagInfo[i].popularity;
+ var color = 'rgb(' + Math.floor(255 * (popularity - 12) / 20) + ', 0, 255)';
+ output += ' <a href="' + url + '" style="font-size: ' + popularity + 'px; color: ' + color + '">' + tag + '</a> \n';
+ }
+
+ output += '</div>';
+ output.replace(" ", "&nbsp;");
+
+ return output;
+}
+
+var tagcloud = makeTagCloud(tagInfo);
+tagInfo = null;
diff --git a/tests/benchmarks/script/sunspider/tests/string-unpack-code.js b/tests/benchmarks/script/sunspider/tests/string-unpack-code.js
new file mode 100644
index 0000000000..e6330f15f3
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/string-unpack-code.js
@@ -0,0 +1,68 @@
+// This test case unpacks the compressed code for the MochiKit,
+// jQuery, Dojo and Prototype JavaScript libraries.
+
+/***
+ MochiKit.MochiKit 1.3.1 : PACKED VERSION
+ THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please
+ diff against the source tree, not this file.
+
+ See <http://mochikit.com/> for documentation, downloads, license, etc.
+
+ (c) 2005 Bob Ippolito. All rights Reserved.
+***/
+
+for (var i = 0; i < 2; i++) {
+
+var decompressedMochiKit = function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('if(H(1q)!="L"){1q.2X("B.J")}if(H(B)=="L"){B={}}if(H(B.J)=="L"){B.J={}}B.J.1Y="1.3.1";B.J.1r="B.J";B.J.2l=G(7V,vR){if(7V===O){7V={}}R(u i=1;i<M.K;i++){u o=M[i];if(H(o)!="L"&&o!==O){R(u k in o){7V[k]=o[k]}}}F 7V};B.J.2l(B.J,{1K:G(){F"["+D.1r+" "+D.1Y+"]"},1l:G(){F D.1K()},4f:G(n){if(M.K===0){n=1}F G(){F n++}},4L:G(mw){u me=M.2U;if(M.K==1){me.1U=mw;F Y me()}},bg:G(vQ){u X=[];u m=B.J;u aw=m.1R(O,M);1M(aw.K){u o=aw.2P();if(o&&H(o)=="3n"&&H(o.K)=="2y"){R(u i=o.K-1;i>=0;i--){aw.e9(o[i])}}N{X.1c(o)}}F X},1R:G(7U,1i,av){if(!av){av=0}if(1i){u l=1i.K;if(H(l)!="2y"){if(H(B.15)!="L"){1i=B.15.2G(1i);l=1i.K}N{14 Y 3p("au 2E an at-as 3W B.15 2E ar")}}if(!7U){7U=[]}R(u i=av;i<l;i++){7U.1c(1i[i])}}F 7U},8Z:G(5g,1i){if(5g===O){5g={}}R(u i=1;i<M.K;i++){u o=M[i];if(H(o)!="L"&&o!==O){R(u k in o){u v=o[k];if(H(5g[k])=="3n"&&H(v)=="3n"){M.2U(5g[k],v)}N{5g[k]=v}}}}F 5g},lO:G(6c,1i){if(6c===O){6c={}}R(u i=1;i<M.K;i++){u o=M[i];R(u k in o){if(!(k in 6c)){6c[k]=o[k]}}}F 6c},lN:G(1i){u fj=[];R(u mv in 1i){fj.1c(mv)}F fj},lM:G(1i){u fh=[];u e;R(u fi in 1i){u v;1f{v=1i[fi]}1e(e){2V}fh.1c([fi,v])}F fh},jq:G(fg,ff,fe){fe.1U=Y B.J.5a(fg.1r+"."+ff);fg[ff]=fe},4i:{7L:G(a){F!!a},vP:G(a){F!a},eE:G(a){F a},2E:G(a){F~a},vO:G(a){F-a},vN:G(a,b){F a+b},vM:G(a,b){F a-b},4u:G(a,b){F a/b},vL:G(a,b){F a%b},vK:G(a,b){F a*b},3W:G(a,b){F a&b},or:G(a,b){F a|b},vJ:G(a,b){F a^b},vI:G(a,b){F a<<b},vH:G(a,b){F a>>b},vG:G(a,b){F a>>>b},eq:G(a,b){F a==b},ne:G(a,b){F a!=b},gt:G(a,b){F a>b},ge:G(a,b){F a>=b},lt:G(a,b){F a<b},le:G(a,b){F a<=b},vF:G(a,b){F B.J.2f(a,b)===0},vE:G(a,b){F B.J.2f(a,b)!==0},vD:G(a,b){F B.J.2f(a,b)==1},vC:G(a,b){F B.J.2f(a,b)!=-1},vB:G(a,b){F B.J.2f(a,b)==-1},vA:G(a,b){F B.J.2f(a,b)!=1},vz:G(a,b){F a&&b},vy:G(a,b){F a||b},vx:G(a,b){F b in a}},24:G(mu){F G(){F D[mu].1w(D,M)}},lL:G(mt){F G(a9){F a9[mt]}},66:G(){u fd={};R(u i=0;i<M.K;i++){u 6b=M[i];fd[6b]=6b}F G(){R(u i=0;i<M.K;i++){if(!(H(M[i])in fd)){F 1m}}F 1h}},lJ:G(){R(u i=0;i<M.K;i++){if(M[i]!==O){F 1m}}F 1h},lK:G(){R(u i=0;i<M.K;i++){u o=M[i];if(!(H(o)=="L"||o===O)){F 1m}}F 1h},lI:G(1i){F!B.J.7e.1w(D,M)},7e:G(1i){R(u i=0;i<M.K;i++){u o=M[i];if(!(o&&o.K)){F 1m}}F 1h},3A:G(){R(u i=0;i<M.K;i++){u o=M[i];u 6b=H(o);if((6b!="3n"&&!(6b=="G"&&H(o.vw)=="G"))||o===O||H(o.K)!="2y"){F 1m}}F 1h},eN:G(){R(u i=0;i<M.K;i++){u o=M[i];if(H(o)!="3n"||o===O||H(o.9P)!="G"){F 1m}}F 1h},lH:G(fn){if(fn===O){F B.J.1R(O,M,1)}u fc=[];R(u i=1;i<M.K;i++){fc.1c(fn(M[i]))}F fc},2r:G(fn,1g){u m=B.J;u 6a=B.15;u fb=m.3A;if(M.K<=2){if(!fb(1g)){if(6a){1g=6a.2G(1g);if(fn===O){F 1g}}N{14 Y 3p("au 2E an at-as 3W B.15 2E ar")}}if(fn===O){F m.1R(O,1g)}u 69=[];R(u i=0;i<1g.K;i++){69.1c(fn(1g[i]))}F 69}N{if(fn===O){fn=7o}u 7T=O;R(i=1;i<M.K;i++){if(!fb(M[i])){if(6a){F 6a.2G(6a.4c.1w(O,M))}N{14 Y 3p("au 2E an at-as 3W B.15 2E ar")}}u l=M[i].K;if(7T===O||7T>l){7T=l}}69=[];R(i=0;i<7T;i++){u fa=[];R(u j=1;j<M.K;j++){fa.1c(M[j][i])}69.1c(fn.1w(D,fa))}F 69}},lG:G(fn){u f9=[];if(fn===O){fn=B.J.4i.7L}R(u i=1;i<M.K;i++){u o=M[i];if(fn(o)){f9.1c(o)}}F f9},47:G(fn,1g,7S){u aq=[];u m=B.J;if(!m.3A(1g)){if(B.15){1g=B.15.2G(1g)}N{14 Y 3p("au 2E an at-as 3W B.15 2E ar")}}if(fn===O){fn=m.4i.7L}if(H(7o.1U.47)=="G"){F 7o.1U.47.cz(1g,fn,7S)}N{if(H(7S)=="L"||7S===O){R(u i=0;i<1g.K;i++){u o=1g[i];if(fn(o)){aq.1c(o)}}}N{R(i=0;i<1g.K;i++){o=1g[i];if(fn.cz(7S,o)){aq.1c(o)}}}}F aq},mq:G(7R){F G(){hd(M.K){3j 0:F 7R();3j 1:F 7R(M[0]);3j 2:F 7R(M[0],M[1]);3j 3:F 7R(M[0],M[1],M[2])}u f8=[];R(u i=0;i<M.K;i++){f8.1c("M["+i+"]")}F dB("(1A("+f8.2b(",")+"))")}},lv:G(mr,ms){u m=B.J;F m.1O.1w(D,m.1R([ms,mr],M,2))},1O:G(3c,4o){if(H(3c)=="1n"){3c=4o[3c]}u ao=3c.f5;u 5f=3c.am;u f6=3c.f7;u m=B.J;if(H(3c)=="G"&&H(3c.1w)=="L"){3c=m.mq(3c)}if(H(ao)!="G"){ao=3c}if(H(4o)!="L"){f6=4o}if(H(5f)=="L"){5f=[]}N{5f=5f.9T()}m.1R(5f,M,2);u 7Q=G(){u ap=M;u me=M.2U;if(me.am.K>0){ap=m.2o(me.am,ap)}u 4o=me.f7;if(!4o){4o=D}F me.f5.1w(4o,ap)};7Q.f7=f6;7Q.f5=ao;7Q.am=5f;F 7Q},lF:G(7P){u mp=B.J.1O;R(u k in 7P){u f4=7P[k];if(H(f4)=="G"){7P[k]=mp(f4,7P)}}},5u:G(mo,mn,ml,mk){B.J.ae.5M(mo,mn,ml,mk)},mj:{"5L":1h,"1n":1h,"2y":1h},2f:G(a,b){if(a==b){F 0}u f3=(H(a)=="L"||a===O);u f2=(H(b)=="L"||b===O);if(f3&&f2){F 0}N{if(f3){F-1}N{if(f2){F 1}}}u m=B.J;u f1=m.mj;if(!(H(a)in f1&&H(b)in f1)){1f{F m.ae.3C(a,b)}1e(e){if(e!=m.4d){14 e}}}if(a<b){F-1}N{if(a>b){F 1}}u f0=m.U;14 Y 3p(f0(a)+" 3W "+f0(b)+" 9v 2E be vv")},eM:G(a,b){F B.J.2f(a.9P(),b.9P())},eL:G(a,b){u mi=B.J.2f;u 7O=a.K;u al=0;if(7O>b.K){al=1;7O=b.K}N{if(7O<b.K){al=-1}}R(u i=0;i<7O;i++){u 4j=mi(a[i],b[i]);if(4j){F 4j}}F al},7M:G(mh,mg,mf,md){B.J.ad.5M(mh,mg,mf,md)},U:G(o){if(H(o)=="L"){F"L"}N{if(o===O){F"O"}}1f{if(H(o.1K)=="G"){F o.1K()}N{if(H(o.U)=="G"&&o.U!=M.2U){F o.U()}}F B.J.ad.3C(o)}1e(e){if(H(o.1r)=="1n"&&(o.1l==cZ.1U.1l||o.1l==vu.1U.1l)){F o.1r}}1f{u eZ=(o+"")}1e(e){F"["+H(o)+"]"}if(H(o)=="G"){o=eZ.23(/^\\s+/,"");u 5n=o.2A("{");if(5n!=-1){o=o.3H(0,5n)+"{...}"}}F eZ},eK:G(o){u m=B.J;F"["+m.2r(m.U,o).2b(", ")+"]"},ac:G(o){F("\\""+o.23(/(["\\\\])/g,"\\\\$1")+"\\"").23(/[\\f]/g,"\\\\f").23(/[\\b]/g,"\\\\b").23(/[\\n]/g,"\\\\n").23(/[\\t]/g,"\\\\t").23(/[\\r]/g,"\\\\r")},eJ:G(o){F o+""},ly:G(mc,mb,ma,m9){B.J.ab.5M(mc,mb,ma,m9)},lx:G(){F dB("("+M[0]+")")},lz:G(o){u 5e=H(o);if(5e=="L"){F"L"}N{if(5e=="2y"||5e=="5L"){F o+""}N{if(o===O){F"O"}}}u m=B.J;u eY=m.ac;if(5e=="1n"){F eY(o)}u me=M.2U;u 3S;if(H(o.m8)=="G"){3S=o.m8();if(o!==3S){F me(3S)}}if(H(o.m7)=="G"){3S=o.m7();if(o!==3S){F me(3S)}}if(5e!="G"&&H(o.K)=="2y"){u X=[];R(u i=0;i<o.K;i++){u 2i=me(o[i]);if(H(2i)!="1n"){2i="L"}X.1c(2i)}F"["+X.2b(", ")+"]"}1f{3S=m.ab.3C(o);F me(3S)}1e(e){if(e!=m.4d){14 e}}if(5e=="G"){F O}X=[];R(u k in o){u ak;if(H(k)=="2y"){ak="\\""+k+"\\""}N{if(H(k)=="1n"){ak=eY(k)}N{2V}}2i=me(o[k]);if(H(2i)!="1n"){2V}X.1c(ak+":"+2i)}F"{"+X.2b(", ")+"}"},lE:G(a,b){F(B.J.2f(a,b)===0)},lD:G(eX,4n){if(eX.K!=4n.K){F 1m}F(B.J.2f(eX,4n)===0)},2o:G(){u eW=[];u m6=B.J.1R;R(u i=0;i<M.K;i++){m6(eW,M[i])}F eW},eR:G(2h){u m=B.J;u eU=m.2f;if(M.K==1){F G(a,b){F eU(a[2h],b[2h])}}u eV=m.1R(O,M);F G(a,b){u aj=0;R(u i=0;(aj===0)&&(i<eV.K);i++){u 2h=eV[i];aj=eU(a[2h],b[2h])}F aj}},lC:G(2h){u m5=B.J.eR.1w(D,M);F G(a,b){F m5(b,a)}},2z:G(m4){u m=B.J;F m.1O.1w(D,m.1R([m4,L],M,1))},67:G(m0,1g){if(1g.K===0){F O}u ai=1g[0];u m3=B.J.2f;R(u i=1;i<1g.K;i++){u o=1g[i];if(m3(o,ai)==m0){ai=o}}F ai},lB:G(){F B.J.67(1,M)},lA:G(){F B.J.67(-1,M)},bi:G(1g,lY,lZ,3B){if(H(3B)=="L"||3B===O){3B=1g.K}R(u i=(lZ||0);i<3B;i++){if(1g[i]===lY){F i}}F-1},eO:G(1g,lW,lX,3B){if(H(3B)=="L"||3B===O){3B=1g.K}u 4j=B.J.2f;R(u i=(lX||0);i<3B;i++){if(4j(1g[i],lW)===0){F i}}F-1},d4:G(1j,lV){u ah=[1j];u lU=B.J.1R;1M(ah.K){u X=lV(ah.2P());if(X){lU(ah,X)}}},3f:G(ag){u 2w=ag.1r;if(H(2w)=="L"){2w=""}N{2w=2w+"."}R(u 1b in ag){u o=ag[1b];if(H(o)=="G"&&H(o.1r)=="L"){1f{o.1r=2w+1b}1e(e){}}}},dw:G(3s,68){if(H(B.S)!="L"&&M.K==1&&(H(3s)=="1n"||(H(3s.3T)!="L"&&3s.3T>0))){u kv=B.S.d5(3s);3s=kv[0];68=kv[1]}N{if(M.K==1){u o=3s;3s=[];68=[];R(u k in o){u v=o[k];if(H(v)!="G"){3s.1c(k);68.1c(v)}}}}u W=[];u lT=28.2a(3s.K,68.K);u eT=B.J.af;R(u i=0;i<lT;i++){v=68[i];if(H(v)!="L"&&v!==O){W.1c(eT(3s[i])+"="+eT(v))}}F W.2b("&")},lw:G(lS,lQ){u 7N=lS.23(/\\+/g,"%20").2R("&");u o={};u 5d;if(H(lR)!="L"){5d=lR}N{5d=vt}if(lQ){R(u i=0;i<7N.K;i++){u 2n=7N[i].2R("=");u 1b=5d(2n[0]);u 4n=o[1b];if(!(4n 2C 7o)){4n=[];o[1b]=4n}4n.1c(5d(2n[1]))}}N{R(i=0;i<7N.K;i++){2n=7N[i].2R("=");o[5d(2n[0])]=5d(2n[1])}}F o}});B.J.4a=G(){D.4m=[]};B.J.4a.1U={5M:G(1b,eS,3y,lP){if(lP){D.4m.e9([1b,eS,3y])}N{D.4m.1c([1b,eS,3y])}},3C:G(){R(u i=0;i<D.4m.K;i++){u 2n=D.4m[i];if(2n[1].1w(D,M)){F 2n[2].1w(D,M)}}14 B.J.4d},vs:G(1b){R(u i=0;i<D.4m.K;i++){u 2n=D.4m[i];if(2n[0]==1b){D.4m.4y(i,1);F 1h}}F 1m}};B.J.1z=["4f","4L","1R","2l","8Z","lO","lN","lM","5a","4i","24","lL","66","lo","ln","lK","lJ","lI","7e","3A","eN","lH","2r","lG","47","1O","lF","4d","4a","5u","2f","7M","U","lE","lD","2o","eR","lC","2z","lm","67","lp","eI","lB","lA","d4","ll","af","dw","lz","ly","lx","lw","eO","bi","bg","lv"];B.J.1W=["3f","ae","ad","ab","eM","eL","eK","ac","eJ"];B.J.2Y=G(lu,eP){if(H(B.eQ)=="L"){B.eQ=(B.3d||(H(1x)=="L"&&H(1q)=="L"))}if(!B.eQ){F}u 1p=eP.2k[":1p"];R(u i=0;i<1p.K;i++){lu[1p[i]]=eP[1p[i]]}};B.J.2d=G(){u m=D;m.vr=m.24;m.vq=m.eO;if(H(ls)!="L"){m.af=G(lr){F ls(lr).23(/\\\'/g,"%27")}}N{m.af=G(lq){F vp(lq).23(/\\+/g,"%2B").23(/\\"/g,"%22").W.23(/\\\'/g,"%27")}}m.5a=G(1b){D.43=1b;D.1b=1b};m.5a.1U=Y 2x();m.2l(m.5a.1U,{U:G(){if(D.43&&D.43!=D.1b){F D.1b+"("+m.U(D.43)+")"}N{F D.1b+"()"}},1l:m.24("U")});m.4d=Y m.5a("B.J.4d");m.lp=m.2z(m.67,1);m.eI=m.2z(m.67,-1);m.lo=m.66("G");m.ln=m.66("L");m.lm=m.2z(m.2l,O);m.ll=m.2z(m.2r,O);m.ae=Y m.4a();m.5u("vo",m.eN,m.eM);m.5u("ej",m.3A,m.eL);m.ad=Y m.4a();m.7M("ej",m.3A,m.eK);m.7M("1n",m.66("1n"),m.ac);m.7M("vn",m.66("2y","5L"),m.eJ);m.ab=Y m.4a();u 1p=m.2o(m.1z,m.1W);m.2k={":3e":m.2o(m.1W),":1p":1p};m.3f(D)};B.J.2d();if(!B.3d){2f=B.J.2f}B.J.2Y(D,B.J);if(H(1q)!="L"){1q.2X("B.15");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.J",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.15 3F on B.J!"}if(H(B.15)=="L"){B.15={}}B.15.1r="B.15";B.15.1Y="1.3.1";B.J.2l(B.15,{1K:G(){F"["+D.1r+" "+D.1Y+"]"},1l:G(){F D.1K()},9W:G(1b,lk,lj,lh){B.15.9Y.5M(1b,lk,lj,lh)},1Q:G(3R,lg){u I=B.15;if(M.K==2){F I.9Z(G(a){F a!=lg},3R)}if(H(3R.1a)=="G"){F 3R}N{if(H(3R.1Q)=="G"){F 3R.1Q()}}1f{F I.9Y.3C(3R)}1e(e){u m=B.J;if(e==m.4d){e=Y 3p(H(3R)+": "+m.U(3R)+" is 2E vm")}14 e}},eu:G(n){if(!n){n=0}u m=B.J;F{U:G(){F"eu("+n+")"},1l:m.24("U"),1a:m.4f(n)}},et:G(p){u I=B.15;u m=B.J;u 1g=[];u lf=I.1Q(p);F{U:G(){F"et(...)"},1l:m.24("U"),1a:G(){1f{u W=lf.1a();1g.1c(W);F W}1e(e){if(e!=I.25){14 e}if(1g.K===0){D.1a=G(){14 I.25}}N{u i=-1;D.1a=G(){i=(i+1)%1g.K;F 1g[i]}}F D.1a()}}}},7b:G(Q,n){u m=B.J;if(H(n)=="L"){F{U:G(){F"7b("+m.U(Q)+")"},1l:m.24("U"),1a:G(){F Q}}}F{U:G(){F"7b("+m.U(Q)+", "+n+")"},1l:m.24("U"),1a:G(){if(n<=0){14 B.15.25}n-=1;F Q}}},1a:G(ld){F ld.1a()},es:G(p,q){u m=B.J;u 1a=B.15.1a;u lc=m.2r(1Q,M);F{U:G(){F"es(...)"},1l:m.24("U"),1a:G(){F m.2r(1a,lc)}}},a1:G(3b,1V){u m=B.J;1V=B.15.1Q(1V);if(3b===O){3b=m.4i.7L}F{U:G(){F"a1(...)"},1l:m.24("U"),1a:G(){1M(1h){u W=1V.1a();if(3b(W)){F W}}F L}}},a0:G(3b,1V){u m=B.J;1V=B.15.1Q(1V);if(3b===O){3b=m.4i.7L}F{U:G(){F"a0(...)"},1l:m.24("U"),1a:G(){1M(1h){u W=1V.1a();if(!3b(W)){F W}}F L}}},er:G(1V){u I=B.15;u m=B.J;1V=I.1Q(1V);u 5c=0;u 2J=0;u 3a=1;u i=-1;if(M.K==2){2J=M[1]}N{if(M.K==3){5c=M[1];2J=M[2]}N{5c=M[1];2J=M[2];3a=M[3]}}F{U:G(){F"er("+["...",5c,2J,3a].2b(", ")+")"},1l:m.24("U"),1a:G(){u W;1M(i<5c){W=1V.1a();i++}if(5c>=2J){14 I.25}5c+=3a;F W}}},4c:G(aa,p,q){u m=B.J;u I=B.15;u lb=m.2r(I.1Q,m.1R(O,M,1));u 2r=m.2r;u 1a=I.1a;F{U:G(){F"4c(...)"},1l:m.24("U"),1a:G(){F aa.1w(D,2r(1a,lb))}}},ep:G(aa,1V,I){1V=B.15.1Q(1V);u m=B.J;F{U:G(){F"ep(...)"},1l:m.24("U"),1a:G(){F aa.1w(I,1V.1a())}}},55:G(p,q){u I=B.15;u m=B.J;if(M.K==1){F I.1Q(M[0])}u 64=m.2r(I.1Q,M);F{U:G(){F"55(...)"},1l:m.24("U"),1a:G(){1M(64.K>1){1f{F 64[0].1a()}1e(e){if(e!=I.25){14 e}64.2P()}}if(64.K==1){u a9=64.2P();D.1a=m.1O("1a",a9);F D.1a()}14 I.25}}},9Z:G(3b,1V){u I=B.15;1V=I.1Q(1V);F{U:G(){F"9Z(...)"},1l:B.J.24("U"),1a:G(){u W=1V.1a();if(!3b(W)){D.1a=G(){14 I.25};D.1a()}F W}}},eo:G(3b,1V){1V=B.15.1Q(1V);u m=B.J;u 1O=m.1O;F{"U":G(){F"eo(...)"},"1l":m.24("U"),"1a":G(){1M(1h){u W=1V.1a();if(!3b(W)){2K}}D.1a=1O("1a",1V);F W}}},a7:G(63,2u,la){2u.62[63]=-1;u m=B.J;u l9=m.eI;F{U:G(){F"en("+63+", ...)"},1l:m.24("U"),1a:G(){u W;u i=2u.62[63];if(i==2u.29){W=la.1a();2u.a8.1c(W);2u.29+=1;2u.62[63]+=1}N{W=2u.a8[i-2u.2a];2u.62[63]+=1;if(i==2u.2a&&l9(2u.62)!=2u.2a){2u.2a+=1;2u.a8.2P()}}F W}}},en:G(a6,n){u W=[];u 2u={"62":[],"a8":[],"29":-1,"2a":-1};if(M.K==1){n=2}u I=B.15;a6=I.1Q(a6);u a7=I.a7;R(u i=0;i<n;i++){W.1c(a7(i,2u,a6))}F W},2G:G(4l){u m=B.J;if(H(4l.9T)=="G"){F 4l.9T()}N{if(m.3A(4l)){F m.2o(4l)}}u I=B.15;4l=I.1Q(4l);u W=[];1f{1M(1h){W.1c(4l.1a())}}1e(e){if(e!=I.25){14 e}F W}F L},7H:G(fn,7K,l8){u i=0;u x=l8;u I=B.15;7K=I.1Q(7K);if(M.K<3){1f{x=7K.1a()}1e(e){if(e==I.25){e=Y 3p("7H() of vl vk vj no vi 3m")}14 e}i++}1f{1M(1h){x=fn(x,7K.1a())}}1e(e){if(e!=I.25){14 e}}F x},7I:G(){u 4k=0;u 2J=0;u 3a=1;if(M.K==1){2J=M[0]}N{if(M.K==2){4k=M[0];2J=M[1]}N{if(M.K==3){4k=M[0];2J=M[1];3a=M[2]}N{14 Y 3p("7I() vh 1, 2, or 3 M!")}}}if(3a===0){14 Y 3p("7I() 3a 5p 2E be 0")}F{1a:G(){if((3a>0&&4k>=2J)||(3a<0&&4k<=2J)){14 B.15.25}u W=4k;4k+=3a;F W},U:G(){F"7I("+[4k,2J,3a].2b(", ")+")"},1l:B.J.24("U")}},l0:G(a5,l7){u x=l7||0;u I=B.15;a5=I.1Q(a5);1f{1M(1h){x+=a5.1a()}}1e(e){if(e!=I.25){14 e}}F x},em:G(a4){u I=B.15;a4=I.1Q(a4);1f{1M(1h){a4.1a()}}1e(e){if(e!=I.25){14 e}}},9a:G(7J,1A,I){u m=B.J;if(M.K>2){1A=m.1O(1A,I)}if(m.3A(7J)){1f{R(u i=0;i<7J.K;i++){1A(7J[i])}}1e(e){if(e!=B.15.25){14 e}}}N{I=B.15;I.em(I.4c(1A,7J))}},kZ:G(l6,1A){u I=B.15;1f{I.a0(1A,l6).1a();F 1m}1e(e){if(e!=I.25){14 e}F 1h}},kY:G(l5,4j){u W=B.15.2G(l5);if(M.K==1){4j=B.J.2f}W.iz(4j);F W},kX:G(l4){u W=B.15.2G(l4);W.vg();F W},kW:G(l3,1A){u I=B.15;1f{I.a1(1A,l3).1a();F 1h}1e(e){if(e!=I.25){14 e}F 1m}},kV:G(1g,5b){if(B.J.3A(5b)){R(u i=0;i<5b.K;i++){1g.1c(5b[i])}}N{u I=B.15;5b=I.1Q(5b);1f{1M(1h){1g.1c(5b.1a())}}1e(e){if(e!=I.25){14 e}}}F 1g},ek:G(a3,eH){u m=B.J;u I=B.15;if(M.K<2){eH=m.4i.eE}a3=I.1Q(a3);u pk=L;u k=L;u v;G eF(){v=a3.1a();k=eH(v)}G l2(){u 7j=v;v=L;F 7j}u eG=1h;F{U:G(){F"ek(...)"},1a:G(){1M(k==pk){eF();if(eG){eG=1m;2K}}pk=k;F[k,{1a:G(){if(v==L){eF()}if(k!=pk){14 I.25}F l2()}}]}}},kU:G(a2,eD){u m=B.J;u I=B.15;if(M.K<2){eD=m.4i.eE}a2=I.1Q(a2);u ey=[];u eA=1h;u ez;1M(1h){1f{u eB=a2.1a();u 2h=eD(eB)}1e(e){if(e==I.25){2K}14 e}if(eA||2h!=ez){u eC=[];ey.1c([2h,eC])}eC.1c(eB);eA=1m;ez=2h}F ey},9X:G(ex){u i=0;F{U:G(){F"9X(...)"},1l:B.J.24("U"),1a:G(){if(i>=ex.K){14 B.15.25}F ex[i++]}}},eh:G(ew){F(ew&&H(ew.ei)=="G")},9V:G(l1){F{U:G(){F"9V(...)"},1l:B.J.24("U"),1a:G(){u W=l1.ei();if(W===O||W===L){14 B.15.25}F W}}}});B.15.1W=["9Y","9X","eh","9V",];B.15.1z=["25","9W","1Q","eu","et","7b","1a","es","a1","a0","er","4c","ep","55","9Z","eo","en","2G","7H","7I","l0","em","9a","kZ","kY","kX","kW","kV","ek","kU"];B.15.2d=G(){u m=B.J;D.25=Y m.5a("25");D.9Y=Y m.4a();D.9W("ej",m.3A,D.9X);D.9W("ei",D.eh,D.9V);D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)};B.15.2d();if(!B.3d){7H=B.15.7H}B.J.2Y(D,B.15);if(H(1q)!="L"){1q.2X("B.1H");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.J",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.1H 3F on B.J!"}if(H(B.1H)=="L"){B.1H={}}B.1H.1r="B.1H";B.1H.1Y="1.3.1";B.1H.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1H.1l=G(){F D.1K()};B.1H.1z=["5C","49","7A","kR","2L","5Z","kG","ch","kE","kC"];B.1H.1W=["ef","e8","e7"];B.1H.49=G(1P,kT,3z){D.1P=1P;D.3N=kT;D.3z=3z;D.vf=Y 3Q()};B.1H.49.1U={U:G(){u m=B.J;F"49("+m.2r(m.U,[D.1P,D.3N,D.3z]).2b(", ")+")"},1l:B.J.24("U")};B.J.2l(B.1H,{ef:G(7F){u I=B.1H;if(H(7F)=="1n"){7F=I.5C[7F]}F G(1t){u 7G=1t.3N;if(H(7G)=="1n"){7G=I.5C[7G]}F 7G>=7F}},e8:G(){u kS=B.1H.49;R(u i=0;i<M.K;i++){if(!(M[i]2C kS)){F 1m}}F 1h},e7:G(a,b){F B.J.2f([a.3N,a.3z],[b.3N,b.3z])},kR:G(1t){cq("1P: "+1t.1P+"\\ve: "+1t.3N+"\\vd: "+1t.3z.2b(" "))}});B.1H.7A=G(7E){D.4f=0;if(H(7E)=="L"||7E===O){7E=-1}D.ec=7E;D.4h=[];D.7C={};D.e5=1m};B.1H.7A.1U={vc:G(){D.4h.4y(0,D.4h.K)},kK:G(1t){if(H(2O)!="L"&&2O.eg&&2O.eg.5Z){2O.eg.5Z(1t)}N{if(H(7h)!="L"&&7h.kQ){7h.kQ(1t)}N{if(H(5X)=="G"){5X(1t)}}}},kL:G(1t){R(u k in D.7C){u 2n=D.7C[k];if(2n.kO!=k||(2n[0]&&!2n[0](1t))){2V}2n[1](1t)}},hE:G(ee,7D,kP){if(H(7D)=="1n"){7D=B.1H.ef(7D)}u ed=[7D,kP];ed.kO=ee;D.7C[ee]=ed},c9:G(kN){gi D.7C[kN]},kH:G(kM,vb){u 1t=Y B.1H.49(D.4f,kM,B.J.1R(O,M,1));D.4h.1c(1t);D.kL(1t);if(D.e5){D.kK(1t.3N+": "+1t.3z.2b(" "))}D.4f+=1;1M(D.ec>=0&&D.4h.K>D.ec){D.4h.2P()}},c8:G(9U){u ea=0;if(!(H(9U)=="L"||9U===O)){ea=28.29(0,D.4h.K-9U)}F D.4h.9T(ea)},kJ:G(7B){if(H(7B)=="L"||7B===O){7B=30}u 9S=D.c8(7B);if(9S.K){u 1g=2r(G(m){F"\\n ["+m.1P+"] "+m.3N+": "+m.3z.2b(" ")},9S);1g.e9("va "+9S.K+" v9:");F 1g.2b("")}F""},v8:G(kI){if(H(B.1I)=="L"){cq(D.kJ())}N{B.1I.bY(kI||1m)}}};B.1H.2d=G(){D.5C={8M:40,8L:50,8K:30,8J:20,8I:10};u m=B.J;m.5u("49",D.e8,D.e7);u 61=m.2z;u e6=D.7A;u 60=e6.1U.kH;m.2l(D.7A.1U,{kF:61(60,"8I"),5Z:61(60,"8J"),dE:61(60,"8M"),kD:61(60,"8L"),kB:61(60,"8K")});u I=D;u 5Y=G(1b){F G(){I.2L[1b].1w(I.2L,M)}};D.5Z=5Y("5Z");D.kG=5Y("dE");D.ch=5Y("kF");D.kE=5Y("kD");D.kC=5Y("kB");D.2L=Y e6();D.2L.e5=1h;D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)};if(H(5X)=="L"&&H(2v)!="L"&&2v.kA&&H(kz)!="L"){5X=G(){5X.3G=M;u ev=2v.kA("v7");ev.v6("5X",1m,1h);kz(ev)}}B.1H.2d();B.J.2Y(D,B.1H);if(H(1q)!="L"){1q.2X("B.1D")}if(H(B)=="L"){B={}}if(H(B.1D)=="L"){B.1D={}}B.1D.1r="B.1D";B.1D.1Y="1.3.1";B.1D.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1D.1l=G(){F D.1K()};B.1D.ks=G(1y){1y=1y+"";if(H(1y)!="1n"||1y.K===0){F O}u 7z=1y.2R("-");if(7z.K===0){F O}F Y 3Q(7z[0],7z[1]-1,7z[2])};B.1D.ky=/(\\d{4,})(?:-(\\d{1,2})(?:-(\\d{1,2})(?:[T ](\\d{1,2}):(\\d{1,2})(?::(\\d{1,2})(?:\\.(\\d+))?)?(?:(Z)|([+-])(\\d{1,2})(?::(\\d{1,2}))?)?)?)?)?/;B.1D.kr=G(1y){1y=1y+"";if(H(1y)!="1n"||1y.K===0){F O}u X=1y.3C(B.1D.ky);if(H(X)=="L"||X===O){F O}u 5W,7y,7x,9R,2a,9Q,7w;5W=3w(X[1],10);if(H(X[2])=="L"||X[2]===""){F Y 3Q(5W)}7y=3w(X[2],10)-1;7x=3w(X[3],10);if(H(X[4])=="L"||X[4]===""){F Y 3Q(5W,7y,7x)}9R=3w(X[4],10);2a=3w(X[5],10);9Q=(H(X[6])!="L"&&X[6]!=="")?3w(X[6],10):0;if(H(X[7])!="L"&&X[7]!==""){7w=28.ha(c5*4M("0."+X[7]))}N{7w=0}if((H(X[8])=="L"||X[8]==="")&&(H(X[9])=="L"||X[9]==="")){F Y 3Q(5W,7y,7x,9R,2a,9Q,7w)}u 58;if(H(X[9])!="L"&&X[9]!==""){58=3w(X[10],10)*v5;if(H(X[11])!="L"&&X[11]!==""){58+=3w(X[11],10)*kw}if(X[9]=="-"){58=-58}}N{58=0}F Y 3Q(3Q.v4(5W,7y,7x,9R,2a,9Q,7w)-58)};B.1D.dY=G(2g,kx){if(H(2g)=="L"||2g===O){F O}u hh=2g.v3();u mm=2g.v2();u ss=2g.v1();u 1g=[((kx&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];F 1g.2b(":")};B.1D.kq=G(2g,7v){if(H(2g)=="L"||2g===O){F O}u ku=7v?"T":" ";u kt=7v?"Z":"";if(7v){2g=Y 3Q(2g.9P()+(2g.v0()*kw))}F B.1D.dX(2g)+ku+B.1D.dY(2g,7v)+kt};B.1D.dX=G(2g){if(H(2g)=="L"||2g===O){F O}u e4=B.1D.e3;F[2g.dZ(),e4(2g.e1()+1),e4(2g.e0())].2b("-")};B.1D.kp=G(d){d=d+"";if(H(d)!="1n"||d.K===0){F O}u a=d.2R("/");F Y 3Q(a[2],a[0]-1,a[1])};B.1D.e3=G(n){F(n>9)?n:"0"+n};B.1D.ko=G(d){if(H(d)=="L"||d===O){F O}u e2=B.1D.e3;F[e2(d.e1()+1),e2(d.e0()),d.dZ()].2b("/")};B.1D.kn=G(d){if(H(d)=="L"||d===O){F O}F[d.e1()+1,d.e0(),d.dZ()].2b("/")};B.1D.1z=["ks","kr","dY","kq","dX","kp","ko","kn"];B.1D.1W=[];B.1D.2k={":3e":B.1D.1z,":1p":B.1D.1z};B.1D.2d=G(){u 2w=D.1r+".";R(u k in D){u o=D[k];if(H(o)=="G"&&H(o.1r)=="L"){1f{o.1r=2w+k}1e(e){}}}};B.1D.2d();if(H(B.J)!="L"){B.J.2Y(D,B.1D)}N{(G(km,dW){if((H(1x)=="L"&&H(1q)=="L")||(H(B.3d)=="5L"&&B.3d)){u 1p=dW.2k[":1p"];R(u i=0;i<1p.K;i++){km[1p[i]]=dW[1p[i]]}}})(D,B.1D)}if(H(1q)!="L"){1q.2X("B.1s")}if(H(B)=="L"){B={}}if(H(B.1s)=="L"){B.1s={}}B.1s.1r="B.1s";B.1s.1Y="1.3.1";B.1s.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1s.1l=G(){F D.1K()};B.1s.ke=G(kl,kk,kj,ki,kh,dV,kg,9N,kf){F G(1P){1P=4M(1P);if(H(1P)=="L"||1P===O||k8(1P)){F kl}u 9L=kk;u 9K=kj;if(1P<0){1P=-1P}N{9L=9L.23(/-/,"")}u me=M.2U;u 9M=B.1s.dJ(ki);if(kh){1P=1P*3k;9K=9M.9y+9K}1P=B.1s.dK(1P,dV);u 9O=1P.2R(/\\./);u 3r=9O[0];u 3P=(9O.K==1)?"":9O[1];u X="";1M(3r.K<kg){3r="0"+3r}if(9N){1M(3r.K>9N){u i=3r.K-9N;X=9M.9A+3r.2W(i,3r.K)+X;3r=3r.2W(0,i)}}X=3r+X;if(dV>0){1M(3P.K<kf){3P=3P+"0"}X=X+9M.9z+3P}F 9L+X+9K}};B.1s.k5=G(9J,9H,9G){if(H(9H)=="L"){9H=""}u 3q=9J.3C(/((?:[0#]+,)?[0#]+)(?:\\.([0#]+))?(%)?/);if(!3q){14 3p("uZ uY")}u 7u=9J.3H(0,3q.c6);u kd=9J.3H(3q.c6+3q[0].K);if(7u.uX(/-/)==-1){7u=7u+"-"}u 9I=3q[1];u 3P=(H(3q[2])=="1n"&&3q[2]!="")?3q[2]:"";u kc=(H(3q[3])=="1n"&&3q[3]!="");u dU=9I.2R(/,/);u 9F;if(H(9G)=="L"){9G="dG"}if(dU.K==1){9F=O}N{9F=dU[1].K}u ka=9I.K-9I.23(/0/g,"").K;u k9=3P.K-3P.23(/0/g,"").K;u kb=3P.K;u W=B.1s.ke(9H,7u,kd,9G,kc,kb,ka,9F,k9);u m=B.J;if(m){u fn=M.2U;u 3G=m.2o(M);W.U=G(){F[I.1r,"(",2r(m.U,3G).2b(", "),")"].2b("")}}F W};B.1s.dJ=G(4g){if(H(4g)=="L"||4g===O){4g="dG"}if(H(4g)=="1n"){u W=B.1s.5V[4g];if(H(W)=="1n"){W=M.2U(W);B.1s.5V[4g]=W}F W}N{F 4g}};B.1s.k4=G(dT,9E){if(9E){u X=dT/9E;if(!k8(X)){F B.1s.9B(dT/9E)}}F"0"};B.1s.9B=G(dS){u dR=(dS<0?"-":"");u s=28.8B(28.uW(dS)*3k).1l();if(s=="0"){F s}if(s.K<3){1M(s.3Z(s.K-1)=="0"){s=s.2W(0,s.K-1)}F dR+"0."+s}u 5E=dR+s.2W(0,s.K-2);u 7t=s.2W(s.K-2,s.K);if(7t=="uV"){F 5E}N{if(7t.3Z(1)=="0"){F 5E+"."+7t.3Z(0)}N{F 5E+"."+7t}}};B.1s.dI=G(1y,dQ){1y=1y+"";if(H(1y)!="1n"){F O}if(!dQ){F 1y.23(/^\\s+/,"")}N{F 1y.23(Y 8V("^["+dQ+"]+"),"")}};B.1s.dH=G(1y,dP){1y=1y+"";if(H(1y)!="1n"){F O}if(!dP){F 1y.23(/\\s+$/,"")}N{F 1y.23(Y 8V("["+dP+"]+$"),"")}};B.1s.k2=G(1y,dO){u I=B.1s;F I.dH(I.dI(1y,dO),dO)};B.1s.dL=G(9D,9C){9D=28.8B(9D*28.dN(10,9C));u X=(9D*28.dN(10,-9C)).6I(9C);if(X.3Z(0)=="."){X="0"+X}F X};B.1s.dK=G(k7,dM){F B.1s.dL(k7+0.5*28.dN(10,-dM),dM)};B.1s.k3=G(k6){F B.1s.9B(3k*k6)+"%"};B.1s.1z=["dL","dK","k5","dJ","k4","9B","k3","dI","dH","k2"];B.1s.5V={k1:{9A:",",9z:".",9y:"%"},uU:{9A:".",9z:",",9y:"%"},uT:{9A:" ",9z:",",9y:"%"},"dG":"k1"};B.1s.1W=[];B.1s.2k={":1p":B.1s.1z,":3e":B.1s.1z};B.1s.2d=G(){u 2w=D.1r+".";u k,v,o;R(k in D.5V){o=D.5V[k];if(H(o)=="3n"){o.U=G(){F D.1r};o.1r=2w+"5V."+k}}R(k in D){o=D[k];if(H(o)=="G"&&H(o.1r)=="L"){1f{o.1r=2w+k}1e(e){}}}};B.1s.2d();if(H(B.J)!="L"){B.J.2Y(D,B.1s)}N{(G(k0,dF){if((H(1x)=="L"&&H(1q)=="L")||(H(B.3d)=="5L"&&B.3d)){u 1p=dF.2k[":1p"];R(u i=0;i<1p.K;i++){k0[1p[i]]=dF[1p[i]]}}})(D,B.1s)}if(H(1q)!="L"){1q.2X("B.1k");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.J",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.1k 3F on B.J!"}if(H(B.1k)=="L"){B.1k={}}B.1k.1r="B.1k";B.1k.1Y="1.3.1";B.1k.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1k.1l=G(){F D.1K()};B.1k.2t=G(jZ){D.55=[];D.id=D.7n();D.2H=-1;D.54=0;D.53=[O,O];D.7m=jZ;D.7l=1m;D.7r=1m};B.1k.2t.1U={U:G(){u 7s;if(D.2H==-1){7s="uS"}N{if(D.2H===0){7s="uR"}N{7s="dE"}}F"2t("+D.id+", "+7s+")"},1l:B.J.24("U"),7n:B.J.4f(),jY:G(){u I=B.1k;if(D.2H==-1){if(D.7m){D.7m(D)}N{D.7l=1h}if(D.2H==-1){D.52(Y I.di(D))}}N{if((D.2H===0)&&(D.53[0]2C I.2t)){D.53[0].jY()}}},jQ:G(){D.54++},jX:G(){D.54--;if((D.54===0)&&(D.2H>=0)){D.9u()}},jR:G(X){D.9x(X);D.jX()},9x:G(X){D.2H=((X 2C 2x)?1:0);D.53[D.2H]=X;D.9u()},dD:G(){if(D.2H!=-1){if(!D.7l){14 Y B.1k.dj(D)}D.7l=1m;F}},3o:G(X){D.dD();if(X 2C B.1k.2t){14 Y 2x("2t jW 9v aB be 7r if jV jU jT jS of a 3o")}D.9x(X)},52:G(X){D.dD();u I=B.1k;if(X 2C I.2t){14 Y 2x("2t jW 9v aB be 7r if jV jU jT jS of a 3o")}if(!(X 2C 2x)){X=Y I.9p(X)}D.9x(X)},jP:G(fn){if(M.K>1){fn=B.J.2z.1w(O,M)}F D.9w(fn,fn)},5Q:G(fn){if(M.K>1){fn=B.J.2z.1w(O,M)}F D.9w(fn,O)},jA:G(fn){if(M.K>1){fn=B.J.2z.1w(O,M)}F D.9w(O,fn)},9w:G(cb,eb){if(D.7r){14 Y 2x("uQ uP 9v 2E be re-uO")}D.55.1c([cb,eb]);if(D.2H>=0){D.9u()}F D},9u:G(){u dC=D.55;u 56=D.2H;u X=D.53[56];u I=D;u cb=O;1M(dC.K>0&&D.54===0){u 2n=dC.2P();u f=2n[56];if(f===O){2V}1f{X=f(X);56=((X 2C 2x)?1:0);if(X 2C B.1k.2t){cb=G(X){I.jR(X)};D.jQ()}}1e(3O){56=1;if(!(3O 2C 2x)){3O=Y B.1k.9p(3O)}X=3O}}D.2H=56;D.53[56]=X;if(cb&&D.54){X.jP(cb);X.7r=1h}}};B.J.2l(B.1k,{dk:G(){F dB("("+M[0].jN+")")},dp:G(uN){u d=Y B.1k.2t();d.3o.1w(d,M);F d},9q:G(uM){u d=Y B.1k.2t();d.52.1w(d,M);F d},do:G(){u I=M.2U;if(!I.7q){u dy=[G(){F Y 7q()},G(){F Y dA("jO.dz")},G(){F Y dA("uL.dz")},G(){F Y dA("jO.dz.4.0")},G(){14 Y B.1k.dh("uK uJ 2E uI 7q")}];R(u i=0;i<dy.K;i++){u 1A=dy[i];1f{I.7q=1A;F 1A()}1e(e){}}}F I.7q()},dx:G(){},jK:G(d){if(D.uH==4){1f{D.5T=O}1e(e){1f{D.5T=B.1k.dx}1e(e){}}u 5U=O;1f{5U=D.jm;if(!5U&&B.J.7e(D.jN)){5U=jM}}1e(e){}if(5U==hQ||5U==jM){d.3o(D)}N{u 3O=Y B.1k.dg(D,"uG uF");if(3O.2y){d.52(3O)}N{d.52(3O)}}}},jL:G(2s){1f{2s.5T=O}1e(e){1f{2s.5T=B.1k.dx}1e(e){}}2s.uE()},dl:G(2s,7p){if(H(7p)=="L"||7p===O){7p=""}u m=B.J;u I=B.1k;u d=Y I.2t(m.2z(I.jL,2s));1f{2s.5T=m.1O(I.jK,2s,d);2s.uD(7p)}1e(e){1f{2s.5T=O}1e(uC){}d.52(e)}F d},dn:G(5F){u I=B.1k;u 2s=I.do();if(M.K>1){u m=B.J;u qs=m.dw.1w(O,m.1R(O,M,1));if(qs){5F+="?"+qs}}2s.cp("uB",5F,1h);F I.dl(2s)},jv:G(5F){u I=B.1k;u d=I.dn.1w(I,M);d=d.5Q(I.dk);F d},dm:G(jJ,dv){u d=Y B.1k.2t();u m=B.J;if(H(dv)!="L"){d.5Q(G(){F dv})}u jI=uA(m.1O("3o",d),28.8B(jJ*c5));d.7m=G(){1f{uz(jI)}1e(e){}};F d},ju:G(jH,1A){u m=B.J;u jG=m.2z.1w(m,m.1R(O,M,1));F B.1k.dm(jH).5Q(G(X){F jG()})}});B.1k.5O=G(){D.5S=[];D.4e=1m;D.id=D.7n()};B.1k.5O.1U={bX:B.1k.5O,uy:G(){d=Y B.1k.2t();if(D.4e){D.5S.1c(d)}N{D.4e=1h;d.3o(D)}F d},jF:G(){if(!D.4e){14 3p("ux to jF an jE 5O")}D.4e=1m;if(D.5S.K>0){D.4e=1h;D.5S.2P().3o(D)}},7n:B.J.4f(),U:G(){u 9t;if(D.4e){9t="4e, "+D.5S.K+" 5S"}N{9t="jE"}F"5O("+D.id+", "+9t+")"},1l:B.J.24("U")};B.1k.7i=G(2G,du,jC,jB,jD){D.2G=2G;D.9r=Y 7o(D.2G.K);D.55=[];D.id=D.7n();D.2H=-1;D.54=0;D.53=[O,O];D.7m=jD;D.7l=1m;if(D.2G.K===0&&!du){D.3o(D.9r)}D.dr=0;D.jz=du;D.jy=jC;D.jx=jB;u 9s=0;B.J.2r(B.J.1O(G(d){d.5Q(B.J.1O(D.dt,D),9s,1h);d.jA(B.J.1O(D.dt,D),9s,1m);9s+=1},D),D.2G)};B.J.2l(B.1k.7i.1U,B.1k.2t.1U);B.J.2l(B.1k.7i.1U,{dt:G(ds,7k,5R){D.9r[ds]=[7k,5R];D.dr+=1;if(D.2H!==0){if(7k&&D.jz){D.3o([ds,5R])}N{if(!7k&&D.jy){D.52(5R)}N{if(D.dr==D.2G.K){D.3o(D.9r)}}}}if(!7k&&D.jx){5R=O}F 5R}});B.1k.jt=G(jw){u d=Y B.1k.7i(jw,1m,1h,1m);d.5Q(G(dq){u 7j=[];R(u i=0;i<dq.K;i++){7j.1c(dq[i][1])}F 7j});F d};B.1k.jr=G(1A){u I=B.1k;u 5P;1f{u r=1A.1w(O,B.J.1R([],M,1));if(r 2C I.2t){5P=r}N{if(r 2C 2x){5P=I.9q(r)}N{5P=I.dp(r)}}}1e(e){5P=I.9q(e)}F 5P};B.1k.1z=["dj","di","dh","9p","dg","2t","dp","9q","do","dn","jv","dm","ju","dl","5O","7i","jt","jr"];B.1k.1W=["dk"];B.1k.2d=G(){u m=B.J;u ne=m.2z(m.jq,D);ne("dj",G(jp){D.jo=jp});ne("di",G(jn){D.jo=jn});ne("dh",G(1t){D.43=1t});ne("9p",G(1t){D.43=1t});ne("dg",G(2s,1t){D.2s=2s;D.43=1t;1f{D.2y=2s.jm}1e(e){}});D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)};B.1k.2d();B.J.2Y(D,B.1k);if(H(1q)!="L"){1q.2X("B.S");1q.2M("B.15")}if(H(1x)!="L"){1x.26("B.15",[])}1f{if(H(B.15)=="L"){14""}}1e(e){14"B.S 3F on B.15!"}if(H(B.S)=="L"){B.S={}}B.S.1r="B.S";B.S.1Y="1.3.1";B.S.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.S.1l=G(){F D.1K()};B.S.1z=["d5","cr","b9","95","94","j3","9k","cX","cw","iT","iV","4X","9j","iQ","hS","cs","ia","i9","i8","i7","i6","i5","i4","hV","i3","i2","i1","cu","hW","ct","i0","hZ","hY","hX","P","io","il","ik","ij","cm","ih","ii","ig","ie","ic","cv","8d","A","6m","ib","1E","$","4q","aH","cO","cN","iM","5G","iK","9d","9e","iH","iD","9c","iB","cG","97","hU","hT","iw","jh","jb","j6","j5","jk","jl"];B.S.1W=["9b"];B.S.5N=G(w,h){D.w=w;D.h=h};B.S.5N.1U.U=G(){u U=B.J.U;F"{w: "+U(D.w)+", h: "+U(D.h)+"}"};B.S.5t=G(x,y){D.x=x;D.y=y};B.S.5t.1U.U=G(){u U=B.J.U;F"{x: "+U(D.x)+", y: "+U(D.y)+"}"};B.S.5t.1U.1l=G(){F D.U()};B.J.2l(B.S,{jl:G(Q,o){Q=B.S.1E(Q);B.S.4X(Q,{"1T":{"9o":o,"-hL-9o":o,"-uw-9o":o,"47":" uv(9o="+(o*3k)+")"}})},jk:G(){u d=Y B.S.5N();u w=B.S.3X;u b=B.S.1Z.5s;if(w.jj){d.w=w.jj;d.h=w.uu}N{if(b.dd.9n){d.w=b.dd.9n;d.h=b.dd.ji}N{if(b&&b.9n){d.w=b.9n;d.h=b.ji}}}F d},jh:G(Q){u I=B.S;if(H(Q.w)=="2y"||H(Q.h)=="2y"){F Y I.5N(Q.w||0,Q.h||0)}Q=I.1E(Q);if(!Q){F L}if(I.4q(Q,"3u")!="98"){F Y I.5N(Q.jg||0,Q.ci||0)}u s=Q.1T;u je=s.dc;u jf=s.6P;s.dc="fR";s.6P="j8";s.3u="";u jd=Q.jg;u jc=Q.ci;s.3u="98";s.6P=jf;s.dc=je;F Y I.5N(jd,jc)},jb:G(Q,4Z){u I=B.S;Q=I.1E(Q);if(!Q){F L}u c=Y I.5t(0,0);if(Q.x&&Q.y){c.x+=Q.x||0;c.y+=Q.y||0;F c}N{if(Q.3t===O||I.4q(Q,"3u")=="98"){F L}}u 51=O;u 2j=O;u d=B.S.1Z;u de=d.7Z;u b=d.5s;if(Q.ja){51=Q.ja();c.x+=51.2I+(de.6y||b.6y)-(de.8q||b.8q);c.y+=51.3D+(de.4C||b.4C)-(de.8p||b.8p)}N{if(d.j9){51=d.j9(Q);c.x+=51.x;c.y+=51.y}N{if(Q.8g){c.x+=Q.db;c.y+=Q.da;2j=Q.8g;if(2j!=Q){1M(2j){c.x+=2j.db;c.y+=2j.da;2j=2j.8g}}u ua=ut.us.8G();if((H(7h)!="L"&&4M(7h.ur())<9)||(ua.2A("uq")!=-1&&I.4q(Q,"6P")=="j8")){c.x-=b.db;c.y-=b.da}}}}if(H(4Z)!="L"){4Z=M.2U(4Z);if(4Z){c.x-=(4Z.x||0);c.y-=(4Z.y||0)}}if(Q.3t){2j=Q.3t}N{2j=O}1M(2j&&2j.j7!="uo"&&2j.j7!="co"){c.x-=2j.6y;c.y-=2j.4C;if(2j.3t){2j=2j.3t}N{2j=O}}F c},j6:G(Q,d9,7g){Q=B.S.1E(Q);if(H(7g)=="L"){7g="px"}B.S.4X(Q,{"1T":{"5A":d9.w+7g,"3V":d9.h+7g}})},j5:G(Q,d8,7f){Q=B.S.1E(Q);if(H(7f)=="L"){7f="px"}B.S.4X(Q,{"1T":{"2I":d8.x+7f,"3D":d8.y+7f}})},cr:G(){F B.S.3X},b9:G(){F B.S.1Z},95:G(2m,1A){u I=B.S;u d6=I.1Z;u d7=I.un;u W;1f{I.3X=2m;I.1Z=2m.2v;W=1A()}1e(e){I.3X=d7;I.1Z=d6;14 e}I.3X=d7;I.1Z=d6;F W},d5:G(Q){u 7d=[];u 7c=[];u m=B.J;u I=B.S;if(H(Q)=="L"||Q===O){Q=I.1Z}N{Q=I.1E(Q)}m.d4(Q,G(Q){u 1b=Q.1b;if(m.7e(1b)){u 4Y=Q.cD;if(4Y=="cv"&&(Q.1J=="um"||Q.1J=="uk")&&!Q.ip){F O}if(4Y=="ct"){if(Q.j4>=0){u 9m=Q.1S[Q.j4];7d.1c(1b);7c.1c((9m.3m)?9m.3m:9m.7X);F O}7d.1c(1b);7c.1c("");F O}if(4Y=="cu"||4Y=="P"||4Y=="8d"||4Y=="6m"){F Q.5h}7d.1c(1b);7c.1c(Q.3m||"");F O}F Q.5h});F[7d,7c]},94:G(1N,1A){u I=B.S;u d3=I.1Z;u W;1f{I.1Z=1N;W=1A()}1e(e){I.1Z=d3;14 e}I.1Z=d3;F W},j3:G(1b,j2,3y,j1){B.S.9b.5M(1b,j2,3y,j1)},9k:G(1j,7a){u im=B.15;u I=B.S;u 1Q=im.1Q;u iY=im.7b;u 4c=im.4c;u iX=I.9b;u iZ=I.9k;u iW=B.J.4d;1M(1h){if(H(1j)=="L"||1j===O){F O}if(H(1j.3T)!="L"&&1j.3T>0){F 1j}if(H(1j)=="2y"||H(1j)=="5L"){1j=1j.1l()}if(H(1j)=="1n"){F I.1Z.4S(1j)}if(H(1j.j0)=="G"){1j=1j.j0(7a);2V}if(H(1j)=="G"){1j=1j(7a);2V}u 9l=O;1f{9l=1Q(1j)}1e(e){}if(9l){F 4c(iZ,9l,iY(7a))}1f{1j=iX.3C(1j,7a);2V}1e(e){if(e!=iW){14 e}}F I.1Z.4S(1j.1l())}F L},iV:G(1j,79,iU){u o={};o[79]=iU;1f{F B.S.4X(1j,o)}1e(e){}F O},iT:G(1j,79){u I=B.S;u d2=I.4U.99[79];1j=I.1E(1j);1f{if(d2){F 1j[d2]}F 1j.fm(79)}1e(e){}F O},4X:G(1j,5K){u Q=1j;u I=B.S;if(H(1j)=="1n"){Q=I.1E(1j)}if(5K){u d0=B.J.8Z;if(I.4U.6X){R(u k in 5K){u v=5K[k];if(H(v)=="3n"&&H(Q[k])=="3n"){d0(Q[k],v)}N{if(k.2W(0,2)=="on"){if(H(v)=="1n"){v=Y cZ(v)}Q[k]=v}N{Q.4p(k,v)}}}}N{u iS=I.4U.99;R(k in 5K){v=5K[k];u d1=iS[k];if(k=="1T"&&H(v)=="1n"){Q.1T.3x=v}N{if(H(d1)=="1n"){Q[d1]=v}N{if(H(Q[k])=="3n"&&H(v)=="3n"){d0(Q[k],v)}N{if(k.2W(0,2)=="on"){if(H(v)=="1n"){v=Y cZ(v)}Q[k]=v}N{Q.4p(k,v)}}}}}}}F Q},9j:G(1j){u Q=1j;u I=B.S;if(H(1j)=="1n"){Q=I.1E(1j)}u 78=[I.9k(B.J.1R(O,M,1),Q)];u iR=B.J.2o;1M(78.K){u n=78.2P();if(H(n)=="L"||n===O){}N{if(H(n.3T)=="2y"){Q.2c(n)}N{78=iR(n,78)}}}F Q},iQ:G(1j){u Q=1j;u I=B.S;if(H(1j)=="1n"){Q=I.1E(1j);M[0]=Q}u cY;1M((cY=Q.6n)){Q.6S(cY)}if(M.K<2){F Q}N{F I.9j.1w(D,M)}},cX:G(1b,4b){u Q;u I=B.S;u m=B.J;if(H(4b)=="1n"||H(4b)=="2y"){u 3G=m.1R([1b,O],M,1);F M.2U.1w(D,3G)}if(H(1b)=="1n"){if(4b&&"1b"in 4b&&!I.4U.6X){1b=("<"+1b+" 1b=\\""+I.9c(4b.1b)+"\\">")}Q=I.1Z.2S(1b)}N{Q=1b}if(4b){I.4X(Q,4b)}if(M.K<=2){F Q}N{u 3G=m.1R([Q],M,2);F I.9j.1w(D,3G)}},cw:G(){u m=B.J;F m.2z.1w(D,m.1R([B.S.cX],M))},cs:G(5J,1d){u I=B.S;5J=I.1E(5J);u cW=5J.3t;if(1d){1d=I.1E(1d);cW.uj(1d,5J)}N{cW.6S(5J)}F 1d},1E:G(id){u I=B.S;if(M.K==1){F((H(id)=="1n")?I.1Z.hN(id):id)}N{F B.J.2r(I.1E,M)}},4q:G(iP,cV,cU){if(M.K==2){cU=cV}u I=B.S;u el=I.1E(iP);u 77=I.1Z;if(!el||el==77){F L}if(el.iO){F el.iO[cV]}if(H(77.5k)=="L"){F L}if(77.5k===O){F L}u 9i=77.5k.g4(el,O);if(H(9i)=="L"||9i===O){F L}F 9i.6q(cU)},aH:G(76,9g,4W){u I=B.S;if(H(76)=="L"||76===O){76="*"}if(H(4W)=="L"||4W===O){4W=I.1Z}4W=I.1E(4W);u 9h=(4W.fr(76)||I.1Z.1p);if(H(9g)=="L"||9g===O){F B.J.1R(O,9h)}u cR=[];R(u i=0;i<9h.K;i++){u cS=9h[i];u cT=cS.3M.2R(" ");R(u j=0;j<cT.K;j++){if(cT[j]==9g){cR.1c(cS);2K}}}F cR},iN:G(5I,9f){u W=G(){u cQ=M.2U.5H;R(u i=0;i<cQ.K;i++){if(cQ[i].1w(D,M)===1m){2K}}if(9f){1f{D[5I]=O}1e(e){}}};W.5H=[];F W},cO:G(cP,5I,1A,9f){u I=B.S;u 4V=cP[5I];u 75=4V;if(!(H(4V)=="G"&&H(4V.5H)=="3n"&&4V.5H!==O)){75=I.iN(5I,9f);if(H(4V)=="G"){75.5H.1c(4V)}cP[5I]=75}75.5H.1c(1A)},cN:G(1A){u I=B.S;I.cO(I.3X,"gh",1A,1h)},iM:G(74){u I=B.S;I.cN(G(){74=I.1E(74);if(74){74.ui()}})},5G:G(iL,cM){u I=B.S;u 1i=I.1E(iL);if(I.4U.6X){1i.4p("iq",cM)}N{1i.4p("3M",cM)}},iK:G(cL){u I=B.S;R(u i=1;i<M.K;i++){u 1i=I.1E(M[i]);if(!I.9d(1i,cL)){I.9e(1i,cL)}}},9d:G(iJ,73){u I=B.S;u 1i=I.1E(iJ);u 2F=1i.3M;if(2F.K===0){I.5G(1i,73);F 1h}if(2F==73){F 1m}u cK=1i.3M.2R(" ");R(u i=0;i<cK.K;i++){if(cK[i]==73){F 1m}}I.5G(1i,2F+" "+73);F 1h},9e:G(iI,cJ){u I=B.S;u 1i=I.1E(iI);u 2F=1i.3M;if(2F.K===0){F 1m}if(2F==cJ){I.5G(1i,"");F 1h}u 72=1i.3M.2R(" ");R(u i=0;i<72.K;i++){if(72[i]==cJ){72.4y(i,1);I.5G(1i,72.2b(" "));F 1h}}F 1m},iH:G(iG,iF,iE){u 1i=B.S.1E(iG);u X=B.S.9e(1i,iF);if(X){B.S.9d(1i,iE)}F X},iD:G(iC,uh){u 1i=B.S.1E(iC);u cI=1i.3M.2R(" ");R(u i=1;i<M.K;i++){u cH=1m;R(u j=0;j<cI.K;j++){if(cI[j]==M[i]){cH=1h;2K}}if(!cH){F 1m}}F 1h},9c:G(s){F s.23(/&/g,"&ug;").23(/"/g,"&uf;").23(/</g,"&lt;").23(/>/g,"&gt;")},iB:G(2q){F B.S.cG(2q).2b("")},cG:G(2q,1g){if(H(1g)=="L"||1g===O){1g=[]}u 70=[2q];u I=B.S;u cB=I.9c;u iA=I.4U;1M(70.K){2q=70.hP();if(H(2q)=="1n"){1g.1c(2q)}N{if(2q.3T==1){1g.1c("<"+2q.cD.8G());u 71=[];u cF=iA(2q);R(u i=0;i<cF.K;i++){u a=cF[i];71.1c([" ",a.1b,"=\\"",cB(a.3m),"\\""])}71.iz();R(i=0;i<71.K;i++){u cE=71[i];R(u j=0;j<cE.K;j++){1g.1c(cE[j])}}if(2q.ue()){1g.1c(">");70.1c("</"+2q.cD.8G()+">");u cC=2q.5h;R(i=cC.K-1;i>=0;i--){70.1c(cC[i])}}N{1g.1c("/>")}}N{if(2q.3T==3){1g.1c(cB(2q.iv))}}}}F 1g},97:G(ix,cA){u m=B.J;u iy=m.1R(O,M,1);B.15.9a(m.47(O,m.2r(B.S.1E,iy)),G(cA){cA.1T.3u=ix})},iw:G(1j,iu){u W=[];(G(1j){u cn=1j.5h;if(cn){R(u i=0;i<cn.K;i++){M.2U.cz(D,cn[i])}}u cy=1j.iv;if(H(cy)=="1n"){W.1c(cy)}})(B.S.1E(1j));if(iu){F W}N{F W.2b("")}},2d:G(2m){u m=B.J;D.1Z=2v;D.3X=2m;D.9b=Y m.4a();u 6Z=D.1Z.2S("cj");u 2T;if(6Z&&6Z.6Y&&6Z.6Y.K>0){u it=m.47;2T=G(1j){F it(2T.ir,1j.6Y)};2T.cx={};B.15.9a(6Z.6Y,G(a){2T.cx[a.1b]=a.3m});2T.ir=G(a){F(2T.cx[a.1b]!=a.3m)};2T.6X=1m;2T.99={"iq":"3M","ip":"ud","uc":"ub","R":"u9"}}N{2T=G(1j){F 1j.6Y};2T.6X=1h;2T.99={}}D.4U=2T;u 1C=D.cw;D.io=1C("ul");D.il=1C("ol");D.ik=1C("li");D.ij=1C("td");D.cm=1C("tr");D.ii=1C("u8");D.ih=1C("u7");D.ig=1C("u6");D.ie=1C("u5");D.ic=1C("th");D.cv=1C("ck");D.8d=1C("cj");D.A=1C("a");D.6m=1C("4u");D.ib=1C("u4");D.ia=1C("2e");D.i9=1C("tt");D.i8=1C("4O");D.i7=1C("h1");D.i6=1C("h2");D.i5=1C("h3");D.i4=1C("br");D.i3=1C("hr");D.i2=1C("u3");D.i1=1C("u2");D.cu=1C("u1");D.P=1C("p");D.ct=1C("u0");D.i0=1C("hJ");D.hZ=1C("tZ");D.hY=1C("tY");D.hX=1C("tX");D.hW=1C("tW");D.hV=1C("tV");D.hU=m.2z(D.97,"98");D.hT=m.2z(D.97,"8c");D.hS=D.cs;D.$=D.1E;D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)}});B.S.2d(((H(2O)=="L")?D:2O));if(!B.3d){95=B.S.95;94=B.S.94}B.J.2Y(D,B.S);if(H(1q)!="L"){1q.2X("B.1I");1q.2M("B.1H");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.1H",[]);1x.26("B.J",[])}1f{if(H(B.J)=="L"||H(B.1H)=="L"){14""}}1e(e){14"B.1I 3F on B.J 3W B.1H!"}if(H(B.1I)=="L"){B.1I={}}B.1I.1r="B.1I";B.1I.1Y="1.3.1";B.1I.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1I.1l=G(){F D.1K()};B.1I.bY=G(6W){u m=B.1I;6W=!(!6W);if(m.3l&&m.3l.8Q!=6W){m.3l.hA();m.3l=O}if(!m.3l||m.3l.8P){m.3l=Y m.1I(6W,B.1H.2L)}F m.3l};B.1I.1I=G(4R,6V){if(H(6V)=="L"||6V===O){6V=B.1H.2L}D.2L=6V;u tU=B.J.2l;u c3=B.J.8Z;u 1O=B.J.1O;u hM=B.J.4L;u 2m=2O;u 6U="tT";if(H(B.S)!="L"){2m=B.S.cr()}if(!4R){u 5F=2m.tS.tR.2R("?")[0].23(/[:\\/.><&]/g,"hR");u 1b=6U+"hR"+5F;u 5D=2m.cp("",1b,"tQ,tP,3V=hQ");if(!5D){cq("tO tN to cp tM 2O tL to hP-up tK.");F L}5D.2v.fl("<!tJ co tI \\"-//tH//tG co 4.0 tF//tE\\" "+"\\"fq://fp.tD.fo/cm/tC/tB.tA\\">"+"<hO><5E><8Y>[B.1I]</8Y></5E>"+"<5s></5s></hO>");5D.2v.hG();5D.2v.8Y+=" "+2m.2v.8Y;2m=5D}u 1N=2m.2v;D.1N=1N;u 21=1N.hN(6U);u c4=!!21;if(21&&H(21.5B)!="L"){21.5B.2L=D.2L;21.5B.6K();F 21.5B}if(c4){u cl;1M((cl=21.6n)){21.6S(cl)}}N{21=1N.2S("4u");21.id=6U}21.5B=D;u 8T=1N.2S("ck");u 8S=1N.2S("ck");u 6O=1N.2S("2e");u 6N=1N.2S("2e");u 6M=1N.2S("2e");u 6L=1N.2S("2e");u 3L=1N.2S("4u");u 42=1N.2S("4u");u 8U=6U+"tz";D.8N=hM(D.8N);u 4T=[];u 6R=O;u cf=G(1t){u 6T=1t.3N;if(H(6T)=="2y"){6T=B.1H.5C[6T]}F 6T};u cd=G(1t){F 1t.3z.2b(" ")};u ca=1O(G(1t){u 8W=cf(1t);u 7X=cd(1t);u c=D.8N[8W];u p=1N.2S("cj");p.3M="B-49 B-5C-"+8W;p.1T.3x="ty: 2N; 4F-8X: -hL-4O-3y; 4F-8X: -o-4O-3y; 4F-8X: 4O-3y; 4F-8X: 4O-tx; hK-3y: 2K-hK; 3y-hJ: tw; 3U: "+c;p.2c(1N.4S(8W+": "+7X));42.2c(p);42.2c(1N.2S("br"));if(3L.ci>3L.hI){3L.4C=0}N{3L.4C=3L.hI}},D);u hD=G(1t){4T[4T.K]=1t;ca(1t)};u hF=G(){u cg,ce;1f{cg=Y 8V(8T.3m);ce=Y 8V(8S.3m)}1e(e){ch("2x in 47 tv: "+e.43);F O}F G(1t){F(cg.hH(cf(1t))&&ce.hH(cd(1t)))}};u cc=G(){1M(42.6n){42.6S(42.6n)}};u hB=G(){4T=[];cc()};u bZ=1O(G(){if(D.8P){F}D.8P=1h;if(B.1I.3l==D){B.1I.3l=O}D.2L.c9(8U);21.5B=O;if(4R){21.3t.6S(21)}N{D.2m.hG()}},D);u c7=G(){cc();R(u i=0;i<4T.K;i++){u 1t=4T[i];if(6R===O||6R(1t)){ca(1t)}}};D.6K=G(){6R=hF();c7();D.2L.c9(8U);D.2L.hE(8U,6R,hD)};u c0=1O(G(){4T=D.2L.c8();c7()},D);u c2=1O(G(6Q){6Q=6Q||2O.6D;2h=6Q.6w||6Q.8t;if(2h==13){D.6K()}},D);u 31="3u: 8c; z-c6: c5; 2I: 2N; 6f: 2N; 6P: tu; 5A: 3k%; he-3U: 4F; c1: "+D.8O;if(4R){31+="; 3V: ts; 3E-3D: fO 8a 8y"}N{31+="; 3V: 3k%;"}21.1T.3x=31;if(!c4){1N.5s.2c(21)}31={"3x":"5A: 33%; 3u: 8Q; c1: "+D.8O};c3(8T,{"3m":"8L|8M|8K|8J|8I","hC":c2,"1T":31});21.2c(8T);c3(8S,{"3m":".*","hC":c2,"1T":31});21.2c(8S);31="5A: 8%; 3u:8Q; c1: "+D.8O;6O.2c(1N.4S("tq"));6O.8R=1O("6K",D);6O.1T.3x=31;21.2c(6O);6N.2c(1N.4S("tp"));6N.8R=c0;6N.1T.3x=31;21.2c(6N);6M.2c(1N.4S("tn"));6M.8R=hB;6M.1T.3x=31;21.2c(6M);6L.2c(1N.4S("tm"));6L.8R=bZ;6L.1T.3x=31;21.2c(6L);3L.1T.3x="fS: tk; 5A: 3k%";42.1T.3x="5A: 3k%; 3V: "+(4R?"tj":"3k%");3L.2c(42);21.2c(3L);D.6K();c0();if(4R){D.2m=L}N{D.2m=2m}D.8Q=4R;D.hA=bZ;D.8P=1m;F D};B.1I.1I.1U={"8O":"ti tg,tf-te","8N":{"8M":"1v","8L":"gU","8K":"1F","8J":"8y","8I":"bx"}};B.1I.1W=["1I"];B.1I.1z=["bY"];B.1I.2d=G(){D.2k={":3e":D.1z,":1p":B.J.2o(D.1z,D.1W)};B.J.3f(D);B.1I.3l=O};B.1I.2d();B.J.2Y(D,B.1I);if(H(1q)!="L"){1q.2X("B.V");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.J",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.V 3F on B.J"}if(H(B.V)=="L"){B.V={}}B.V.1r="B.V";B.V.1Y="1.3.1";B.V.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.V.1l=G(){F D.1K()};B.V.V=G(1v,hz,1F,6J){if(H(6J)=="L"||6J===O){6J=1}D.1B={r:1v,g:hz,b:1F,a:6J}};B.V.V.1U={bX:B.V.V,tc:G(hy){u 1B=D.1B;u m=B.V;F m.V.3Y(1B.r,1B.g,1B.b,hy)},tb:G(1o){u 1G=D.41();1G.h=1o;u m=B.V;F m.V.4H(1G)},ta:G(hx){u 1G=D.41();1G.s=hx;u m=B.V;F m.V.4H(1G)},t9:G(hw){u 1G=D.41();1G.l=hw;u m=B.V;F m.V.4H(1G)},t8:G(hv){u 1G=D.41();1G.l=28.29(1G.l-hv,0);u m=B.V;F m.V.4H(1G)},t7:G(hu){u 1G=D.41();1G.l=28.2a(1G.l+hu,1);u m=B.V;F m.V.4H(1G)},fJ:G(ht,5z){if(H(5z)=="L"||5z===O){5z=0.5}u sf=1-5z;u s=D.1B;u d=ht.1B;u df=5z;F B.V.V.3Y((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df))},h4:G(hs){u a=D.6r();u b=hs.6r();F B.J.2f([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a])},hq:G(){F D.41().b>0.5},t6:G(){F(!D.hq())},t5:G(){u c=D.41();u 2Z=B.V.6F;u W=D.ho;if(!W){u 5y=(2Z(c.h,bF).6I(0)+","+2Z(c.s,3k).hp(4)+"%"+","+2Z(c.l,3k).hp(4)+"%");u a=c.a;if(a>=1){a=1;W="1G("+5y+")"}N{if(a<=0){a=0}W="t4("+5y+","+a+")"}D.ho=W}F W},hl:G(){u c=D.1B;u 2Z=B.V.6F;u W=D.hn;if(!W){u 5y=(2Z(c.r,3h).6I(0)+","+2Z(c.g,3h).6I(0)+","+2Z(c.b,3h).6I(0));if(c.a!=1){W="t3("+5y+","+c.a+")"}N{W="1B("+5y+")"}D.hn=W}F W},6r:G(){F B.J.4L(D.1B)},t2:G(){u m=B.V;u c=D.1B;u 2Z=B.V.6F;u W=D.hm;if(!W){W=("#"+m.6E(2Z(c.r,3h))+m.6E(2Z(c.g,3h))+m.6E(2Z(c.b,3h)));D.hm=W}F W},t1:G(){u 2Q=D.2Q;u c=D.1B;if(H(2Q)=="L"||2Q===O){2Q=B.V.bA(D.1B);D.2Q=2Q}F B.J.4L(2Q)},41:G(){u 1G=D.1G;u c=D.1B;if(H(1G)=="L"||1G===O){1G=B.V.bC(D.1B);D.1G=1G}F B.J.4L(1G)},1l:G(){F D.hl()},U:G(){u c=D.1B;u hk=[c.r,c.g,c.b,c.a];F D.bX.1r+"("+hk.2b(", ")+")"}};B.J.2l(B.V.V,{3Y:G(1v,bW,1F,8H){u hj=B.V.V;if(M.K==1){u 1B=1v;1v=1B.r;bW=1B.g;1F=1B.b;if(H(1B.a)=="L"){8H=L}N{8H=1B.a}}F Y hj(1v,bW,1F,8H)},4H:G(1o,t0,sZ,sY){u m=B.V;F m.V.3Y(m.bB.1w(m,M))},sX:G(1o,sW,sV,sU){u m=B.V;F m.V.3Y(m.bz.1w(m,M))},hi:G(1b){u 8F=B.V.V;if(1b.3Z(0)=="\\""){1b=1b.3H(1,1b.K-2)}u bV=8F.by[1b.8G()];if(H(bV)=="1n"){F 8F.bT(bV)}N{if(1b=="aP"){F 8F.sT()}}F O},8f:G(4Q){u I=B.V.V;u bU=4Q.3H(0,3);if(bU=="1B"){F I.h9(4Q)}N{if(bU=="1G"){F I.h8(4Q)}N{if(4Q.3Z(0)=="#"){F I.bT(4Q)}}}F I.hi(4Q)},bT:G(4P){if(4P.3Z(0)=="#"){4P=4P.2W(1)}u 8E=[];u i,5x;if(4P.K==3){R(i=0;i<3;i++){5x=4P.3H(i,1);8E.1c(3w(5x+5x,16)/3h)}}N{R(i=0;i<6;i+=2){5x=4P.3H(i,2);8E.1c(3w(5x,16)/3h)}}u bS=B.V.V;F bS.3Y.1w(bS,8E)},bG:G(4O,hf,hg,4N){if(4N.2A(4O)===0){4N=4N.2W(4N.2A("(",3)+1,4N.K-1)}u bR=4N.2R(/\\s*,\\s*/);u bP=[];R(u i=0;i<bR.K;i++){u c=bR[i];u 2i;u bQ=c.2W(c.K-3);if(c.3Z(c.K-1)=="%"){2i=0.bE*4M(c.2W(0,c.K-1))}N{if(bQ=="sS"){2i=4M(c)/bF}N{if(bQ=="sR"){2i=4M(c)/(28.sQ*2)}N{2i=hg[i]*4M(c)}}}bP.1c(2i)}F D[hf].1w(D,bP)},bN:G(Q,sP,sO){u d=B.S;u 2F=B.V.V;R(Q=d.1E(Q);Q;Q=Q.3t){u bO=d.4q.1w(d,M);if(!bO){2V}u 8D=2F.8f(bO);if(!8D){2K}if(8D.6r().a>0){F 8D}}F O},ba:G(Q){u 2F=B.V.V;F 2F.bN(Q,"aZ","he-3U")||2F.sN()},sM:G(Q){u 2F=B.V.V;F 2F.bN(Q,"3U","3U")||2F.sL()},sK:G(){F B.J.4L(B.V.V.by)}});B.J.2l(B.V,{6F:G(v,8C){v*=8C;if(v<0){F 0}N{if(v>8C){F 8C}N{F v}}},hc:G(n1,n2,1o){if(1o>6){1o-=6}N{if(1o<0){1o+=6}}u 2i;if(1o<1){2i=n1+(n2-n1)*1o}N{if(1o<3){2i=n2}N{if(1o<4){2i=n1+(n2-n1)*(4-1o)}N{2i=n1}}}F 2i},bz:G(1o,5w,3i,bM){if(M.K==1){u 2Q=1o;1o=2Q.h;5w=2Q.s;3i=2Q.v;bM=2Q.a}u 1v;u 3K;u 1F;if(5w===0){1v=0;3K=0;1F=0}N{u i=28.8B(1o*6);u f=(1o*6)-i;u p=3i*(1-5w);u q=3i*(1-(5w*f));u t=3i*(1-(5w*(1-f)));hd(i){3j 1:1v=q;3K=3i;1F=p;2K;3j 2:1v=p;3K=3i;1F=t;2K;3j 3:1v=p;3K=q;1F=3i;2K;3j 4:1v=t;3K=p;1F=3i;2K;3j 5:1v=3i;3K=p;1F=q;2K;3j 6:3j 0:1v=3i;3K=t;1F=p;2K}}F{r:1v,g:3K,b:1F,a:bM}},bB:G(1o,5v,3v,bL){if(M.K==1){u 1G=1o;1o=1G.h;5v=1G.s;3v=1G.l;bL=1G.a}u 1v;u 8A;u 1F;if(5v===0){1v=3v;8A=3v;1F=3v}N{u m2;if(3v<=0.5){m2=3v*(1+5v)}N{m2=3v+5v-(3v*5v)}u m1=(2*3v)-m2;u f=B.V.hc;u h6=1o*6;1v=f(m1,m2,h6+2);8A=f(m1,m2,h6);1F=f(m1,m2,h6-2)}F{r:1v,g:8A,b:1F,a:bL}},bA:G(1v,4K,1F,bK){if(M.K==1){u 1B=1v;1v=1B.r;4K=1B.g;1F=1B.b;bK=1B.a}u 29=28.29(28.29(1v,4K),1F);u 2a=28.2a(28.2a(1v,4K),1F);u 1o;u 8z;u hb=29;if(2a==29){1o=0;8z=0}N{u 6H=(29-2a);8z=6H/29;if(1v==29){1o=(4K-1F)/6H}N{if(4K==29){1o=2+((1F-1v)/6H)}N{1o=4+((1v-4K)/6H)}}1o/=6;if(1o<0){1o+=1}if(1o>1){1o-=1}}F{h:1o,s:8z,v:hb,a:bK}},bC:G(1v,4J,1F,bI){if(M.K==1){u 1B=1v;1v=1B.r;4J=1B.g;1F=1B.b;bI=1B.a}u 29=28.29(1v,28.29(4J,1F));u 2a=28.2a(1v,28.2a(4J,1F));u 1o;u 6G;u bJ=(29+2a)/2;u 4I=29-2a;if(4I===0){1o=0;6G=0}N{if(bJ<=0.5){6G=4I/(29+2a)}N{6G=4I/(2-29-2a)}if(1v==29){1o=(4J-1F)/4I}N{if(4J==29){1o=2+((1F-1v)/4I)}N{1o=4+((1v-4J)/4I)}}1o/=6;if(1o<0){1o+=1}if(1o>1){1o-=1}}F{h:1o,s:6G,l:bJ,a:bI}},6E:G(1P){1P=28.ha(1P);u bH=1P.1l(16);if(1P<16){F"0"+bH}F bH},2d:G(){u m=B.J;D.V.h9=m.1O(D.V.bG,D.V,"1B","3Y",[1/3h,1/3h,1/3h,1]);D.V.h8=m.1O(D.V.bG,D.V,"1G","4H",[1/bF,0.bE,0.bE,1]);u 4G=1/3;u bD={8y:[0,0,0],1F:[0,0,1],gY:[0.6,0.4,0.2],gX:[0,1,1],sJ:[4G,4G,4G],gR:[0.5,0.5,0.5],bx:[0,1,0],sI:[2*4G,2*4G,2*4G],gN:[1,0,1],gL:[1,0.5,0],gK:[0.5,0,0.5],1v:[1,0,0],aP:[0,0,0,0],4F:[1,1,1],gI:[1,1,0]};u h7=G(1b,r,g,b,a){u W=D.3Y(r,g,b,a);D[1b]=G(){F W};F W};R(u k in bD){u 1b=k+"V";u h5=m.2o([h7,D.V,1b],bD[k]);D.V[1b]=m.1O.1w(O,h5)}u h0=G(){R(u i=0;i<M.K;i++){if(!(M[i]2C V)){F 1m}}F 1h};u gZ=G(a,b){F a.h4(b)};m.3f(D);m.5u(D.V.1r,h0,gZ);D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)}}});B.V.1z=["V"];B.V.1W=["6F","bC","bB","bA","bz","6E"];B.V.2d();B.J.2Y(D,B.V);B.V.V.by={sH:"#sG",sF:"#sE",sD:"#gW",sC:"#sB",sA:"#sz",sy:"#sx",sw:"#sv",8y:"#su",st:"#sr",1F:"#sq",sp:"#so",gY:"#sn",sm:"#sl",sk:"#sj",si:"#sh",sg:"#se",sd:"#sc",sb:"#sa",s9:"#s8",s7:"#s6",gX:"#gW",s5:"#s4",s3:"#s2",s1:"#s0",rZ:"#gV",rY:"#rX",rW:"#gV",rV:"#rU",rT:"#rS",rR:"#rQ",rP:"#rO",rN:"#rM",gU:"#rL",rK:"#rJ",rI:"#rH",rG:"#rF",rE:"#gT",rD:"#gT",rC:"#rB",rA:"#rz",ry:"#rx",rw:"#rv",ru:"#gS",rt:"#gS",rs:"#rr",rq:"#rp",ro:"#rn",rm:"#rl",rk:"#gM",rj:"#ri",rh:"#rg",rf:"#rd",rc:"#rb",gR:"#gQ",bx:"#ra",r9:"#r8",r7:"#gQ",r6:"#r5",r4:"#r3",r2:"#r1",r0:"#qZ",qY:"#qX",qW:"#qV",qU:"#qT",qS:"#qR",qQ:"#qP",qO:"#qN",qM:"#qL",qK:"#qJ",qI:"#qH",qG:"#qF",qE:"#gP",qD:"#qC",qB:"#gP",qA:"#qz",qy:"#qx",qw:"#qv",qu:"#qt",qr:"#gO",qq:"#gO",qp:"#qo",qn:"#qm",ql:"#qk",qj:"#qi",qh:"#qg",gN:"#gM",qf:"#qe",qd:"#qc",qb:"#qa",q9:"#q8",q7:"#q6",q5:"#q4",q3:"#q2",q1:"#q0",pZ:"#pY",pX:"#pW",pV:"#pU",pT:"#pS",pR:"#pQ",pP:"#pO",pN:"#pM",pL:"#pK",pJ:"#pI",pH:"#pG",pF:"#pE",gL:"#pD",pC:"#pB",pA:"#pz",py:"#pw",pv:"#pu",pt:"#ps",pr:"#pq",pp:"#po",pn:"#pm",pl:"#pj",pi:"#ph",pg:"#pf",pe:"#pd",gK:"#pc",1v:"#pb",pa:"#p9",p8:"#p7",p6:"#p5",p4:"#p3",p2:"#p1",p0:"#oZ",oY:"#oX",oW:"#oV",oU:"#oT",oS:"#oR",oQ:"#oP",oO:"#gJ",oN:"#gJ",oM:"#oL",oK:"#oJ",oI:"#oH",oG:"#oF",oE:"#oD",oC:"#oB",oA:"#oz",oy:"#ox",ow:"#ov",ou:"#ot",4F:"#os",oq:"#op",gI:"#oo",om:"#ok"};if(H(1q)!="L"){1q.2X("B.1u");1q.2M("B.J");1q.2M("B.S")}if(H(1x)!="L"){1x.26("B.J",[]);1x.26("B.S",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.1u 3F on B.J!"}1f{if(H(B.S)=="L"){14""}}1e(e){14"B.1u 3F on B.S!"}if(H(B.1u)=="L"){B.1u={}}B.1u.1r="B.1u";B.1u.1Y="1.3.1";B.1u.4x=[];B.1u.bq=G(1d,e){D.1L=e||2O.6D;D.gH=1d};B.J.2l(B.1u.bq.1U,{1K:G(){u U=B.J.U;u 1y="{6D(): "+U(D.6D())+", 1d(): "+U(D.1d())+", 1J(): "+U(D.1J())+", 8x(): "+U(D.8x())+", 4E(): "+"{8w: "+U(D.4E().8w)+", 8v: "+U(D.4E().8v)+", 8u: "+U(D.4E().8u)+", 2P: "+U(D.4E().2P)+", bw: "+U(D.4E().bw)+"}";if(D.1J()&&D.1J().2A("2h")===0){1y+=", 2h(): {3J: "+U(D.2h().3J)+", 1n: "+U(D.2h().1n)+"}"}if(D.1J()&&(D.1J().2A("3I")===0||D.1J().2A("gE")!=-1||D.1J()=="gD")){1y+=", 3I(): {4D: "+U(D.3I().4D)+", 6A: "+U(D.3I().6A);if(D.1J()!="gC"){1y+=", 2e: {2I: "+U(D.3I().2e.2I)+", 6v: "+U(D.3I().2e.6v)+", 3g: "+U(D.3I().2e.3g)+"}}"}N{1y+="}"}}if(D.1J()=="gG"||D.1J()=="gF"){1y+=", 6C(): "+U(D.6C())}1y+="}";F 1y},1l:G(){F D.1K()},1d:G(){F D.gH},6D:G(){F D.1L},1J:G(){F D.1L.1J||L},8x:G(){F D.1L.8x||D.1L.oj},6C:G(){if(D.1J()=="gG"){F(D.1L.6C||D.1L.aW)}N{if(D.1J()=="gF"){F(D.1L.6C||D.1L.oi)}}F L},4E:G(){u m={};m.8w=D.1L.oh;m.8v=D.1L.og;m.8u=D.1L.oe||1m;m.2P=D.1L.od;m.bw=m.8w||m.8v||m.2P||m.8u;F m},2h:G(){u k={};if(D.1J()&&D.1J().2A("2h")===0){if(D.1J()=="oc"||D.1J()=="ob"){k.3J=D.1L.8t;k.1n=(B.1u.5r[k.3J]||"oa");F k}N{if(D.1J()=="o9"){k.3J=0;k.1n="";if(H(D.1L.6B)!="L"&&D.1L.6B!==0&&!B.1u.bv[D.1L.6B]){k.3J=D.1L.6B;k.1n=bu.bt(k.3J)}N{if(D.1L.8t&&H(D.1L.6B)=="L"){k.3J=D.1L.8t;k.1n=bu.bt(k.3J)}}F k}}}F L},3I:G(){u m={};u e=D.1L;if(D.1J()&&(D.1J().2A("3I")===0||D.1J().2A("gE")!=-1||D.1J()=="gD")){m.6A=Y B.S.5t(0,0);if(e.6z||e.6x){m.6A.x=(!e.6z||e.6z<0)?0:e.6z;m.6A.y=(!e.6x||e.6x<0)?0:e.6x}m.4D=Y B.S.5t(0,0);if(e.8s||e.8r){m.4D.x=(!e.8s||e.8s<0)?0:e.8s;m.4D.y=(!e.8r||e.8r<0)?0:e.8r}N{u de=B.S.1Z.7Z;u b=B.S.1Z.5s;m.4D.x=e.6z+(de.6y||b.6y)-(de.8q||b.8q);m.4D.y=e.6x+(de.4C||b.4C)-(de.8p||b.8p)}if(D.1J()!="gC"){m.2e={};m.2e.2I=1m;m.2e.3g=1m;m.2e.6v=1m;if(e.6w){m.2e.2I=(e.6w==1);m.2e.6v=(e.6w==2);m.2e.3g=(e.6w==3)}N{m.2e.2I=!!(e.2e&1);m.2e.3g=!!(e.2e&2);m.2e.6v=!!(e.2e&4)}}F m}F L},2J:G(){D.8o();D.8n()},8o:G(){if(D.1L.8o){D.1L.8o()}N{D.1L.o8=1h}},8n:G(){if(D.1L.8n){D.1L.8n()}N{D.1L.o7=1m}}});B.1u.bv={3:"gz",o6:"gA",o5:"gy",o4:"gx",o3:"gw",o2:"gv",o1:"gu",o0:"gs",nZ:"gr",nY:"gq",nX:"gp",nW:"go"};R(i=gB;i<=nV;i++){B.1u.bv[i]="gk"+(i-gB+1)}B.1u.5r={8:"nU",9:"nT",12:"gA",13:"gz",16:"nS",17:"nR",18:"nQ",19:"nP",20:"nO",27:"nN",32:"nM",33:"gy",34:"gx",35:"gw",36:"gv",37:"gu",38:"gs",39:"gr",40:"gq",44:"nL",45:"gp",46:"go",59:"gn",91:"nK",92:"nJ",93:"nI",nH:"nG",nF:"nE",nD:"nC-gm",nB:"nA",nz:"ny",nx:"nw",nv:"nu",nt:"gn",ns:"nr",nq:"np",nn:"nm-gm",nl:"nk",nj:"ni",nh:"ng",nf:"nd",nc:"nb",na:"n9",n8:"n7"};R(u i=48;i<=57;i++){B.1u.5r[i]="gl"+(i-48)}R(i=65;i<=90;i++){B.1u.5r[i]="gl"+bu.bt(i)}R(i=96;i<=n6;i++){B.1u.5r[i]="n5"+(i-96)}R(i=gj;i<=n4;i++){B.1u.5r[i]="gk"+(i-gj+1)}B.J.2l(B.1u,{1K:G(){F"["+D.1r+" "+D.1Y+"]"},1l:G(){F D.1K()},g7:G(){u I=B.1u;u bs=I.4x;R(u i=0;i<bs.K;i++){I.6t(bs[i])}gi I.4x;1f{2O.gh=L}1e(e){}1f{2O.g8=L}1e(e){}},gb:G(1d,1A,1i,gg){u E=B.1u.bq;if(!gg){F B.J.1O(1A,1i)}1i=1i||1d;if(H(1A)=="1n"){F G(gf){1i[1A].1w(1i,[Y E(1d,gf)])}}N{F G(gd){1A.1w(1i,[Y E(1d,gd)])}}},6s:G(1d,2D,5q,4B){1d=B.S.1E(1d);u I=B.1u;if(H(2D)!="1n"){14 Y 2x("\'2D\' 5p be a 1n")}u 1i=O;u 1A=O;if(H(4B)!="L"){1i=5q;1A=4B;if(H(4B)=="1n"){if(H(5q[4B])!="G"){14 Y 2x("\'bp\' 5p be a G on \'gc\'")}}N{if(H(4B)!="G"){14 Y 2x("\'bp\' 5p be a G or 1n")}}}N{if(H(5q)!="G"){14 Y 2x("\'gc\' 5p be a G if \'bp\' is 2E n3")}N{1A=5q}}if(H(1i)=="L"||1i===O){1i=1d}u bm=!!(1d.bo||1d.bn);u 8m=I.gb(1d,1A,1i,bm);if(1d.bo){1d.bo(2D.3H(2),8m,1m)}N{if(1d.bn){1d.bn(2D,8m)}}u bk=[1d,2D,8m,bm,5q,4B];I.4x.1c(bk);F bk},6t:G(6u){if(!6u[3]){F}u 1d=6u[0];u 2D=6u[1];u bj=6u[2];if(1d.ga){1d.ga(2D.3H(2),bj,1m)}N{if(1d.g9){1d.g9(2D,bj)}N{14 Y 2x("\'1d\' 5p be a S n0")}}},8j:G(bh){u I=B.1u;u 5o=I.4x;u m=B.J;if(M.K>1){u 1d=B.S.1E(M[0]);u 2D=M[1];u 1i=M[2];u 1A=M[3];R(u i=5o.K-1;i>=0;i--){u o=5o[i];if(o[0]===1d&&o[1]===2D&&o[4]===1i&&o[5]===1A){I.6t(o);5o.4y(i,1);F 1h}}}N{u 5n=m.bi(5o,bh);if(5n>=0){I.6t(bh);5o.4y(5n,1);F 1h}}F 1m},8i:G(1d,2D){1d=B.S.1E(1d);u m=B.J;u 8l=m.bg(m.1R(O,M,1));u I=B.1u;u bd=I.6t;u 4z=I.4x;if(8l.K===0){R(u i=4z.K-1;i>=0;i--){u 4A=4z[i];if(4A[0]===1d){bd(4A);4z.4y(i,1)}}}N{u bf={};R(u i=0;i<8l.K;i++){bf[8l[i]]=1h}R(u i=4z.K-1;i>=0;i--){u 4A=4z[i];if(4A[0]===1d&&4A[1]in bf){bd(4A);4z.4y(i,1)}}}},8h:G(1d,2D){u bc=B.1u.4x;1d=B.S.1E(1d);u 3G=B.J.1R(O,M,2);u 5m=[];R(u i=0;i<bc.K;i++){u 8k=bc[i];if(8k[0]===1d&&8k[1]===2D){1f{8k[2].1w(1d,3G)}1e(e){5m.1c(e)}}}if(5m.K==1){14 5m[0]}N{if(5m.K>1){u e=Y 2x("mZ bb mY in mX \'2D\', mW bb mV");e.bb=5m;14 e}}}});B.1u.1W=[];B.1u.1z=["6s","8j","8h","8i"];B.1u.2d=G(2m){u m=B.J;D.1Z=2v;D.3X=2m;1f{D.6s(2O,"g8",D.g7)}1e(e){}D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)};B.1u.2d(D);if(!B.3d){6s=B.1u.6s;8j=B.1u.8j;8i=B.1u.8i;8h=B.1u.8h}B.J.2Y(D,B.1u);if(H(1q)!="L"){1q.2X("B.1X");1q.2M("B.J");1q.2M("B.S");1q.2M("B.V")}if(H(1x)!="L"){1x.26("B.J",[]);1x.26("B.S",[]);1x.26("B.V",[])}1f{if(H(B.J)=="L"||H(B.S)=="L"||H(B.V)=="L"){14""}}1e(e){14"B.1X 3F on B.J, B.S 3W B.V!"}if(H(B.1X)=="L"){B.1X={}}B.1X.1r="B.1X";B.1X.1Y="1.3.1";B.1X.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1X.1l=G(){F D.1K()};B.1X.aI=G(e,g6){e=B.S.1E(e);D.fN(g6);if(D.1S.fL){e=D.g5(e)}u 4w=D.1S.3U;u C=B.V.V;if(D.1S.3U=="aW"){4w=C.ba(e)}N{if(!(4w 2C C)){4w=C.8f(4w)}}D.82=(4w.6r().a<=0);u 5l=D.1S.aV;if(D.1S.aV=="fM"){5l=C.ba(e.8g)}N{if(!(5l 2C C)){5l=C.8f(5l)}}D.g3(e,4w,5l)};B.1X.aI.1U={g5:G(e){u mU=e.3t;u 1N=B.S.b9();if(H(1N.5k)=="L"||1N.5k===O){F e}u 4v=1N.5k.g4(e,O);if(H(4v)=="L"||4v===O){F e}u b8=B.S.6m({"1T":{3u:"8c",mT:4v.6q("6p-3D"),85:4v.6q("6p-3g"),mS:4v.6q("6p-6f"),86:4v.6q("6p-2I"),6p:"2N"}});b8.6o=e.6o;e.6o="";e.2c(b8);F e},g3:G(e,b7,8e){if(D.1S.3E){D.g2(e,8e)}if(D.fy()){D.fX(e,b7,8e)}if(D.fx()){D.fV(e,b7,8e)}},g2:G(el,g1){u b6="6l 8a "+D.aQ(g1);u g0="3E-2I: "+b6;u fZ="3E-3g: "+b6;u fY="1T=\'"+g0+";"+fZ+"\'";el.6o="<4u "+fY+">"+el.6o+"</4u>"},fX:G(el,fW,b5){u b4=D.b1(b5);R(u i=0;i<D.1S.89;i++){b4.2c(D.b0(fW,b5,i,"3D"))}el.1T.mR=0;el.mQ(b4,el.6n)},fV:G(el,fU,b3){u b2=D.b1(b3);R(u i=(D.1S.89-1);i>=0;i--){b2.2c(D.b0(fU,b3,i,"6f"))}el.1T.mP=0;el.2c(b2)},b1:G(fT){u 2q=B.S;F 2q.6m({1T:{aZ:fT.1l()}})},b0:G(aY,fQ,n,aX){u 6k=B.S.8d();u 2p=6k.1T;2p.aZ=aY.1l();2p.3u="8c";2p.3V="6l";2p.fS="fR";2p.mO="6l";u 8b=D.aQ(aY,fQ);if(D.1S.3E&&n===0){2p.mN="8a";2p.mM="6l";2p.84="2N";2p.83="2N";2p.mL="2N";2p.3V="2N";2p.fP=8b.1l()}N{if(8b){2p.fP=8b.1l();2p.mK="8a";2p.mJ="2N 6l"}}if(!D.1S.4r&&(n==(D.1S.89-1))){2p.3V="fO"}D.fI(6k,n,aX);D.fG(6k,n,aX);F 6k},fN:G(fK){D.1S={6g:"1p",3U:"aW",aV:"fM",5j:1h,3E:1m,4r:1m,fL:1m};B.J.2l(D.1S,fK);D.1S.89=(D.1S.4r?2:4)},aL:G(){u 88=D.1S.6g;if(D.6h(88,"1p","3D")){F""}u aU=(88.2A("tl")!=-1);u aT=(88.2A("tr")!=-1);if(aU&&aT){F""}if(aU){F"2I"}if(aT){F"3g"}F""},aK:G(){u 87=D.1S.6g;if(D.6h(87,"1p","6f")){F""}u aS=(87.2A("bl")!=-1);u aR=(87.2A("br")!=-1);if(aS&&aR){F""}if(aS){F"2I"}if(aR){F"3g"}F""},aQ:G(aN,aO){if(aN=="aP"){F aO}N{if(D.1S.3E){F D.1S.3E}N{if(D.1S.5j){F aO.fJ(aN)}}}F""},fI:G(el,n,fH){u 6j=D.fE(n)+"px";u aM=(fH=="3D"?D.aL():D.aK());u 4t=el.1T;if(aM=="2I"){4t.86=6j;4t.85="2N"}N{if(aM=="3g"){4t.85=6j;4t.86="2N"}N{4t.86=6j;4t.85=6j}}},fG:G(el,n,fF){u 6i=D.fz(n)+"px";u aJ=(fF=="3D"?D.aL():D.aK());u 4s=el.1T;if(aJ=="2I"){4s.84=6i;4s.83="2N"}N{if(aJ=="3g"){4s.83=6i;4s.84="2N"}N{4s.84=6i;4s.83=6i}}},fE:G(n){if(D.82){F 0}u o=D.1S;if(o.4r&&o.5j){u fD=[1,0];F fD[n]}N{if(o.4r){u fC=[2,1];F fC[n]}N{if(o.5j){u fB=[3,2,1,0];F fB[n]}N{u fA=[5,3,2,1];F fA[n]}}}},fz:G(n){u o=D.1S;u 5i;if(o.4r&&(o.5j||D.82)){F 1}N{if(o.4r){5i=[1,0]}N{if(o.5j){5i=[2,1,1,1]}N{if(o.3E){5i=[0,2,0,0]}N{if(D.82){5i=[5,3,2,1]}N{F 0}}}}}F 5i[n]},6h:G(1y){R(u i=1;i<M.K;i++){if(1y.2A(M[i])!=-1){F 1h}}F 1m},fy:G(){F D.6h(D.1S.6g,"1p","3D","tl","tr")},fx:G(){F D.6h(D.1S.6g,"1p","6f","bl","br")},mI:G(el){F(el.5h.K==1&&el.5h[0].3T==3)}};B.1X.aF=G(e,fw){Y B.1X.aI(e,fw)};B.1X.fs=G(fv,fu,ft){u aG=B.S.aH(fv,fu);R(u i=0;i<aG.K;i++){B.1X.aF(aG[i],ft)}};B.1X.V=B.V.V;B.1X.mH=B.S.4q;B.1X.2d=G(){u m=B.J;m.3f(D);D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)}};B.1X.1z=["aF","fs"];B.1X.1W=[];B.1X.2d();B.J.2Y(D,B.1X);if(H(B)=="L"){B={}}if(H(B.B)=="L"){B.B={}}B.B.1r="B.B";B.B.1Y="1.3.1";B.B.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.B.1l=G(){F D.1K()};B.B.aA=["J","15","1H","1D","1s","1k","S","1I","V","1u","1X"];if(H(1x)!="L"||H(1q)!="L"){if(H(1q)!="L"){1q.2X("B.B");1q.2M("B.*")}if(H(1x)!="L"){1x.26("B.J",[]);1x.26("B.15",[]);1x.26("B.1H",[]);1x.26("B.1D",[]);1x.26("B.1s",[]);1x.26("B.1k",[]);1x.26("B.S",[]);1x.26("B.1I",[]);1x.26("B.V",[]);1x.26("B.1u",[]);1x.26("B.1X",[])}(G(){u 6e=B.J.1R;u I=B.B;u aE=I.aA;u aD=[];u aC=[];u 81={};u i,k,m,1p;R(i=0;i<aE.K;i++){m=B[aE[i]];6e(aD,m.1z);6e(aC,m.1W);R(k in m.2k){81[k]=6e(81[k],m.2k[k])}1p=m.2k[":1p"];if(!1p){1p=6e(O,m.1z,m.1W)}u j;R(j=0;j<1p.K;j++){k=1p[j];I[k]=m[k]}}I.1z=aD;I.1W=aC;I.2k=81}())}N{if(H(B.3d)=="L"){B.3d=1h}(G(){u 80=2v.fr("7W");u ay="fq://fp.mG.fo/mF/mE/mD.is.aB.mC";u 2w=O;u ax=O;u az={};u i;R(i=0;i<80.K;i++){u 1d=80[i].fm("1d");if(!1d){2V}az[1d]=1h;if(1d.3C(/B.js$/)){2w=1d.2W(0,1d.mB("B.js"));ax=80[i]}}if(2w===O){F}u 6d=B.B.aA;R(u i=0;i<6d.K;i++){if(B[6d[i]]){2V}u 7Y=2w+6d[i]+".js";if(7Y in az){2V}if(2v.7Z&&2v.7Z.mA==ay){u s=2v.mz(ay,"7W");s.4p("id","my"+2w+6d[i]);s.4p("1d",7Y);s.4p("1J","mx/x-fk");ax.3t.2c(s)}N{2v.fl("<7W 1d=\\""+7Y+"\\" 1J=\\"7X/fk\\"></7W>")}}})()}',62,1976,'||||||||||||||||||||||||||||||var|||||||MochiKit||this||return|function|typeof|self|Base|length|undefined|arguments|else|null||elem|for|DOM||repr|Color|rval|res|new||||||throw|Iter|||||next|name|push|src|catch|try|lst|true|obj|node|Async|toString|false|string|hue|all|dojo|NAME|Format|msg|Signal|red|apply|JSAN|str|EXPORT|func|rgb|_425|DateTime|getElement|blue|hsl|Logging|LoggingPane|type|__repr__|_event|while|doc|bind|num|iter|extend|options|style|prototype|seq|EXPORT_OK|Visual|VERSION|_document||_434||replace|forwardCall|StopIteration|use||Math|max|min|join|appendChild|__new__|button|compare|date|key|val|_329|EXPORT_TAGS|update|win|pair|concat|_596|dom|map|req|Deferred|sync|document|base|Error|number|partial|indexOf||instanceof|sig|not|cls|list|fired|left|stop|break|logger|require|0px|window|shift|hsv|split|createElement|_423|callee|continue|substring|provide|_exportSymbols|ccc||_464|||||||||step|pred|_51|__compat__|common|nameFunctions|right|255|_517|case|100|_loggingPane|value|object|callback|TypeError|_251|_246|_113|parentNode|display|_522|parseInt|cssText|wrap|info|isArrayLike|end|match|top|border|depends|args|substr|mouse|code|_519|_443|className|level|err|frac|Date|_135|_85|nodeType|color|height|and|_window|fromRGB|charAt||asHSL|_444|message||||filter||LogMessage|AdapterRegistry|_366|imap|NotFound|locked|counter|_262|_messages|operator|cmp|_165|_161|pairs|arr|_52|setAttribute|computedStyle|compact|_614|_610|div|_576|_572|_observers|splice|_565|_566|_555|scrollTop|page|modifier|white|_541|fromHSL|_539|_535|_528|clone|parseFloat|_505|pre|_499|_497|_427|createTextNode|_446|attributeArray|_388|_379|updateNodeAttributes|_341|_326||box|errback|results|paused|chain|_285||ofs||NamedError|_175|_147|_122|_83|_54|_17|childNodes|_619|blend|defaultView|_574|_569|idx|_562|must|_554|_specialKeys|body|Coordinates|registerComparator|_521|_516|hex|mid|_478|width|loggingPane|LogLevel|nwin|head|url|setElementClass|callStack|path|dest|_359|boolean|register|Dimensions|DeferredLock|_313|addCallback|_310|waiting|onreadystatechange|_290|LOCALE|year|printfire|_214|log|_213|_211|pos|_155|_153||typeMatcher|listMinMax|_114|_40|itr|typ|_19|_634|_625|bottom|corners|_hasString|_612|_608|_595|1px|DIV|firstChild|innerHTML|padding|getPropertyValue|asRGB|connect|_disconnect|_559|middle|which|clientY|scrollLeft|clientX|client|charCode|relatedTarget|event|toColorPart|clampColorComponent|_537|_534|toFixed|_468|buildAndApplyFilter|_442|_441|_440|_439|position|_463|_447|removeChild|_449|uid|_428|_426|compliant|attributes|_422|_409|_412|_400|_395|_390|_389|_377|_375|_363|attr|ctx|repeat|_340|_339|isNotEmpty|_335|_333|opera|DeferredList|ret|_309|silentlyCancelled|canceller|_nextId|Array|_293|XMLHttpRequest|chained|_281|tail|_252|_225|msec|day|month|iso|Logger|_208|listeners|_200|_198|_194|_196|reduce|range|_169|_162|truth|registerRepr|_121|_70|_58|_56|_47|_45|_41|_13|_1|script|text|uri|documentElement|_630|_629|isTransparent|borderRightWidth|borderLeftWidth|marginRight|marginLeft|_602|_599|numSlices|solid|_597|block|SPAN|_579|fromString|offsetParent|signal|disconnectAll|disconnect|_570|_563|_557|preventDefault|stopPropagation|clientTop|clientLeft|pageY|pageX|keyCode|meta|ctrl|alt|target|black|_532|_524|floor|_513|_512|_500|_495|toLowerCase|_487|DEBUG|INFO|WARNING|FATAL|ERROR|colorTable|logFont|closed|inline|onclick|_438|_437|_445|RegExp|_452|space|title|updatetree|||||withDocument|withWindow||setDisplayForElement|none|renames|forEach|domConverters|escapeHTML|addElementClass|removeElementClass|once|_378|_380|_376|appendChildNodes|coerceToDOM|_355|opt|clientWidth|opacity|GenericError|fail|resultList|_307|_301|_fire|can|addCallbacks|_resback|percent|decimal|separator|twoDigitFloat|_274|_273|_264|_257|_250|_249|_254|_248|_243|_242|fmt|_240|_245|getTime|sec|hour|_209|slice|_206|iterateNextIter|registerIteratorFactory|arrayLikeIter|iteratorRegistry|takewhile|ifilterfalse|ifilter|_181|_176|_168|_166|_159|_tee|deque|arg|fun|jsonRegistry|reprString|reprRegistry|comparatorRegistry|urlEncode|_110|_108|cur|_95|_87|_71|im_preargs||_53|_57|_46|present|like|array|Argument|_15|_12|_632|_631|_633|SUBMODULES|only|_628|_627|_626|roundElement|_624|getElementsByTagAndClassName|_RoundCorners|_613|_whichSideBottom|_whichSideTop|_609|_605|_606|transparent|_borderColor|_604|_603|_601|_600|bgColor|fromElement|_594|_592|backgroundColor|_createCornerSlice|_createCorner|_590|_589|_587|_586|_581|_578|_577|currentDocument|fromBackground|errors|_568|_564||sigs|flattenArguments|_561|findIdentical|_560|_558||_556|attachEvent|addEventListener|funcOrStr|Event||_548|fromCharCode|String|_specialMacKeys|any|green|_namedColors|hsvToRGB|rgbToHSV|hslToRGB|rgbToHSL|_542|01|360|_fromColorString|_540|_536|_538|_529|_523|_518|fromComputedStyle|_511|_507|_508|_506|_501|fromHexString|_498|_496|_486|__class__|createLoggingPane|_459|_461|font|_462|_430|_435|1000|index|_460|getMessages|removeListener|_451||_457|_450|infore|_448|_456|logDebug|offsetHeight|span|input|_436|TR||HTML|open|alert|currentWindow|swapDOM|SELECT|FORM|INPUT|createDOMFunc|ignoreAttr|_421|call|_417|_410|_415|nodeName|_414|_413|emitHTML|good|_406|_399|_397|_393|_392|addLoadEvent|addToCallStack|_387|_386|_381|_382|_383|_373|_372|_369|createDOM|_365|Function|_360|_362|_358|_344|nodeWalk|formContents|_337|_338|_334|_332|offsetTop|offsetLeft|visibility|parentElement|||XMLHttpRequestError|BrowserComplianceError|CancelledError|AlreadyCalledError|evalJSONRequest|sendXMLHttpRequest|wait|doSimpleXMLHttpRequest|getXMLHttpRequest|succeed|_312|finishedCount|_308|_cbDeferred|_303|_297|queryString|_nothing|_289|XMLHTTP|ActiveXObject|eval|_284|_check|error|_279|default|rstrip|lstrip|formatLocale|roundToFixed|truncToFixed|_276|pow|_272|_271|_270|sign|_265|_263|tmp|_238|_232|toISODate|toISOTime|getFullYear|getDate|getMonth|_230|_padTwo|_228|useNativeConsole|_212|compareLogMessage|isLogMessage|unshift|_207||maxSize|_202|_199|logLevelAtLeast|console|hasIterateNext|iterateNext|arrayLike|groupby||exhaust|tee|dropwhile|applymap||islice|izip|cycle|count||_189|_188|_183|_185|_184|_186|_187|_182|identity|fetch|_180|_177|listMin|reprNumber|reprArrayLike|compareArrayLike|compareDateLike|isDateLike|findValue|_128|__export__|keyComparator|_124|_118|_93|_94|_90|_88|_84|_77|_68|_67|_66|_65|_60|im_func|_55|im_self|_48|_44|_42|_39|_36|_33|_27|_26|_25|_22|_24|_20|javascript|write|getAttribute||org|www|http|getElementsByTagName|roundClass|_623|_622|_621|_620|_isBottomRounded|_isTopRounded|_borderSize|_618|_617|_616|_615|_marginSize|_611|_setBorder|_607|_setMargin|blendedColor|_598|__unstable__wrapElement|fromParent|_setOptions|2px|borderColor|_593|hidden|overflow|_591|_588|_roundBottomCorners|_585|_roundTopCorners|_584|_583|_582|_580|_renderBorder|_roundCornersImpl|getComputedStyle|_doWrap|_571|_unloadCache|onunload|detachEvent|removeEventListener|_listener|objOrFunc|_552||_551|_549|onload|delete|112|KEY_F|KEY_|MINUS|KEY_SEMICOLON|KEY_DELETE|KEY_INSERT|KEY_ARROW_DOWN|KEY_ARROW_RIGHT|KEY_ARROW_UP||KEY_ARROW_LEFT|KEY_HOME|KEY_END|KEY_PAGE_DOWN|KEY_PAGE_UP|KEY_ENTER|KEY_NUM_PAD_CLEAR|63236|mousemove|contextmenu|click|mouseout|mouseover|_src|yellow|708090|purple|orange|ff00ff|magenta|778899|d3d3d3|808080|gray|696969|2f4f4f|darkred|a9a9a9|00ffff|cyan|brown|_547|_546||||compareRGB|_545||_543|fromHSLString|fromRGBString|round|_533|_hslValue|switch|background|_503|_504||fromName|_488|col|toRGBString|_hexString|_rgbString|_hslString|toPrecision|isLight||_481|_477|_476|_475|_474|_473|_469|_466|closePane|_458|onkeypress|_454|addListener|_455|close|test|scrollHeight|option|word|moz|_431|getElementById|html|pop|200|_|removeElement|showElement|hideElement|CANVAS|STRONG|FIELDSET|LEGEND|OPTGROUP|OPTION|TEXTAREA|LABEL|HR|BR|H3|H2|H1|PRE|TT|BUTTON|IMG|TH||TABLE||TFOOT|THEAD|TBODY|TD|LI|OL|||UL|checked|class|ignoreAttrFilter||_424|_419|nodeValue|scrapeText|_416|_418|sort|_411|toHTML|_404|hasElementClass|_403|_402|_401|swapElementClass|_398|_394|toggleElementClass|_391|focusOnLoad|_newCallStack|currentStyle|_371|replaceChildNodes|_364|_361|getNodeAttribute|_357|setNodeAttribute|_354|_352|_350|_353|toDOM|_346|_345|registerDOMConverter|selectedIndex|setElementPosition|setElementDimensions|tagName|absolute|getBoxObjectFor|getBoundingClientRect|elementPosition|_325|_324|_322|_323|offsetWidth|elementDimensions|clientHeight|innerWidth|getViewportDimensions|setOpacity|status|_317|deferred|_316|_newNamedError|maybeDeferred||gatherResults|callLater|loadJSONDoc|_311|consumeErrors|fireOnOneErrback|fireOnOneCallback|addErrback|_305|_304|_306|unlocked|release|_300|_299|_298|_296|_xhr_onreadystatechange|_xhr_canceller|304|responseText|Msxml2|addBoth|_pause|_continue|result|the|are|they|instances|_unpause|cancel|_280|_278|en_US|strip|percentFormat|twoDigitAverage|numberFormatter|_277|_275|isNaN|_259|_258|_260|_255|_253|_numberFormatter|_241|_239|_237|_236|_235|_234|_233|_231|toAmericanDate|toPaddedAmericanDate|americanDate|toISOTimestamp|isoTimestamp|isoDate|foot|sep||60000|_221|_isoRegexp|dispatchEvent|createEvent|warning|logWarning|fatal|logFatal|debug|logError|baseLog|_210|getMessageText|logToConsole|dispatchListeners|_204|_203|ident|_201|postError|alertListener|_197|_192|groupby_as_array|iextend|some|reversed|sorted|every|sum|_190|eat|_174|_173|_172|_171|_167|_163|_158|_157|_151|_144|_141||_139|_136|_134||_133|_132|zip|merge|isUndefined|isCallable|listMax|_131|_130|encodeURIComponent||_127|method|parseQueryString|evalJSON|registerJSON|serializeJSON|objMin|objMax|reverseKeyComparator|arrayEqual|objEqual|bindMethods|xfilter|xmap|isEmpty|isNull|isUndefinedOrNull|itemgetter|items|keys|setdefault|_126|_120|decodeURIComponent|_119|len|_109|_107|_104|_105|_101|_102|_98|||_100|_97|_96|_91|json|__json__|_82|_81|_80|_79|_76||_75|_74|_73|_69|_primitives|_64|_63||_62|_61|_59|_wrapDumbFunction|_49|_50|_31|_30|_21|_7|application|MochiKit_|createElementNS|namespaceURI|lastIndexOf|xul|there|gatekeeper|keymaster|mozilla|getElementsComputedStyle|_hasSingleTextChild|borderWidth|borderStyle|borderBottomWidth|borderTopWidth|borderTopStyle|fontSize|paddingBottom|insertBefore|paddingTop|marginBottom|marginTop|_575|property|see|handling|thrown|Multiple|element|||given|123|KEY_NUM_PAD_|105|KEY_APOSTROPHE|222|KEY_RIGHT_SQUARE_BRACKET|221|KEY_REVERSE_SOLIDUS|220|KEY_LEFT_SQUARE_BRACKET||219|KEY_GRAVE_ACCENT|192|KEY_SOLIDUS|191|KEY_FULL_STOP|190|KEY_HYPHEN|189||KEY_COMMA|188|KEY_EQUALS_SIGN|187|186|KEY_SCROLL_LOCK|145|KEY_NUM_LOCK|144|KEY_NUM_PAD_SOLIDUS|111|KEY_NUM_PAD_FULL_STOP|110|KEY_NUM_PAD_HYPHEN|109|KEY_NUM_PAD_PLUS_SIGN|107|KEY_NUM_PAD_ASTERISK|106|KEY_SELECT|KEY_WINDOWS_RIGHT|KEY_WINDOWS_LEFT|KEY_PRINT_SCREEN|KEY_SPACEBAR|KEY_ESCAPE|KEY_CAPS_LOCK|KEY_PAUSE|KEY_ALT|KEY_CTRL|KEY_SHIFT|KEY_TAB|KEY_BACKSPACE|63242|63272|63302|63233|63235|63232|63234|63273|63275|63277|63276|63289|returnValue|cancelBubble|keypress|KEY_UNKNOWN|keyup|keydown|shiftKey|metaKey||ctrlKey|altKey|toElement|srcElement|9acd32||yellowgreen||ffff00|f5f5f5|whitesmoke||ffffff|f5deb3|wheat|ee82ee|violet|40e0d0|turquoise|ff6347|tomato|d8bfd8|thistle|008080|teal|d2b48c|tan|4682b4|steelblue|00ff7f|springgreen|fffafa|snow|slategrey|slategray|6a5acd|slateblue|87ceeb|skyblue|c0c0c0|silver|a0522d|sienna|fff5ee|seashell|2e8b57|seagreen|f4a460|sandybrown|fa8072|salmon|8b4513|saddlebrown|4169e1|royalblue|bc8f8f|rosybrown|ff0000|800080|b0e0e6|powderblue|dda0dd|plum|ffc0cb|pink|cd853f||peru|ffdab9|peachpuff|ffefd5|papayawhip|db7093|palevioletred|afeeee|paleturquoise|98fb98|palegreen|eee8aa||palegoldenrod|da70d6|orchid|ff4500|orangered|ffa500|6b8e23|olivedrab|808000|olive|fdf5e6|oldlace|000080|navy|ffdead|navajowhite|ffe4b5|moccasin|ffe4e1|mistyrose|f5fffa|mintcream|191970|midnightblue|c71585|mediumvioletred|48d1cc|mediumturquoise|00fa9a|mediumspringgreen|7b68ee|mediumslateblue|3cb371|mediumseagreen|9370db|mediumpurple|ba55d3|mediumorchid|0000cd|mediumblue|66cdaa|mediumaquamarine|800000|maroon|faf0e6|linen|32cd32|limegreen|00ff00|lime|ffffe0|lightyellow|b0c4de|lightsteelblue|lightslategrey|lightslategray||87cefa|lightskyblue|20b2aa|lightseagreen|ffa07a|lightsalmon|ffb6c1|lightpink|lightgrey|90ee90|lightgreen|lightgray|fafad2|lightgoldenrodyellow|e0ffff|lightcyan|f08080|lightcoral|add8e6|lightblue|fffacd|lemonchiffon|7cfc00|lawngreen|fff0f5|lavenderblush|e6e6fa|lavender|f0e68c|khaki|fffff0|ivory|4b0082|indigo|cd5c5c|indianred|ff69b4|hotpink|f0fff0|honeydew|grey|adff2f|greenyellow|008000|daa520|goldenrod|ffd700||gold|f8f8ff|ghostwhite|dcdcdc|gainsboro|fuchsia|228b22|forestgreen|fffaf0|floralwhite|b22222|firebrick|1e90ff|dodgerblue|dimgrey|dimgray|00bfff|deepskyblue|ff1493|deeppink|9400d3|darkviolet|00ced1|darkturquoise|darkslategrey|darkslategray|483d8b|darkslateblue|8fbc8f|darkseagreen|e9967a|darksalmon|8b0000|9932cc|darkorchid|ff8c00|darkorange|556b2f|darkolivegreen|8b008b|darkmagenta|bdb76b|darkkhaki|darkgrey|006400|darkgreen|darkgray|b8860b|darkgoldenrod|008b8b|darkcyan|00008b|darkblue|dc143c|crimson|fff8dc|cornsilk|6495ed|cornflowerblue|ff7f50|coral|d2691e||chocolate|7fff00|chartreuse|5f9ea0|cadetblue|deb887|burlywood|a52a2a|8a2be2|blueviolet|0000ff|ffebcd||blanchedalmond|000000|ffe4c4|bisque|f5f5dc|beige|f0ffff|azure|7fffd4|aquamarine|aqua|faebd7|antiquewhite|f0f8ff|aliceblue|lightGray|darkGray|namedColors|blackColor|fromText|whiteColor|_510|_509|PI|rad|deg|transparentColor|_494|_493|_492|fromHSV|_491|_490|_489|asHSV|toHexString|rgba|hsla|toHSLString|isDark|lighterColorWithLevel|darkerColorWithLevel|colorWithLightness|colorWithSaturation|colorWithHue|colorWithAlpha||serif|sans|Verdana||8pt|8em|auto||Close|Clear||Load|Filter||10em||fixed|regex|emergency|line|margin|_Listener|dtd|loose|html4|w3|EN|Transitional|DTD|W3C|PUBLIC|DOCTYPE|blocking|due|debugging|able|Not|resizable|dependent|href|location|_MochiKit_LoggingPane|_429|canvas|strong|fieldset|legend|optgroup|select|form|textarea|label|img|table|tfoot|thead|tbody|htmlFor||useMap|usemap|defaultChecked|hasChildNodes|quot|amp|_405|focus|replaceChild|checkbox||radio|_win|BODY||safari|version|userAgent|navigator|innerHeight|alpha|khtml|Tried|acquire|clearTimeout|setTimeout|GET|ignore|send|abort|failed|Request|readyState|support|does|Browser|Microsoft|_288|_287|used|Deferreds|Chained|success|unfired|fr_FR|de_DE|00|abs|search|pattern|Invalid|getTimezoneOffset|getSeconds|getMinutes|getHours|UTC|3600000|initEvent|Events|debuggingBookmarklet|MESSAGES|LAST|_205|clear|ninfo|nlevel|timestamp|reverse|takes|initial|with|sequence|empty|iterable|numbers|dateLike|escape|find|forward|unregister|unescape|Object|compared|item|contains|logor|logand|cle|clt|cge|cgt|cne|ceq|zrshift|rshift|lshift|xor|mul|mod|sub|add|neg|lognot|_9|_2'.split('|'),0,{})
+
+
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+
+var decompressedJQuery = function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(G(){9(1m E!="W")H w=E;H E=18.15=G(a,b){I 6 7u E?6.5N(a,b):1u E(a,b)};9(1m $!="W")H D=$;18.$=E;H u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;E.1b=E.3A={5N:G(c,a){c=c||U;9(1m c=="1M"){H m=u.2S(c);9(m&&(m[1]||!a)){9(m[1])c=E.4D([m[1]],a);J{H b=U.3S(m[3]);9(b)9(b.22!=m[3])I E().1Y(c);J{6[0]=b;6.K=1;I 6}J c=[]}}J I 1u E(a).1Y(c)}J 9(E.1n(c))I 1u E(U)[E.1b.2d?"2d":"39"](c);I 6.6v(c.1c==1B&&c||(c.4c||c.K&&c!=18&&!c.1y&&c[0]!=W&&c[0].1y)&&E.2h(c)||[c])},4c:"1.2.1",7Y:G(){I 6.K},K:0,21:G(a){I a==W?E.2h(6):6[a]},2o:G(a){H b=E(a);b.4Y=6;I b},6v:G(a){6.K=0;1B.3A.1a.16(6,a);I 6},N:G(a,b){I E.N(6,a,b)},4I:G(a){H b=-1;6.N(G(i){9(6==a)b=i});I b},1x:G(f,d,e){H c=f;9(f.1c==3X)9(d==W)I 6.K&&E[e||"1x"](6[0],f)||W;J{c={};c[f]=d}I 6.N(G(a){L(H b 1i c)E.1x(e?6.R:6,b,E.1e(6,c[b],e,a,b))})},17:G(b,a){I 6.1x(b,a,"3C")},2g:G(e){9(1m e!="5i"&&e!=S)I 6.4n().3g(U.6F(e));H t="";E.N(e||6,G(){E.N(6.3j,G(){9(6.1y!=8)t+=6.1y!=1?6.6x:E.1b.2g([6])})});I t},5m:G(b){9(6[0])E(b,6[0].3H).6u().3d(6[0]).1X(G(){H a=6;1W(a.1w)a=a.1w;I a}).3g(6);I 6},8m:G(a){I 6.N(G(){E(6).6q().5m(a)})},8d:G(a){I 6.N(G(){E(6).5m(a)})},3g:G(){I 6.3z(1q,Q,1,G(a){6.58(a)})},6j:G(){I 6.3z(1q,Q,-1,G(a){6.3d(a,6.1w)})},6g:G(){I 6.3z(1q,P,1,G(a){6.12.3d(a,6)})},50:G(){I 6.3z(1q,P,-1,G(a){6.12.3d(a,6.2q)})},2D:G(){I 6.4Y||E([])},1Y:G(t){H b=E.1X(6,G(a){I E.1Y(t,a)});I 6.2o(/[^+>] [^+>]/.14(t)||t.1g("..")>-1?E.4V(b):b)},6u:G(e){H f=6.1X(G(){I 6.67?E(6.67)[0]:6.4R(Q)});H d=f.1Y("*").4O().N(G(){9(6[F]!=W)6[F]=S});9(e===Q)6.1Y("*").4O().N(G(i){H c=E.M(6,"2P");L(H a 1i c)L(H b 1i c[a])E.1j.1f(d[i],a,c[a][b],c[a][b].M)});I f},1E:G(t){I 6.2o(E.1n(t)&&E.2W(6,G(b,a){I t.16(b,[a])})||E.3m(t,6))},5V:G(t){I 6.2o(t.1c==3X&&E.3m(t,6,Q)||E.2W(6,G(a){I(t.1c==1B||t.4c)?E.2A(a,t)<0:a!=t}))},1f:G(t){I 6.2o(E.1R(6.21(),t.1c==3X?E(t).21():t.K!=W&&(!t.11||E.11(t,"2Y"))?t:[t]))},3t:G(a){I a?E.3m(a,6).K>0:P},7c:G(a){I 6.3t("."+a)},3i:G(b){9(b==W){9(6.K){H c=6[0];9(E.11(c,"24")){H e=c.4Z,a=[],Y=c.Y,2G=c.O=="24-2G";9(e<0)I S;L(H i=2G?e:0,33=2G?e+1:Y.K;i<33;i++){H d=Y[i];9(d.26){H b=E.V.1h&&!d.9V["1Q"].9L?d.2g:d.1Q;9(2G)I b;a.1a(b)}}I a}J I 6[0].1Q.1p(/\\r/g,"")}}J I 6.N(G(){9(b.1c==1B&&/4k|5j/.14(6.O))6.2Q=(E.2A(6.1Q,b)>=0||E.2A(6.2H,b)>=0);J 9(E.11(6,"24")){H a=b.1c==1B?b:[b];E("9h",6).N(G(){6.26=(E.2A(6.1Q,a)>=0||E.2A(6.2g,a)>=0)});9(!a.K)6.4Z=-1}J 6.1Q=b})},4o:G(a){I a==W?(6.K?6[0].3O:S):6.4n().3g(a)},6H:G(a){I 6.50(a).28()},6E:G(i){I 6.2J(i,i+1)},2J:G(){I 6.2o(1B.3A.2J.16(6,1q))},1X:G(b){I 6.2o(E.1X(6,G(a,i){I b.2O(a,i,a)}))},4O:G(){I 6.1f(6.4Y)},3z:G(f,d,g,e){H c=6.K>1,a;I 6.N(G(){9(!a){a=E.4D(f,6.3H);9(g<0)a.8U()}H b=6;9(d&&E.11(6,"1I")&&E.11(a[0],"4m"))b=6.4l("1K")[0]||6.58(U.5B("1K"));E.N(a,G(){H a=c?6.4R(Q):6;9(!5A(0,a))e.2O(b,a)})})}};G 5A(i,b){H a=E.11(b,"1J");9(a){9(b.3k)E.3G({1d:b.3k,3e:P,1V:"1J"});J E.5f(b.2g||b.6s||b.3O||"");9(b.12)b.12.3b(b)}J 9(b.1y==1)E("1J",b).N(5A);I a}E.1k=E.1b.1k=G(){H c=1q[0]||{},a=1,2c=1q.K,5e=P;9(c.1c==8o){5e=c;c=1q[1]||{}}9(2c==1){c=6;a=0}H b;L(;a<2c;a++)9((b=1q[a])!=S)L(H i 1i b){9(c==b[i])6r;9(5e&&1m b[i]==\'5i\'&&c[i])E.1k(c[i],b[i]);J 9(b[i]!=W)c[i]=b[i]}I c};H F="15"+(1u 3D()).3B(),6p=0,5c={};E.1k({8a:G(a){18.$=D;9(a)18.15=w;I E},1n:G(a){I!!a&&1m a!="1M"&&!a.11&&a.1c!=1B&&/G/i.14(a+"")},4a:G(a){I a.2V&&!a.1G||a.37&&a.3H&&!a.3H.1G},5f:G(a){a=E.36(a);9(a){9(18.6l)18.6l(a);J 9(E.V.1N)18.56(a,0);J 3w.2O(18,a)}},11:G(b,a){I b.11&&b.11.27()==a.27()},1L:{},M:G(c,d,b){c=c==18?5c:c;H a=c[F];9(!a)a=c[F]=++6p;9(d&&!E.1L[a])E.1L[a]={};9(b!=W)E.1L[a][d]=b;I d?E.1L[a][d]:a},30:G(c,b){c=c==18?5c:c;H a=c[F];9(b){9(E.1L[a]){2E E.1L[a][b];b="";L(b 1i E.1L[a])1T;9(!b)E.30(c)}}J{2a{2E c[F]}29(e){9(c.53)c.53(F)}2E E.1L[a]}},N:G(a,b,c){9(c){9(a.K==W)L(H i 1i a)b.16(a[i],c);J L(H i=0,48=a.K;i<48;i++)9(b.16(a[i],c)===P)1T}J{9(a.K==W)L(H i 1i a)b.2O(a[i],i,a[i]);J L(H i=0,48=a.K,3i=a[0];i<48&&b.2O(3i,i,3i)!==P;3i=a[++i]){}}I a},1e:G(c,b,d,e,a){9(E.1n(b))b=b.2O(c,[e]);H f=/z-?4I|7T-?7Q|1r|69|7P-?1H/i;I b&&b.1c==4W&&d=="3C"&&!f.14(a)?b+"2T":b},1o:{1f:G(b,c){E.N((c||"").2l(/\\s+/),G(i,a){9(!E.1o.3K(b.1o,a))b.1o+=(b.1o?" ":"")+a})},28:G(b,c){b.1o=c!=W?E.2W(b.1o.2l(/\\s+/),G(a){I!E.1o.3K(c,a)}).66(" "):""},3K:G(t,c){I E.2A(c,(t.1o||t).3s().2l(/\\s+/))>-1}},2k:G(e,o,f){L(H i 1i o){e.R["3r"+i]=e.R[i];e.R[i]=o[i]}f.16(e,[]);L(H i 1i o)e.R[i]=e.R["3r"+i]},17:G(e,p){9(p=="1H"||p=="2N"){H b={},42,41,d=["7J","7I","7G","7F"];E.N(d,G(){b["7C"+6]=0;b["7B"+6+"5Z"]=0});E.2k(e,b,G(){9(E(e).3t(\':3R\')){42=e.7A;41=e.7w}J{e=E(e.4R(Q)).1Y(":4k").5W("2Q").2D().17({4C:"1P",2X:"4F",19:"2Z",7o:"0",1S:"0"}).5R(e.12)[0];H a=E.17(e.12,"2X")||"3V";9(a=="3V")e.12.R.2X="7g";42=e.7e;41=e.7b;9(a=="3V")e.12.R.2X="3V";e.12.3b(e)}});I p=="1H"?42:41}I E.3C(e,p)},3C:G(h,j,i){H g,2w=[],2k=[];G 3n(a){9(!E.V.1N)I P;H b=U.3o.3Z(a,S);I!b||b.4y("3n")==""}9(j=="1r"&&E.V.1h){g=E.1x(h.R,"1r");I g==""?"1":g}9(j.1t(/4u/i))j=y;9(!i&&h.R[j])g=h.R[j];J 9(U.3o&&U.3o.3Z){9(j.1t(/4u/i))j="4u";j=j.1p(/([A-Z])/g,"-$1").2p();H d=U.3o.3Z(h,S);9(d&&!3n(h))g=d.4y(j);J{L(H a=h;a&&3n(a);a=a.12)2w.4w(a);L(a=0;a<2w.K;a++)9(3n(2w[a])){2k[a]=2w[a].R.19;2w[a].R.19="2Z"}g=j=="19"&&2k[2w.K-1]!=S?"2s":U.3o.3Z(h,S).4y(j)||"";L(a=0;a<2k.K;a++)9(2k[a]!=S)2w[a].R.19=2k[a]}9(j=="1r"&&g=="")g="1"}J 9(h.3Q){H f=j.1p(/\\-(\\w)/g,G(m,c){I c.27()});g=h.3Q[j]||h.3Q[f];9(!/^\\d+(2T)?$/i.14(g)&&/^\\d/.14(g)){H k=h.R.1S;H e=h.4v.1S;h.4v.1S=h.3Q.1S;h.R.1S=g||0;g=h.R.71+"2T";h.R.1S=k;h.4v.1S=e}}I g},4D:G(a,e){H r=[];e=e||U;E.N(a,G(i,d){9(!d)I;9(d.1c==4W)d=d.3s();9(1m d=="1M"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,G(m,a,b){I b.1t(/^(70|6Z|6Y|9Q|4t|9N|9K|3a|9G|9E)$/i)?m:a+"></"+b+">"});H s=E.36(d).2p(),1s=e.5B("1s"),2x=[];H c=!s.1g("<9y")&&[1,"<24>","</24>"]||!s.1g("<9w")&&[1,"<6T>","</6T>"]||s.1t(/^<(9u|1K|9t|9r|9p)/)&&[1,"<1I>","</1I>"]||!s.1g("<4m")&&[2,"<1I><1K>","</1K></1I>"]||(!s.1g("<9m")||!s.1g("<9k"))&&[3,"<1I><1K><4m>","</4m></1K></1I>"]||!s.1g("<6Y")&&[2,"<1I><1K></1K><6L>","</6L></1I>"]||E.V.1h&&[1,"1s<1s>","</1s>"]||[0,"",""];1s.3O=c[1]+d+c[2];1W(c[0]--)1s=1s.5p;9(E.V.1h){9(!s.1g("<1I")&&s.1g("<1K")<0)2x=1s.1w&&1s.1w.3j;J 9(c[1]=="<1I>"&&s.1g("<1K")<0)2x=1s.3j;L(H n=2x.K-1;n>=0;--n)9(E.11(2x[n],"1K")&&!2x[n].3j.K)2x[n].12.3b(2x[n]);9(/^\\s/.14(d))1s.3d(e.6F(d.1t(/^\\s*/)[0]),1s.1w)}d=E.2h(1s.3j)}9(0===d.K&&(!E.11(d,"2Y")&&!E.11(d,"24")))I;9(d[0]==W||E.11(d,"2Y")||d.Y)r.1a(d);J r=E.1R(r,d)});I r},1x:G(c,d,a){H e=E.4a(c)?{}:E.5o;9(d=="26"&&E.V.1N)c.12.4Z;9(e[d]){9(a!=W)c[e[d]]=a;I c[e[d]]}J 9(E.V.1h&&d=="R")I E.1x(c.R,"9e",a);J 9(a==W&&E.V.1h&&E.11(c,"2Y")&&(d=="9d"||d=="9a"))I c.97(d).6x;J 9(c.37){9(a!=W){9(d=="O"&&E.11(c,"4t")&&c.12)6G"O 94 93\'t 92 91";c.90(d,a)}9(E.V.1h&&/6C|3k/.14(d)&&!E.4a(c))I c.4p(d,2);I c.4p(d)}J{9(d=="1r"&&E.V.1h){9(a!=W){c.69=1;c.1E=(c.1E||"").1p(/6O\\([^)]*\\)/,"")+(3I(a).3s()=="8S"?"":"6O(1r="+a*6A+")")}I c.1E?(3I(c.1E.1t(/1r=([^)]*)/)[1])/6A).3s():""}d=d.1p(/-([a-z])/8Q,G(z,b){I b.27()});9(a!=W)c[d]=a;I c[d]}},36:G(t){I(t||"").1p(/^\\s+|\\s+$/g,"")},2h:G(a){H r=[];9(1m a!="8P")L(H i=0,2c=a.K;i<2c;i++)r.1a(a[i]);J r=a.2J(0);I r},2A:G(b,a){L(H i=0,2c=a.K;i<2c;i++)9(a[i]==b)I i;I-1},1R:G(a,b){9(E.V.1h){L(H i=0;b[i];i++)9(b[i].1y!=8)a.1a(b[i])}J L(H i=0;b[i];i++)a.1a(b[i]);I a},4V:G(b){H r=[],2f={};2a{L(H i=0,6y=b.K;i<6y;i++){H a=E.M(b[i]);9(!2f[a]){2f[a]=Q;r.1a(b[i])}}}29(e){r=b}I r},2W:G(b,a,c){9(1m a=="1M")a=3w("P||G(a,i){I "+a+"}");H d=[];L(H i=0,4g=b.K;i<4g;i++)9(!c&&a(b[i],i)||c&&!a(b[i],i))d.1a(b[i]);I d},1X:G(c,b){9(1m b=="1M")b=3w("P||G(a){I "+b+"}");H d=[];L(H i=0,4g=c.K;i<4g;i++){H a=b(c[i],i);9(a!==S&&a!=W){9(a.1c!=1B)a=[a];d=d.8M(a)}}I d}});H v=8K.8I.2p();E.V={4s:(v.1t(/.+(?:8F|8E|8C|8B)[\\/: ]([\\d.]+)/)||[])[1],1N:/6w/.14(v),34:/34/.14(v),1h:/1h/.14(v)&&!/34/.14(v),35:/35/.14(v)&&!/(8z|6w)/.14(v)};H y=E.V.1h?"4h":"5h";E.1k({5g:!E.V.1h||U.8y=="8x",4h:E.V.1h?"4h":"5h",5o:{"L":"8w","8v":"1o","4u":y,5h:y,4h:y,3O:"3O",1o:"1o",1Q:"1Q",3c:"3c",2Q:"2Q",8u:"8t",26:"26",8s:"8r"}});E.N({1D:"a.12",8q:"15.4e(a,\'12\')",8p:"15.2I(a,2,\'2q\')",8n:"15.2I(a,2,\'4d\')",8l:"15.4e(a,\'2q\')",8k:"15.4e(a,\'4d\')",8j:"15.5d(a.12.1w,a)",8i:"15.5d(a.1w)",6q:"15.11(a,\'8h\')?a.8f||a.8e.U:15.2h(a.3j)"},G(i,n){E.1b[i]=G(a){H b=E.1X(6,n);9(a&&1m a=="1M")b=E.3m(a,b);I 6.2o(E.4V(b))}});E.N({5R:"3g",8c:"6j",3d:"6g",8b:"50",89:"6H"},G(i,n){E.1b[i]=G(){H a=1q;I 6.N(G(){L(H j=0,2c=a.K;j<2c;j++)E(a[j])[n](6)})}});E.N({5W:G(a){E.1x(6,a,"");6.53(a)},88:G(c){E.1o.1f(6,c)},87:G(c){E.1o.28(6,c)},86:G(c){E.1o[E.1o.3K(6,c)?"28":"1f"](6,c)},28:G(a){9(!a||E.1E(a,[6]).r.K){E.30(6);6.12.3b(6)}},4n:G(){E("*",6).N(G(){E.30(6)});1W(6.1w)6.3b(6.1w)}},G(i,n){E.1b[i]=G(){I 6.N(n,1q)}});E.N(["85","5Z"],G(i,a){H n=a.2p();E.1b[n]=G(h){I 6[0]==18?E.V.1N&&3y["84"+a]||E.5g&&38.33(U.2V["5a"+a],U.1G["5a"+a])||U.1G["5a"+a]:6[0]==U?38.33(U.1G["6n"+a],U.1G["6m"+a]):h==W?(6.K?E.17(6[0],n):S):6.17(n,h.1c==3X?h:h+"2T")}});H C=E.V.1N&&3x(E.V.4s)<83?"(?:[\\\\w*57-]|\\\\\\\\.)":"(?:[\\\\w\\82-\\81*57-]|\\\\\\\\.)",6k=1u 47("^>\\\\s*("+C+"+)"),6i=1u 47("^("+C+"+)(#)("+C+"+)"),6h=1u 47("^([#.]?)("+C+"*)");E.1k({55:{"":"m[2]==\'*\'||15.11(a,m[2])","#":"a.4p(\'22\')==m[2]",":":{80:"i<m[3]-0",7Z:"i>m[3]-0",2I:"m[3]-0==i",6E:"m[3]-0==i",3v:"i==0",3u:"i==r.K-1",6f:"i%2==0",6e:"i%2","3v-46":"a.12.4l(\'*\')[0]==a","3u-46":"15.2I(a.12.5p,1,\'4d\')==a","7X-46":"!15.2I(a.12.5p,2,\'4d\')",1D:"a.1w",4n:"!a.1w",7W:"(a.6s||a.7V||15(a).2g()||\'\').1g(m[3])>=0",3R:\'"1P"!=a.O&&15.17(a,"19")!="2s"&&15.17(a,"4C")!="1P"\',1P:\'"1P"==a.O||15.17(a,"19")=="2s"||15.17(a,"4C")=="1P"\',7U:"!a.3c",3c:"a.3c",2Q:"a.2Q",26:"a.26||15.1x(a,\'26\')",2g:"\'2g\'==a.O",4k:"\'4k\'==a.O",5j:"\'5j\'==a.O",54:"\'54\'==a.O",52:"\'52\'==a.O",51:"\'51\'==a.O",6d:"\'6d\'==a.O",6c:"\'6c\'==a.O",2r:\'"2r"==a.O||15.11(a,"2r")\',4t:"/4t|24|6b|2r/i.14(a.11)",3K:"15.1Y(m[3],a).K",7S:"/h\\\\d/i.14(a.11)",7R:"15.2W(15.32,G(1b){I a==1b.T;}).K"}},6a:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1u 47("^([:.#]*)("+C+"+)")],3m:G(a,c,b){H d,2b=[];1W(a&&a!=d){d=a;H f=E.1E(a,c,b);a=f.t.1p(/^\\s*,\\s*/,"");2b=b?c=f.r:E.1R(2b,f.r)}I 2b},1Y:G(t,o){9(1m t!="1M")I[t];9(o&&!o.1y)o=S;o=o||U;H d=[o],2f=[],3u;1W(t&&3u!=t){H r=[];3u=t;t=E.36(t);H l=P;H g=6k;H m=g.2S(t);9(m){H p=m[1].27();L(H i=0;d[i];i++)L(H c=d[i].1w;c;c=c.2q)9(c.1y==1&&(p=="*"||c.11.27()==p.27()))r.1a(c);d=r;t=t.1p(g,"");9(t.1g(" ")==0)6r;l=Q}J{g=/^([>+~])\\s*(\\w*)/i;9((m=g.2S(t))!=S){r=[];H p=m[2],1R={};m=m[1];L(H j=0,31=d.K;j<31;j++){H n=m=="~"||m=="+"?d[j].2q:d[j].1w;L(;n;n=n.2q)9(n.1y==1){H h=E.M(n);9(m=="~"&&1R[h])1T;9(!p||n.11.27()==p.27()){9(m=="~")1R[h]=Q;r.1a(n)}9(m=="+")1T}}d=r;t=E.36(t.1p(g,""));l=Q}}9(t&&!l){9(!t.1g(",")){9(o==d[0])d.44();2f=E.1R(2f,d);r=d=[o];t=" "+t.68(1,t.K)}J{H k=6i;H m=k.2S(t);9(m){m=[0,m[2],m[3],m[1]]}J{k=6h;m=k.2S(t)}m[2]=m[2].1p(/\\\\/g,"");H f=d[d.K-1];9(m[1]=="#"&&f&&f.3S&&!E.4a(f)){H q=f.3S(m[2]);9((E.V.1h||E.V.34)&&q&&1m q.22=="1M"&&q.22!=m[2])q=E(\'[@22="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.11(q,m[3]))?[q]:[]}J{L(H i=0;d[i];i++){H a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];9(a=="*"&&d[i].11.2p()=="5i")a="3a";r=E.1R(r,d[i].4l(a))}9(m[1]==".")r=E.4X(r,m[2]);9(m[1]=="#"){H e=[];L(H i=0;r[i];i++)9(r[i].4p("22")==m[2]){e=[r[i]];1T}r=e}d=r}t=t.1p(k,"")}}9(t){H b=E.1E(t,r);d=r=b.r;t=E.36(b.t)}}9(t)d=[];9(d&&o==d[0])d.44();2f=E.1R(2f,d);I 2f},4X:G(r,m,a){m=" "+m+" ";H c=[];L(H i=0;r[i];i++){H b=(" "+r[i].1o+" ").1g(m)>=0;9(!a&&b||a&&!b)c.1a(r[i])}I c},1E:G(t,r,h){H d;1W(t&&t!=d){d=t;H p=E.6a,m;L(H i=0;p[i];i++){m=p[i].2S(t);9(m){t=t.7O(m[0].K);m[2]=m[2].1p(/\\\\/g,"");1T}}9(!m)1T;9(m[1]==":"&&m[2]=="5V")r=E.1E(m[3],r,Q).r;J 9(m[1]==".")r=E.4X(r,m[2],h);J 9(m[1]=="["){H g=[],O=m[3];L(H i=0,31=r.K;i<31;i++){H a=r[i],z=a[E.5o[m[2]]||m[2]];9(z==S||/6C|3k|26/.14(m[2]))z=E.1x(a,m[2])||\'\';9((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1g(m[5])||O=="$="&&z.68(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1g(m[5])>=0)^h)g.1a(a)}r=g}J 9(m[1]==":"&&m[2]=="2I-46"){H e={},g=[],14=/(\\d*)n\\+?(\\d*)/.2S(m[3]=="6f"&&"2n"||m[3]=="6e"&&"2n+1"||!/\\D/.14(m[3])&&"n+"+m[3]||m[3]),3v=(14[1]||1)-0,d=14[2]-0;L(H i=0,31=r.K;i<31;i++){H j=r[i],12=j.12,22=E.M(12);9(!e[22]){H c=1;L(H n=12.1w;n;n=n.2q)9(n.1y==1)n.4U=c++;e[22]=Q}H b=P;9(3v==1){9(d==0||j.4U==d)b=Q}J 9((j.4U+d)%3v==0)b=Q;9(b^h)g.1a(j)}r=g}J{H f=E.55[m[1]];9(1m f!="1M")f=E.55[m[1]][m[2]];f=3w("P||G(a,i){I "+f+"}");r=E.2W(r,f,h)}}I{r:r,t:t}},4e:G(b,c){H d=[];H a=b[c];1W(a&&a!=U){9(a.1y==1)d.1a(a);a=a[c]}I d},2I:G(a,e,c,b){e=e||1;H d=0;L(;a;a=a[c])9(a.1y==1&&++d==e)1T;I a},5d:G(n,a){H r=[];L(;n;n=n.2q){9(n.1y==1&&(!a||n!=a))r.1a(n)}I r}});E.1j={1f:G(g,e,c,h){9(E.V.1h&&g.4j!=W)g=18;9(!c.2u)c.2u=6.2u++;9(h!=W){H d=c;c=G(){I d.16(6,1q)};c.M=h;c.2u=d.2u}H i=e.2l(".");e=i[0];c.O=i[1];H b=E.M(g,"2P")||E.M(g,"2P",{});H f=E.M(g,"2t",G(){H a;9(1m E=="W"||E.1j.4T)I a;a=E.1j.2t.16(g,1q);I a});H j=b[e];9(!j){j=b[e]={};9(g.4S)g.4S(e,f,P);J g.7N("43"+e,f)}j[c.2u]=c;6.1Z[e]=Q},2u:1,1Z:{},28:G(d,c,b){H e=E.M(d,"2P"),2L,4I;9(1m c=="1M"){H a=c.2l(".");c=a[0]}9(e){9(c&&c.O){b=c.4Q;c=c.O}9(!c){L(c 1i e)6.28(d,c)}J 9(e[c]){9(b)2E e[c][b.2u];J L(b 1i e[c])9(!a[1]||e[c][b].O==a[1])2E e[c][b];L(2L 1i e[c])1T;9(!2L){9(d.4P)d.4P(c,E.M(d,"2t"),P);J d.7M("43"+c,E.M(d,"2t"));2L=S;2E e[c]}}L(2L 1i e)1T;9(!2L){E.30(d,"2P");E.30(d,"2t")}}},1F:G(d,b,e,c,f){b=E.2h(b||[]);9(!e){9(6.1Z[d])E("*").1f([18,U]).1F(d,b)}J{H a,2L,1b=E.1n(e[d]||S),4N=!b[0]||!b[0].2M;9(4N)b.4w(6.4M({O:d,2m:e}));b[0].O=d;9(E.1n(E.M(e,"2t")))a=E.M(e,"2t").16(e,b);9(!1b&&e["43"+d]&&e["43"+d].16(e,b)===P)a=P;9(4N)b.44();9(f&&f.16(e,b)===P)a=P;9(1b&&c!==P&&a!==P&&!(E.11(e,\'a\')&&d=="4L")){6.4T=Q;e[d]()}6.4T=P}I a},2t:G(d){H a;d=E.1j.4M(d||18.1j||{});H b=d.O.2l(".");d.O=b[0];H c=E.M(6,"2P")&&E.M(6,"2P")[d.O],3q=1B.3A.2J.2O(1q,1);3q.4w(d);L(H j 1i c){3q[0].4Q=c[j];3q[0].M=c[j].M;9(!b[1]||c[j].O==b[1]){H e=c[j].16(6,3q);9(a!==P)a=e;9(e===P){d.2M();d.3p()}}}9(E.V.1h)d.2m=d.2M=d.3p=d.4Q=d.M=S;I a},4M:G(c){H a=c;c=E.1k({},a);c.2M=G(){9(a.2M)a.2M();a.7L=P};c.3p=G(){9(a.3p)a.3p();a.7K=Q};9(!c.2m&&c.65)c.2m=c.65;9(E.V.1N&&c.2m.1y==3)c.2m=a.2m.12;9(!c.4K&&c.4J)c.4K=c.4J==c.2m?c.7H:c.4J;9(c.64==S&&c.63!=S){H e=U.2V,b=U.1G;c.64=c.63+(e&&e.2R||b.2R||0);c.7E=c.7D+(e&&e.2B||b.2B||0)}9(!c.3Y&&(c.61||c.60))c.3Y=c.61||c.60;9(!c.5F&&c.5D)c.5F=c.5D;9(!c.3Y&&c.2r)c.3Y=(c.2r&1?1:(c.2r&2?3:(c.2r&4?2:0)));I c}};E.1b.1k({3W:G(c,a,b){I c=="5Y"?6.2G(c,a,b):6.N(G(){E.1j.1f(6,c,b||a,b&&a)})},2G:G(d,b,c){I 6.N(G(){E.1j.1f(6,d,G(a){E(6).5X(a);I(c||b).16(6,1q)},c&&b)})},5X:G(a,b){I 6.N(G(){E.1j.28(6,a,b)})},1F:G(c,a,b){I 6.N(G(){E.1j.1F(c,a,6,Q,b)})},7x:G(c,a,b){9(6[0])I E.1j.1F(c,a,6[0],P,b)},25:G(){H a=1q;I 6.4L(G(e){6.4H=0==6.4H?1:0;e.2M();I a[6.4H].16(6,[e])||P})},7v:G(f,g){G 4G(e){H p=e.4K;1W(p&&p!=6)2a{p=p.12}29(e){p=6};9(p==6)I P;I(e.O=="4x"?f:g).16(6,[e])}I 6.4x(4G).5U(4G)},2d:G(f){5T();9(E.3T)f.16(U,[E]);J E.3l.1a(G(){I f.16(6,[E])});I 6}});E.1k({3T:P,3l:[],2d:G(){9(!E.3T){E.3T=Q;9(E.3l){E.N(E.3l,G(){6.16(U)});E.3l=S}9(E.V.35||E.V.34)U.4P("5S",E.2d,P);9(!18.7t.K)E(18).39(G(){E("#4E").28()})}}});E.N(("7s,7r,39,7q,6n,5Y,4L,7p,"+"7n,7m,7l,4x,5U,7k,24,"+"51,7j,7i,7h,3U").2l(","),G(i,o){E.1b[o]=G(f){I f?6.3W(o,f):6.1F(o)}});H x=P;G 5T(){9(x)I;x=Q;9(E.V.35||E.V.34)U.4S("5S",E.2d,P);J 9(E.V.1h){U.7f("<7d"+"7y 22=4E 7z=Q "+"3k=//:><\\/1J>");H a=U.3S("4E");9(a)a.62=G(){9(6.2C!="1l")I;E.2d()};a=S}J 9(E.V.1N)E.4B=4j(G(){9(U.2C=="5Q"||U.2C=="1l"){4A(E.4B);E.4B=S;E.2d()}},10);E.1j.1f(18,"39",E.2d)}E.1b.1k({39:G(g,d,c){9(E.1n(g))I 6.3W("39",g);H e=g.1g(" ");9(e>=0){H i=g.2J(e,g.K);g=g.2J(0,e)}c=c||G(){};H f="4z";9(d)9(E.1n(d)){c=d;d=S}J{d=E.3a(d);f="5P"}H h=6;E.3G({1d:g,O:f,M:d,1l:G(a,b){9(b=="1C"||b=="5O")h.4o(i?E("<1s/>").3g(a.40.1p(/<1J(.|\\s)*?\\/1J>/g,"")).1Y(i):a.40);56(G(){h.N(c,[a.40,b,a])},13)}});I 6},7a:G(){I E.3a(6.5M())},5M:G(){I 6.1X(G(){I E.11(6,"2Y")?E.2h(6.79):6}).1E(G(){I 6.2H&&!6.3c&&(6.2Q||/24|6b/i.14(6.11)||/2g|1P|52/i.14(6.O))}).1X(G(i,c){H b=E(6).3i();I b==S?S:b.1c==1B?E.1X(b,G(a,i){I{2H:c.2H,1Q:a}}):{2H:c.2H,1Q:b}}).21()}});E.N("5L,5K,6t,5J,5I,5H".2l(","),G(i,o){E.1b[o]=G(f){I 6.3W(o,f)}});H B=(1u 3D).3B();E.1k({21:G(d,b,a,c){9(E.1n(b)){a=b;b=S}I E.3G({O:"4z",1d:d,M:b,1C:a,1V:c})},78:G(b,a){I E.21(b,S,a,"1J")},77:G(c,b,a){I E.21(c,b,a,"45")},76:G(d,b,a,c){9(E.1n(b)){a=b;b={}}I E.3G({O:"5P",1d:d,M:b,1C:a,1V:c})},75:G(a){E.1k(E.59,a)},59:{1Z:Q,O:"4z",2z:0,5G:"74/x-73-2Y-72",6o:Q,3e:Q,M:S},49:{},3G:G(s){H f,2y=/=(\\?|%3F)/g,1v,M;s=E.1k(Q,s,E.1k(Q,{},E.59,s));9(s.M&&s.6o&&1m s.M!="1M")s.M=E.3a(s.M);9(s.1V=="4b"){9(s.O.2p()=="21"){9(!s.1d.1t(2y))s.1d+=(s.1d.1t(/\\?/)?"&":"?")+(s.4b||"5E")+"=?"}J 9(!s.M||!s.M.1t(2y))s.M=(s.M?s.M+"&":"")+(s.4b||"5E")+"=?";s.1V="45"}9(s.1V=="45"&&(s.M&&s.M.1t(2y)||s.1d.1t(2y))){f="4b"+B++;9(s.M)s.M=s.M.1p(2y,"="+f);s.1d=s.1d.1p(2y,"="+f);s.1V="1J";18[f]=G(a){M=a;1C();1l();18[f]=W;2a{2E 18[f]}29(e){}}}9(s.1V=="1J"&&s.1L==S)s.1L=P;9(s.1L===P&&s.O.2p()=="21")s.1d+=(s.1d.1t(/\\?/)?"&":"?")+"57="+(1u 3D()).3B();9(s.M&&s.O.2p()=="21"){s.1d+=(s.1d.1t(/\\?/)?"&":"?")+s.M;s.M=S}9(s.1Z&&!E.5b++)E.1j.1F("5L");9(!s.1d.1g("8g")&&s.1V=="1J"){H h=U.4l("9U")[0];H g=U.5B("1J");g.3k=s.1d;9(!f&&(s.1C||s.1l)){H j=P;g.9R=g.62=G(){9(!j&&(!6.2C||6.2C=="5Q"||6.2C=="1l")){j=Q;1C();1l();h.3b(g)}}}h.58(g);I}H k=P;H i=18.6X?1u 6X("9P.9O"):1u 6W();i.9M(s.O,s.1d,s.3e);9(s.M)i.5C("9J-9I",s.5G);9(s.5y)i.5C("9H-5x-9F",E.49[s.1d]||"9D, 9C 9B 9A 5v:5v:5v 9z");i.5C("X-9x-9v","6W");9(s.6U)s.6U(i);9(s.1Z)E.1j.1F("5H",[i,s]);H c=G(a){9(!k&&i&&(i.2C==4||a=="2z")){k=Q;9(d){4A(d);d=S}1v=a=="2z"&&"2z"||!E.6S(i)&&"3U"||s.5y&&E.6R(i,s.1d)&&"5O"||"1C";9(1v=="1C"){2a{M=E.6Q(i,s.1V)}29(e){1v="5k"}}9(1v=="1C"){H b;2a{b=i.5s("6P-5x")}29(e){}9(s.5y&&b)E.49[s.1d]=b;9(!f)1C()}J E.5r(s,i,1v);1l();9(s.3e)i=S}};9(s.3e){H d=4j(c,13);9(s.2z>0)56(G(){9(i){i.9q();9(!k)c("2z")}},s.2z)}2a{i.9o(s.M)}29(e){E.5r(s,i,S,e)}9(!s.3e)c();I i;G 1C(){9(s.1C)s.1C(M,1v);9(s.1Z)E.1j.1F("5I",[i,s])}G 1l(){9(s.1l)s.1l(i,1v);9(s.1Z)E.1j.1F("6t",[i,s]);9(s.1Z&&!--E.5b)E.1j.1F("5K")}},5r:G(s,a,b,e){9(s.3U)s.3U(a,b,e);9(s.1Z)E.1j.1F("5J",[a,s,e])},5b:0,6S:G(r){2a{I!r.1v&&9n.9l=="54:"||(r.1v>=6N&&r.1v<9j)||r.1v==6M||E.V.1N&&r.1v==W}29(e){}I P},6R:G(a,c){2a{H b=a.5s("6P-5x");I a.1v==6M||b==E.49[c]||E.V.1N&&a.1v==W}29(e){}I P},6Q:G(r,b){H c=r.5s("9i-O");H d=b=="6K"||!b&&c&&c.1g("6K")>=0;H a=d?r.9g:r.40;9(d&&a.2V.37=="5k")6G"5k";9(b=="1J")E.5f(a);9(b=="45")a=3w("("+a+")");I a},3a:G(a){H s=[];9(a.1c==1B||a.4c)E.N(a,G(){s.1a(3f(6.2H)+"="+3f(6.1Q))});J L(H j 1i a)9(a[j]&&a[j].1c==1B)E.N(a[j],G(){s.1a(3f(j)+"="+3f(6))});J s.1a(3f(j)+"="+3f(a[j]));I s.66("&").1p(/%20/g,"+")}});E.1b.1k({1A:G(b,a){I b?6.1U({1H:"1A",2N:"1A",1r:"1A"},b,a):6.1E(":1P").N(G(){6.R.19=6.3h?6.3h:"";9(E.17(6,"19")=="2s")6.R.19="2Z"}).2D()},1z:G(b,a){I b?6.1U({1H:"1z",2N:"1z",1r:"1z"},b,a):6.1E(":3R").N(G(){6.3h=6.3h||E.17(6,"19");9(6.3h=="2s")6.3h="2Z";6.R.19="2s"}).2D()},6J:E.1b.25,25:G(a,b){I E.1n(a)&&E.1n(b)?6.6J(a,b):a?6.1U({1H:"25",2N:"25",1r:"25"},a,b):6.N(G(){E(6)[E(6).3t(":1P")?"1A":"1z"]()})},9c:G(b,a){I 6.1U({1H:"1A"},b,a)},9b:G(b,a){I 6.1U({1H:"1z"},b,a)},99:G(b,a){I 6.1U({1H:"25"},b,a)},98:G(b,a){I 6.1U({1r:"1A"},b,a)},96:G(b,a){I 6.1U({1r:"1z"},b,a)},95:G(c,a,b){I 6.1U({1r:a},c,b)},1U:G(k,i,h,g){H j=E.6D(i,h,g);I 6[j.3L===P?"N":"3L"](G(){j=E.1k({},j);H f=E(6).3t(":1P"),3y=6;L(H p 1i k){9(k[p]=="1z"&&f||k[p]=="1A"&&!f)I E.1n(j.1l)&&j.1l.16(6);9(p=="1H"||p=="2N"){j.19=E.17(6,"19");j.2U=6.R.2U}}9(j.2U!=S)6.R.2U="1P";j.3M=E.1k({},k);E.N(k,G(c,a){H e=1u E.2j(3y,j,c);9(/25|1A|1z/.14(a))e[a=="25"?f?"1A":"1z":a](k);J{H b=a.3s().1t(/^([+-]=)?([\\d+-.]+)(.*)$/),1O=e.2b(Q)||0;9(b){H d=3I(b[2]),2i=b[3]||"2T";9(2i!="2T"){3y.R[c]=(d||1)+2i;1O=((d||1)/e.2b(Q))*1O;3y.R[c]=1O+2i}9(b[1])d=((b[1]=="-="?-1:1)*d)+1O;e.3N(1O,d,2i)}J e.3N(1O,a,"")}});I Q})},3L:G(a,b){9(E.1n(a)){b=a;a="2j"}9(!a||(1m a=="1M"&&!b))I A(6[0],a);I 6.N(G(){9(b.1c==1B)A(6,a,b);J{A(6,a).1a(b);9(A(6,a).K==1)b.16(6)}})},9f:G(){H a=E.32;I 6.N(G(){L(H i=0;i<a.K;i++)9(a[i].T==6)a.6I(i--,1)}).5n()}});H A=G(b,c,a){9(!b)I;H q=E.M(b,c+"3L");9(!q||a)q=E.M(b,c+"3L",a?E.2h(a):[]);I q};E.1b.5n=G(a){a=a||"2j";I 6.N(G(){H q=A(6,a);q.44();9(q.K)q[0].16(6)})};E.1k({6D:G(b,a,c){H d=b&&b.1c==8Z?b:{1l:c||!c&&a||E.1n(b)&&b,2e:b,3J:c&&a||a&&a.1c!=8Y&&a};d.2e=(d.2e&&d.2e.1c==4W?d.2e:{8X:8W,8V:6N}[d.2e])||8T;d.3r=d.1l;d.1l=G(){E(6).5n();9(E.1n(d.3r))d.3r.16(6)};I d},3J:{6B:G(p,n,b,a){I b+a*p},5q:G(p,n,b,a){I((-38.9s(p*38.8R)/2)+0.5)*a+b}},32:[],2j:G(b,c,a){6.Y=c;6.T=b;6.1e=a;9(!c.3P)c.3P={}}});E.2j.3A={4r:G(){9(6.Y.2F)6.Y.2F.16(6.T,[6.2v,6]);(E.2j.2F[6.1e]||E.2j.2F.6z)(6);9(6.1e=="1H"||6.1e=="2N")6.T.R.19="2Z"},2b:G(a){9(6.T[6.1e]!=S&&6.T.R[6.1e]==S)I 6.T[6.1e];H r=3I(E.3C(6.T,6.1e,a));I r&&r>-8O?r:3I(E.17(6.T,6.1e))||0},3N:G(c,b,e){6.5u=(1u 3D()).3B();6.1O=c;6.2D=b;6.2i=e||6.2i||"2T";6.2v=6.1O;6.4q=6.4i=0;6.4r();H f=6;G t(){I f.2F()}t.T=6.T;E.32.1a(t);9(E.32.K==1){H d=4j(G(){H a=E.32;L(H i=0;i<a.K;i++)9(!a[i]())a.6I(i--,1);9(!a.K)4A(d)},13)}},1A:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1A=Q;6.3N(0,6.2b());9(6.1e=="2N"||6.1e=="1H")6.T.R[6.1e]="8N";E(6.T).1A()},1z:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1z=Q;6.3N(6.2b(),0)},2F:G(){H t=(1u 3D()).3B();9(t>6.Y.2e+6.5u){6.2v=6.2D;6.4q=6.4i=1;6.4r();6.Y.3M[6.1e]=Q;H a=Q;L(H i 1i 6.Y.3M)9(6.Y.3M[i]!==Q)a=P;9(a){9(6.Y.19!=S){6.T.R.2U=6.Y.2U;6.T.R.19=6.Y.19;9(E.17(6.T,"19")=="2s")6.T.R.19="2Z"}9(6.Y.1z)6.T.R.19="2s";9(6.Y.1z||6.Y.1A)L(H p 1i 6.Y.3M)E.1x(6.T.R,p,6.Y.3P[p])}9(a&&E.1n(6.Y.1l))6.Y.1l.16(6.T);I P}J{H n=t-6.5u;6.4i=n/6.Y.2e;6.4q=E.3J[6.Y.3J||(E.3J.5q?"5q":"6B")](6.4i,n,0,1,6.Y.2e);6.2v=6.1O+((6.2D-6.1O)*6.4q);6.4r()}I Q}};E.2j.2F={2R:G(a){a.T.2R=a.2v},2B:G(a){a.T.2B=a.2v},1r:G(a){E.1x(a.T.R,"1r",a.2v)},6z:G(a){a.T.R[a.1e]=a.2v+a.2i}};E.1b.6m=G(){H c=0,3E=0,T=6[0],5t;9(T)8L(E.V){H b=E.17(T,"2X")=="4F",1D=T.12,23=T.23,2K=T.3H,4f=1N&&3x(4s)<8J;9(T.6V){5w=T.6V();1f(5w.1S+38.33(2K.2V.2R,2K.1G.2R),5w.3E+38.33(2K.2V.2B,2K.1G.2B));9(1h){H d=E("4o").17("8H");d=(d=="8G"||E.5g&&3x(4s)>=7)&&2||d;1f(-d,-d)}}J{1f(T.5l,T.5z);1W(23){1f(23.5l,23.5z);9(35&&/^t[d|h]$/i.14(1D.37)||!4f)d(23);9(4f&&!b&&E.17(23,"2X")=="4F")b=Q;23=23.23}1W(1D.37&&!/^1G|4o$/i.14(1D.37)){9(!/^8D|1I-9S.*$/i.14(E.17(1D,"19")))1f(-1D.2R,-1D.2B);9(35&&E.17(1D,"2U")!="3R")d(1D);1D=1D.12}9(4f&&b)1f(-2K.1G.5l,-2K.1G.5z)}5t={3E:3E,1S:c}}I 5t;G d(a){1f(E.17(a,"9T"),E.17(a,"8A"))}G 1f(l,t){c+=3x(l)||0;3E+=3x(t)||0}}})();',62,616,'||||||this|||if|||||||||||||||||||||||||||||||||function|var|return|else|length|for|data|each|type|false|true|style|null|elem|document|browser|undefined||options|||nodeName|parentNode||test|jQuery|apply|css|window|display|push|fn|constructor|url|prop|add|indexOf|msie|in|event|extend|complete|typeof|isFunction|className|replace|arguments|opacity|div|match|new|status|firstChild|attr|nodeType|hide|show|Array|success|parent|filter|trigger|body|height|table|script|tbody|cache|string|safari|start|hidden|value|merge|left|break|animate|dataType|while|map|find|global||get|id|offsetParent|select|toggle|selected|toUpperCase|remove|catch|try|cur|al|ready|duration|done|text|makeArray|unit|fx|swap|split|target||pushStack|toLowerCase|nextSibling|button|none|handle|guid|now|stack|tb|jsre|timeout|inArray|scrollTop|readyState|end|delete|step|one|name|nth|slice|doc|ret|preventDefault|width|call|events|checked|scrollLeft|exec|px|overflow|documentElement|grep|position|form|block|removeData|rl|timers|max|opera|mozilla|trim|tagName|Math|load|param|removeChild|disabled|insertBefore|async|encodeURIComponent|append|oldblock|val|childNodes|src|readyList|multiFilter|color|defaultView|stopPropagation|args|old|toString|is|last|first|eval|parseInt|self|domManip|prototype|getTime|curCSS|Date|top||ajax|ownerDocument|parseFloat|easing|has|queue|curAnim|custom|innerHTML|orig|currentStyle|visible|getElementById|isReady|error|static|bind|String|which|getComputedStyle|responseText|oWidth|oHeight|on|shift|json|child|RegExp|ol|lastModified|isXMLDoc|jsonp|jquery|previousSibling|dir|safari2|el|styleFloat|state|setInterval|radio|getElementsByTagName|tr|empty|html|getAttribute|pos|update|version|input|float|runtimeStyle|unshift|mouseover|getPropertyValue|GET|clearInterval|safariTimer|visibility|clean|__ie_init|absolute|handleHover|lastToggle|index|fromElement|relatedTarget|click|fix|evt|andSelf|removeEventListener|handler|cloneNode|addEventListener|triggered|nodeIndex|unique|Number|classFilter|prevObject|selectedIndex|after|submit|password|removeAttribute|file|expr|setTimeout|_|appendChild|ajaxSettings|client|active|win|sibling|deep|globalEval|boxModel|cssFloat|object|checkbox|parsererror|offsetLeft|wrapAll|dequeue|props|lastChild|swing|handleError|getResponseHeader|results|startTime|00|box|Modified|ifModified|offsetTop|evalScript|createElement|setRequestHeader|ctrlKey|callback|metaKey|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxStop|ajaxStart|serializeArray|init|notmodified|POST|loaded|appendTo|DOMContentLoaded|bindReady|mouseout|not|removeAttr|unbind|unload|Width|keyCode|charCode|onreadystatechange|clientX|pageX|srcElement|join|outerHTML|substr|zoom|parse|textarea|reset|image|odd|even|before|quickClass|quickID|prepend|quickChild|execScript|offset|scroll|processData|uuid|contents|continue|textContent|ajaxComplete|clone|setArray|webkit|nodeValue|fl|_default|100|linear|href|speed|eq|createTextNode|throw|replaceWith|splice|_toggle|xml|colgroup|304|200|alpha|Last|httpData|httpNotModified|httpSuccess|fieldset|beforeSend|getBoundingClientRect|XMLHttpRequest|ActiveXObject|col|br|abbr|pixelLeft|urlencoded|www|application|ajaxSetup|post|getJSON|getScript|elements|serialize|clientWidth|hasClass|scr|clientHeight|write|relative|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|right|dblclick|resize|focus|blur|frames|instanceof|hover|offsetWidth|triggerHandler|ipt|defer|offsetHeight|border|padding|clientY|pageY|Left|Right|toElement|Bottom|Top|cancelBubble|returnValue|detachEvent|attachEvent|substring|line|weight|animated|header|font|enabled|innerText|contains|only|size|gt|lt|uFFFF|u0128|417|inner|Height|toggleClass|removeClass|addClass|replaceAll|noConflict|insertAfter|prependTo|wrap|contentWindow|contentDocument|http|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|Boolean|next|parents|maxLength|maxlength|readOnly|readonly|class|htmlFor|CSS1Compat|compatMode|compatible|borderTopWidth|ie|ra|inline|it|rv|medium|borderWidth|userAgent|522|navigator|with|concat|1px|10000|array|ig|PI|NaN|400|reverse|fast|600|slow|Function|Object|setAttribute|changed|be|can|property|fadeTo|fadeOut|getAttributeNode|fadeIn|slideToggle|method|slideUp|slideDown|action|cssText|stop|responseXML|option|content|300|th|protocol|td|location|send|cap|abort|colg|cos|tfoot|thead|With|leg|Requested|opt|GMT|1970|Jan|01|Thu|area|Since|hr|If|Type|Content|meta|specified|open|link|XMLHTTP|Microsoft|img|onload|row|borderLeftWidth|head|attributes'.split('|'),0,{});
+
+/*
+ Copyright (c) 2004-2007, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+/*
+ This is a compiled version of Dojo, built for deployment and not for
+ development. To get an editable version, please visit:
+
+ http://dojotoolkit.org
+
+ for documentation and information on getting the source.
+*/
+
+var decompressedDojo = function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('if(V z=="1k"){(B(){if(V D["1o"]=="1k"){D.1o={}}if((!D["1z"])||(!1z["ca"])){D.1z={}}A cn=["rA","rz","1K","ry","rx","9f","rw","rv","ru","rt","rs","rr","rq","ro","rn","rm"];A i=0,24;1s(24=cn[i++]){if(!1z[24]){1z[24]=B(){}}}if(V D["z"]=="1k"){D.z={}}z.1W=D;A d3={im:U,rl:U,rk:"",rj:"",ri:"",rh:K,rg:U};R(A 8z in d3){if(V 1o[8z]=="1k"){1o[8z]=d3[8z]}}A jK=["rf","rd","rc","rb"];A t;1s(t=jK.3a()){z["is"+t]=U}})();z.8h=1o.8h;z.cY={jJ:0,jI:9,jH:0,jG:"",jF:2V("$ra: r9 $".1f(/[0-9]+/)[0]),2i:B(){4G(z.cY){C jJ+"."+jI+"."+jH+jG+" ("+jF+")"}}};z.d1=B(jE,jD,1V){A 2h=1V||z.1W;R(A i=0,p;2h&&(p=jE[i]);i++){2h=(p in 2h?2h[p]:(jD?2h[p]={}:1k))}C 2h};z.88=B(jC,jA,jB){A d2=jC.1A("."),p=d2.8q(),M=z.d1(d2,K,jB);C(M&&p?(M[p]=jA):1k)};z.6q=B(jz,jy,jx){C z.d1(jz.1A("."),jy,jx)};z.r8=B(jw,M){C!!z.6q(jw,U,M)};z["3u"]=B(d0){C z.1W.3u?z.1W.3u(d0):3u(d0)};z.ia=B(jv,cZ,cX){A 8y="r7: "+jv;if(cZ){8y+=" "+cZ}if(cX){8y+=" -- r6 be r5 in cY: "+cX}1z.1K(8y)};z.r4=B(ju,cW){A cV="r3: "+ju+" -- r2 r1 4F r0 qZ qY.";if(cW){cV+=" "+cW}1z.1K(cV)};(B(){A cR={53:{},6p:0,1h:{},8k:{z:{1p:"z",1Z:"."},cU:{1p:"cU",1Z:"../qX/cU"},cT:{1p:"cT",1Z:"cT"}},cN:B(cS){A mp=D.8k;C jp(mp[cS]&&mp[cS].1Z)},jk:B(8x){A mp=D.8k;if(D.cN(8x)){C mp[8x].1Z}C 8x},8v:[],6t:U,56:[],8t:[],8u:U};R(A cQ in cR){z[cQ]=cR[cQ]}})();z.jg=B(8w,cP,cb){A 1g=(((8w.2s(0)=="/"||8w.1f(/^\\w+:/)))?"":D.51)+8w;if(1o.jt&&z.c8){1g+="?"+67(1o.jt).2f(/\\W+/g,"")}1u{C!cP?D.cO(1g,cb):D.jq(1g,cP,cb)}1y(e){1z.1K(e);C U}};z.cO=B(1g,cb){if(D.8v[1g]){C K}A 6u=D.iR(1g,K);if(!6u){C U}D.8v[1g]=K;D.8v.Y(1g);if(cb){6u="("+6u+")"}A jr=z["3u"](6u+"\\r\\n//@ qW="+1g);if(cb){cb(jr)}C K};z.jq=B(1g,jo,cb){A ok=U;1u{ok=D.cO(1g,cb)}1y(e){1z.1K("qV je ",1g," 4G 9f: ",e)}C jp(ok&&D.53[jo])};z.6m=B(){D.8u=K;D.6t=K;A 57=D.56;D.56=[];R(A x=0;x<57.G;x++){57[x]()}D.8u=U;if(z.6t&&z.6p==0&&D.56.G>0){z.8s()}};z.ck=B(){A 57=D.8t;1s(57.G){(57.8q())()}};z.qU=B(M,jn){A d=z;if(P.G==1){d.56.Y(M)}I{if(P.G>1){d.56.Y(B(){M[jn]()})}}if(d.6t&&d.6p==0&&!d.8u){d.8s()}};z.dW=B(M,jm){A d=z;if(P.G==1){d.8t.Y(M)}I{if(P.G>1){d.8t.Y(B(){M[jm]()})}}};z.iM=B(){if(D.6t){C}if(D.6p>0){1z.1K("qT qS in qR!");C}z.8s()};z.8s=B(){if(V 5c=="8b"||(1o["qQ"]&&z.2M)){5c("z.6m();",0)}I{z.6m()}};z.cF=B(jl){A 4v=jl.1A(".");R(A i=4v.G;i>0;i--){A 8r=4v.2w(0,i).22(".");if((i==1)&&!D.cN(8r)){4v[0]="../"+4v[0]}I{A cM=D.jk(8r);if(cM!=8r){4v.3S(0,i,cM);3f}}}C 4v};z.jj=U;z.8m=B(2T,qP,55){55=D.jj||55;A 54=D.53[2T];if(54){C 54}A cL=2T.1A(".");A 3L=D.cF(2T);A jh=((3L[0].2s(0)!="/")&&!3L[0].1f(/^\\w+:/));A ji=3L[3L.G-1];A 3m;if(ji=="*"){2T=cL.2w(0,-1).22(".");3L.8q();3m=3L.22("/")+"/"+(1o["qO"]||"qN")+".js";if(jh&&3m.2s(0)=="/"){3m=3m.2w(1)}}I{3m=3L.22("/")+".js";2T=cL.22(".")}A jf=(!55)?2T:L;A ok=D.jg(3m,jf);if((!ok)&&(!55)){2m S 1O("qM 3O 4E \'"+2T+"\'; 72 qL \'"+3m+"\'")}if((!55)&&(!D["qK"])){54=D.53[2T];if(!54){2m S 1O("qJ \'"+2T+"\' is 3O qI a8 je \'"+3m+"\'")}}C 54};z.8c=z.8m;z.1Q=B(cK){A cJ=cK+"";A 8p=cJ;A 6s=cK.1A(/\\./);if(6s[6s.G-1]=="*"){6s.8q();8p=6s.22(".")}A 8o=z.6q(8p,K);D.53[cJ]=8o;D.53[8p]=8o;C 8o};z.qH=B(8n){A jd=8n["qG"]||[];A cI=jd.3U(8n[z.j4]||8n["aY"]||[]);R(A x=0;x<cI.G;x++){A 8l=cI[x];if(8l.1P==4e){z.8m.14(z,8l)}I{z.8m(8l)}}};z.jb=B(jc,qF){if(jc===K){A cH=[];R(A i=1;i<P.G;i++){cH.Y(P[i])}z.8c.14(z,cH)}};z.qE=z.jb;z.io=B(cG,ja){D.8k[cG]={1p:cG,1Z:ja}};z.qD=B(qC,qB,qA,qz){z.8c("z.j9");z.j9.qy.14(z.qx,P)};(B(){A j7=S 9G("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?$");A j6=S 9G("^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$");z.4r=B(){A n=L;A 1V=P;A 1g=1V[0];R(A i=1;i<1V.G;i++){if(!1V[i]){6c}A 1t=S z.4r(1V[i]+"");A 4u=S z.4r(1g+"");if((1t.28=="")&&(!1t.4t)&&(!1t.3l)&&(!1t.1r)){if(1t.52!=n){4u.52=1t.52}1t=4u}I{if(!1t.4t){1t.4t=4u.4t;if(!1t.3l){1t.3l=4u.3l;if(1t.28.2s(0)!="/"){A j8=4u.28.21(0,4u.28.31("/")+1)+1t.28;A 1X=j8.1A("/");R(A j=0;j<1X.G;j++){if(1X[j]=="."){if(j==1X.G-1){1X[j]=""}I{1X.3S(j,1);j--}}I{if(j>0&&!(j==1&&1X[0]=="")&&1X[j]==".."&&1X[j-1]!=".."){if(j==(1X.G-1)){1X.3S(j,1);1X[j-1]=""}I{1X.3S(j-1,2);j-=2}}}}1t.28=1X.22("/")}}}}1g="";if(1t.4t){1g+=1t.4t+":"}if(1t.3l){1g+="//"+1t.3l}1g+=1t.28;if(1t.1r){1g+="?"+1t.1r}if(1t.52){1g+="#"+1t.52}}D.1g=1g.2i();A r=D.1g.1f(j7);D.4t=r[2]||(r[1]?"":n);D.3l=r[4]||(r[3]?"":n);D.28=r[5];D.1r=r[7]||(r[6]?"":n);D.52=r[9]||(r[8]?"":n);if(D.3l!=n){r=D.3l.1f(j6);D.8X=r[3]||n;D.8W=r[4]||n;D.qw=r[5];D.qv=r[7]||n}};z.4r.1C.2i=B(){C D.1g}})();z.qu=B(j5,2E){A 2B=z.cF(j5).22("/");if(!2B){C L}if(2B.31("/")!=2B.G-1){2B+="/"}A cE=2B.T(":");if(2B.2s(0)!="/"&&(cE==-1||cE>2B.T("/"))){2B=z.51+2B}C S z.4r(2B,2E)};if(V 26!="1k"){z.c8=K;z.j4="qt";(B(){A d=z;if(1q&&1q.4I){A 8j=1q.4I("ak");A j3=/z(\\.qs)?\\.js([\\?\\.]|$)/i;R(A i=0;i<8j.G;i++){A 4X=8j[i].5t("4X");if(!4X){6c}A m=4X.1f(j3);if(m){if(!1o["51"]){1o["51"]=4X.21(0,m.hK)}A cD=8j[i].5t("1o");if(cD){A cC=3u("({ "+cD+" })");R(A x in cC){1o[x]=cC[x]}}3f}}}d.51=1o["51"];A n=cq;A 8i=n.iL;A 4Z=n.qr;A 6r=2k(4Z);d.2M=(8i.T("qq")>=0)?6r:0;d.6B=(4Z.T("qo")>=0)||(4Z.T("j2")>=0)?6r:0;d.3o=(4Z.T("j2")>=0)?6r:0;A j1=8i.T("qn");d.gu=d.7B=((j1>=0)&&(!d.6B))?6r:0;d.j0=0;d.1l=0;d.iV=0;1u{if(d.7B){d.j0=2k(8i.1A("qm/")[1].1A(" ")[0])}if((1q.gx)&&(!d.2M)){d.1l=2k(4Z.1A("qk ")[1].1A(";")[0])}}1y(e){}if(z.1l&&(26.8f.cu==="9q:")){1o.iT=K}d.iX=B(){A 2A;A qj;A cB=d.6q("cz.cy");if(cB){C cB}if(V iZ!="1k"){2A=S iZ()}I{if(d.1l){1u{2A=S 9j("qi.qh")}1y(e){}}I{if(cq.qg["8Z/x-iY"]){2A=1q.a9("8b");2A.cA("Z","8Z/x-iY");2A.cA("3n",0);2A.cA("58",0);2A.1c.gq="7C";1q.5K.4c(2A)}}}if(!2A){C L}z.88("cz.cy.qf",2A);C z.6q("cz.cy")};A iW=d.iX();if(iW){d.iV=K}A cm=1q["aX"];d.qe=(cm=="aW")||(cm=="gr")||(d.1l<6);d.8h=1o.8h||(d.1l?n.qd:n.qc).1M();d.qb=1z.1K;d.cx=["iU.8g","em.8g","iU.8g.4.0"];d.9b=B(){A 4s=L;A cv=L;if(!z.1l||!1o.iT){1u{4s=S qa()}1y(e){}}if(!4s){R(A i=0;i<3;++i){A cw=z.cx[i];1u{4s=S 9j(cw)}1y(e){cv=e}if(4s){z.cx=[cw];3f}}}if(!4s){2m S 1O("8g 3O q9: "+cv)}C 4s};d.8Y=B(iS){A 4Y=iS.3N||0;C((4Y>=q8)&&(4Y<q7))||(4Y==q6)||(4Y==q5)||(!4Y&&(8f.cu=="9q:"||8f.cu=="q4:"))};A cs=1q.4I("q3");A iQ=(cs&&cs.G>0);d.iR=B(1g,iP){A 3K=D.9b();if(!iQ&&z.4r){1g=(S z.4r(26.8f,1g)).2i()}3K.dL("dD",1g,U);1u{3K.dI(L);if(!d.8Y(3K)){A 1G=1O("q2 4F 4E "+1g+" 3N:"+3K.3N);1G.3N=3K.3N;1G.2G=3K.2G;2m 1G}}1y(e){if(iP){C L}2m e}C 3K.2G}})();z.iO=U;z.6o=B(e){z.iO=K;A cr=(e&&e.Z)?e.Z.1M():"4E";if(P.2O.iN||(cr!="q1"&&cr!="4E")){C}P.2O.iN=K;if(V z["8e"]!="1k"){dX(z.8e);63 z.8e}if(z.6p==0){z.iM()}};if(1q.66){if(z.2M||(z.7B&&(1o["q0"]===K))){1q.66("pZ",z.6o,L)}26.66("4E",z.6o,L)}if(/(pY|pX)/i.6Z(cq.iL)){z.8e=dN(B(){if(/6m|iJ/.6Z(1q.6F)){z.6o()}},10)}(B(){A 3g=26;A 8d=B(cp,fp){A iK=3g[cp]||B(){};3g[cp]=B(){fp.14(3g,P);iK.14(3g,P)}};if(z.1l){1q.fJ("<iI"+"iH pW 4X=\\"//:\\" "+"pV=\\"if(D.6F==\'iJ\'){z.6o();}\\">"+"</iI"+"iH>");A co=K;8d("iG",B(){3g.5c(B(){co=U},0)});8d("pU",B(){if(co){z.ck()}});1u{1q.pT.2P("v","pS:pR-pQ-pP:pO");1q.pN().pM("v\\\\:*","pL:2E(#aY#pK)")}1y(e){}}I{8d("iG",B(){z.ck()})}})();z.pJ=B(){};z.1e=26["1q"]||L;z.3E=B(){C z.1e.3E||z.1e.4I("3E")[0]};z.ch=B(iF,iE){z.1W=iF;z.1e=iE};z.cf=B(4q,6n,iD){if((6n)&&((V 4q=="3c")||(4q 1N 67))){4q=6n[4q]}C(6n?4q.14(6n,iD||[]):4q())};z.pI=B(cj,iC,iB,iA){A cg;A iz=z.1W;A iy=z.1e;1u{z.ch(cj,cj.1q);cg=z.cf(iC,iB,iA)}ir{z.ch(iz,iy)}C cg};z.pH=B(ix,iw,iv,iu){A ce;A ip=z.1e;1u{z.1e=ix;ce=z.cf(iw,iv,iu)}ir{z.1e=ip}C ce};if(1o["cd"]){R(A cc in 1o["cd"]){z.io(cc,1o["cd"][cc])}}}if(1o.im){if(!1z.ca){z.8c("z.pG.ca")}}}if(!z.1h["z.X.c9"]){z.1h["z.X.c9"]=K;z.1Q("z.X.c9");z.1R=B(it){C(V it=="3c"||it 1N 67)};z.2l=B(it){C(it&&it 1N 4e||V it=="6a"||((V z["1H"]!="1k")&&(it 1N z.1H)))};if(z.c8&&z.3o){z.1Y=B(it){if((V(it)=="B")&&(it=="[8b 1H]")){C U}C(V it=="B"||it 1N bI)}}I{z.1Y=B(it){C(V it=="B"||it 1N bI)}}z.ib=B(it){if(V it=="1k"){C U}C(it===L||V it=="8b"||z.2l(it)||z.1Y(it))};z.pF=B(it){A d=z;if((!it)||(V it=="1k")){C U}if(d.1R(it)){C U}if(d.1Y(it)){C U}if(d.2l(it)){C K}if((it.5w)&&(it.5w.1M()=="3R")){C U}if(pE(it.G)){C K}C U};z.pD=B(it){if(!it){C U}C!z.1Y(it)&&/\\{\\s*\\[il 5h\\]\\s*\\}/.6Z(67(it))};z.c7=B(M,4W){A 8a={};R(A x in 4W){if((V 8a[x]=="1k")||(8a[x]!=4W[x])){M[x]=4W[x]}}if(z.1l){A p=4W.2i;if((V(p)=="B")&&(p!=M.2i)&&(p!=8a.2i)&&(p!="\\pC 2i() {\\n [il 5h]\\n}\\n")){M.2i=4W.2i}}C M};z.1x=B(M,pB){R(A i=1,l=P.G;i<l;i++){z.c7(M,P[i])}C M};z.4M=B(c6,pA){R(A i=1,l=P.G;i<l;i++){z.c7(c6.1C,P[i])}C c6};z.ig=B(c5,89){A ij=z.4d(P,2);A ik=z.1R(89);C B(){A ih=z.4d(P);A f=(ik?(c5||z.1W)[89]:89);C(f)&&(f.14(c5||D,ij.3U(ih)))}};z.2p=B(2z,3k){if(P.G>2){C z.ig.14(z,P)}if(!3k){3k=2z;2z=L}if(z.1R(3k)){2z=2z||z.1W;if(!2z[3k]){2m(["z.2p: ie[\\"",3k,"\\"] is L (ie=\\"",2z,"\\")"].22(""))}C B(){C 2z[3k].14(2z,P||[])}}I{C(!2z?3k:B(){C 3k.14(2z,P||[])})}};z.6j=B(M,c3){B c4(){};c4.1C=M;A c2=S c4();if(c3){z.1x(c2,c3)}C c2};z.7X=B(pz){A Q=[L];C z.2p.14(z,Q.3U(z.4d(P)))};z.4d=B(M,ic){A Q=[];R(A x=ic||0;x<M.G;x++){Q.Y(M[x])}C Q};z.c1=B(o){if(!o){C o}if(z.2l(o)){A r=[];R(A i=0;i<o.G;++i){r.Y(z.c1(o[i]))}C r}I{if(z.ib(o)){if(o.2t&&o.a7){C o.a7(K)}I{A r=S o.1P();R(A i in o){if(!(i in r)||r[i]!=o[i]){r[i]=z.c1(o[i])}}C r}}}C o};z.7g=B(2H){C 2H.2f(/^\\s\\s*/,"").2f(/\\s\\s*$/,"")}}if(!z.1h["z.X.2r"]){z.1h["z.X.2r"]=K;z.1Q("z.X.2r");z.2r=B(6l,4p,3j){if(z.1Y(3j)||(P.G>3)){z.ia("z.2r: R 9P \'"+6l+"\' py pw B as \'1P\' pv pu of as a pt i3.","","1.0");A c=3j;3j=P[3]||{};3j.1P=c}A dd=P.2O,4V=L;if(z.2l(4p)){4V=4p;4p=4V.3a()}if(4V){R(A i=0,m;i<4V.G;i++){m=4V[i];if(!m){2m("ps #"+i+" 4F pr of "+6l+" is L. pq\'s pp a po pl is 3O 6m.")}4p=dd.6j(4p,m)}}A i9=(3j||0).1P,6k=dd.6j(4p),fn;R(A i in 3j){if(z.1Y(fn=3j[i])&&(!0[i])){fn.i4=i}}z.4M(6k,{4o:6l,bY:i9,bZ:L},3j||0);6k.1C.1P=6k;C z.88(6l,6k)};z.1x(z.2r,{6j:B(c0,i8){A bp=(c0||0).1C,mp=(i8||0).1C;A 2S=z.2r.i7();z.1x(2S,{84:bp,1x:mp});if(c0){2S.1C=z.6j(bp)}z.4M(2S,z.2r.i6,mp||0,{bY:L});2S.1C.1P=2S;2S.1C.4o=(bp||0).4o+"pk"+(mp||0).4o;z.88(2S.1C.4o,2S);C 2S},i7:B(){C B(){D.i5(P)}},i6:{i5:B(86){A c=86.2O,s=c.84,ct=s&&s.1P,m=c.1x,87=m&&m.1P,a=86,ii,fn;if(a[0]){if((fn=a[0]["bZ"])){a=fn.14(D,a)||a}}if(fn=c.1C.bZ){a=fn.14(D,a)||a}if(ct&&ct.14){ct.14(D,a)}if(87&&87.14){87.14(D,a)}if(ii=c.1C.bY){ii.14(D,86)}},bX:B(85){A c=D.1P,p,m;1s(c){p=c.84;m=c.1x;if(m==85||(m 1N 85.1P)){C p}if(m&&(m=m.bX(85))){C m}c=p&&p.1P}},6h:B(83,82,bW,6i){A p=bW,c,m,f;do{c=p.1P;m=c.1x;if(m&&(m=D.6h(83,82,m,6i))){C m}if((f=p[83])&&(6i==(f==82))){C p}p=c.84}1s(p);C!6i&&(p=D.bX(bW))&&D.6h(83,82,p,6i)},bU:B(2R,4U,bV){A a=P;if(!z.1R(a[0])){bV=4U;4U=2R;2R=4U.2O.i4}A c=4U.2O,p=D.1P.1C,a=bV||4U,fn,mp;if(D[2R]!=c||p[2R]==c){mp=D.6h(2R,c,p,K);if(!mp){2m(D.4o+": 1p i3 (\\""+2R+"\\") 4F bU pj 1f 2O (2r.js)")}p=D.6h(2R,c,mp,U)}fn=p&&p[2R];if(!fn){1z.1K(mp.4o+": no bU \\""+2R+"\\" ph pg (2r.js)");C}C fn.14(D,a)}}})}if(!z.1h["z.X.2c"]){z.1h["z.X.2c"]=K;z.1Q("z.X.2c");z.3i={i2:B(){C B(){A ap=4e.1C,c=P.2O,ls=c.2b,t=c.5V;A r=t&&t.14(D,P);R(A i in ls){if(!(i in ap)){ls[i].14(D,P)}}C r}},2P:B(6g,bT,i1){6g=6g||z.1W;A f=6g[bT];if(!f||!f.2b){A d=z.3i.i2();d.5V=f;d.2b=[];f=6g[bT]=d}C f.2b.Y(i1)},3J:B(i0,hZ,bS){A f=(i0||z.1W)[hZ];if(f&&f.2b&&bS--){63 f.2b[bS]}}};z.2c=B(M,pd,pc,pa,p9){A a=P,F=[],i=0;F.Y(z.1R(a[0])?L:a[i++],a[i++]);A a1=a[i+1];F.Y(z.1R(a1)||z.1Y(a1)?a[i++]:L,a[i++]);R(A l=a.G;i<l;i++){F.Y(a[i])}C z.by.14(D,F)};z.by=B(M,bR,hY,hX){A l=z.3i,h=l.2P(M,bR,z.2p(hY,hX));C[M,bR,h,l]};z.p8=B(6f){if(6f&&6f[0]!==1k){z.bv.14(D,6f);63 6f[0]}};z.bv=B(M,hV,hU,hW){hW.3J(M,hV,hU)};z.80={};z.p7=B(bQ,hT,hS){C[bQ,z.3i.2P(z.80,bQ,z.2p(hT,hS))]};z.p6=B(81){if(81){z.3i.3J(z.80,81[0],81[1])}};z.hQ=B(hR,F){A f=z.80[hR];(f)&&(f.14(D,F||[]))};z.p5=B(hP,M,bP){A pf=B(){z.hQ(hP,P)};C(bP)?z.2c(M,bP,pf):z.2c(M,pf)}}if(!z.1h["z.X.30"]){z.1h["z.X.30"]=K;z.1Q("z.X.30");z.30=B(hO){D.bM=[];D.id=D.hN();D.2y=-1;D.3M=0;D.4R=[L,L];D.bO=hO;D.7Z=U};z.4M(z.30,{hN:(B(){A n=1;C B(){C n++}})(),4C:B(){if(D.2y==-1){if(D.bO){D.bO(D)}I{D.7Z=K}if(D.2y==-1){A 1G=S 1O("30 p4");1G.dY="4C";D.5i(1G)}}I{if((D.2y==0)&&(D.4R[0]1N z.30)){D.4R[0].4C()}}},7V:B(1v){D.2y=((1v 1N 1O)?1:0);D.4R[D.2y]=1v;D.7U()},bN:B(){if(D.2y!=-1){if(!D.7Z){2m S 1O("p3 p2!")}D.7Z=U;C}},dM:B(1v){D.bN();D.7V(1v)},5i:B(1v){D.bN();if(!(1v 1N 1O)){1v=S 1O(1v)}D.7V(1v)},9e:B(cb,4T){A 6e=z.2p(cb,4T);if(P.G>2){6e=z.7X(6e,P,2)}C D.5k(6e,6e)},ef:B(cb,4T){A 7Y=z.2p(cb,4T);if(P.G>2){7Y=z.7X(7Y,P,2)}C D.5k(7Y,L)},ed:B(cb,4T){A 7W=z.2p(cb,4T);if(P.G>2){7W=z.7X(7W,P,2)}C D.5k(L,7W)},5k:B(cb,eb){D.bM.Y([cb,eb]);if(D.2y>=0){D.7U()}C D},7U:B(){A bL=D.bM;A 4n=D.2y;A 1v=D.4R[4n];A 4S=D;A cb=L;1s((bL.G>0)&&(D.3M==0)){A f=bL.3a()[4n];if(!f){6c}1u{1v=f(1v);4n=((1v 1N 1O)?1:0);if(1v 1N z.30){cb=B(1v){4S.7V(1v);4S.3M--;if((4S.3M==0)&&(4S.2y>=0)){4S.7U()}};D.3M++}}1y(1G){1z.1K(1G);4n=1;1v=1G}}D.2y=4n;D.4R[4n]=1v;if((cb)&&(D.3M)){1v.9e(cb)}}})}if(!z.1h["z.X.2e"]){z.1h["z.X.2e"]=K;z.1Q("z.X.2e");z.5m=B(2e){1u{C 3u("("+2e+")")}1y(e){1z.1K(e);C 2e}};z.bK=B(2H){C("\\""+2H.2f(/(["\\\\])/g,"\\\\$1")+"\\"").2f(/[\\f]/g,"\\\\f").2f(/[\\b]/g,"\\\\b").2f(/[\\n]/g,"\\\\n").2f(/[\\t]/g,"\\\\t").2f(/[\\r]/g,"\\\\r")};z.hM="\\t";z.eq=B(it,4l,4P){4P=4P||"";A 4k=(4l?4P+z.hM:"");A 6b=(4l?"\\n":"");A 4Q=V(it);if(4Q=="1k"){C"1k"}I{if((4Q=="4J")||(4Q=="p1")){C it+""}I{if(it===L){C"L"}}}if(4Q=="3c"){C z.bK(it)}A 6d=P.2O;A 4m;if(V it.hL=="B"){4m=it.hL();if(it!==4m){C 6d(4m,4l,4k)}}if(V it.2e=="B"){4m=it.2e();if(it!==4m){C 6d(4m,4l,4k)}}if(z.2l(it)){A 1v=[];R(A i=0;i<it.G;i++){A 1U=6d(it[i],4l,4k);if(V(1U)!="3c"){1U="1k"}1v.Y(6b+4k+1U)}C"["+1v.22(", ")+6b+4P+"]"}if(4Q=="B"){C L}A bJ=[];R(A 1i in it){A 7T;if(V(1i)=="4J"){7T="\\""+1i+"\\""}I{if(V(1i)=="3c"){7T=z.bK(1i)}I{6c}}1U=6d(it[1i],4l,4k);if(V(1U)!="3c"){6c}bJ.Y(6b+4k+7T+": "+1U)}C"{"+bJ.22(", ")+6b+4P+"}"}}if(!z.1h["z.X.6a"]){z.1h["z.X.6a"]=K;z.1Q("z.X.6a");(B(){A 69=B(Q,M,cb){C[(z.1R(Q)?Q.1A(""):Q),(M||z.1W),(z.1R(cb)?(S bI("1m","hK","6a",cb)):cb)]};z.1x(z,{T:B(bH,hH,hI,hJ){A i=0,2q=1,1d=bH.G;if(hJ){i=1d-1;2q=1d=-1}R(i=hI||i;i!=1d;i+=2q){if(bH[i]==hH){C i}}C-1},31:B(hG,hF,hE){C z.T(hG,hF,hE,K)},1n:B(Q,hD,M){if(!Q||!Q.G){C}A 1I=69(Q,M,hD);Q=1I[0];R(A i=0,l=1I[0].G;i<l;i++){1I[2].2d(1I[1],Q[i],i,Q)}},bE:B(bF,Q,hC,M){A 1I=69(Q,M,hC);Q=1I[0];R(A i=0,l=Q.G;i<l;i++){A bG=!!1I[2].2d(1I[1],Q[i],i,Q);if(bF^bG){C bG}}C bF},ah:B(Q,hB,hA){C D.bE(K,Q,hB,hA)},ag:B(Q,hz,hy){C D.bE(U,Q,hz,hy)},23:B(Q,7t,M){A 1I=69(Q,M,7t);Q=1I[0];A bD=((P[3])?(S P[3]()):[]);R(A i=0;i<Q.G;++i){bD.Y(1I[2].2d(1I[1],Q[i],i,Q))}C bD},3T:B(Q,hx,M){A 1I=69(Q,M,hx);Q=1I[0];A bC=[];R(A i=0;i<Q.G;i++){if(1I[2].2d(1I[1],Q[i],i,Q)){bC.Y(Q[i])}}C bC}})})()}if(!z.1h["z.X.1J"]){z.1h["z.X.1J"]=K;z.1Q("z.X.1J");z.1J=B(bB){if(bB){D.hw(bB)}};z.1J.hp={p0:[0,0,0],oZ:[60,60,60],oY:[2j,2j,2j],oX:[1T,1T,1T],oW:[2j,0,0],oV:[1T,0,0],oU:[2j,0,2j],oT:[1T,0,1T],oS:[0,2j,0],oR:[0,1T,0],oQ:[2j,2j,0],oP:[1T,1T,0],oO:[0,0,2j],oN:[0,0,1T],oM:[0,2j,2j],oL:[0,1T,1T]};z.4M(z.1J,{r:1T,g:1T,b:1T,a:1,bz:B(r,g,b,a){A t=D;t.r=r;t.g=g;t.b=b;t.a=a},hw:B(2Q){A d=z;if(d.1R(2Q)){d.hq(2Q,D)}I{if(d.2l(2Q)){d.7P(2Q,D)}I{D.bz(2Q.r,2Q.g,2Q.b,2Q.a);if(!(2Q 1N d.1J)){D.7Q()}}}C D},7Q:B(){C D},oK:B(){A t=D;C[t.r,t.g,t.b]},oJ:B(){A t=D;C[t.r,t.g,t.b,t.a]},oI:B(){A Q=z.23(["r","g","b"],B(x){A s=D[x].2i(16);C s.G<2?"0"+s:s},D);C"#"+Q.22("")},8F:B(hv){A t=D,7S=t.r+", "+t.g+", "+t.b;C(hv?"hs("+7S+", "+t.a:"7S("+7S)+")"},2i:B(){C D.8F(K)}});z.d8=B(bA,1d,hu,M){A d=z,t=M||S z.1J();d.1n(["r","g","b","a"],B(x){t[x]=bA[x]+(1d[x]-bA[x])*hu;if(x!="a"){t[x]=2Y.oH(t[x])}});C t.7Q()};z.ho=B(ht,M){A m=ht.1M().1f(/^hs?\\(([\\s\\.,0-9]+)\\)/);C m&&z.7P(m[1].1A(/\\s*,\\s*/),M)};z.hn=B(4j,M){A d=z,t=M||S d.1J(),7R=(4j.G==4)?4:8,hr=(1<<7R)-1;4j=2V("oG"+4j.3b(1));if(2L(4j)){C L}d.1n(["b","g","r"],B(x){A c=4j&hr;4j>>=7R;t[x]=7R==4?17*c:c});t.a=1;C t};z.7P=B(a,M){A t=M||S z.1J();t.bz(2V(a[0]),2V(a[1]),2V(a[2]),2V(a[3]));if(2L(t.a)){t.a=1}C t.7Q()};z.hq=B(2H,M){A a=z.1J.hp[2H];C a&&z.7P(a,M)||z.ho(2H,M)||z.hn(2H,M)}}if(!z.1h["z.X"]){z.1h["z.X"]=K;z.1Q("z.X")}if(!z.1h["z.X.5Z"]){z.1h["z.X.5Z"]=K;z.1Q("z.X.5Z");(B(){A 1j=z.b2={2P:B(E,68,fp){if(!E){C}68=1j.4O(68);fp=1j.7G(68,fp);E.66(68,fp,U);C fp},3J:B(E,hm,hl){(E)&&(E.oF(1j.4O(hm),hl,U))},4O:B(1p){C(1p.2w(0,2)=="on"?1p.2w(2):1p)},7G:B(1p,fp){C(1p!="4b"?fp:B(e){C fp.2d(D,1j.4i(e,D))})},4i:B(H,oE){4w(H.Z){2X"4b":1j.7K(H);3f}C H},7K:B(H){H.oD=(H.3h?67.oC(H.3h):"")}};z.oB=B(H,hk){C 1j.4i(H,hk)};z.gY=B(H){H.7J();H.7I()};A 7O=z.3i;z.by=B(M,bx,hh,hg,hi){A hj=M&&(M.2t||M.oA||M.66);A bw=!hj?0:(!hi?1:2),l=[z.3i,1j,7O][bw];A h=l.2P(M,bx,z.2p(hh,hg));C[M,bx,h,bw]};z.bv=B(M,he,hd,hf){([z.3i,1j,7O][hf]).3J(M,he,hd)};z.5W={oz:8,gV:9,oy:12,ox:13,ow:16,ov:17,ou:18,gG:19,ot:20,os:27,or:32,b5:33,b4:34,gE:35,gF:36,b7:37,b9:38,b6:39,b8:40,gD:45,8S:46,oq:47,oo:91,om:92,ol:93,oj:96,oi:97,oh:98,og:99,oe:6D,od:oc,ob:oa,o9:o8,o7:o6,o5:o4,o3:bi,o2:o1,o0:nZ,nY:nX,nW:nV,nU:bk,gS:nT,gR:nS,gQ:nR,gP:nQ,gO:nP,gN:nO,gM:nN,gL:nM,gK:nL,gJ:nK,gI:nJ,gH:nI,nH:nG,nF:nE,nD:nC,gB:nB,gC:nA};if(z.1l){bf=B(e,5h){1u{C(e.3I=5h)}1y(e){C 0}};A 61=z.3i;if(!1o.nz){7O=61=z.gy={b3:[],2P:B(64,bu,hc){64=64||z.1W;A f=64[bu];if(!f||!f.2b){A d=z.gz();d.5V=f&&(7M.Y(f)-1);d.2b=[];f=64[bu]=d}C f.2b.Y(7M.Y(hc)-1)},3J:B(hb,ha,7N){A f=(hb||z.1W)[ha],l=f&&f.2b;if(f&&l&&7N--){63 7M[l[7N]];63 l[7N]}}};A 7M=61.b3}z.1x(1j,{2P:B(E,62,fp){if(!E){C}62=1j.4O(62);if(62=="h3"){A kd=E.bs;if(!kd||!kd.2b||!kd.h9){1j.2P(E,"bs",1j.h4);E.bs.h9=K}}C 61.2P(E,62,1j.7G(fp))},3J:B(E,h8,h7){61.3J(E,1j.4O(h8),h7)},4O:B(7L){C(7L.2w(0,2)!="on"?"on"+7L:7L)},ny:B(){},4i:B(H,4N){if(!H){A w=(4N)&&((4N.aD||4N.1q||4N).nx)||26;H=w.5Z}if(!H){C(H)}H.5V=H.br;H.bh=(4N||H.br);H.nw=H.nv;H.nu=H.nr;A bq=H.br,1e=(bq&&bq.aD)||1q;A bn=((z.1l<6)||(1e["aX"]=="aW"))?1e.3E:1e.5K;A bm=z.aB();H.nq=H.np+z.aH(bn.5I||0)-bm.x;H.nn=H.nm+(bn.5G||0)-bm.y;if(H.Z=="fk"){H.h6=H.nl}if(H.Z=="fj"){H.h6=H.nk}H.7I=1j.bc;H.7J=1j.ba;C 1j.h5(H)},h5:B(H){4w(H.Z){2X"4b":A c=("3h"in H?H.3h:H.3I);if(c==10){c=0;H.3I=13}I{if(c==13||c==27){c=0}I{if(c==3){c=99}}}H.3h=c;1j.7K(H);3f}C H},gZ:{bi:42,bk:47,h2:59,nj:43,ni:44,nh:45,ng:46,nf:47,60:96,h1:91,nb:92,na:93,h0:39},h4:B(H){A kp=H.bh.h3;if(!kp||!kp.2b){C}A k=H.3I;A bj=(k!=13)&&(k!=32)&&(k!=27)&&(k<48||k>90)&&(k<96||k>bk)&&(k<h2||k>60)&&(k<h1||k>h0);if(bj||H.5Y){A c=(bj?0:k);if(H.5Y){if(k==3||k==13){C}I{if(c>95&&c<bi){c-=48}I{if((!H.5X)&&(c>=65&&c<=90)){c+=32}I{c=1j.gZ[c]||c}}}}A 2x=1j.7H(H,{Z:"4b",2x:K,3h:c});kp.2d(H.bh,2x);H.bg=2x.bg;H.bd=2x.bd;bf(H,2x.3I)}},bc:B(){D.bg=K},ba:B(){D.n9=D.3I;if(D.5Y){bf(D,0)}D.bd=U}});z.gY=B(H){H=H||26.5Z;1j.bc.2d(H);1j.ba.2d(H)}}1j.7H=B(H,gX){A 2x=z.1x({},H,gX);1j.7K(2x);2x.7J=B(){H.7J()};2x.7I=B(){H.7I()};C 2x};if(z.2M){z.1x(1j,{4i:B(H,n8){4w(H.Z){2X"4b":A c=H.n7;if(c==3){c=99}c=((c<41)&&(!H.5X)?0:c);if((H.5Y)&&(!H.5X)&&(c>=65)&&(c<=90)){c+=32}C 1j.7H(H,{3h:c})}C H}})}if(z.3o){z.1x(1j,{4i:B(H,n6){4w(H.Z){2X"4b":A c=H.3h,s=H.5X,k=H.3I;k=k||gA[H.gW]||0;if(H.gW=="n5"){c=0}I{if((H.5Y)&&(c>0)&&(c<27)){c+=96}I{if(c==z.5W.gU){c=z.5W.gV;s=K}I{c=(c>=32&&c<gT?c:0)}}}C 1j.7H(H,{3h:c,5X:s,3I:k})}C H}});z.1x(z.5W,{gU:25,b9:gT,b8:n4,b7:n3,b6:n2,gS:n1,gR:n0,gQ:mZ,gP:mY,gO:mX,gN:mW,gM:mV,gL:mU,gK:mT,gJ:mS,gI:mR,gH:mQ,gG:mP,8S:mO,gF:mN,gE:mM,b5:mL,b4:mK,gD:mJ,mI:mH,gC:mG,gB:mF});A dk=z.5W,gA={"mE":dk.b9,"mD":dk.b8,"mC":dk.b7,"mB":dk.b6,"mA":dk.b5,"mz":dk.b4}}})();if(z.1l){z.gz=B(){C B(){A ap=4e.1C,h=z.gy.b3,c=P.2O,ls=c.2b,t=h[c.5V];A r=t&&t.14(D,P);R(A i in ls){if(!(i in ap)){h[ls[i]].14(D,P)}}C r}};z.b2.7G=B(fp){A f=z.b2.4i;C B(e){C fp.2d(D,f(e,D))}}}}if(!z.1h["z.X.b1"]){z.1h["z.X.b1"]=K;z.1Q("z.X.b1");1u{1q.my("mx",U,K)}1y(e){}if(z.1l||z.2M){z.1D=B(id,1e){if(z.1R(id)){A b0=(1e||z.1e);A 11=b0.gv(id);if((11)&&(11.gw.id.1Z==id)){C 11}I{A 5U=b0.gx[id];if(!5U){C}if(!5U.G){C 5U}A i=0;1s(11=5U[i++]){if(11.gw.id.1Z==id){C 11}}}}I{C id}}}I{z.1D=B(id,1e){if(z.1R(id)){C(1e||z.1e).gv(id)}I{C id}}}(B(){A 5T=L;z.mw=B(E){E=z.1D(E);1u{if(!5T){5T=1q.a9("mv")}5T.4c(E.1L?E.1L.fs(E):E);5T.9L=""}1y(e){}};z.mu=B(E,7F){1u{E=z.1D(E);7F=z.1D(7F);1s(E){if(E===7F){C K}E=E.1L}}1y(e){}C U};z.mt=B(E,5S){E=z.1D(E);if(z.gu){E.1c.ms=(5S)?"dg":"7C"}I{if(z.6B){E.1c.mr=(5S)?"8K":"7C"}I{if(z.1l){E.gs=(5S)?"":"on";z.1r("*",E).1n(B(gt){gt.gs=(5S)?"":"on"})}}}};A 5R=B(E,4h){4h.1L.mq(E,4h);C K};A aZ=B(E,4h){A pn=4h.1L;if(4h==pn.fm){pn.4c(E)}I{C 5R(E,4h.71)}C K};z.5E=B(E,2a,3H){if((!E)||(!2a)||(V 3H=="1k")){C U}E=z.1D(E);2a=z.1D(2a);if(V 3H=="4J"){A cn=2a.3W;if(((3H==0)&&(cn.G==0))||(cn.G==3H)){2a.4c(E);C K}if(3H==0){C 5R(E,2a.5A)}C aZ(E,cn[3H-1])}4w(3H.1M()){2X"mo":C 5R(E,2a);2X"a8":C aZ(E,2a);2X"9M":if(2a.5A){C 5R(E,2a.5A)}I{2a.4c(E);C K}3f;aY:2a.4c(E);C K}};z.aP="5g-3G";if(z.1l){A aV=1q.aX;z.aP=(aV=="aW")||(aV=="gr")||(z.1l<6)?"g5-3G":"5g-3G"}A 1E,dv=1q.mn;if(z.3o){1E=B(E){A s=dv.3F(E,L);if(!s&&E.1c){E.1c.gq="";s=dv.3F(E,L)}C s||{}}}I{if(z.1l){1E=B(E){C E.gn}}I{1E=B(E){C dv.3F(E,L)}}}z.3F=1E;if(!z.1l){z.4g=B(mm,gp){C 2k(gp)||0}}I{z.4g=B(go,2N){if(!2N){C 0}if(2N=="ml"){C 4}if(2N.2w&&(2N.2w(-2)=="px")){C 2k(2N)}4G(go){A gm=1c.2g;A gl=aU.2g;aU.2g=gn.2g;1u{1c.2g=2N;2N=1c.mk}1y(e){2N=0}1c.2g=gm;aU.2g=gl}C 2N}}z.ge=(z.1l?B(E){1u{C(E.mj.mi.2W/6D)}1y(e){C 1}}:B(E){C z.3F(E).2W});z.gf=(z.1l?B(E,7D){if(7D==1){E.1c.7E=E.1c.7E.2f(/gk:[^;]*;/i,"");if(E.gj.1M()=="gi"){z.1r("> gh",E).1n(B(i){i.1c.7E=i.1c.7E.2f(/gk:[^;]*;/i,"")})}}I{A o="mh(mg="+(7D*6D)+")";E.1c.3T=o}if(E.gj.1M()=="gi"){z.1r("> gh",E).1n(B(i){i.1c.3T=o})}C 7D}:B(E,gg){C E.1c.2W=gg});A 5Q={3n:K,58:K,2g:K,5J:K};A gd=B(E,Z,5P){Z=Z.1M();if(5Q[Z]===K){C z.4g(E,5P)}I{if(5Q[Z]===U){C 5P}I{if((Z.T("mf")>=0)||(Z.T("md")>=0)||(Z.T("3n")>=0)||(Z.T("58")>=0)||(Z.T("5q")>=0)||(Z.T("mc")>=0)||(Z.T("ma")>=0)){5Q[Z]=K;C z.4g(E,5P)}I{5Q[Z]=U;C 5P}}}};z.1c=B(E,5O,aT){A n=z.1D(E),F=P.G,op=(5O=="2W");if(F==3){C op?z.gf(n,aT):n.1c[5O]=aT}if(F==2&&op){C z.ge(n)}A s=z.3F(n);C(F==1)?s:gd(n,5O,s[5O])};z.7A=B(n,gc){A s=gc||1E(n),px=z.4g,l=px(n,s.m9),t=px(n,s.m8);C{l:l,t:t,w:l+px(n,s.m7),h:t+px(n,s.m6)}};z.5N=B(n,gb){A ne="7C",px=z.4g,s=gb||1E(n),bl=(s.m5!=ne?px(n,s.m4):0),bt=(s.m3!=ne?px(n,s.m2):0);C{l:bl,t:bt,w:bl+(s.m1!=ne?px(n,s.m0):0),h:bt+(s.lZ!=ne?px(n,s.lY):0)}};z.aN=B(n,ga){A s=ga||1E(n),p=z.7A(n,s),b=z.5N(n,s);C{l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h}};z.aM=B(n,g9){A s=g9||1E(n),px=z.4g,l=px(n,s.lX),t=px(n,s.lW),r=px(n,s.lV),b=px(n,s.lU);if(z.3o&&(s.ax!="fU")){r=l}C{l:l,t:t,w:l+r,h:t+b}};z.au=B(E,g8){A s=g8||1E(E),me=z.aM(E,s);A l=E.fT-me.l,t=E.fS-me.t;if(z.7B){A aS=2k(s.2g),aR=2k(s.5J);if(!2L(aS)&&!2L(aR)){l=aS,t=aR}I{A p=E.1L;if(p&&p.1c){A aQ=1E(p);if(aQ.lT!="lS"){A be=z.5N(p,aQ);l+=be.l,t+=be.t}}}}I{if(z.2M){A p=E.1L;if(p){A be=z.5N(p);l-=be.l,t-=be.t}}}C{l:l,t:t,w:E.6v+me.w,h:E.8D+me.h}};z.aK=B(E,g7){A s=g7||1E(E),pe=z.7A(E,s),be=z.5N(E,s),w=E.aF,h;if(!w){w=E.6v,h=E.8D}I{h=E.lR,be.w=be.h=0}if(z.2M){pe.l+=be.l;pe.t+=be.t}C{l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h}};z.lQ=B(E,g6){A s=g6||1E(E),pe=z.7A(E,s),cb=z.aK(E,s);C{l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h}};z.aL=B(E,l,t,w,h,u){u=u||"px";4G(E.1c){if(!2L(l)){2g=l+u}if(!2L(t)){5J=t+u}if(w>=0){3n=w+u}if(h>=0){58=h+u}}};z.aO=B(E){A n=E.5w;C(z.aP=="g5-3G")||(n=="lP")||(n=="lO")};z.fX=B(E,7z,7y,g4){A bb=z.aO(E);if(bb){A pb=z.aN(E,g4);if(7z>=0){7z+=pb.w}if(7y>=0){7y+=pb.h}}z.aL(E,g3,g3,7z,7y)};z.fY=B(E,g1,g0,5M,5L,g2){A s=g2||z.3F(E);A bb=z.aO(E),pb=bb?fZ:z.aN(E,s),mb=z.aM(E,s);if(5M>=0){5M=2Y.5q(5M-pb.w-mb.w,0)}if(5L>=0){5L=2Y.5q(5L-pb.h-mb.h,0)}z.aL(E,g1,g0,5M,5L)};A fZ={l:0,t:0,w:0,h:0};z.lN=B(E,3G){A n=z.1D(E),s=1E(n),b=3G;C!b?z.au(n,s):z.fY(n,b.l,b.t,b.w,b.h,s)};z.lM=B(E,3G){A n=z.1D(E),s=1E(n),b=3G;C!b?z.aK(n,s):z.fX(n,b.w,b.h,s)};A 5H=B(E,1a){if(!(E=(E||0).1L)){C 0}A 1U,aJ=0,2h=z.3E();1s(E&&E.1c){if(1E(E).ax=="lL"){C 0}1U=E[1a];if(1U){aJ+=1U-0;if(E==2h){3f}}E=E.1L}C aJ};z.fQ=B(){A 2h=z.3E();A 3g=z.1W;A de=z.1e.5K;C{y:(3g.lK||de.5G||2h.5G||0),x:(3g.lJ||z.aH(de.5I)||2h.5I||0)}};z.aG=B(){C V z.aI=="1k"?(z.aI=z.3F(z.3E()).lI=="lH"):z.aI};z.aB=B(){A de=z.1e.5K;if(z.1l>=7){C{x:de.aC().2g,y:de.aC().5J}}I{C{x:z.aG()||26.am==26?de.fW:de.6v-de.aF-de.fW,y:de.lG}}};z.aH=B(aE){if(z.1l&&!z.aG()){A de=z.1e.5K;C aE+de.aF-de.lF}C aE};z.fP=B(E,aw){A ay=E.aD;A J={x:0,y:0};A 7w=U;A db=z.3E();if(z.1l){A aA=E.aC();A az=z.aB();J.x=aA.2g-az.x;J.y=aA.5J-az.y}I{if(ay["fV"]){A bo=ay.fV(E);J.x=bo.x-5H(E,"5I");J.y=bo.y-5H(E,"5G")}I{if(E["fR"]){7w=K;A 7x;if(z.3o&&(1E(E).ax=="fU")&&(E.1L==db)){7x=db}I{7x=db.1L}if(E.1L!=db){A nd=E;if(z.2M){nd=db}J.x-=5H(nd,"5I");J.y-=5H(nd,"5G")}A 4f=E;do{A n=4f["fT"];if(!z.2M||n>0){J.x+=2L(n)?0:n}A m=4f["fS"];J.y+=2L(m)?0:m;4f=4f.fR}1s((4f!=7x)&&4f)}I{if(E["x"]&&E["y"]){J.x+=2L(E.x)?0:E.x;J.y+=2L(E.y)?0:E.y}}}}if(7w||aw){A av=z.fQ();A m=7w?(!aw?-1:0):1;J.y+=m*av.y;J.x+=m*av.x}C J};z.af=B(E,fO){A n=z.1D(E),s=1E(n),mb=z.au(n,s);A at=z.fP(n,fO);mb.x=at.x;mb.y=at.y;C mb}})();z.fL=B(E,fN){C((" "+E.3A+" ").T(" "+fN+" ")>=0)};z.7s=B(E,ar){A 7v=E.3A;if((" "+7v+" ").T(" "+ar+" ")<0){E.3A=7v+(7v?" ":"")+ar}};z.7r=B(E,fM){A t=z.7g((" "+E.3A+" ").2f(" "+fM+" "," "));if(E.3A!=t){E.3A=t}};z.lE=B(E,aq,7u){if(V 7u=="1k"){7u=!z.fL(E,aq)}z[7u?"7s":"7r"](E,aq)}}if(!z.1h["z.X.1H"]){z.1h["z.X.1H"]=K;z.1Q("z.X.1H");(B(){A d=z;z.1H=B(){A F=P;if((F.G==1)&&(V F[0]=="4J")){D.G=eK(F[0])}I{if(F.G){d.1n(F,B(i){D.Y(i)},D)}}};z.1H.1C=S 4e;if(d.1l){A fK=B(al){C("A a2 = am."+al+"; "+"A ap = 4e.1C; "+"A ao = a2.1C; "+"R(A x in ao){ ap[x] = ao[x]; } "+"am."+al+" = 4e; ")};A fI=fK("z.1H");A aj=26.lD();aj.1q.fJ("<ak>"+fI+"</ak>");aj.lC(1,1,1,1)}z.4M(z.1H,{T:B(fH,fG){C d.T(D,fH,fG)},31:B(lB,lA){A aa=d.4d(P);aa.ae(D);C d.31.14(d,aa)},ah:B(fF,fE){C d.ah(D,fF,fE)},ag:B(fD,fC){C d.ag(D,fD,fC)},1n:B(fB,fA){d.1n(D,fB,fA);C D},23:B(7t,M){C d.23(D,7t,M,d.1H)},af:B(){C d.23(D,d.af)},1c:B(lz,ly){A aa=d.4d(P);aa.ae(D[0]);A s=d.1c.14(d,aa);C(P.G>1)?D:s},lx:B(lw,lv){A aa=d.4d(P);aa.ae(L);A s=D.23(B(i){aa[0]=i;C d.1c.14(d,aa)});C(P.G>1)?D:s},7s:B(fz){C D.1n(B(i){z.7s(i,fz)})},7r:B(fy){C D.1n(B(i){z.7r(i,fy)})},5E:B(fw,7q){A 1m=d.1r(fw)[0];7q=7q||"72";R(A x=0;x<D.G;x++){d.5E(D[x],1m,7q)}C D},2c:B(fv,fu,ft){D.1n(B(1m){d.2c(1m,fv,fu,ft)});C D},lu:B(ad){A ac=(ad)?d.9t(D,ad):D;ac.1n(B(1m){if(1m["1L"]){1m.1L.fs(1m)}});C ac},lt:B(fr,fq){A 1m=D[0];C d.1r(fr).1n(B(ai){d.5E(ai,1m,(fq||"72"))})},1r:B(7p){7p=7p||"";A J=S d.1H();D.1n(B(1m){d.1r(7p,1m).1n(B(ab){if(V ab!="1k"){J.Y(ab)}})});C J},3T:B(fo){A 5F=D;A 1V=P;A r=S d.1H();A rp=B(t){if(V t!="1k"){r.Y(t)}};if(d.1R(fo)){5F=d.9t(D,1V[0]);if(1V.G==1){C 5F}d.1n(d.3T(5F,1V[1],1V[2]),rp);C r}d.1n(d.3T(5F,1V[0],1V[1]),rp);C r},lr:B(7o,7n){A 1S=d.1e.a9("lq");if(d.1R(7o)){1S.9L=7o}I{1S.4c(7o)}A ct=((7n=="9M")||(7n=="a8"))?"fm":"5A";D.1n(B(1m){A 24=1S.a7(K);1s(24[ct]){d.5E(24[ct],1m,7n)}});C D},7m:B(fl,F){A a5=[];F=F||{};D.1n(B(1m){A a6={E:1m};d.1x(a6,F);a5.Y(d[fl](a6))});C d.fx.lp(a5)},8I:B(F){C D.7m("8I",F)},8H:B(F){C D.7m("8H",F)},6y:B(F){C D.7m("6y",F)}});z.1n(["fk","lo","fj","fi","ln","lm","ll","fi","lk","lj","4b"],B(H){A a4="on"+H;z.1H.1C[a4]=B(a,b){C D.2c(a4,a,b)}})})()}if(!z.1h["z.X.1r"]){z.1h["z.X.1r"]=K;z.1Q("z.X.1r");(B(){A d=z;A 2I=B(q){C[q.T("#"),q.T("."),q.T("["),q.T(":")]};A a0=B(a3,fh){A ql=a3.G;A i=2I(a3);A 1d=ql;R(A x=fh;x<i.G;x++){if(i[x]>=0){if(i[x]<1d){1d=i[x]}}}C(1d<0)?ql:1d};A 6X=B(7l){A i=2I(7l);if(i[0]!=-1){C 7l.21(i[0]+1,a0(7l,1))}I{C""}};A 5r=B(7k){A 5D;A i=2I(7k);if((i[0]==0)||(i[1]==0)){5D=0}I{5D=a0(7k,0)}C((5D>0)?7k.3b(0,5D).1M():"*")};A fg=B(Q){A J=-1;R(A x=0;x<Q.G;x++){A 1S=Q[x];if(1S>=0){if((1S>J)||(J==-1)){J=1S}}}C J};A 9H=B(7i){A i=2I(7i);if(-1==i[1]){C""}A di=i[1]+1;A 7j=fg(i.2w(2));if(di<7j){C 7i.21(di,7j)}I{if(-1==7j){C 7i.3b(di)}I{C""}}};A f3=[{1i:"|=",1f:B(15,fe){C"[5z(3U(\' \',@"+15+",\' \'), \' "+fe+"-\')]"}},{1i:"~=",1f:B(15,fd){C"[5z(3U(\' \',@"+15+",\' \'), \' "+fd+" \')]"}},{1i:"^=",1f:B(15,fb){C"[li-4G(@"+15+", \'"+fb+"\')]"}},{1i:"*=",1f:B(15,fa){C"[5z(@"+15+", \'"+fa+"\')]"}},{1i:"$=",1f:B(15,9Z){C"[21(@"+15+", 3c-G(@"+15+")-"+(9Z.G-1)+")=\'"+9Z+"\']"}},{1i:"!=",1f:B(15,f9){C"[3O(@"+15+"=\'"+f9+"\')]"}},{1i:"=",1f:B(15,f8){C"[@"+15+"=\'"+f8+"\']"}}];A 9C=B(9Y,3Z,f7,f6){A 49;A i=2I(3Z);if(i[2]>=0){A 4L=3Z.T("]",i[2]);A 29=3Z.21(i[2]+1,4L);1s(29&&29.G){if(29.2s(0)=="@"){29=29.2w(1)}49=L;R(A x=0;x<9Y.G;x++){A 1S=9Y[x];A 7h=29.T(1S.1i);if(7h>=0){A 15=29.21(0,7h);A 4a=29.21(7h+1S.1i.G);if((4a.2s(0)=="\\"")||(4a.2s(0)=="\'")){4a=4a.21(1,4a.G-1)}49=1S.1f(d.7g(15),d.7g(4a));3f}}if((!49)&&(29.G)){49=f7(29)}if(49){f6(49)}29=L;A 7f=3Z.T("[",4L);if(0<=7f){4L=3Z.T("]",7f);if(0<=4L){29=3Z.21(7f+1,4L)}}}}};A f0=B(f5){A 4K=".";A 7e=f5.1A(" ");1s(7e.G){A 2K=7e.3a();A 7d;if(2K==">"){7d="/";2K=7e.3a()}I{7d="//"}A f4=5r(2K);4K+=7d+f4;A id=6X(2K);if(id.G){4K+="[@id=\'"+id+"\'][1]"}A cn=9H(2K);if(cn.G){A 9X=" ";if(cn.2s(cn.G-1)=="*"){9X="";cn=cn.3b(0,cn.G-1)}4K+="[5z(3U(\' \',@9P,\' \'), \' "+cn+9X+"\')]"}9C(f3,2K,B(f2){C"[@"+f2+"]"},B(f1){4K+=f1})}C 4K};A 7a={};A eC=B(28){if(7a[28]){C 7a[28]}A 1e=d.1e;A 9W=f0(28);A 4H=B(9V){A J=[];A 7b;1u{7b=1e.9x(9W,9V,L,lh.lg,L)}1y(e){1z.1K("lf in le:",9W,"lc:",9V);1z.1K(e)}A 7c=7b.eZ();1s(7c){J.Y(7c);7c=7b.eZ()}C J};C 7a[28]=4H};A 5x={};A 9B={};A 3y=B(79,78){if(!79){C 78}if(!78){C 79}C B(){C 79.14(26,P)&&78.14(26,P)}};A 75=B(9U,3Y,5B,2J){A 2v=2J+1;A 76=(3Y.G==2v);A 2K=3Y[2J];if(2K==">"){A 77=9U.3W;if(!77.G){C}2v++;76=(3Y.G==2v);A 4H=6O(3Y[2J+1]);R(A x=0,11;x<77.G,11=77[x];x++){if(4H(11)){if(76){5B.Y(11)}I{75(11,3Y,5B,2v)}}}}A 5C=6U(2K)(9U);if(76){1s(5C.G){5B.Y(5C.3a())}}I{1s(5C.G){75(5C.3a(),3Y,5B,2v)}}};A eE=B(9T,eY){A J=[];A x=9T.G-1,11;1s(11=9T[x--]){75(11,eY,J,0)}C J};A 6O=B(3D){if(5x[3D]){C 5x[3D]}A ff=L;A 9S=5r(3D);if(9S!="*"){ff=3y(ff,B(N){C((N.2t==1)&&(9S==N.5w.1M()))})}A 9R=6X(3D);if(9R.G){ff=3y(ff,B(N){C((N.2t==1)&&(N.id==9R))})}if(2Y.5q.14(D,2I(3D).2w(1))>=0){ff=3y(ff,9z(3D))}C 5x[3D]=ff};A 5y=B(E){A pn=E.1L;A 9Q=pn.3W;A 2v=-1;A 3C=pn.5A;if(!3C){C 2v}A ci=E["eW"];A cl=pn["eX"];if(((V cl=="4J")&&(cl!=9Q.G))||(V ci!="4J")){pn["eX"]=9Q.G;A 2J=1;do{if(3C===E){2v=2J}if(3C.2t==1){3C["eW"]=2J;2J++}3C=3C.71}1s(3C)}I{2v=ci}C 2v};A lb=0;A 3X=B(N,15){A 74="";if(15=="9P"){C N.3A||74}if(15=="R"){C N.la||74}C N.5t(15,2)||74};A eH=[{1i:"|=",1f:B(15,9O){A eV=" "+9O+"-";C B(N){A ea=" "+(N.5t(15,2)||"");C((ea==9O)||(ea.T(eV)==0))}}},{1i:"^=",1f:B(15,eU){C B(N){C(3X(N,15).T(eU)==0)}}},{1i:"*=",1f:B(15,eT){C B(N){C(3X(N,15).T(eT)>=0)}}},{1i:"~=",1f:B(15,eS){A 9N=" "+eS+" ";C B(N){A ea=" "+3X(N,15)+" ";C(ea.T(9N)>=0)}}},{1i:"$=",1f:B(15,73){A 9N=" "+73;C B(N){A ea=" "+3X(N,15);C(ea.31(73)==(ea.G-73.G))}}},{1i:"!=",1f:B(15,eR){C B(N){C(3X(N,15)!=eR)}}},{1i:"=",1f:B(15,eQ){C B(N){C(3X(N,15)==eQ)}}}];A 9E=[{1i:"9M-9K",1f:B(1p,l9){C B(N){if(N.2t!=1){C U}A fc=N.eP;1s(fc&&(fc.2t!=1)){fc=fc.eP}C(!fc)}}},{1i:"72-9K",1f:B(1p,l8){C B(N){if(N.2t!=1){C U}A nc=N.71;1s(nc&&(nc.2t!=1)){nc=nc.71}C(!nc)}}},{1i:"l7",1f:B(1p,l6){C B(N){A cn=N.3W;A eO=N.3W.G;R(A x=eO-1;x>=0;x--){A nt=cn[x].2t;if((nt==1)||(nt==3)){C U}}C K}}},{1i:"5z",1f:B(1p,eN){C B(N){C(N.9L.T(eN)>=0)}}},{1i:"3O",1f:B(1p,eM){A eL=6O(eM);C B(N){C(!eL(N))}}},{1i:"l5-9K",1f:B(1p,2u){A pi=eK;if(2u=="l4"){C B(N){C(((5y(N))%2)==1)}}I{if((2u=="2n")||(2u=="l3")){C B(N){C((5y(N)%2)==0)}}I{if(2u.T("l2+")==0){A 70=pi(2u.3b(3));C B(N){C(N.1L.3W[70-1]===N)}}I{if((2u.T("n+")>0)&&(2u.G>3)){A 9J=2u.1A("n+",2);A eJ=pi(9J[0]);A 2J=pi(9J[1]);C B(N){C((5y(N)%eJ)==2J)}}I{if(2u.T("n")==-1){A 70=pi(2u);C B(N){C(5y(N)==70)}}}}}}}}];A 9z=B(3e){A 9I=(9B[3e]||5x[3e]);if(9I){C 9I}A ff=L;A i=2I(3e);if(i[0]>=0){A 24=5r(3e);if(24!="*"){ff=3y(ff,B(N){C(N.5w.1M()==24)})}}A 5u;A 3B=9H(3e);if(3B.G){A 9F=3B.2s(3B.G-1)=="*";if(9F){3B=3B.3b(0,3B.G-1)}A re=S 9G("(?:^|\\\\s)"+3B+(9F?".*":"")+"(?:\\\\s|$)");ff=3y(ff,B(N){C re.6Z(N.3A)})}if(i[3]>=0){A 3z=3e.3b(i[3]+1);A 9D="";A 5v=3z.T("(");A 6Y=3z.31(")");if((0<=5v)&&(0<=6Y)&&(6Y>5v)){9D=3z.21(5v+1,6Y);3z=3z.3b(0,5v)}5u=L;R(A x=0;x<9E.G;x++){A 1S=9E[x];if(1S.1i==3z){5u=1S.1f(3z,9D);3f}}if(5u){ff=3y(ff,5u)}}A eG=(d.1l)?B(5s){A eI=5s.1M();C B(N){C N[5s]||N[eI]}}:B(5s){C B(N){C(N&&N.5t&&N.l1(5s))}};9C(eH,3e,eG,B(eF){ff=3y(ff,eF)});if(!ff){ff=B(){C K}}C 9B[3e]=ff};A 6W={};A 6U=B(3d,1B){A 9A=6W[3d];if(9A){C 9A}A i=2I(3d);A id=6X(3d);if(i[0]==0){C 6W[3d]=B(1B){C[d.1D(id)]}}A 9y=9z(3d);A 5p;if(i[0]>=0){5p=B(1B){A 11=d.1D(id);if(9y(11)){C[11]}}}I{A 3V;A 24=5r(3d);if(2Y.5q.14(D,2I(3d))==-1){5p=B(1B){A J=[];A 11,x=0,3V=1B.4I(24);1s(11=3V[x++]){J.Y(11)}C J}}I{5p=B(1B){A J=[];A 11,x=0,3V=1B.4I(24);1s(11=3V[x++]){if(9y(11)){J.Y(11)}}C J}}}C 6W[3d]=5p};A l0={};A 5o={">":B(1B){A J=[];A 11,x=0,3V=1B.3W;1s(11=3V[x++]){if(11.2t==1){J.Y(11)}}C J}};A 9w=B(6V){if(0>6V.T(" ")){C 6U(6V)}A eD=B(1B){A 6S=6V.1A(" ");A 6T;if(6S[0]==">"){6T=[1B]}I{6T=6U(6S.3a())(1B)}C eE(6T,6S)};C eD};A 9v=((1q["9x"]&&!d.3o)?B(3x){A 6R=3x.1A(" ");if((1q["9x"])&&(3x.T(":")==-1)&&((K))){if(((6R.G>2)&&(3x.T(">")==-1))||(6R.G>3)||(3x.T("[")>=0)||((1==6R.G)&&(0<=3x.T(".")))){C eC(3x)}}C 9w(3x)}:9w);A ey=B(3w){if(5o[3w]){C 5o[3w]}if(0>3w.T(",")){C 5o[3w]=9v(3w)}I{A eB=3w.1A(/\\s*,\\s*/);A 4H=B(1B){A eA=0;A J=[];A 6Q;1s(6Q=eB[eA++]){J=J.3U(9v(6Q,6Q.T(" "))(1B))}C J};C 5o[3w]=4H}};A 5n=0;A ez=B(Q){A J=S d.1H();if(!Q){C J}if(Q[0]){J.Y(Q[0])}if(Q.G<2){C J}5n++;Q[0]["9u"]=5n;R(A x=1,11;11=Q[x];x++){if(Q[x]["9u"]!=5n){J.Y(11)}11["9u"]=5n}C J};d.1r=B(6P,1B){if(V 6P!="3c"){C S d.1H(6P)}if(V 1B=="3c"){1B=d.1D(1B)}C ez(ey(6P)(1B||d.1e))};d.9t=B(ex,9s){A 9r=S d.1H();A ff=(9s)?6O(9s):B(){C K};R(A x=0,11;11=ex[x];x++){if(ff(11)){9r.Y(11)}}C 9r}})()}if(!z.1h["z.X.1b"]){z.1h["z.X.1b"]=K;z.1Q("z.X.1b");z.6K=B(ew){A J={};A iq="kZ[Z!=9q][Z!=kY][Z!=et][Z!=kX][Z!=kW], kV, kU";z.1r(iq,ew).3T(B(E){C(!E.kT)}).1n(B(1m){A 3v=1m.1p;A Z=(1m.Z||"").1M();if((Z=="kS")||(Z=="kR")){if(1m.kQ){J[3v]=1m.1Z}}I{if(1m.kP){A ev=J[3v]=[];z.1r("kO[kN]",1m).1n(B(eu){ev.Y(eu.1Z)})}I{J[3v]=1m.1Z;if(Z=="et"){J[3v+".x"]=J[3v+".y"]=J[3v].x=J[3v].y=0}}}});C J};z.9h=B(23){A ec=kM;A J="";A es={};R(A x in 23){if(23[x]!=es[x]){if(z.2l(23[x])){R(A y=0;y<23[x].G;y++){J+=ec(x)+"="+ec(23[x][y])+"&"}}I{J+=ec(x)+"="+ec(23[x])+"&"}}}if((J.G)&&(J.2s(J.G-1)=="&")){J=J.3b(0,J.G-1)}C J};z.kL=B(er){C z.9h(z.6K(er))};z.kK=B(ep){C z.eq(z.6K(ep))};z.kJ=B(2H){A J={};A qp=2H.1A("&");A dc=kI;z.1n(qp,B(1m){if(1m.G){A 9p=1m.1A("=");A 1p=dc(9p.3a());A 1U=dc(9p.22("="));if(z.1R(J[1p])){J[1p]=[J[1p]]}if(z.2l(J[1p])){J[1p].Y(1U)}I{J[1p]=1U}}});C J};z.e1=U;z.e6={"9g":B(1b){C 1b.2G},"2e":B(1b){if(!1o.eo){1z.1K("kH kG kF a kE of 9g/2e-6M-9m"+" 4F kD kC kB kA 4G en kz"+" (ky 1o.eo=K 4F kx kw D kv)")}C z.5m(1b.2G)},"2e-6M-ku":B(1b){A 6N=1b.2G;A 9o=6N.T("/*");A 9n=6N.31("*/");if((9o==-1)||(9n==-1)){C z.5m(1b.2G)}C z.5m(6N.21(9o+2,9n))},"2e-6M-9m":B(1b){A 6L=1b.2G;A 9l=6L.T("/*");A 9k=6L.31("*/");if((9l==-1)||(9k==-1)){1z.1K("kt en ks\'t 6M 9m!");C""}C z.5m(6L.21(9l+2,9k))},"kr":B(1b){C z.3u(1b.2G)},"kq":B(1b){if(z.1l&&!1b.el){z.1n(["ko","em","kn","km"],B(i){1u{A 1e=S 9j(kl[i]+".kk");1e.kj=U;1e.ki(1b.2G);C 1e}1y(e){}})}I{C 1b.el}}};(B(){z.e5=B(F,ej,ei,eh){A 2F={};2F.F=F;A 6J=L;if(F.3R){A 3R=z.1D(F.3R);A 9i=3R.kh("kg");2F.2E=F.2E||(9i?9i.1Z:L);6J=z.6K(3R)}I{2F.2E=F.2E}A 5l=[{}];if(6J){5l.Y(6J)}if(F.5g){5l.Y(F.5g)}if(F.ek){5l.Y({"z.ek":S 5d().8O()})}2F.1r=z.9h(z.1x.14(L,5l));2F.9d=F.9d||"9g";A d=S z.30(ej);d.5k(ei,B(eg){C eh(eg,d)});A ld=F.4E;if(ld&&z.1Y(ld)){d.ef(B(ee){C ld.2d(F,ee,2F)})}A 1G=F.9f;if(1G&&z.1Y(1G)){d.ed(B(e9){C 1G.2d(F,e9,2F)})}A 6I=F.kf;if(6I&&z.1Y(6I)){d.9e(B(e8){C 6I.2d(F,e8,2F)})}d.1F=2F;C d};A e4=B(O){O.e0=K;A 1b=O.1F.1b;if(V 1b.e7=="B"){1b.e7()}};A e3=B(O){C z.e6[O.1F.9d](O.1F.1b)};A e2=B(9c,O){1z.1K(9c);C 9c};A 3Q=B(F){A O=z.e5(F,e4,e3,e2);O.1F.1b=z.9b(O.1F.F);C O};A 5j=L;A 3t=[];A 94=B(){A dZ=(S 5d()).dU();if(!z.e1){z.1n(3t,B(4D,6H){if(!4D){C}A O=4D.O;1u{if(!O||O.e0||!4D.dT(O)){3t.3S(6H,1);C}if(4D.dR(O)){3t.3S(6H,1);4D.dP(O)}I{if(O.9a){if(O.9a+(O.1F.F.6G||0)<dZ){3t.3S(6H,1);A 1G=S 1O("6G ke");1G.dY="6G";O.5i(1G);O.4C()}}}}1y(e){1z.1K(e);O.5i(S 1O("kc!"))}})}if(!3t.G){dX(5j);5j=L;C}};z.dV=B(){1u{z.1n(3t,B(i){i.O.4C()})}1y(e){}};if(z.1l){z.dW(z.dV)}z.dH=B(O,dS,dQ,dO){if(O.1F.F.6G){O.9a=(S 5d()).dU()}3t.Y({O:O,dT:dS,dR:dQ,dP:dO});if(!5j){5j=dN(94,50)}94()};A dJ="8Z/x-kb-3R-ka";A dG=B(O){C O.1F.1b.6F};A dF=B(O){C 4==O.1F.1b.6F};A dE=B(O){if(z.8Y(O.1F.1b)){O.dM(O)}I{O.5i(S 1O("k9 k8 k7 5h:"+O.1F.1b.3N))}};A 3P=B(Z,O){A 3s=O.1F;A F=3s.F;3s.1b.dL(Z,3s.2E,(F.k6!==K),(F.8X?F.8X:1k),(F.8W?F.8W:1k));if(F.6E){R(A 5f in F.6E){if(5f.1M()==="5g-Z"&&!F.8V){F.8V=F.6E[5f]}I{3s.1b.dK(5f,F.6E[5f])}}}3s.1b.dK("k5-k4",(F.8V||dJ));1u{3s.1b.dI(3s.1r)}1y(e){O.4C()}z.dH(O,dG,dF,dE);C O};z.8T=B(4B){if(4B.1r.G){4B.2E+=(4B.2E.T("?")==-1?"?":"&")+4B.1r;4B.1r=L}};z.k3=B(F){A O=3Q(F);z.8T(O.1F);C 3P("dD",O)};z.k2=B(F){C 3P("dC",3Q(F))};z.k1=B(F){A O=3Q(F);O.1F.1r=F.k0;C 3P("dC",O)};z.jZ=B(F){C 3P("dA",3Q(F))};z.jY=B(F){A O=3Q(F);A dB=O.1F;if(F["8U"]){dB.1r=F.8U;F.8U=L}C 3P("dA",O)};z.jX=B(F){A O=3Q(F);z.8T(O.1F);C 3P("8S",O)};z.dz=B(jW){2m S 1O("z.dz 3O jV jU")}})()}if(!z.1h["z.X.fx"]){z.1h["z.X.fx"]=K;z.1Q("z.X.fx");z.dx=B(dy,1d){D.1w=dy;D.1d=1d;D.4x=B(n){C((D.1d-D.1w)*n)+D.1w}};z.2r("z.d6",L,{1P:B(F){z.1x(D,F);if(z.2l(D.2C)){D.2C=S z.dx(D.2C[0],D.2C[1])}},2C:L,8Q:jT,5a:L,4z:0,dj:10,du:L,6x:L,dt:L,8B:L,dh:L,ds:L,dr:L,dm:L,2D:U,2Z:U,4A:L,8N:L,3r:L,2o:0,4y:0,3q:B(H,F){if(D[H]){D[H].14(D,F||[])}C D},5b:B(dw,8R){if(8R){5e(D.3r);D.2D=D.2Z=U;D.2o=0}I{if(D.2D&&!D.2Z){C D}}D.3q("6x");A d=dw||D.du;if(d>0){5c(z.2p(D,B(){D.5b(L,8R)}),d);C D}D.4A=S 5d().8O();if(D.2Z){D.4A-=D.8Q*D.2o}D.8N=D.4A+D.8Q;D.2D=K;D.2Z=U;A 8P=D.2C.4x(D.2o);if(!D.2o){if(!D.4y){D.4y=D.4z}D.3q("dt",[8P])}D.3q("ds",[8P]);D.8M();C D},jS:B(){5e(D.3r);if(!D.2D){C D}D.2Z=K;D.3q("dr",[D.2C.4x(D.2o)]);C D},jR:B(dq,dp){5e(D.3r);D.2D=D.2Z=K;D.2o=dq*6D;if(dp){D.5b()}C D},jQ:B(dn){if(!D.3r){C}5e(D.3r);if(dn){D.2o=1}D.3q("dm",[D.2C.4x(D.2o)]);D.2D=D.2Z=U;C D},3N:B(){if(D.2D){C D.2Z?"3M":"jP"}C"jO"},8M:B(){5e(D.3r);if(D.2D){A dl=S 5d().8O();A 2q=(dl-D.4A)/(D.8N-D.4A);if(2q>=1){2q=1}D.2o=2q;if(D.5a){2q=D.5a(2q)}D.3q("8B",[D.2C.4x(2q)]);if(2q<1){D.3r=5c(z.2p(D,"8M"),D.dj)}I{D.2D=U;if(D.4z>0){D.4z--;D.5b(L,K)}I{if(D.4z==-1){D.5b(L,K)}I{if(D.4y){D.4z=D.4y;D.4y=0}}}D.2o=0;D.3q("dh")}}C D}});(B(){A df=B(E){if(z.1l){A ns=E.1c;if(!ns.8L.G&&z.1c(E,"8L")=="dg"){ns.8L="1"}if(!ns.3n.G&&z.1c(E,"3n")=="8K"){ns.3n="8K"}}};z.6C=B(F){if(V F.1d=="1k"){2m S 1O("z.6C jN an 1d 1Z")}F.E=z.1D(F.E);A 3p=z.1x({6w:{}},F);A 8J=(3p.6w.2W={});8J.1w=(V 3p.1w=="1k")?B(){C 2V(z.1c(3p.E,"2W"))}:3p.1w;8J.1d=3p.1d;A 2U=z.6y(3p);z.2c(2U,"6x",L,B(){df(3p.E)});C 2U};z.8I=B(F){C z.6C(z.1x({1d:1},F))};z.8H=B(F){C z.6C(z.1x({1d:0},F))};if(z.6B&&!z.3o){z.8E=B(n){C 2k("0.5")+((2Y.da((n+2k("1.5"))*2Y.d9))/2)}}I{z.8E=B(n){C 0.5+((2Y.da((n+1.5)*2Y.d9))/2)}}A d4=B(6A){D.8G=6A;R(A p in 6A){A 1a=6A[p];if(1a.1w 1N z.1J){1a.d7=S z.1J()}}D.4x=B(r){A J={};R(A p in D.8G){A 1a=D.8G[p];A 6z=L;if(1a.1w 1N z.1J){6z=z.d8(1a.1w,1a.1d,r,1a.d7).8F()}I{if(!z.2l(1a.1w)){6z=((1a.1d-1a.1w)*r)+1a.1w+(p!="2W"?1a.jM||"px":"")}}J[p]=6z}C J}};z.6y=B(F){F.E=z.1D(F.E);if(!F.5a){F.5a=z.8E}A 2U=S z.d6(F);z.2c(2U,"6x",2U,B(){A pm={};R(A p in D.6w){A 1a=pm[p]=z.1x({},D.6w[p]);if(z.1Y(1a.1w)){1a.1w=1a.1w()}if(z.1Y(1a.1d)){1a.1d=1a.1d()}A d5=(p.1M().T("jL")>=0);B 8C(E,p){4w(p){2X"58":C E.8D;2X"3n":C E.6v}A v=z.1c(E,p);C(p=="2W")?2V(v):2k(v)};if(V 1a.1d=="1k"){1a.1d=8C(D.E,p)}I{if(V 1a.1w=="1k"){1a.1w=8C(D.E,p)}}if(d5){1a.1w=S z.1J(1a.1w);1a.1d=S z.1J(1a.1d)}I{1a.1w=(p=="2W")?2V(1a.1w):2k(1a.1w)}}D.2C=S d4(pm)});z.2c(2U,"8B",2U,B(8A){R(A s in 8A){z.1c(D.E,s,8A[s])}});C 2U}})()}',62,1711,'|||||||||||||||||||||||||||||||||||dojo|var|function|return|this|node|args|length|evt|else|ret|true|null|obj|elem|dfd|arguments|arr|for|new|indexOf|false|typeof||_base|push|type||te|||apply|attr|||||prop|xhr|style|end|doc|match|uri|_hasResource|key|del|undefined|isIE|item|forEach|djConfig|name|document|query|while|_66|try|res|start|mixin|catch|console|split|root|prototype|byId|gcs|ioArgs|err|NodeList|_p|Color|debug|parentNode|toLowerCase|instanceof|Error|constructor|provide|isString|ta|255|val|_a|global|_69|isFunction|value||substring|join|map|tn||window||path|_343|_220|_listeners|connect|call|json|replace|left|_b|toString|128|parseFloat|isArray|throw||_percent|hitch|step|declare|charAt|nodeType|_3c3|nidx|slice|faux|fired|_c4|_7e|loc|curve|_active|url|_44c|responseText|str|_312|idx|tqp|isNaN|isOpera|_22d|callee|add|_18b|_f8|_e2|_41|anim|Number|opacity|case|Math|_paused|Deferred|lastIndexOf|||||||||shift|substr|string|_3e7|_3ce|break|_w|charCode|_listener|_d5|_c5|authority|_49|width|isSafari|_49e|fire|_timer|_47b|_465|eval|_in|_40c|_409|_362|_3d9|className|_3d5|_386|_37a|body|getComputedStyle|box|_221|keyCode|remove|_8d|_46|paused|status|not|_478|_461|form|splice|filter|concat|tret|childNodes|_38b|_367|_33d||||||||||_340|_348|keypress|appendChild|_toArray|Array|_2b0|_toPixelValue|ref|_fixEvent|_19f|_14c|_14a|_150|_141|declaredClass|_d4|_99|_Url|_83|scheme|_67|_3d|switch|getValue|_startRepeatCount|repeat|_startTime|_47e|cancel|tif|load|to|with|tf|getElementsByTagName|number|_34c|_342|extend|_1e3|_normalizeEventName|_14b|_14e|results|self|cbfn|_f9|_d8|_b2|src|_88|dav||baseUrl|fragment|_loadedModules|_44|_43|_loaders|mll|height||easing|play|setTimeout|Date|clearTimeout|hdr|content|code|errback|_464|addCallbacks|_450|fromJson|_413|_3fc|_3ee|max|_31e|cond|getAttribute|_3d4|obi|tagName|_360|_381|contains|firstChild|_368|_372|_320|place|_2fa|scrollTop|_299|scrollLeft|top|documentElement|_288|_287|_getBorderExtents|_23f|_23d|_239|_218|_216|_211|eles|target|keys|shiftKey|ctrlKey|event|192|iel|_1db|delete|_1cf||addEventListener|String|_1af|_157|array|_14d|continue|_14f|_137|_11f|_106|_findMethod|has|_delegate|_dc|_d3|loaded|_9a|_loadInit|_inFlightCount|getObject|tv|_4f|_postLoad|_2d|offsetWidth|properties|beforeBegin|animateProperty|_4ad|_4a6|isKhtml|_fade|100|headers|readyState|timeout|_469|_457|_44d|formToObject|_441|comment|_43d|_36f|_419|tp|_40a|_406|_407|_373|_403|_3e6|_31b|cbi|test|_3c7|nextSibling|last|_3a1|_38e|_365|_36b|ecn|_364|_363|_356|_35e|_35f|_34f|_34d|_349|trim|tci|_328|_32b|_31f|_31c|_anim|_300|_2ff|_2f5|_2e7|removeClass|addClass|func|_2c4|cls|_2a9|_2ae|_280|_27f|_getPadExtents|isMoz|none|_233|cssText|_214|_fixCallback|_synthesizeEvent|stopPropagation|preventDefault|_setKeyChar|_1e1|ieh|_1d7|_1be|colorFromArray|sanitize|bits|rgb|_156|_fire|_resback|_13d|partial|_13a|silentlyCancelled|_topics|_127|_f1|_f0|superclass|_ec|_e3|mct|setObject|_bf|_b3|object|require|_92|_khtmlTimer|location|XMLHTTP|locale|dua|_71|_modulePrefixes|_55|_loadModule|_51|_50|_4e|pop|_3f|_callLoaded|_unloaders|_loadNotifying|_loadedUrls|_27|_24|_1d|_5|_4b7|onAnimate|getStyle|offsetHeight|_defaultEasing|toCss|_properties|fadeOut|fadeIn|_49f|auto|zoom|_cycle|_endTime|valueOf|_494|duration|_492|DELETE|_ioAddQueryToUrl|putData|contentType|password|user|_isDocumentOk|application|||||_466||||||startTime|_xhrObj|_45f|handleAs|addBoth|error|text|objectToQuery|_44f|ActiveXObject|_443|_442|filtered|_43f|_43e|_437|file|tnl|_41c|_filterQueryResult|_zipIdx|_408|_402|evaluate|_3ed|_380|fHit|_361|_33b|_3da|_3ab|_3d6|RegExp|_327|_3cf|_3c9|child|innerHTML|first|tval|_391|class|pnc|_37e|_37c|_375|_366|_35c|_35a|_353|_33c|_336|_314|||_315|_oe|_307|_309|cloneNode|after|createElement||_2f8|_2ef|_2ee|unshift|coords|some|every||_2cb|script|_2c9|parent||a2p||_2c3|_2bd||abs|_getMarginBox|_2b3|_2a6|position|_2a7|_2ac|_2ab|_getIeDocumentElementOffset|getBoundingClientRect|ownerDocument|_2a3|clientWidth|_isBodyLtr|_fixIeBiDiScrollLeft|_bodyLtr|_29d|_getContentBox|_setBox|_getMarginExtents|_getPadBorderExtents|_usesBorderBox|boxModel|pcs|st|sl|_240|runtimeStyle|_dcm|BackCompat|compatMode|default|_21b|_d|html|_event_listener|handlers|PAGE_DOWN|PAGE_UP|RIGHT_ARROW|LEFT_ARROW|DOWN_ARROW|UP_ARROW|_preventDefault||_stopPropagation|returnValue||_trySetKeyCode|cancelBubble|currentTarget|106|_1ee|111||_1e8|_1e7|||se|srcElement|onkeydown||_1d0|_disconnect|lid|_1c0|_connect|_set|_195|_185|_183|_17d|_everyOrSome|_16b|_172|_15b|Function|_154|_escapeString|_140|chain|_check|canceller|_12d|_124|_11a|_10d|_107|inherited|_fa|_f2|_findMixin|_constructor|preamble|_de|clone|tmp|_c7|TMP|_be|_ba|_mixin|isBrowser|lang|firebug||param|modulePaths|_a7|_fireCallback|_a0|setContext||_9c|unloaded||||_96|_93|navigator|_90|_89||protocol|_84|_86|_XMLHTTP_PROGIDS|gears|google|setAttribute|_80|_77|cfg|_6f|_getModuleSymbols|_5a|_58|_53|_4d|_4c|_45|_40|_moduleHasPrefix|_loadUri|_28|_26|_21|_22|tests|doh|_20|_1f|_1c|version|_1b|_19|_getProp|_11|_4|_4a5|_4b3|_Animation|tempColor|blendColors|PI|sin|||||_49a|normal|onEnd||rate||curr|onStop|_497||_496|pct|onPause|onPlay|onBegin|delay||_491|_Line|_48b|wrapForm|PUT|_487|POST|GET|_476|_474|_472|_ioWatch|send|_471|setRequestHeader|open|callback|setInterval|_470|resHandle|_46f|ioCheck|_46e|validCheck|getTime|_ioCancelAll|addOnUnload|clearInterval|dojoType|now|canceled|_blockAsync|_45e|_45c|_459|_ioSetArgs|_contentHandlers|abort|_458|_456||||addErrback|_454|addCallback|_452|_44b|_44a|_449|preventCache|responseXML|Microsoft|JSON|usePlainJson|_431|toJson|_430|_42d|image|opt|ria|_421|_41b|_40b|_zip|_410|_40d|_357|sqf|_374|_3e5|_3df|_38f|clc|pred|parseInt|ntf|_3bf|_3bc|cnl|previousSibling|_3a9|_3a6|_39c|_399|_396|_392|__cachedIndex|__cachedLength|_376|iterateNext|_34a|_355|_354|_32c|_350|_34b|_33f|_33e|_33a|_338|_334|_332||_330|_32e||_322|_316|mousemove|mouseout|mouseover|_305|lastChild||_2f9||_2f2|_2f1|removeChild|_2ec|_2eb|_2ea|_2e6||_2e4|_2e2|_2d6|_2d5|_2d4|_2d3|_2d2|_2d1|_2cd|_2cc|scs|write|_2c8|hasClass|_2c0|_2bb|_2b5|_abs|_docScroll|offsetParent|offsetTop|offsetLeft|absolute|getBoxObjectFor|clientLeft|_setContentSize|_setMarginBox|_28d|_286|_285|_289|NaN|_281|border|_272|_26b|_260|_258|_253|_24c|_246|_23a|_getOpacity|_setOpacity|_238|td|tr|nodeName|FILTER|_22f|_22e|currentStyle|_22c|_22b|display|QuirksMode|unselectable|_217|isMozilla|getElementById|attributes|all|_ie_listener|_getIeDispatcher|_1fd|NUM_LOCK|SCROLL_LOCK|INSERT|END|HOME|PAUSE|F12|F11|F10|F9|F8|F7|F6|F5|F4|F3|F2|F1|63232|SHIFT_TAB|TAB|keyIdentifier|_1f3|stopEvent|_punctMap|222|219|186|onkeypress|_stealthKeyDown|_fixKeys|relatedTarget|_1e0|_1df|_stealthKeydown|_1d6|_1d5|_1d1|_1ca|_1c9|_1cb|_1c2|_1c1|_1c3|_1c4|_1bc|_1b3|_1b2|colorFromHex|colorFromRgb|named|colorFromString|mask|rgba|_19c|_197|_192|setColor|_180|_178|_177|_175|_174|_16d|_166|_164|_163|_162|_15c|_15d|_15e|index|__json__|toJsonIndentStr|_nextId|_12f|_12b|publish|_128|_126|_125|_122|_121|_123|_11c|_11b|_10c|_10b|_108|getDispatcher|argument|nom|_construct|_core|_makeCtor|_df|_db|deprecated|isObject|_cc||scope||_hitchArgs|_c2||pre|_c1|native|isDebug||registerModulePath|_a8||finally|||_a6|_a5|_a4|_a3|_a2|_a1|_9f|_9e|_9d|_9b|_98|_97|onbeforeunload|ipt|scr|complete|_95|userAgent|_modulesLoaded|initialized|_initFired|_8c|_8a|_getText|_87|ieForceActiveXXhr|Msxml2|isGears|_81|_gearsObject|googlegears|GearsFactory|isFF|_7d|Safari|_72|_name|_6c|ire|ore|_68|i18n|_5b|requireIf|_56|_52|loading|_4a|_loadPath|_47|_48|_global_omit_module_check|_getModulePrefix|_3c|_3a|_37|_30|Boolean|_loadUriAndCheck|_2e||cacheBust|_1e|_1a|_17|_16|_15|_14|_f|_10|_e|_9|_8|revision|flag|patch|minor|major|_6|color|units|needs|stopped|playing|stop|gotoPercent|pause|1000|implemented|yet|_48a|xhrDelete|rawXhrPut|xhrPut|postData|rawXhrPost|xhrPost|xhrGet|Type|Content|sync|response|http|bad|urlencoded|www|_watchInFlightError||exceeded|handle|action|getAttributeNode|loadXML|async|XMLDOM|prefixes|MSXML3|MSXML|MSXML2||xml|javascript|wasn|your|optional|message|off|turn|use|endpoints|issues|security|potential|avoid|mimetype|using|consider|please|decodeURIComponent|queryToObject|formToJson|formToQuery|encodeURIComponent|selected|option|multiple|checked|checkbox|radio|disabled|textarea|select|button|reset|submit|input|_3fb|hasAttribute|0n|even|odd|nth|_3b5|empty|_3b1|_3ad|htmlFor|_38a|under||exprssion|failure|ANY_TYPE|XPathResult|starts|keyup|keydown|mouseup|mousedown|blur|click|combine|span|addContent||adopt|orphan|_2de|_2dd|styles|_2da|_2d9|_2cf|_2ce|show|createPopup|toggleClass|scrollWidth|clientTop|ltr|direction|pageXOffset|pageYOffset|fixed|contentBox|marginBox|BUTTON|TABLE|_getBorderBox|clientHeight|visible|overflow|marginBottom|marginRight|marginTop|marginLeft|borderBottomWidth|borderBottomStyle|borderRightWidth|borderRightStyle|borderTopWidth|borderTopStyle|borderLeftWidth|borderLeftStyle|paddingBottom|paddingRight|paddingTop|paddingLeft|offset||min|padding||margin|Opacity|Alpha|alpha|filters|pixelLeft|medium|_22a|defaultView|before||insertBefore|KhtmlUserSelect|MozUserSelect|setSelectable|isDescendant|div|_destroyElement|BackgroundImageCache|execCommand|PageDown|PageUp|Right|Left|Down|Up|63289|63249|63248|PRINT_SCREEN|63302|63277|63276|63275|63273|63272|63250|63247|63246|63245|63244|63243|63242|63241|63240|63239|63238|63237|63236|63235|63234|63233|Enter|_1f9|which|_1f6|bubbledKeyCode|221|220||||191|190|189|188|187|toElement|fromElement|clientY|pageY||clientX|pageX|offsetY|||layerY|offsetX|layerX|parentWindow|_nop|_allow_leaks|145|144|126|F15|125|F14|124|F13|123|122|121|120|119|118|117|116|115|114|113|112|NUMPAD_DIVIDE|110|NUMPAD_PERIOD|109|NUMPAD_MINUS|108|NUMPAD_ENTER|107|NUMPAD_PLUS|NUMPAD_MULTIPLY|105|NUMPAD_9|104|NUMPAD_8|103|NUMPAD_7|102|NUMPAD_6|101|NUMPAD_5|NUMPAD_4||NUMPAD_3|NUMPAD_2|NUMPAD_1|NUMPAD_0||SELECT|RIGHT_WINDOW||LEFT_WINDOW||HELP|SPACE|ESCAPE|CAPS_LOCK|ALT|CTRL|SHIFT|ENTER|CLEAR|BACKSPACE|attachEvent|fixEvent|fromCharCode|keyChar|_1b9|removeEventListener|0x|round|toHex|toRgba|toRgb|aqua|teal|blue|navy|yellow|olive|lime|green|fuchsia|purple|red|maroon|white|gray|silver|black|boolean|called|already|Cancelled|connectPublisher|unsubscribe|subscribe|disconnect|_113|_112||_111|_110|||found|was||must|_|module|||required|likely|It|declaration|Mixin|separate|instead|property|initializer||pass|_c9|_bb|_b7|nfunction|isAlien|isFinite|isArrayLike|_firebug|withDoc|withGlobal|_writeIncludes|VML|behavior|addRule|createStyleSheet|vml|com|microsoft|schemas|urn|namespaces|onunload|onreadystatechange|defer|khtml|WebKit|DOMContentLoaded|enableMozDomContentLoaded|domcontentloaded|Unable|base|chrome|1223|304|300|200|available|XMLHttpRequest|_println|language|userLanguage|isQuirks|factory|mimeTypes|Factory|Gears|_7f|MSIE||Firefox|Gecko|Konqueror||Opera|appVersion|xd|browser|moduleUrl|port|host|hostenv|_requireLocalization|_5f|_5e|_5d|_5c|requireLocalization|requireAfterIf|_57|common|platformRequire|defined|symbol|_isXDomain|tried|Could|__package__|packageFileName|_42|useXDomain|flight|still|files|addOnLoad|failed|sourceURL|util|notice|without|change|subject|APIs|EXPERIMENTAL|experimental|removed|will|DEPRECATED|exists|10315|Rev|Mobile|Spidermonkey|Rhino||Browser|delayMozLoadingFix|preventBackButtonFix|libraryScriptUri|baseRelativePath|baseScriptUri|allowQueryConfig|warn|trace|timeEnd||time|profileEnd|profile|log|info|groupEnd|group|dirxml|dir|count|assert'.split('|'),0,{});
+
+
+/*
+
+Prototype 1.5 rc0
+ - Adapted from Ruby on Rails - http://dev.rubyonrails.org/browser/spinoffs/prototype/src
+ - By Lunarmedia, 06 August, 2006
+ - Available at (and packed with) JavascriptCompressor.com
+
+Please note this version is missing the selector.js component of the full Prototype library.
+You can get the compressed version of selector at JavascriptCompressor.com
+
+*/
+
+var decompressedPrototype = function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[(function(e){return d[e]})];e=(function(){return'\\w+'});c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('d T={4l:\'1.5.8P\',3E:\'(?:<3G.*?>)((\\n|\\r|.)*?)(?:<\\/3G>)\',2v:7(){},K:7(x){c x}};d 1b={17:7(){c 7(){6.1I.2n(6,N)}}};d 1e=z q();q.u=7(5d,O){G(d 1G 2M O){5d[1G]=O[1G]}c 5d};q.1U=7(U){1j{f(U==1v)c\'1v\';f(U==1L)c\'1L\';c U.1U?U.1U():U.2C()}1s(e){f(e 8R 9l)c\'...\';25 e}};7j.v.1d=7(){d 43=6,23=$A(N),U=23.8S();c 7(){c 43.2n(U,23.3s($A(N)))}};7j.v.8U=7(U){d 43=6;c 7(C){c 43.8V(U,C||1W.C)}};q.u(8Q.v,{8W:7(){d 4Z=6.2C(16);f(6<16)c\'0\'+4Z;c 4Z},5j:7(){c 6+1},8Y:7(o){$R(0,6,11).V(o);c 6}});d 6s={6j:7(){d 48;G(d i=0;i<N.t;i++){d 6L=N[i];1j{48=6L();1y}1s(e){}}c 48}};d 6Q=1b.17();6Q.v={1I:7(1a,1J){6.1a=1a;6.1J=1J;6.41=Y;6.2A()},2A:7(){5Z(6.2D.1d(6),6.1J*4z)},2D:7(){f(!6.41){1j{6.41=11;6.1a()}8Z{6.41=Y}}}};q.u(4b.v,{2T:7(1A,1z){d L=\'\',O=6,I;1z=N.90.52(1z);1H(O.t>0){f(I=O.I(1A)){L+=O.47(0,I.w);L+=(1z(I)||\'\').2C();O=O.47(I.w+I[0].t)}1D{L+=O,O=\'\'}}c L},92:7(1A,1z,3i){1z=6.2T.52(1z);3i=3i===1v?1:3i;c 6.2T(1A,7(I){f(--3i<0)c I[0];c 1z(I)})},93:7(1A,o){6.2T(1A,o);c 6},94:7(t,2S){t=t||30;2S=2S===1v?\'...\':2S;c 6.t>t?6.47(0,t-2S.t)+2S:6},9F:7(){c 6.2y(/^\\s+/,\'\').2y(/\\s+$/,\'\')},71:7(){c 6.2y(/<\\/?[^>]+>/7Y,\'\')},2Q:7(){c 6.2y(z 3O(T.3E,\'5P\'),\'\')},70:7(){d 6Y=z 3O(T.3E,\'5P\');d 5p=z 3O(T.3E,\'98\');c(6.I(6Y)||[]).1C(7(5o){c(5o.I(5p)||[\'\',\'\'])[1]})},3q:7(){c 6.70().1C(7(3G){c 4q(3G)})},9E:7(){d 1q=J.4Y(\'1q\');d 1Y=J.9D(6);1q.75(1Y);c 1q.3h},9c:7(){d 1q=J.4Y(\'1q\');1q.3h=6.71();c 1q.2z[0]?1q.2z[0].6q:\'\'},78:7(){d 7i=6.I(/^\\??(.*)$/)[1].3j(\'&\');c 7i.36({},7(5b,72){d 1i=72.3j(\'=\');5b[1i[0]]=1i[1];c 5b})},1Z:7(){c 6.3j(\'\')},3P:7(){d 2l=6.3j(\'-\');f(2l.t==1)c 2l[0];d 54=6.5g(\'-\')==0?2l[0].7e(0).3Y()+2l[0].7g(1):2l[0];G(d i=1,73=2l.t;i<73;i++){d s=2l[i];54+=s.7e(0).3Y()+s.7g(1)}c 54},1U:7(){c"\'"+6.2y(/\\\\/g,\'\\\\\\\\\').2y(/\'/g,\'\\\\\\\'\')+"\'"}});4b.v.2T.52=7(1z){f(2i 1z==\'7\')c 1z;d 2U=z 3n(1z);c 7(I){c 2U.7a(I)}};4b.v.9h=4b.v.78;d 3n=1b.17();3n.79=/(^|.|\\r|\\n)(#\\{(.*?)\\})/;3n.v={1I:7(2U,1A){6.2U=2U.2C();6.1A=1A||3n.79},7a:7(U){c 6.2U.2T(6.1A,7(I){d 53=I[1];f(53==\'\\\\\')c I[2];c 53+(U[I[3]]||\'\').2C()})}};d $1y=z q();d $49=z q();d 1p={V:7(o){d w=0;1j{6.2m(7(h){1j{o(h,w++)}1s(e){f(e!=$49)25 e}})}1s(e){f(e!=$1y)25 e}},9n:7(o){d L=11;6.V(7(h,w){L=L&&!!(o||T.K)(h,w);f(!L)25 $1y});c L},9o:7(o){d L=11;6.V(7(h,w){f(L=!!(o||T.K)(h,w))25 $1y});c L},3e:7(o){d P=[];6.V(7(h,w){P.W(o(h,w))});c P},7n:7(o){d L;6.V(7(h,w){f(o(h,w)){L=h;25 $1y}});c L},7o:7(o){d P=[];6.V(7(h,w){f(o(h,w))P.W(h)});c P},9p:7(1A,o){d P=[];6.V(7(h,w){d 7c=h.2C();f(7c.I(1A))P.W((o||T.K)(h,w))});c P},1M:7(U){d 51=Y;6.V(7(h){f(h==U){51=11;25 $1y}});c 51},36:7(45,o){6.V(7(h,w){45=o(45,h,w)});c 45},9q:7(1F){d 23=$A(N).47(1);c 6.3e(7(h){c h[1F].2n(h,23)})},9s:7(o){d L;6.V(7(h,w){h=(o||T.K)(h,w);f(L==1v||h>=L)L=h});c L},9u:7(o){d L;6.V(7(h,w){h=(o||T.K)(h,w);f(L==1v||h<L)L=h});c L},9v:7(o){d 50=[],58=[];6.V(7(h,w){((o||T.K)(h,w)?50:58).W(h)});c[50,58]},3r:7(1G){d P=[];6.V(7(h,w){P.W(h[1G])});c P},9x:7(o){d P=[];6.V(7(h,w){f(!o(h,w))P.W(h)});c P},9y:7(o){c 6.3e(7(h,w){c{h:h,59:o(h,w)}}).9z(7(18,3U){d a=18.59,b=3U.59;c a<b?-1:a>b?1:0}).3r(\'h\')},1Z:7(){c 6.3e(T.K)},9B:7(){d o=T.K,23=$A(N);f(2i 23.5e()==\'7\')o=23.9C();d 7l=[6].3s(23).1C($A);c 6.1C(7(h,w){c o(7l.3r(w))})},1U:7(){c\'#<1p:\'+6.1Z().1U()+\'>\'}};q.u(1p,{1C:1p.3e,5v:1p.7n,1k:1p.7o,8M:1p.1M,7p:1p.1Z});d $A=1E.7q=7(2R){f(!2R)c[];f(2R.1Z){c 2R.1Z()}1D{d P=[];G(d i=0;i<2R.t;i++)P.W(2R[i]);c P}};q.u(1E.v,1p);f(!1E.v.4d)1E.v.4d=1E.v.4m;q.u(1E.v,{2m:7(o){G(d i=0;i<6.t;i++)o(6[i])},5i:7(){6.t=0;c 6},7r:7(){c 6[0]},5e:7(){c 6[6.t-1]},7s:7(){c 6.1k(7(h){c h!=1v||h!=1L})},6J:7(){c 6.36([],7(6H,h){c 6H.3s(h&&h.5D==1E?h.6J():[h])})},5s:7(){d 4N=$A(N);c 6.1k(7(h){c!4N.1M(h)})},5g:7(U){G(d i=0;i<6.t;i++)f(6[i]==U)c i;c-1},4m:7(5h){c(5h!==Y?6:6.1Z()).4d()},1U:7(){c\'[\'+6.1C(q.1U).1N(\', \')+\']\'}});d 4h={2m:7(o){G(d 1O 2M 6){d h=6[1O];f(2i h==\'7\')49;d 1i=[1O,h];1i.1O=1O;1i.h=h;o(1i)}},7t:7(){c 6.3r(\'1O\')},4N:7(){c 6.3r(\'h\')},7u:7(2N){c $H(2N).36($H(6),7(4Q,1i){4Q[1i.1O]=1i.h;c 4Q})},7w:7(){c 6.1C(7(1i){c 1i.1C(4n).1N(\'=\')}).1N(\'&\')},1U:7(){c\'#<4h:{\'+6.1C(7(1i){c 1i.1C(q.1U).1N(\': \')}).1N(\', \')+\'}>\'}};7 $H(U){d 2N=q.u({},U||{});q.u(2N,1p);q.u(2N,4h);c 2N};3L=1b.17();q.u(3L.v,1p);q.u(3L.v,{1I:7(22,2x,2H){6.22=22;6.2x=2x;6.2H=2H},2m:7(o){d h=6.22;2q{o(h);h=h.5j()}1H(6.1M(h))},1M:7(h){f(h<6.22)c Y;f(6.2H)c h<6.2x;c h<=6.2x}});d $R=7(22,2x,2H){c z 3L(22,2x,2H)};d M={4w:7(){c 6s.6j(7(){c z 5C()},7(){c z 5n(\'7y.6d\')},7(){c z 5n(\'7z.6d\')})||Y},4s:0};M.2W={3b:[],2m:7(o){6.3b.2m(o)},69:7(4F){f(!6.1M(4F))6.3b.W(4F)},7A:7(5t){6.3b=6.3b.5s(5t)},3y:7(1a,26,E,2Z){6.V(7(3o){f(3o[1a]&&2i 3o[1a]==\'7\'){1j{3o[1a].2n(3o,[26,E,2Z])}1s(e){}}})}};q.u(M.2W,1p);M.2W.69({5G:7(){M.4s++},1B:7(){M.4s--}});M.44=7(){};M.44.v={4a:7(m){6.m={1F:\'4j\',4p:11,5H:\'5E/x-86-Q-7C\',28:\'\'};q.u(6.m,m||{})},3l:7(){c 6.E.32==1v||6.E.32==0||(6.E.32>=84&&6.E.32<7E)},7G:7(){c!6.3l()}};M.3t=1b.17();M.3t.5L=[\'7H\',\'80\',\'7I\',\'7J\',\'4t\'];M.3t.v=q.u(z M.44(),{1I:7(1l,m){6.E=M.4w();6.4a(m);6.26(1l)},26:7(1l){d 28=6.m.28||\'\';f(28.t>0)28+=\'&7K=\';1j{6.1l=1l;f(6.m.1F==\'7L\'&&28.t>0)6.1l+=(6.1l.I(/\\?/)?\'&\':\'?\')+28;M.2W.3y(\'5G\',6,6.E);6.E.7N(6.m.1F,6.1l,6.m.4p);f(6.m.4p){6.E.5T=6.5J.1d(6);2Y((7(){6.4r(1)}).1d(6),10)}6.5A();d 1c=6.m.5V?6.m.5V:28;6.E.7O(6.m.1F==\'4j\'?1c:1L)}1s(e){6.3p(e)}},5A:7(){d 1P=[\'X-7P-7Q\',\'5C\',\'X-T-4l\',T.4l,\'7R\',\'1Y/7m, 1Y/2e, 5E/5F, 1Y/5F, */*\'];f(6.m.1F==\'4j\'){1P.W(\'5Q-2g\',6.m.5H);f(6.E.7S)1P.W(\'7T\',\'7U\')}f(6.m.1P)1P.W.2n(1P,6.m.1P);G(d i=0;i<1P.t;i+=2)6.E.7V(1P[i],1P[i+1])},5J:7(){d 2F=6.E.2F;f(2F!=1)6.4r(6.E.2F)},4A:7(B){1j{c 6.E.7W(B)}1s(e){}},5M:7(){1j{c 4q(\'(\'+6.4A(\'X-7X\')+\')\')}1s(e){}},5R:7(){1j{c 4q(6.E.3F)}1s(e){6.3p(e)}},4r:7(2F){d C=M.3t.5L[2F];d E=6.E,2Z=6.5M();f(C==\'4t\'){1j{(6.m[\'2I\'+6.E.32]||6.m[\'2I\'+(6.3l()?\'81\':\'82\')]||T.2v)(E,2Z)}1s(e){6.3p(e)}f((6.4A(\'5Q-2g\')||\'\').I(/^1Y\\/7m/i))6.5R()}1j{(6.m[\'2I\'+C]||T.2v)(E,2Z);M.2W.3y(\'2I\'+C,6,E,2Z)}1s(e){6.3p(e)}f(C==\'4t\')6.E.5T=T.2v},3p:7(57){(6.m.5W||T.2v)(6,57);M.2W.3y(\'5W\',6,57)}});M.4C=1b.17();q.u(q.u(M.4C.v,M.3t.v),{1I:7(1w,1l,m){6.4x={3m:1w.3m?$(1w.3m):$(1w),3z:1w.3z?$(1w.3z):(1w.3m?1L:$(1w))};6.E=M.4w();6.4a(m);d 1B=6.m.1B||T.2v;6.m.1B=(7(E,U){6.5Y();1B(E,U)}).1d(6);6.26(1l)},5Y:7(){d 3A=6.3l()?6.4x.3m:6.4x.3z;d 3k=6.E.3F;f(!6.m.3q)3k=3k.2Q();f(3A){f(6.m.60){z 6.m.60(3A,3k)}1D{k.6h(3A,3k)}}f(6.3l()){f(6.1B)2Y(6.1B.1d(6),10)}}});M.61=1b.17();M.61.v=q.u(z M.44(),{1I:7(1w,1l,m){6.4a(m);6.1B=6.m.1B;6.1J=(6.m.1J||2);6.2s=(6.m.2s||1);6.4B={};6.1w=1w;6.1l=1l;6.22()},22:7(){6.m.1B=6.63.1d(6);6.2D()},7b:7(){6.4B.1B=1v;89(6.65);(6.1B||T.2v).2n(6,N)},63:7(26){f(6.m.2s){6.2s=(26.3F==6.64?6.2s*6.m.2s:1);6.64=26.3F}6.65=2Y(6.2D.1d(6),6.2s*6.1J*4z)},2D:7(){6.4B=z M.4C(6.1w,6.1l,6.m)}});7 $(){d P=[],4;G(d i=0;i<N.t;i++){4=N[i];f(2i 4==\'8c\')4=J.8d(4);P.W(k.u(4))}c P.t<2?P[0]:P};J.8f=7(1f,6a){d 6b=($(6a)||J.1c).4D(\'*\');c $A(6b).36([],7(12,4E){f(4E.1f.I(z 3O("(^|\\\\s)"+1f+"(\\\\s|$)")))12.W(k.u(4E));c 12})};f(!1W.k)d k=z q();k.u=7(4){f(!4)c;f(4X)c 4;f(!4.6e&&4.1h&&4!=1W){d 2a=k.3d,2r=k.u.2r;G(d 1G 2M 2a){d h=2a[1G];f(2i h==\'7\')4[1G]=2r.4W(h)}}4.6e=11;c 4};k.u.2r={4W:7(h){c 6[h]=6[h]||7(){c h.2n(1L,[6].3s($A(N)))}}};k.3d={4U:7(4){c $(4).l.2B!=\'3Q\'},6N:7(){G(d i=0;i<N.t;i++){d 4=$(N[i]);k[k.4U(4)?\'6f\':\'6w\'](4)}},6f:7(){G(d i=0;i<N.t;i++){d 4=$(N[i]);4.l.2B=\'3Q\'}},6w:7(){G(d i=0;i<N.t;i++){d 4=$(N[i]);4.l.2B=\'\'}},42:7(4){4=$(4);4.1X.8h(4)},6h:7(4,2e){$(4).3h=2e.2Q();2Y(7(){2e.3q()},10)},2y:7(4,2e){4=$(4);f(4.6k){4.6k=2e.2Q()}1D{d 1K=4.6R.6S();1K.56(4);4.1X.8i(1K.6T(2e.2Q()),4)}2Y(7(){2e.3q()},10)},8k:7(4){4=$(4);c 4.2k},3K:7(4){c z k.3S(4)},8l:7(4,1f){f(!(4=$(4)))c;c k.3K(4).1M(1f)},8m:7(4,1f){f(!(4=$(4)))c;c k.3K(4).7k(1f)},8n:7(4,1f){f(!(4=$(4)))c;c k.3K(4).42(1f)},8p:7(4){4=$(4);G(d i=0;i<4.2z.t;i++){d 3M=4.2z[i];f(3M.8q==3&&!/\\S/.4v(3M.6q))k.42(3M)}},8r:7(4){c $(4).3h.I(/^\\s*$/)},8s:7(4,3I){4=$(4),3I=$(3I);1H(4=4.1X)f(4==3I)c 11;c Y},6t:7(4){4=$(4);d x=4.x?4.x:4.2f,y=4.y?4.y:4.29;1W.6t(x,y)},1R:7(4,l){4=$(4);d h=4.l[l.3P()];f(!h){f(J.4J&&J.4J.6v){d 4L=J.4J.6v(4,1L);h=4L?4L.8v(l):1L}1D f(4.6x){h=4.6x[l.3P()]}}f(1W.6E&&[\'18\',\'1n\',\'3U\',\'6G\'].1M(l))f(k.1R(4,\'14\')==\'4G\')h=\'6y\';c h==\'6y\'?1L:h},8x:7(4,l){4=$(4);G(d B 2M l)4.l[B.3P()]=l[B]},8y:7(4){4=$(4);f(k.1R(4,\'2B\')!=\'3Q\')c{21:4.2p,24:4.2k};d 20=4.l;d 6B=20.4O;d 6A=20.14;20.4O=\'31\';20.14=\'2o\';20.2B=\'\';d 6C=4.6m;d 6D=4.6p;20.2B=\'3Q\';20.14=6A;20.4O=6B;c{21:6C,24:6D}},8z:7(4){4=$(4);d 4R=k.1R(4,\'14\');f(4R==\'4G\'||!4R){4.4T=11;4.l.14=\'3T\';f(1W.6E){4.l.1n=0;4.l.18=0}}},8A:7(4){4=$(4);f(4.4T){4.4T=1v;4.l.14=4.l.1n=4.l.18=4.l.6G=4.l.3U=\'\'}},8B:7(4){4=$(4);f(4.3c)c;4.3c=4.l.3V;f((k.1R(4,\'3V\')||\'4U\')!=\'31\')4.l.3V=\'31\'},8D:7(4){4=$(4);f(4.3c)c;4.l.3V=4.3c;4.3c=1v}};q.u(k,k.3d);d 4X=Y;f(!3W&&/3x|3w|3u/.4v(33.62)){d 3W={}};k.6K=7(2a){q.u(k.3d,2a||{});f(2i 3W!=\'1v\'){d 2a=k.3d,2r=k.u.2r;G(d 1G 2M 2a){d h=2a[1G];f(2i h==\'7\')3W.v[1G]=2r.4W(h)}4X=11}};k.6K();d 6M=z q();6M.2B=k.6N;1e.1g=7(3f){6.3f=3f};1e.1g.v={1I:7(4,2t){6.4=$(4);6.2t=2t.2Q();f(6.3f&&6.4.6O){1j{6.4.6O(6.3f,6.2t)}1s(e){d 1h=6.4.1h.2w();f(1h==\'4V\'||1h==\'8N\'){6.2X(6.6U())}1D{25 e}}}1D{6.1K=6.4.6R.6S();f(6.2V)6.2V();6.2X([6.1K.6T(6.2t)])}2Y(7(){2t.3q()},10)},6U:7(){d 1q=J.4Y(\'1q\');1q.3h=\'<6V><4V>\'+6.2t+\'</4V></6V>\';c $A(1q.2z[0].2z[0].2z)}};d 1g=z q();1g.6W=1b.17();1g.6W.v=q.u(z 1e.1g(\'96\'),{2V:7(){6.1K.97(6.4)},2X:7(2h){2h.V((7(2j){6.4.1X.55(2j,6.4)}).1d(6))}});1g.5m=1b.17();1g.5m.v=q.u(z 1e.1g(\'99\'),{2V:7(){6.1K.56(6.4);6.1K.74(11)},2X:7(2h){2h.4m(Y).V((7(2j){6.4.55(2j,6.4.9a)}).1d(6))}});1g.7h=1b.17();1g.7h.v=q.u(z 1e.1g(\'9d\'),{2V:7(){6.1K.56(6.4);6.1K.74(6.4)},2X:7(2h){2h.V((7(2j){6.4.75(2j)}).1d(6))}});1g.76=1b.17();1g.76.v=q.u(z 1e.1g(\'9i\'),{2V:7(){6.1K.9m(6.4)},2X:7(2h){2h.V((7(2j){6.4.1X.55(2j,6.4.9t)}).1d(6))}});k.3S=1b.17();k.3S.v={1I:7(4){6.4=$(4)},2m:7(o){6.4.1f.3j(/\\s+/).1k(7(B){c B.t>0}).2m(o)},5c:7(1f){6.4.1f=1f},7k:7(5a){f(6.1M(5a))c;6.5c(6.1Z().3s(5a).1N(\' \'))},42:7(4c){f(!6.1M(4c))c;6.5c(6.1k(7(1f){c 1f!=4c}).1N(\' \'))},2C:7(){c 6.1Z().1N(\' \')}};q.u(k.3S.v,1p);d 5I={5i:7(){G(d i=0;i<N.t;i++)$(N[i]).h=\'\'},4f:7(4){$(4).4f()},7v:7(){G(d i=0;i<N.t;i++)f($(N[i]).h==\'\')c Y;c 11},1k:7(4){$(4).1k()},5y:7(4){4=$(4);4.4f();f(4.1k)4.1k()}};d D={3a:7(Q){d 12=D.2L($(Q));d 4I=z 1E();G(d i=0;i<12.t;i++){d 4g=D.k.3a(12[i]);f(4g)4I.W(4g)}c 4I.1N(\'&\')},2L:7(Q){Q=$(Q);d 12=z 1E();G(d 1h 2M D.k.2E){d 4H=Q.4D(1h);G(d j=0;j<4H.t;j++)12.W(4H[j])}c 12},7x:7(Q,3N,B){Q=$(Q);d 3H=Q.4D(\'2u\');f(!3N&&!B)c 3H;d 4y=z 1E();G(d i=0;i<3H.t;i++){d 2u=3H[i];f((3N&&2u.2g!=3N)||(B&&2u.B!=B))49;4y.W(2u)}c 4y},7B:7(Q){d 12=D.2L(Q);G(d i=0;i<12.t;i++){d 4=12[i];4.7D();4.4o=\'11\'}},7F:7(Q){d 12=D.2L(Q);G(d i=0;i<12.t;i++){d 4=12[i];4.4o=\'\'}},5z:7(Q){c D.2L(Q).5v(7(4){c 4.2g!=\'31\'&&!4.4o&&[\'2u\',\'1k\',\'3J\'].1M(4.1h.2w())})},7M:7(Q){5I.5y(D.5z(Q))},5w:7(Q){$(Q).5w()}};D.k={3a:7(4){4=$(4);d 1F=4.1h.2w();d 1S=D.k.2E[1F](4);f(1S){d 1O=4n(1S[0]);f(1O.t==0)c;f(1S[1].5D!=1E)1S[1]=[1S[1]];c 1S[1].1C(7(h){c 1O+\'=\'+4n(h)}).1N(\'&\')}},1x:7(4){4=$(4);d 1F=4.1h.2w();d 1S=D.k.2E[1F](4);f(1S)c 1S[1]}};D.k.2E={2u:7(4){6c(4.2g.2w()){1r\'7Z\':1r\'31\':1r\'6l\':1r\'1Y\':c D.k.2E.3J(4);1r\'6g\':1r\'6i\':c D.k.2E.5O(4)}c Y},5O:7(4){f(4.83)c[4.B,4.h]},3J:7(4){c[4.B,4.h]},1k:7(4){c D.k.2E[4.2g==\'1k-6n\'?\'5S\':\'5X\'](4)},5S:7(4){d h=\'\',2b,w=4.85;f(w>=0){2b=4.m[w];h=2b.h||2b.1Y}c[4.B,h]},5X:7(4){d h=[];G(d i=0;i<4.t;i++){d 2b=4.m[i];f(2b.87)h.W(2b.h||2b.1Y)}c[4.B,h]}};d $F=D.k.1x;1e.3D=7(){};1e.3D.v={1I:7(4,1J,1a){6.1J=1J;6.4=$(4);6.1a=1a;6.2K=6.1x();6.2A()},2A:7(){5Z(6.2D.1d(6),6.1J*4z)},2D:7(){d h=6.1x();f(6.2K!=h){6.1a(6.4,h);6.2K=h}}};D.k.3C=1b.17();D.k.3C.v=q.u(z 1e.3D(),{1x:7(){c D.k.1x(6.4)}});D.3C=1b.17();D.3C.v=q.u(z 1e.3D(),{1x:7(){c D.3a(6.4)}});1e.2c=7(){};1e.2c.v={1I:7(4,1a){6.4=$(4);6.1a=1a;6.2K=6.1x();f(6.4.1h.2w()==\'Q\')6.67();1D 6.2A(6.4)},4K:7(){d h=6.1x();f(6.2K!=h){6.1a(6.4,h);6.2K=h}},67:7(){d 12=D.2L(6.4);G(d i=0;i<12.t;i++)6.2A(12[i])},2A:7(4){f(4.2g){6c(4.2g.2w()){1r\'6g\':1r\'6i\':1o.3B(4,\'8j\',6.4K.1d(6));1y;1r\'6l\':1r\'1Y\':1r\'3J\':1r\'1k-6n\':1r\'1k-8t\':1o.3B(4,\'8u\',6.4K.1d(6));1y}}}};D.k.2c=1b.17();D.k.2c.v=q.u(z 1e.2c(),{1x:7(){c D.k.1x(6.4)}});D.2c=1b.17();D.2c.v=q.u(z 1e.2c(),{1x:7(){c D.3a(6.4)}});f(!1W.1o){d 1o=z q()}q.u(1o,{8C:8,8F:9,8H:13,8I:27,8J:37,8L:38,8O:39,8T:40,8X:46,4:7(C){c C.Z||C.91},95:7(C){c(((C.6X)&&(C.6X==1))||((C.6Z)&&(C.6Z==1)))},9b:7(C){c C.9e||(C.9f+(J.3R.2G||J.1c.2G))},9g:7(C){c C.9j||(C.9k+(J.3R.2O||J.1c.2O))},7b:7(C){f(C.7d){C.7d();C.9r()}1D{C.48=Y;C.9w=11}},9A:7(C,1h){d 4=1o.4(C);1H(4.1X&&(!4.1h||(4.1h.3Y()!=1h.3Y())))4=4.1X;c 4},1T:Y,5u:7(4,B,1V,1u){f(!6.1T)6.1T=[];f(4.5f){6.1T.W([4,B,1V,1u]);4.5f(B,1V,1u)}1D f(4.4i){6.1T.W([4,B,1V,1u]);4.4i(\'2I\'+B,1V)}},66:7(){f(!1o.1T)c;G(d i=0;i<1o.1T.t;i++){1o.5N.2n(6,1o.1T[i]);1o.1T[i][0]=1L}1o.1T=Y},3B:7(4,B,1V,1u){d 4=$(4);1u=1u||Y;f(B==\'5U\'&&(33.4u.I(/3x|3w|3u/)||4.4i))B=\'5K\';6.5u(4,B,1V,1u)},5N:7(4,B,1V,1u){d 4=$(4);1u=1u||Y;f(B==\'5U\'&&(33.4u.I(/3x|3w|3u/)||4.4k))B=\'5K\';f(4.5x){4.5x(B,1V,1u)}1D f(4.4k){1j{4.4k(\'2I\'+B,1V)}1s(e){}}}});f(33.4u.I(/\\88\\b/))1o.3B(1W,\'8a\',1o.66,Y);d 2d={6o:Y,4P:7(){6.6z=1W.8e||J.3R.2G||J.1c.2G||0;6.6F=1W.8g||J.3R.2O||J.1c.2O||0},6u:7(4){d 19=0,15=0;2q{19+=4.2O||0;15+=4.2G||0;4=4.1X}1H(4);c[15,19]},35:7(4){d 19=0,15=0;2q{19+=4.29||0;15+=4.2f||0;4=4.1Q}1H(4);c[15,19]},68:7(4){d 19=0,15=0;2q{19+=4.29||0;15+=4.2f||0;4=4.1Q;f(4){p=k.1R(4,\'14\');f(p==\'3T\'||p==\'2o\')1y}}1H(4);c[15,19]},1Q:7(4){f(4.1Q)c 4.1Q;f(4==J.1c)c 4;1H((4=4.1X)&&4!=J.1c)f(k.1R(4,\'14\')!=\'4G\')c 4;c J.1c},8o:7(4,x,y){f(6.6o)c 6.6r(4,x,y);6.3g=x;6.34=y;6.1t=6.35(4);c(y>=6.1t[1]&&y<6.1t[1]+4.2k&&x>=6.1t[0]&&x<6.1t[0]+4.2p)},6r:7(4,x,y){d 4S=6.6u(4);6.3g=x+4S[0]-6.6z;6.34=y+4S[1]-6.6F;6.1t=6.35(4);c(6.34>=6.1t[1]&&6.34<6.1t[1]+4.2k&&6.3g>=6.1t[0]&&6.3g<6.1t[0]+4.2p)},8E:7(3Z,4){f(!3Z)c 0;f(3Z==\'8G\')c((6.1t[1]+4.2k)-6.34)/4.2k;f(3Z==\'8K\')c((6.1t[0]+4.2p)-6.3g)/4.2p},77:7(O,Z){O=$(O);Z=$(Z);Z.l.14=\'2o\';d 2P=6.35(O);Z.l.1n=2P[1]+\'1m\';Z.l.18=2P[0]+\'1m\';Z.l.21=O.2p+\'1m\';Z.l.24=O.2k+\'1m\'},4e:7(4M){d 19=0,15=0;d 4=4M;2q{19+=4.29||0;15+=4.2f||0;f(4.1Q==J.1c)f(k.1R(4,\'14\')==\'2o\')1y}1H(4=4.1Q);4=4M;2q{19-=4.2O||0;15-=4.2G||0}1H(4=4.1X);c[15,19]},77:7(O,Z){d m=q.u({5l:11,5r:11,5B:11,5q:11,29:0,2f:0},N[2]||{});O=$(O);d p=2d.4e(O);Z=$(Z);d 2J=[0,0];d 3v=1L;f(k.1R(Z,\'14\')==\'2o\'){3v=2d.1Q(Z);2J=2d.4e(3v)}f(3v==J.1c){2J[0]-=J.1c.2f;2J[1]-=J.1c.29}f(m.5l)Z.l.18=(p[0]-2J[0]+m.2f)+\'1m\';f(m.5r)Z.l.1n=(p[1]-2J[1]+m.29)+\'1m\';f(m.5B)Z.l.21=O.2p+\'1m\';f(m.5q)Z.l.24=O.2k+\'1m\'},8b:7(4){4=$(4);f(4.l.14==\'2o\')c;2d.4P();d 2P=2d.68(4);d 1n=2P[1];d 18=2P[0];d 21=4.6m;d 24=4.6p;4.6P=18-3X(4.l.18||0);4.6I=1n-3X(4.l.1n||0);4.5k=4.l.21;4.7f=4.l.24;4.l.14=\'2o\';4.l.1n=1n+\'1m\';4.l.18=18+\'1m\';4.l.21=21+\'1m\';4.l.24=24+\'1m\'},8w:7(4){4=$(4);f(4.l.14==\'3T\')c;2d.4P();4.l.14=\'3T\';d 1n=3X(4.l.1n||0)-(4.6I||0);d 18=3X(4.l.18||0)-(4.6P||0);4.l.1n=1n+\'1m\';4.l.18=18+\'1m\';4.l.24=4.7f;4.l.21=4.5k}};f(/3x|3w|3u/.4v(33.62)){2d.35=7(4){d 19=0,15=0;2q{19+=4.29||0;15+=4.2f||0;f(4.1Q==J.1c)f(k.1R(4,\'14\')==\'2o\')1y;4=4.1Q}1H(4);c[15,19]}};',62,600,'||||element||this|function|||||return|var||if||value|||Element|style|options||iterator||Object|||length|extend|prototype|index|||new||name|event|Form|transport||for||match|document||result|Ajax|arguments|source|results|form|||Prototype|object|each|push||false|target||true|elements||position|valueL||create|left|valueT|callback|Class|body|bind|Abstract|className|Insertion|tagName|pair|try|select|url|px|top|Event|Enumerable|div|case|catch|offset|useCapture|undefined|container|getValue|break|replacement|pattern|onComplete|map|else|Array|method|property|while|initialize|frequency|range|null|include|join|key|requestHeaders|offsetParent|getStyle|parameter|observers|inspect|observer|window|parentNode|text|toArray|els|width|start|args|height|throw|request||parameters|offsetTop|methods|opt|EventObserver|Position|html|offsetLeft|type|fragments|typeof|fragment|offsetHeight|oStringList|_each|apply|absolute|offsetWidth|do|cache|decay|content|input|emptyFunction|toLowerCase|end|replace|childNodes|registerCallback|display|toString|onTimerEvent|Serializers|readyState|scrollLeft|exclusive|on|delta|lastValue|getElements|in|hash|scrollTop|offsets|stripScripts|iterable|truncation|gsub|template|initializeRange|Responders|insertContent|setTimeout|json||hidden|status|navigator|ycomp|cumulativeOffset|inject||||serialize|responders|_overflow|Methods|collect|adjacency|xcomp|innerHTML|count|split|response|responseIsSuccess|success|Template|responder|dispatchException|evalScripts|pluck|concat|Request|KHTML|parent|Safari|Konqueror|dispatch|failure|receiver|observe|Observer|TimedObserver|ScriptFragment|responseText|script|inputs|ancestor|textarea|classNames|ObjectRange|node|typeName|RegExp|camelize|none|documentElement|ClassNames|relative|right|overflow|HTMLElement|parseFloat|toUpperCase|mode||currentlyExecuting|remove|__method|Base|memo||slice|returnValue|continue|setOptions|String|classNameToRemove|_reverse|page|focus|queryComponent|Hash|attachEvent|post|detachEvent|Version|reverse|encodeURIComponent|disabled|asynchronous|eval|respondToReadyState|activeRequestCount|Complete|appVersion|test|getTransport|containers|matchingInputs|1000|header|updater|Updater|getElementsByTagName|child|responderToAdd|static|tagElements|queryComponents|defaultView|onElementEvent|css|forElement|values|visibility|prepare|mergedHash|pos|offsetcache|_madePositioned|visible|tbody|findOrStore|_nativeExtensions|createElement|digits|trues|found|prepareReplacement|before|camelizedString|insertBefore|selectNodeContents|exception|falses|criteria|classNameToAdd|params|set|destination|last|addEventListener|indexOf|inline|clear|succ|_originalWidth|setLeft|Top|ActiveXObject|scriptTag|matchOne|setHeight|setTop|without|responderToRemove|_observeAndCache|find|reset|removeEventListener|activate|findFirstElement|setRequestHeaders|setWidth|XMLHttpRequest|constructor|application|xml|onCreate|contentType|Field|onStateChange|keydown|Events|evalJSON|stopObserving|inputSelector|img|Content|evalResponse|selectOne|onreadystatechange|keypress|postBody|onException|selectMany|updateContent|setInterval|insertion|PeriodicalUpdater|userAgent|updateComplete|lastText|timer|unloadCache|registerFormCallbacks|positionedOffset|register|parentElement|children|switch|XMLHTTP|_extended|hide|checkbox|update|radio|these|outerHTML|password|clientWidth|one|includeScrollOffsets|clientHeight|nodeValue|withinIncludingScrolloffsets|Try|scrollTo|realOffset|getComputedStyle|show|currentStyle|auto|deltaX|originalPosition|originalVisibility|originalWidth|originalHeight|opera|deltaY|bottom|array|_originalTop|flatten|addMethods|lambda|Toggle|toggle|insertAdjacentHTML|_originalLeft|PeriodicalExecuter|ownerDocument|createRange|createContextualFragment|contentFromAnonymousTable|table|Before|which|matchAll|button|extractScripts|stripTags|pairString|len|collapse|appendChild|After|clone|toQueryParams|Pattern|evaluate|stop|stringValue|preventDefault|charAt|_originalHeight|substring|Bottom|pairs|Function|add|collections|javascript|detect|findAll|entries|from|first|compact|keys|merge|present|toQueryString|getInputs|Msxml2|Microsoft|unregister|disable|urlencoded|blur|300|enable|responseIsFailure|Uninitialized|Loaded|Interactive|_|get|focusFirstElement|open|send|Requested|With|Accept|overrideMimeType|Connection|close|setRequestHeader|getResponseHeader|JSON|gi|submit|Loading|Success|Failure|checked|200|selectedIndex|www|selected|bMSIE|clearTimeout|unload|absolutize|string|getElementById|pageXOffset|getElementsByClassName|pageYOffset|removeChild|replaceChild|click|getHeight|hasClassName|addClassName|removeClassName|within|cleanWhitespace|nodeType|empty|childOf|multiple|change|getPropertyValue|relativize|setStyle|getDimensions|makePositioned|undoPositioned|makeClipping|KEY_BACKSPACE|undoClipping|overlap|KEY_TAB|vertical|KEY_RETURN|KEY_ESC|KEY_LEFT|horizontal|KEY_UP|member|tr|KEY_RIGHT|0_RC_0|Number|instanceof|shift|KEY_DOWN|bindAsEventListener|call|toColorPart|KEY_DELETE|times|finally|callee|srcElement|sub|scan|truncate|isLeftClick|beforeBegin|setStartBefore|im|afterBegin|firstChild|pointerX|unescapeHTML|beforeEnd|pageX|clientX|pointerY|parseQuery|afterEnd|pageY|clientY|RangeError|setStartAfter|all|any|grep|invoke|stopPropagation|max|nextSibling|min|partition|cancelBubble|reject|sortBy|sort|findElement|zip|pop|createTextNode|escapeHTML|strip'.split('|'),0,{})
+
+} \ No newline at end of file
diff --git a/tests/benchmarks/script/sunspider/tests/string-validate-input.js b/tests/benchmarks/script/sunspider/tests/string-validate-input.js
new file mode 100644
index 0000000000..3455b3208d
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tests/string-validate-input.js
@@ -0,0 +1,89 @@
+letters = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
+numbers = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26);
+colors = new Array("FF","CC","99","66","33","00");
+
+var endResult;
+
+function doTest()
+{
+ endResult = "";
+
+ // make up email address
+ for (var k=0;k<4000;k++)
+ {
+ name = makeName(6);
+ (k%2)?email=name+"@mac.com":email=name+"(at)mac.com";
+
+ // validate the email address
+ var pattern = /^[a-zA-Z0-9\-\._]+@[a-zA-Z0-9\-_]+(\.?[a-zA-Z0-9\-_]*)\.[a-zA-Z]{2,3}$/;
+
+ if(pattern.test(email))
+ {
+ var r = email + " appears to be a valid email address.";
+ addResult(r);
+ }
+ else
+ {
+ r = email + " does NOT appear to be a valid email address.";
+ addResult(r);
+ }
+ }
+
+ // make up ZIP codes
+ for (var s=0;s<4000;s++)
+ {
+ var zipGood = true;
+ var zip = makeNumber(4);
+ (s%2)?zip=zip+"xyz":zip=zip.concat("7");
+
+ // validate the zip code
+ for (var i = 0; i < zip.length; i++) {
+ var ch = zip.charAt(i);
+ if (ch < "0" || ch > "9") {
+ zipGood = false;
+ r = zip + " contains letters.";
+ addResult(r);
+ }
+ }
+ if (zipGood && zip.length>5)
+ {
+ zipGood = false;
+ r = zip + " is longer than five characters.";
+ addResult(r);
+ }
+ if (zipGood)
+ {
+ r = zip + " appears to be a valid ZIP code.";
+ addResult(r);
+ }
+ }
+}
+
+function makeName(n)
+{
+ var tmp = "";
+ for (var i=0;i<n;i++)
+ {
+ var l = Math.floor(26*Math.random());
+ tmp += letters[l];
+ }
+ return tmp;
+}
+
+function makeNumber(n)
+{
+ var tmp = "";
+ for (var i=0;i<n;i++)
+ {
+ var l = Math.floor(9*Math.random());
+ tmp = tmp.concat(l);
+ }
+ return tmp;
+}
+
+function addResult(r)
+{
+ endResult += "\n" + r;
+}
+
+doTest();
diff --git a/tests/benchmarks/script/sunspider/tst_sunspider.cpp b/tests/benchmarks/script/sunspider/tst_sunspider.cpp
new file mode 100644
index 0000000000..0df19b6a4d
--- /dev/null
+++ b/tests/benchmarks/script/sunspider/tst_sunspider.cpp
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qtextstream.h>
+#include <QtScript/qscriptengine.h>
+#include <QtScript/qscriptvalue.h>
+
+//TESTED_FILES=
+
+static QString readFile(const QString &filename)
+{
+ QFile file(filename);
+ if (!file.open(QFile::ReadOnly))
+ return QString();
+ QTextStream stream(&file);
+ stream.setCodec("UTF-8");
+ return stream.readAll();
+}
+
+class tst_SunSpider : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_SunSpider();
+ virtual ~tst_SunSpider();
+
+public slots:
+ void init();
+ void cleanup();
+
+private slots:
+ void benchmark_data();
+ void benchmark();
+
+private:
+ QDir testsDir;
+};
+
+tst_SunSpider::tst_SunSpider()
+{
+ testsDir = QDir(":/tests");
+ if (!testsDir.exists())
+ qWarning("*** no tests/ dir!");
+}
+
+tst_SunSpider::~tst_SunSpider()
+{
+}
+
+void tst_SunSpider::init()
+{
+}
+
+void tst_SunSpider::cleanup()
+{
+}
+
+void tst_SunSpider::benchmark_data()
+{
+ QTest::addColumn<QString>("testName");
+ QFileInfoList testFileInfos = testsDir.entryInfoList(QStringList() << "*.js", QDir::Files);
+ foreach (QFileInfo tfi, testFileInfos) {
+ QString name = tfi.baseName();
+ QTest::newRow(name.toLatin1().constData()) << name;
+ }
+}
+
+void tst_SunSpider::benchmark()
+{
+ QFETCH(QString, testName);
+ QString testContents = readFile(testsDir.absoluteFilePath(testName + ".js"));
+ QVERIFY(!testContents.isEmpty());
+
+ QScriptEngine engine;
+ QBENCHMARK {
+ engine.evaluate(testContents);
+ }
+ QVERIFY(!engine.hasUncaughtException());
+}
+
+QTEST_MAIN(tst_SunSpider)
+#include "tst_sunspider.moc"
diff --git a/tests/benchmarks/script/v8/tests/README.txt b/tests/benchmarks/script/v8/tests/README.txt
new file mode 100644
index 0000000000..6676f37556
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/README.txt
@@ -0,0 +1,79 @@
+V8 Benchmark Suite
+==================
+
+This is the V8 benchmark suite: A collection of pure JavaScript
+benchmarks that we have used to tune V8. The licenses for the
+individual benchmarks are included in the JavaScript files.
+
+In addition to the benchmarks, the suite consists of the benchmark
+framework (base.js), which must be loaded before any of the individual
+benchmark files, and two benchmark runners: An HTML version (run.html)
+and a standalone JavaScript version (run.js).
+
+
+Changes From Version 1 To Version 2
+===================================
+
+For version 2 the crypto benchmark was fixed. Previously, the
+decryption stage was given plaintext as input, which resulted in an
+error. Now, the decryption stage is given the output of the
+encryption stage as input. The result is checked against the original
+plaintext. For this to give the correct results the crypto objects
+are reset for each iteration of the benchmark. In addition, the size
+of the plain text has been increased a little and the use of
+Math.random() and new Date() to build an RNG pool has been removed.
+
+Other benchmarks were fixed to do elementary verification of the
+results of their calculations. This is to avoid accidentally
+obtaining scores that are the result of an incorrect JavaScript engine
+optimization.
+
+
+Changes From Version 2 To Version 3
+===================================
+
+Version 3 adds a new benchmark, RegExp. The RegExp benchmark is
+generated by loading 50 of the most popular pages on the web and
+logging all regexp operations performed. Each operation is given a
+weight that is calculated from an estimate of the popularity of the
+pages where it occurs and the number of times it is executed while
+loading each page. Finally the literal letters in the data are
+encoded using ROT13 in a way that does not affect how the regexps
+match their input.
+
+
+Changes from Version 3 to Version 4
+===================================
+
+The Splay benchmark is a newcomer in version 4. It manipulates a
+splay tree by adding and removing data nodes, thus exercising the
+memory management subsystem of the JavaScript engine.
+
+Furthermore, all the unused parts of the Prototype library were
+removed from the RayTrace benchmark. This does not affect the running
+of the benchmark.
+
+
+Changes from Version 4 to Version 5
+===================================
+
+Removed duplicate line in random seed code, and changed the name of
+the Object.prototype.inherits function in the DeltaBlue benchmark to
+inheritsFrom to avoid name clashes when running in Chromium with
+extensions enabled.
+
+
+Changes from Version 5 to Version 6
+===================================
+
+Removed dead code from the RayTrace benchmark and fixed a couple of
+typos in the DeltaBlue implementation. Changed the Splay benchmark to
+avoid converting the same numeric key to a string over and over again
+and to avoid inserting and removing the same element repeatedly thus
+increasing pressure on the memory subsystem. Changed the RegExp
+benchmark to exercise the regular expression engine on different
+input strings.
+
+Furthermore, the benchmark runner was changed to run the benchmarks
+for at least a few times to stabilize the reported numbers on slower
+machines.
diff --git a/tests/benchmarks/script/v8/tests/base.js b/tests/benchmarks/script/v8/tests/base.js
new file mode 100644
index 0000000000..ffabf24dda
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/base.js
@@ -0,0 +1,284 @@
+// Copyright 2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// Simple framework for running the benchmark suites and
+// computing a score based on the timing measurements.
+
+
+// A benchmark has a name (string) and a function that will be run to
+// do the performance measurement. The optional setup and tearDown
+// arguments are functions that will be invoked before and after
+// running the benchmark, but the running time of these functions will
+// not be accounted for in the benchmark score.
+function Benchmark(name, run, setup, tearDown) {
+ this.name = name;
+ this.run = run;
+ this.Setup = setup ? setup : function() { };
+ this.TearDown = tearDown ? tearDown : function() { };
+}
+
+
+// Benchmark results hold the benchmark and the measured time used to
+// run the benchmark. The benchmark score is computed later once a
+// full benchmark suite has run to completion.
+function BenchmarkResult(benchmark, time) {
+ this.benchmark = benchmark;
+ this.time = time;
+}
+
+
+// Automatically convert results to numbers. Used by the geometric
+// mean computation.
+BenchmarkResult.prototype.valueOf = function() {
+ return this.time;
+}
+
+
+// Suites of benchmarks consist of a name and the set of benchmarks in
+// addition to the reference timing that the final score will be based
+// on. This way, all scores are relative to a reference run and higher
+// scores implies better performance.
+function BenchmarkSuite(name, reference, benchmarks) {
+ this.name = name;
+ this.reference = reference;
+ this.benchmarks = benchmarks;
+ BenchmarkSuite.suites.push(this);
+}
+
+
+// Keep track of all declared benchmark suites.
+BenchmarkSuite.suites = [];
+
+
+// Scores are not comparable across versions. Bump the version if
+// you're making changes that will affect that scores, e.g. if you add
+// a new benchmark or change an existing one.
+BenchmarkSuite.version = '6';
+
+
+// To make the benchmark results predictable, we replace Math.random
+// with a 100% deterministic alternative.
+Math.random = (function() {
+ var seed = 49734321;
+ return function() {
+ // Robert Jenkins' 32 bit integer hash function.
+ seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff;
+ seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff;
+ seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff;
+ seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;
+ seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff;
+ seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff;
+ return (seed & 0xfffffff) / 0x10000000;
+ };
+})();
+
+
+// Runs all registered benchmark suites and optionally yields between
+// each individual benchmark to avoid running for too long in the
+// context of browsers. Once done, the final score is reported to the
+// runner.
+BenchmarkSuite.RunSuites = function(runner) {
+ var continuation = null;
+ var suites = BenchmarkSuite.suites;
+ var length = suites.length;
+ BenchmarkSuite.scores = [];
+ var index = 0;
+ function RunStep() {
+ while (continuation || index < length) {
+ if (continuation) {
+ continuation = continuation();
+ } else {
+ var suite = suites[index++];
+ if (runner.NotifyStart) runner.NotifyStart(suite.name);
+ continuation = suite.RunStep(runner);
+ }
+ if (continuation && typeof window != 'undefined' && window.setTimeout) {
+ window.setTimeout(RunStep, 25);
+ return;
+ }
+ }
+ if (runner.NotifyScore) {
+ var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores);
+ var formatted = BenchmarkSuite.FormatScore(100 * score);
+ runner.NotifyScore(formatted);
+ }
+ }
+ RunStep();
+}
+
+
+// Counts the total number of registered benchmarks. Useful for
+// showing progress as a percentage.
+BenchmarkSuite.CountBenchmarks = function() {
+ var result = 0;
+ var suites = BenchmarkSuite.suites;
+ for (var i = 0; i < suites.length; i++) {
+ result += suites[i].benchmarks.length;
+ }
+ return result;
+}
+
+
+// Computes the geometric mean of a set of numbers.
+BenchmarkSuite.GeometricMean = function(numbers) {
+ var log = 0;
+ for (var i = 0; i < numbers.length; i++) {
+ log += Math.log(numbers[i]);
+ }
+ return Math.pow(Math.E, log / numbers.length);
+}
+
+
+// Converts a score value to a string with at least three significant
+// digits.
+BenchmarkSuite.FormatScore = function(value) {
+ if (value > 100) {
+ return value.toFixed(0);
+ } else {
+ return value.toPrecision(3);
+ }
+}
+
+// Notifies the runner that we're done running a single benchmark in
+// the benchmark suite. This can be useful to report progress.
+BenchmarkSuite.prototype.NotifyStep = function(result) {
+ this.results.push(result);
+ if (this.runner.NotifyStep) this.runner.NotifyStep(result.benchmark.name);
+}
+
+
+// Notifies the runner that we're done with running a suite and that
+// we have a result which can be reported to the user if needed.
+BenchmarkSuite.prototype.NotifyResult = function() {
+ var mean = BenchmarkSuite.GeometricMean(this.results);
+ var score = this.reference / mean;
+ BenchmarkSuite.scores.push(score);
+ if (this.runner.NotifyResult) {
+ var formatted = BenchmarkSuite.FormatScore(100 * score);
+ this.runner.NotifyResult(this.name, formatted);
+ }
+}
+
+
+// Notifies the runner that running a benchmark resulted in an error.
+BenchmarkSuite.prototype.NotifyError = function(error) {
+ if (this.runner.NotifyError) {
+ this.runner.NotifyError(this.name, error);
+ }
+ if (this.runner.NotifyStep) {
+ this.runner.NotifyStep(this.name);
+ }
+}
+
+
+// Runs a single benchmark for at least a second and computes the
+// average time it takes to run a single iteration.
+BenchmarkSuite.prototype.RunSingleBenchmark = function(benchmark, data) {
+ function Measure(data) {
+ var elapsed = 0;
+ var start = new Date();
+ for (var n = 0; elapsed < 1000; n++) {
+ benchmark.run();
+ elapsed = new Date() - start;
+ }
+ if (data != null) {
+ data.runs += n;
+ data.elapsed += elapsed;
+ }
+ }
+
+ if (data == null) {
+ // Measure the benchmark once for warm up and throw the result
+ // away. Return a fresh data object.
+ Measure(null);
+ return { runs: 0, elapsed: 0 };
+ } else {
+ Measure(data);
+ // If we've run too few iterations, we continue for another second.
+ if (data.runs < 32) return data;
+ var usec = (data.elapsed * 1000) / data.runs;
+ this.NotifyStep(new BenchmarkResult(benchmark, usec));
+ return null;
+ }
+}
+
+
+// This function starts running a suite, but stops between each
+// individual benchmark in the suite and returns a continuation
+// function which can be invoked to run the next benchmark. Once the
+// last benchmark has been executed, null is returned.
+BenchmarkSuite.prototype.RunStep = function(runner) {
+ this.results = [];
+ this.runner = runner;
+ var length = this.benchmarks.length;
+ var index = 0;
+ var suite = this;
+ var data;
+
+ // Run the setup, the actual benchmark, and the tear down in three
+ // separate steps to allow the framework to yield between any of the
+ // steps.
+
+ function RunNextSetup() {
+ if (index < length) {
+ try {
+ suite.benchmarks[index].Setup();
+ } catch (e) {
+ suite.NotifyError(e);
+ return null;
+ }
+ return RunNextBenchmark;
+ }
+ suite.NotifyResult();
+ return null;
+ }
+
+ function RunNextBenchmark() {
+ try {
+ data = suite.RunSingleBenchmark(suite.benchmarks[index], data);
+ } catch (e) {
+ suite.NotifyError(e);
+ return null;
+ }
+ // If data is null, we're done with this benchmark.
+ return (data == null) ? RunNextTearDown : RunNextBenchmark();
+ }
+
+ function RunNextTearDown() {
+ try {
+ suite.benchmarks[index++].TearDown();
+ } catch (e) {
+ suite.NotifyError(e);
+ return null;
+ }
+ return RunNextSetup;
+ }
+
+ // Start out running the setup.
+ return RunNextSetup();
+}
diff --git a/tests/benchmarks/script/v8/tests/crypto.js b/tests/benchmarks/script/v8/tests/crypto.js
new file mode 100644
index 0000000000..ffa69b53bb
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/crypto.js
@@ -0,0 +1,1698 @@
+/*
+ * Copyright (c) 2003-2005 Tom Wu
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
+ * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * In addition, the following condition applies:
+ *
+ * All redistributions must retain an intact copy of this copyright notice
+ * and disclaimer.
+ */
+
+
+// The code has been adapted for use as a benchmark by Google.
+var Crypto = new BenchmarkSuite('Crypto', 266181, [
+ new Benchmark("Encrypt", encrypt),
+ new Benchmark("Decrypt", decrypt)
+]);
+
+
+// Basic JavaScript BN library - subset useful for RSA encryption.
+
+// Bits per digit
+var dbits;
+var BI_DB;
+var BI_DM;
+var BI_DV;
+
+var BI_FP;
+var BI_FV;
+var BI_F1;
+var BI_F2;
+
+// JavaScript engine analysis
+var canary = 0xdeadbeefcafe;
+var j_lm = ((canary&0xffffff)==0xefcafe);
+
+// (public) Constructor
+function BigInteger(a,b,c) {
+ this.array = new Array();
+ if(a != null)
+ if("number" == typeof a) this.fromNumber(a,b,c);
+ else if(b == null && "string" != typeof a) this.fromString(a,256);
+ else this.fromString(a,b);
+}
+
+// return new, unset BigInteger
+function nbi() { return new BigInteger(null); }
+
+// am: Compute w_j += (x*this_i), propagate carries,
+// c is initial carry, returns final carry.
+// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
+// We need to select the fastest one that works in this environment.
+
+// am1: use a single mult and divide to get the high bits,
+// max digit bits should be 26 because
+// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
+function am1(i,x,w,j,c,n) {
+ var this_array = this.array;
+ var w_array = w.array;
+ while(--n >= 0) {
+ var v = x*this_array[i++]+w_array[j]+c;
+ c = Math.floor(v/0x4000000);
+ w_array[j++] = v&0x3ffffff;
+ }
+ return c;
+}
+
+// am2 avoids a big mult-and-extract completely.
+// Max digit bits should be <= 30 because we do bitwise ops
+// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
+function am2(i,x,w,j,c,n) {
+ var this_array = this.array;
+ var w_array = w.array;
+ var xl = x&0x7fff, xh = x>>15;
+ while(--n >= 0) {
+ var l = this_array[i]&0x7fff;
+ var h = this_array[i++]>>15;
+ var m = xh*l+h*xl;
+ l = xl*l+((m&0x7fff)<<15)+w_array[j]+(c&0x3fffffff);
+ c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
+ w_array[j++] = l&0x3fffffff;
+ }
+ return c;
+}
+
+// Alternately, set max digit bits to 28 since some
+// browsers slow down when dealing with 32-bit numbers.
+function am3(i,x,w,j,c,n) {
+ var this_array = this.array;
+ var w_array = w.array;
+
+ var xl = x&0x3fff, xh = x>>14;
+ while(--n >= 0) {
+ var l = this_array[i]&0x3fff;
+ var h = this_array[i++]>>14;
+ var m = xh*l+h*xl;
+ l = xl*l+((m&0x3fff)<<14)+w_array[j]+c;
+ c = (l>>28)+(m>>14)+xh*h;
+ w_array[j++] = l&0xfffffff;
+ }
+ return c;
+}
+
+// This is tailored to VMs with 2-bit tagging. It makes sure
+// that all the computations stay within the 29 bits available.
+function am4(i,x,w,j,c,n) {
+ var this_array = this.array;
+ var w_array = w.array;
+
+ var xl = x&0x1fff, xh = x>>13;
+ while(--n >= 0) {
+ var l = this_array[i]&0x1fff;
+ var h = this_array[i++]>>13;
+ var m = xh*l+h*xl;
+ l = xl*l+((m&0x1fff)<<13)+w_array[j]+c;
+ c = (l>>26)+(m>>13)+xh*h;
+ w_array[j++] = l&0x3ffffff;
+ }
+ return c;
+}
+
+// am3/28 is best for SM, Rhino, but am4/26 is best for v8.
+// Kestrel (Opera 9.5) gets its best result with am4/26.
+// IE7 does 9% better with am3/28 than with am4/26.
+// Firefox (SM) gets 10% faster with am3/28 than with am4/26.
+
+setupEngine = function(fn, bits) {
+ BigInteger.prototype.am = fn;
+ dbits = bits;
+
+ BI_DB = dbits;
+ BI_DM = ((1<<dbits)-1);
+ BI_DV = (1<<dbits);
+
+ BI_FP = 52;
+ BI_FV = Math.pow(2,BI_FP);
+ BI_F1 = BI_FP-dbits;
+ BI_F2 = 2*dbits-BI_FP;
+}
+
+
+// Digit conversions
+var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
+var BI_RC = new Array();
+var rr,vv;
+rr = "0".charCodeAt(0);
+for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
+rr = "a".charCodeAt(0);
+for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
+rr = "A".charCodeAt(0);
+for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
+
+function int2char(n) { return BI_RM.charAt(n); }
+function intAt(s,i) {
+ var c = BI_RC[s.charCodeAt(i)];
+ return (c==null)?-1:c;
+}
+
+// (protected) copy this to r
+function bnpCopyTo(r) {
+ var this_array = this.array;
+ var r_array = r.array;
+
+ for(var i = this.t-1; i >= 0; --i) r_array[i] = this_array[i];
+ r.t = this.t;
+ r.s = this.s;
+}
+
+// (protected) set from integer value x, -DV <= x < DV
+function bnpFromInt(x) {
+ var this_array = this.array;
+ this.t = 1;
+ this.s = (x<0)?-1:0;
+ if(x > 0) this_array[0] = x;
+ else if(x < -1) this_array[0] = x+DV;
+ else this.t = 0;
+}
+
+// return bigint initialized to value
+function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
+
+// (protected) set from string and radix
+function bnpFromString(s,b) {
+ var this_array = this.array;
+ var k;
+ if(b == 16) k = 4;
+ else if(b == 8) k = 3;
+ else if(b == 256) k = 8; // byte array
+ else if(b == 2) k = 1;
+ else if(b == 32) k = 5;
+ else if(b == 4) k = 2;
+ else { this.fromRadix(s,b); return; }
+ this.t = 0;
+ this.s = 0;
+ var i = s.length, mi = false, sh = 0;
+ while(--i >= 0) {
+ var x = (k==8)?s[i]&0xff:intAt(s,i);
+ if(x < 0) {
+ if(s.charAt(i) == "-") mi = true;
+ continue;
+ }
+ mi = false;
+ if(sh == 0)
+ this_array[this.t++] = x;
+ else if(sh+k > BI_DB) {
+ this_array[this.t-1] |= (x&((1<<(BI_DB-sh))-1))<<sh;
+ this_array[this.t++] = (x>>(BI_DB-sh));
+ }
+ else
+ this_array[this.t-1] |= x<<sh;
+ sh += k;
+ if(sh >= BI_DB) sh -= BI_DB;
+ }
+ if(k == 8 && (s[0]&0x80) != 0) {
+ this.s = -1;
+ if(sh > 0) this_array[this.t-1] |= ((1<<(BI_DB-sh))-1)<<sh;
+ }
+ this.clamp();
+ if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+// (protected) clamp off excess high words
+function bnpClamp() {
+ var this_array = this.array;
+ var c = this.s&BI_DM;
+ while(this.t > 0 && this_array[this.t-1] == c) --this.t;
+}
+
+// (public) return string representation in given radix
+function bnToString(b) {
+ var this_array = this.array;
+ if(this.s < 0) return "-"+this.negate().toString(b);
+ var k;
+ if(b == 16) k = 4;
+ else if(b == 8) k = 3;
+ else if(b == 2) k = 1;
+ else if(b == 32) k = 5;
+ else if(b == 4) k = 2;
+ else return this.toRadix(b);
+ var km = (1<<k)-1, d, m = false, r = "", i = this.t;
+ var p = BI_DB-(i*BI_DB)%k;
+ if(i-- > 0) {
+ if(p < BI_DB && (d = this_array[i]>>p) > 0) { m = true; r = int2char(d); }
+ while(i >= 0) {
+ if(p < k) {
+ d = (this_array[i]&((1<<p)-1))<<(k-p);
+ d |= this_array[--i]>>(p+=BI_DB-k);
+ }
+ else {
+ d = (this_array[i]>>(p-=k))&km;
+ if(p <= 0) { p += BI_DB; --i; }
+ }
+ if(d > 0) m = true;
+ if(m) r += int2char(d);
+ }
+ }
+ return m?r:"0";
+}
+
+// (public) -this
+function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
+
+// (public) |this|
+function bnAbs() { return (this.s<0)?this.negate():this; }
+
+// (public) return + if this > a, - if this < a, 0 if equal
+function bnCompareTo(a) {
+ var this_array = this.array;
+ var a_array = a.array;
+
+ var r = this.s-a.s;
+ if(r != 0) return r;
+ var i = this.t;
+ r = i-a.t;
+ if(r != 0) return r;
+ while(--i >= 0) if((r=this_array[i]-a_array[i]) != 0) return r;
+ return 0;
+}
+
+// returns bit length of the integer x
+function nbits(x) {
+ var r = 1, t;
+ if((t=x>>>16) != 0) { x = t; r += 16; }
+ if((t=x>>8) != 0) { x = t; r += 8; }
+ if((t=x>>4) != 0) { x = t; r += 4; }
+ if((t=x>>2) != 0) { x = t; r += 2; }
+ if((t=x>>1) != 0) { x = t; r += 1; }
+ return r;
+}
+
+// (public) return the number of bits in "this"
+function bnBitLength() {
+ var this_array = this.array;
+ if(this.t <= 0) return 0;
+ return BI_DB*(this.t-1)+nbits(this_array[this.t-1]^(this.s&BI_DM));
+}
+
+// (protected) r = this << n*DB
+function bnpDLShiftTo(n,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ var i;
+ for(i = this.t-1; i >= 0; --i) r_array[i+n] = this_array[i];
+ for(i = n-1; i >= 0; --i) r_array[i] = 0;
+ r.t = this.t+n;
+ r.s = this.s;
+}
+
+// (protected) r = this >> n*DB
+function bnpDRShiftTo(n,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ for(var i = n; i < this.t; ++i) r_array[i-n] = this_array[i];
+ r.t = Math.max(this.t-n,0);
+ r.s = this.s;
+}
+
+// (protected) r = this << n
+function bnpLShiftTo(n,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ var bs = n%BI_DB;
+ var cbs = BI_DB-bs;
+ var bm = (1<<cbs)-1;
+ var ds = Math.floor(n/BI_DB), c = (this.s<<bs)&BI_DM, i;
+ for(i = this.t-1; i >= 0; --i) {
+ r_array[i+ds+1] = (this_array[i]>>cbs)|c;
+ c = (this_array[i]&bm)<<bs;
+ }
+ for(i = ds-1; i >= 0; --i) r_array[i] = 0;
+ r_array[ds] = c;
+ r.t = this.t+ds+1;
+ r.s = this.s;
+ r.clamp();
+}
+
+// (protected) r = this >> n
+function bnpRShiftTo(n,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ r.s = this.s;
+ var ds = Math.floor(n/BI_DB);
+ if(ds >= this.t) { r.t = 0; return; }
+ var bs = n%BI_DB;
+ var cbs = BI_DB-bs;
+ var bm = (1<<bs)-1;
+ r_array[0] = this_array[ds]>>bs;
+ for(var i = ds+1; i < this.t; ++i) {
+ r_array[i-ds-1] |= (this_array[i]&bm)<<cbs;
+ r_array[i-ds] = this_array[i]>>bs;
+ }
+ if(bs > 0) r_array[this.t-ds-1] |= (this.s&bm)<<cbs;
+ r.t = this.t-ds;
+ r.clamp();
+}
+
+// (protected) r = this - a
+function bnpSubTo(a,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ var a_array = a.array;
+ var i = 0, c = 0, m = Math.min(a.t,this.t);
+ while(i < m) {
+ c += this_array[i]-a_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ if(a.t < this.t) {
+ c -= a.s;
+ while(i < this.t) {
+ c += this_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ c += this.s;
+ }
+ else {
+ c += this.s;
+ while(i < a.t) {
+ c -= a_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ c -= a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c < -1) r_array[i++] = BI_DV+c;
+ else if(c > 0) r_array[i++] = c;
+ r.t = i;
+ r.clamp();
+}
+
+// (protected) r = this * a, r != this,a (HAC 14.12)
+// "this" should be the larger one if appropriate.
+function bnpMultiplyTo(a,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ var x = this.abs(), y = a.abs();
+ var y_array = y.array;
+
+ var i = x.t;
+ r.t = i+y.t;
+ while(--i >= 0) r_array[i] = 0;
+ for(i = 0; i < y.t; ++i) r_array[i+x.t] = x.am(0,y_array[i],r,i,0,x.t);
+ r.s = 0;
+ r.clamp();
+ if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
+}
+
+// (protected) r = this^2, r != this (HAC 14.16)
+function bnpSquareTo(r) {
+ var x = this.abs();
+ var x_array = x.array;
+ var r_array = r.array;
+
+ var i = r.t = 2*x.t;
+ while(--i >= 0) r_array[i] = 0;
+ for(i = 0; i < x.t-1; ++i) {
+ var c = x.am(i,x_array[i],r,2*i,0,1);
+ if((r_array[i+x.t]+=x.am(i+1,2*x_array[i],r,2*i+1,c,x.t-i-1)) >= BI_DV) {
+ r_array[i+x.t] -= BI_DV;
+ r_array[i+x.t+1] = 1;
+ }
+ }
+ if(r.t > 0) r_array[r.t-1] += x.am(i,x_array[i],r,2*i,0,1);
+ r.s = 0;
+ r.clamp();
+}
+
+// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
+// r != q, this != m. q or r may be null.
+function bnpDivRemTo(m,q,r) {
+ var pm = m.abs();
+ if(pm.t <= 0) return;
+ var pt = this.abs();
+ if(pt.t < pm.t) {
+ if(q != null) q.fromInt(0);
+ if(r != null) this.copyTo(r);
+ return;
+ }
+ if(r == null) r = nbi();
+ var y = nbi(), ts = this.s, ms = m.s;
+ var pm_array = pm.array;
+ var nsh = BI_DB-nbits(pm_array[pm.t-1]); // normalize modulus
+ if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
+ else { pm.copyTo(y); pt.copyTo(r); }
+ var ys = y.t;
+
+ var y_array = y.array;
+ var y0 = y_array[ys-1];
+ if(y0 == 0) return;
+ var yt = y0*(1<<BI_F1)+((ys>1)?y_array[ys-2]>>BI_F2:0);
+ var d1 = BI_FV/yt, d2 = (1<<BI_F1)/yt, e = 1<<BI_F2;
+ var i = r.t, j = i-ys, t = (q==null)?nbi():q;
+ y.dlShiftTo(j,t);
+
+ var r_array = r.array;
+ if(r.compareTo(t) >= 0) {
+ r_array[r.t++] = 1;
+ r.subTo(t,r);
+ }
+ BigInteger.ONE.dlShiftTo(ys,t);
+ t.subTo(y,y); // "negative" y so we can replace sub with am later
+ while(y.t < ys) y_array[y.t++] = 0;
+ while(--j >= 0) {
+ // Estimate quotient digit
+ var qd = (r_array[--i]==y0)?BI_DM:Math.floor(r_array[i]*d1+(r_array[i-1]+e)*d2);
+ if((r_array[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
+ y.dlShiftTo(j,t);
+ r.subTo(t,r);
+ while(r_array[i] < --qd) r.subTo(t,r);
+ }
+ }
+ if(q != null) {
+ r.drShiftTo(ys,q);
+ if(ts != ms) BigInteger.ZERO.subTo(q,q);
+ }
+ r.t = ys;
+ r.clamp();
+ if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
+ if(ts < 0) BigInteger.ZERO.subTo(r,r);
+}
+
+// (public) this mod a
+function bnMod(a) {
+ var r = nbi();
+ this.abs().divRemTo(a,null,r);
+ if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
+ return r;
+}
+
+// Modular reduction using "classic" algorithm
+function Classic(m) { this.m = m; }
+function cConvert(x) {
+ if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
+ else return x;
+}
+function cRevert(x) { return x; }
+function cReduce(x) { x.divRemTo(this.m,null,x); }
+function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+Classic.prototype.convert = cConvert;
+Classic.prototype.revert = cRevert;
+Classic.prototype.reduce = cReduce;
+Classic.prototype.mulTo = cMulTo;
+Classic.prototype.sqrTo = cSqrTo;
+
+// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
+// justification:
+// xy == 1 (mod m)
+// xy = 1+km
+// xy(2-xy) = (1+km)(1-km)
+// x[y(2-xy)] = 1-k^2m^2
+// x[y(2-xy)] == 1 (mod m^2)
+// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
+// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
+// JS multiply "overflows" differently from C/C++, so care is needed here.
+function bnpInvDigit() {
+ var this_array = this.array;
+ if(this.t < 1) return 0;
+ var x = this_array[0];
+ if((x&1) == 0) return 0;
+ var y = x&3; // y == 1/x mod 2^2
+ y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
+ y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
+ y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
+ // last step - calculate inverse mod DV directly;
+ // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
+ y = (y*(2-x*y%BI_DV))%BI_DV; // y == 1/x mod 2^dbits
+ // we really want the negative inverse, and -DV < y < DV
+ return (y>0)?BI_DV-y:-y;
+}
+
+// Montgomery reduction
+function Montgomery(m) {
+ this.m = m;
+ this.mp = m.invDigit();
+ this.mpl = this.mp&0x7fff;
+ this.mph = this.mp>>15;
+ this.um = (1<<(BI_DB-15))-1;
+ this.mt2 = 2*m.t;
+}
+
+// xR mod m
+function montConvert(x) {
+ var r = nbi();
+ x.abs().dlShiftTo(this.m.t,r);
+ r.divRemTo(this.m,null,r);
+ if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
+ return r;
+}
+
+// x/R mod m
+function montRevert(x) {
+ var r = nbi();
+ x.copyTo(r);
+ this.reduce(r);
+ return r;
+}
+
+// x = x/R mod m (HAC 14.32)
+function montReduce(x) {
+ var x_array = x.array;
+ while(x.t <= this.mt2) // pad x so am has enough room later
+ x_array[x.t++] = 0;
+ for(var i = 0; i < this.m.t; ++i) {
+ // faster way of calculating u0 = x[i]*mp mod DV
+ var j = x_array[i]&0x7fff;
+ var u0 = (j*this.mpl+(((j*this.mph+(x_array[i]>>15)*this.mpl)&this.um)<<15))&BI_DM;
+ // use am to combine the multiply-shift-add into one call
+ j = i+this.m.t;
+ x_array[j] += this.m.am(0,u0,x,i,0,this.m.t);
+ // propagate carry
+ while(x_array[j] >= BI_DV) { x_array[j] -= BI_DV; x_array[++j]++; }
+ }
+ x.clamp();
+ x.drShiftTo(this.m.t,x);
+ if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = "x^2/R mod m"; x != r
+function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = "xy/R mod m"; x,y != r
+function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Montgomery.prototype.convert = montConvert;
+Montgomery.prototype.revert = montRevert;
+Montgomery.prototype.reduce = montReduce;
+Montgomery.prototype.mulTo = montMulTo;
+Montgomery.prototype.sqrTo = montSqrTo;
+
+// (protected) true iff this is even
+function bnpIsEven() {
+ var this_array = this.array;
+ return ((this.t>0)?(this_array[0]&1):this.s) == 0;
+}
+
+// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
+function bnpExp(e,z) {
+ if(e > 0xffffffff || e < 1) return BigInteger.ONE;
+ var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
+ g.copyTo(r);
+ while(--i >= 0) {
+ z.sqrTo(r,r2);
+ if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
+ else { var t = r; r = r2; r2 = t; }
+ }
+ return z.revert(r);
+}
+
+// (public) this^e % m, 0 <= e < 2^32
+function bnModPowInt(e,m) {
+ var z;
+ if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
+ return this.exp(e,z);
+}
+
+// protected
+BigInteger.prototype.copyTo = bnpCopyTo;
+BigInteger.prototype.fromInt = bnpFromInt;
+BigInteger.prototype.fromString = bnpFromString;
+BigInteger.prototype.clamp = bnpClamp;
+BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
+BigInteger.prototype.drShiftTo = bnpDRShiftTo;
+BigInteger.prototype.lShiftTo = bnpLShiftTo;
+BigInteger.prototype.rShiftTo = bnpRShiftTo;
+BigInteger.prototype.subTo = bnpSubTo;
+BigInteger.prototype.multiplyTo = bnpMultiplyTo;
+BigInteger.prototype.squareTo = bnpSquareTo;
+BigInteger.prototype.divRemTo = bnpDivRemTo;
+BigInteger.prototype.invDigit = bnpInvDigit;
+BigInteger.prototype.isEven = bnpIsEven;
+BigInteger.prototype.exp = bnpExp;
+
+// public
+BigInteger.prototype.toString = bnToString;
+BigInteger.prototype.negate = bnNegate;
+BigInteger.prototype.abs = bnAbs;
+BigInteger.prototype.compareTo = bnCompareTo;
+BigInteger.prototype.bitLength = bnBitLength;
+BigInteger.prototype.mod = bnMod;
+BigInteger.prototype.modPowInt = bnModPowInt;
+
+// "constants"
+BigInteger.ZERO = nbv(0);
+BigInteger.ONE = nbv(1);
+// Copyright (c) 2005 Tom Wu
+// All Rights Reserved.
+// See "LICENSE" for details.
+
+// Extended JavaScript BN functions, required for RSA private ops.
+
+// (public)
+function bnClone() { var r = nbi(); this.copyTo(r); return r; }
+
+// (public) return value as integer
+function bnIntValue() {
+ var this_array = this.array;
+ if(this.s < 0) {
+ if(this.t == 1) return this_array[0]-BI_DV;
+ else if(this.t == 0) return -1;
+ }
+ else if(this.t == 1) return this_array[0];
+ else if(this.t == 0) return 0;
+ // assumes 16 < DB < 32
+ return ((this_array[1]&((1<<(32-BI_DB))-1))<<BI_DB)|this_array[0];
+}
+
+// (public) return value as byte
+function bnByteValue() {
+ var this_array = this.array;
+ return (this.t==0)?this.s:(this_array[0]<<24)>>24;
+}
+
+// (public) return value as short (assumes DB>=16)
+function bnShortValue() {
+ var this_array = this.array;
+ return (this.t==0)?this.s:(this_array[0]<<16)>>16;
+}
+
+// (protected) return x s.t. r^x < DV
+function bnpChunkSize(r) { return Math.floor(Math.LN2*BI_DB/Math.log(r)); }
+
+// (public) 0 if this == 0, 1 if this > 0
+function bnSigNum() {
+ var this_array = this.array;
+ if(this.s < 0) return -1;
+ else if(this.t <= 0 || (this.t == 1 && this_array[0] <= 0)) return 0;
+ else return 1;
+}
+
+// (protected) convert to radix string
+function bnpToRadix(b) {
+ if(b == null) b = 10;
+ if(this.signum() == 0 || b < 2 || b > 36) return "0";
+ var cs = this.chunkSize(b);
+ var a = Math.pow(b,cs);
+ var d = nbv(a), y = nbi(), z = nbi(), r = "";
+ this.divRemTo(d,y,z);
+ while(y.signum() > 0) {
+ r = (a+z.intValue()).toString(b).substr(1) + r;
+ y.divRemTo(d,y,z);
+ }
+ return z.intValue().toString(b) + r;
+}
+
+// (protected) convert from radix string
+function bnpFromRadix(s,b) {
+ this.fromInt(0);
+ if(b == null) b = 10;
+ var cs = this.chunkSize(b);
+ var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
+ for(var i = 0; i < s.length; ++i) {
+ var x = intAt(s,i);
+ if(x < 0) {
+ if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
+ continue;
+ }
+ w = b*w+x;
+ if(++j >= cs) {
+ this.dMultiply(d);
+ this.dAddOffset(w,0);
+ j = 0;
+ w = 0;
+ }
+ }
+ if(j > 0) {
+ this.dMultiply(Math.pow(b,j));
+ this.dAddOffset(w,0);
+ }
+ if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+// (protected) alternate constructor
+function bnpFromNumber(a,b,c) {
+ if("number" == typeof b) {
+ // new BigInteger(int,int,RNG)
+ if(a < 2) this.fromInt(1);
+ else {
+ this.fromNumber(a,c);
+ if(!this.testBit(a-1)) // force MSB set
+ this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+ if(this.isEven()) this.dAddOffset(1,0); // force odd
+ while(!this.isProbablePrime(b)) {
+ this.dAddOffset(2,0);
+ if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
+ }
+ }
+ }
+ else {
+ // new BigInteger(int,RNG)
+ var x = new Array(), t = a&7;
+ x.length = (a>>3)+1;
+ b.nextBytes(x);
+ if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
+ this.fromString(x,256);
+ }
+}
+
+// (public) convert to bigendian byte array
+function bnToByteArray() {
+ var this_array = this.array;
+ var i = this.t, r = new Array();
+ r[0] = this.s;
+ var p = BI_DB-(i*BI_DB)%8, d, k = 0;
+ if(i-- > 0) {
+ if(p < BI_DB && (d = this_array[i]>>p) != (this.s&BI_DM)>>p)
+ r[k++] = d|(this.s<<(BI_DB-p));
+ while(i >= 0) {
+ if(p < 8) {
+ d = (this_array[i]&((1<<p)-1))<<(8-p);
+ d |= this_array[--i]>>(p+=BI_DB-8);
+ }
+ else {
+ d = (this_array[i]>>(p-=8))&0xff;
+ if(p <= 0) { p += BI_DB; --i; }
+ }
+ if((d&0x80) != 0) d |= -256;
+ if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
+ if(k > 0 || d != this.s) r[k++] = d;
+ }
+ }
+ return r;
+}
+
+function bnEquals(a) { return(this.compareTo(a)==0); }
+function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
+function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
+
+// (protected) r = this op a (bitwise)
+function bnpBitwiseTo(a,op,r) {
+ var this_array = this.array;
+ var a_array = a.array;
+ var r_array = r.array;
+ var i, f, m = Math.min(a.t,this.t);
+ for(i = 0; i < m; ++i) r_array[i] = op(this_array[i],a_array[i]);
+ if(a.t < this.t) {
+ f = a.s&BI_DM;
+ for(i = m; i < this.t; ++i) r_array[i] = op(this_array[i],f);
+ r.t = this.t;
+ }
+ else {
+ f = this.s&BI_DM;
+ for(i = m; i < a.t; ++i) r_array[i] = op(f,a_array[i]);
+ r.t = a.t;
+ }
+ r.s = op(this.s,a.s);
+ r.clamp();
+}
+
+// (public) this & a
+function op_and(x,y) { return x&y; }
+function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
+
+// (public) this | a
+function op_or(x,y) { return x|y; }
+function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
+
+// (public) this ^ a
+function op_xor(x,y) { return x^y; }
+function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
+
+// (public) this & ~a
+function op_andnot(x,y) { return x&~y; }
+function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
+
+// (public) ~this
+function bnNot() {
+ var this_array = this.array;
+ var r = nbi();
+ var r_array = r.array;
+
+ for(var i = 0; i < this.t; ++i) r_array[i] = BI_DM&~this_array[i];
+ r.t = this.t;
+ r.s = ~this.s;
+ return r;
+}
+
+// (public) this << n
+function bnShiftLeft(n) {
+ var r = nbi();
+ if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
+ return r;
+}
+
+// (public) this >> n
+function bnShiftRight(n) {
+ var r = nbi();
+ if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
+ return r;
+}
+
+// return index of lowest 1-bit in x, x < 2^31
+function lbit(x) {
+ if(x == 0) return -1;
+ var r = 0;
+ if((x&0xffff) == 0) { x >>= 16; r += 16; }
+ if((x&0xff) == 0) { x >>= 8; r += 8; }
+ if((x&0xf) == 0) { x >>= 4; r += 4; }
+ if((x&3) == 0) { x >>= 2; r += 2; }
+ if((x&1) == 0) ++r;
+ return r;
+}
+
+// (public) returns index of lowest 1-bit (or -1 if none)
+function bnGetLowestSetBit() {
+ var this_array = this.array;
+ for(var i = 0; i < this.t; ++i)
+ if(this_array[i] != 0) return i*BI_DB+lbit(this_array[i]);
+ if(this.s < 0) return this.t*BI_DB;
+ return -1;
+}
+
+// return number of 1 bits in x
+function cbit(x) {
+ var r = 0;
+ while(x != 0) { x &= x-1; ++r; }
+ return r;
+}
+
+// (public) return number of set bits
+function bnBitCount() {
+ var r = 0, x = this.s&BI_DM;
+ for(var i = 0; i < this.t; ++i) r += cbit(this_array[i]^x);
+ return r;
+}
+
+// (public) true iff nth bit is set
+function bnTestBit(n) {
+ var this_array = this.array;
+ var j = Math.floor(n/BI_DB);
+ if(j >= this.t) return(this.s!=0);
+ return((this_array[j]&(1<<(n%BI_DB)))!=0);
+}
+
+// (protected) this op (1<<n)
+function bnpChangeBit(n,op) {
+ var r = BigInteger.ONE.shiftLeft(n);
+ this.bitwiseTo(r,op,r);
+ return r;
+}
+
+// (public) this | (1<<n)
+function bnSetBit(n) { return this.changeBit(n,op_or); }
+
+// (public) this & ~(1<<n)
+function bnClearBit(n) { return this.changeBit(n,op_andnot); }
+
+// (public) this ^ (1<<n)
+function bnFlipBit(n) { return this.changeBit(n,op_xor); }
+
+// (protected) r = this + a
+function bnpAddTo(a,r) {
+ var this_array = this.array;
+ var a_array = a.array;
+ var r_array = r.array;
+ var i = 0, c = 0, m = Math.min(a.t,this.t);
+ while(i < m) {
+ c += this_array[i]+a_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ if(a.t < this.t) {
+ c += a.s;
+ while(i < this.t) {
+ c += this_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ c += this.s;
+ }
+ else {
+ c += this.s;
+ while(i < a.t) {
+ c += a_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ c += a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c > 0) r_array[i++] = c;
+ else if(c < -1) r_array[i++] = BI_DV+c;
+ r.t = i;
+ r.clamp();
+}
+
+// (public) this + a
+function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
+
+// (public) this - a
+function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
+
+// (public) this * a
+function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
+
+// (public) this / a
+function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
+
+// (public) this % a
+function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
+
+// (public) [this/a,this%a]
+function bnDivideAndRemainder(a) {
+ var q = nbi(), r = nbi();
+ this.divRemTo(a,q,r);
+ return new Array(q,r);
+}
+
+// (protected) this *= n, this >= 0, 1 < n < DV
+function bnpDMultiply(n) {
+ var this_array = this.array;
+ this_array[this.t] = this.am(0,n-1,this,0,0,this.t);
+ ++this.t;
+ this.clamp();
+}
+
+// (protected) this += n << w words, this >= 0
+function bnpDAddOffset(n,w) {
+ var this_array = this.array;
+ while(this.t <= w) this_array[this.t++] = 0;
+ this_array[w] += n;
+ while(this_array[w] >= BI_DV) {
+ this_array[w] -= BI_DV;
+ if(++w >= this.t) this_array[this.t++] = 0;
+ ++this_array[w];
+ }
+}
+
+// A "null" reducer
+function NullExp() {}
+function nNop(x) { return x; }
+function nMulTo(x,y,r) { x.multiplyTo(y,r); }
+function nSqrTo(x,r) { x.squareTo(r); }
+
+NullExp.prototype.convert = nNop;
+NullExp.prototype.revert = nNop;
+NullExp.prototype.mulTo = nMulTo;
+NullExp.prototype.sqrTo = nSqrTo;
+
+// (public) this^e
+function bnPow(e) { return this.exp(e,new NullExp()); }
+
+// (protected) r = lower n words of "this * a", a.t <= n
+// "this" should be the larger one if appropriate.
+function bnpMultiplyLowerTo(a,n,r) {
+ var r_array = r.array;
+ var a_array = a.array;
+ var i = Math.min(this.t+a.t,n);
+ r.s = 0; // assumes a,this >= 0
+ r.t = i;
+ while(i > 0) r_array[--i] = 0;
+ var j;
+ for(j = r.t-this.t; i < j; ++i) r_array[i+this.t] = this.am(0,a_array[i],r,i,0,this.t);
+ for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a_array[i],r,i,0,n-i);
+ r.clamp();
+}
+
+// (protected) r = "this * a" without lower n words, n > 0
+// "this" should be the larger one if appropriate.
+function bnpMultiplyUpperTo(a,n,r) {
+ var r_array = r.array;
+ var a_array = a.array;
+ --n;
+ var i = r.t = this.t+a.t-n;
+ r.s = 0; // assumes a,this >= 0
+ while(--i >= 0) r_array[i] = 0;
+ for(i = Math.max(n-this.t,0); i < a.t; ++i)
+ r_array[this.t+i-n] = this.am(n-i,a_array[i],r,0,0,this.t+i-n);
+ r.clamp();
+ r.drShiftTo(1,r);
+}
+
+// Barrett modular reduction
+function Barrett(m) {
+ // setup Barrett
+ this.r2 = nbi();
+ this.q3 = nbi();
+ BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
+ this.mu = this.r2.divide(m);
+ this.m = m;
+}
+
+function barrettConvert(x) {
+ if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
+ else if(x.compareTo(this.m) < 0) return x;
+ else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
+}
+
+function barrettRevert(x) { return x; }
+
+// x = x mod m (HAC 14.42)
+function barrettReduce(x) {
+ x.drShiftTo(this.m.t-1,this.r2);
+ if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
+ this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
+ this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
+ while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
+ x.subTo(this.r2,x);
+ while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = x^2 mod m; x != r
+function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = x*y mod m; x,y != r
+function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Barrett.prototype.convert = barrettConvert;
+Barrett.prototype.revert = barrettRevert;
+Barrett.prototype.reduce = barrettReduce;
+Barrett.prototype.mulTo = barrettMulTo;
+Barrett.prototype.sqrTo = barrettSqrTo;
+
+// (public) this^e % m (HAC 14.85)
+function bnModPow(e,m) {
+ var e_array = e.array;
+ var i = e.bitLength(), k, r = nbv(1), z;
+ if(i <= 0) return r;
+ else if(i < 18) k = 1;
+ else if(i < 48) k = 3;
+ else if(i < 144) k = 4;
+ else if(i < 768) k = 5;
+ else k = 6;
+ if(i < 8)
+ z = new Classic(m);
+ else if(m.isEven())
+ z = new Barrett(m);
+ else
+ z = new Montgomery(m);
+
+ // precomputation
+ var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
+ g[1] = z.convert(this);
+ if(k > 1) {
+ var g2 = nbi();
+ z.sqrTo(g[1],g2);
+ while(n <= km) {
+ g[n] = nbi();
+ z.mulTo(g2,g[n-2],g[n]);
+ n += 2;
+ }
+ }
+
+ var j = e.t-1, w, is1 = true, r2 = nbi(), t;
+ i = nbits(e_array[j])-1;
+ while(j >= 0) {
+ if(i >= k1) w = (e_array[j]>>(i-k1))&km;
+ else {
+ w = (e_array[j]&((1<<(i+1))-1))<<(k1-i);
+ if(j > 0) w |= e_array[j-1]>>(BI_DB+i-k1);
+ }
+
+ n = k;
+ while((w&1) == 0) { w >>= 1; --n; }
+ if((i -= n) < 0) { i += BI_DB; --j; }
+ if(is1) { // ret == 1, don't bother squaring or multiplying it
+ g[w].copyTo(r);
+ is1 = false;
+ }
+ else {
+ while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
+ if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
+ z.mulTo(r2,g[w],r);
+ }
+
+ while(j >= 0 && (e_array[j]&(1<<i)) == 0) {
+ z.sqrTo(r,r2); t = r; r = r2; r2 = t;
+ if(--i < 0) { i = BI_DB-1; --j; }
+ }
+ }
+ return z.revert(r);
+}
+
+// (public) gcd(this,a) (HAC 14.54)
+function bnGCD(a) {
+ var x = (this.s<0)?this.negate():this.clone();
+ var y = (a.s<0)?a.negate():a.clone();
+ if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
+ var i = x.getLowestSetBit(), g = y.getLowestSetBit();
+ if(g < 0) return x;
+ if(i < g) g = i;
+ if(g > 0) {
+ x.rShiftTo(g,x);
+ y.rShiftTo(g,y);
+ }
+ while(x.signum() > 0) {
+ if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
+ if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
+ if(x.compareTo(y) >= 0) {
+ x.subTo(y,x);
+ x.rShiftTo(1,x);
+ }
+ else {
+ y.subTo(x,y);
+ y.rShiftTo(1,y);
+ }
+ }
+ if(g > 0) y.lShiftTo(g,y);
+ return y;
+}
+
+// (protected) this % n, n < 2^26
+function bnpModInt(n) {
+ var this_array = this.array;
+ if(n <= 0) return 0;
+ var d = BI_DV%n, r = (this.s<0)?n-1:0;
+ if(this.t > 0)
+ if(d == 0) r = this_array[0]%n;
+ else for(var i = this.t-1; i >= 0; --i) r = (d*r+this_array[i])%n;
+ return r;
+}
+
+// (public) 1/this % m (HAC 14.61)
+function bnModInverse(m) {
+ var ac = m.isEven();
+ if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
+ var u = m.clone(), v = this.clone();
+ var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
+ while(u.signum() != 0) {
+ while(u.isEven()) {
+ u.rShiftTo(1,u);
+ if(ac) {
+ if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
+ a.rShiftTo(1,a);
+ }
+ else if(!b.isEven()) b.subTo(m,b);
+ b.rShiftTo(1,b);
+ }
+ while(v.isEven()) {
+ v.rShiftTo(1,v);
+ if(ac) {
+ if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
+ c.rShiftTo(1,c);
+ }
+ else if(!d.isEven()) d.subTo(m,d);
+ d.rShiftTo(1,d);
+ }
+ if(u.compareTo(v) >= 0) {
+ u.subTo(v,u);
+ if(ac) a.subTo(c,a);
+ b.subTo(d,b);
+ }
+ else {
+ v.subTo(u,v);
+ if(ac) c.subTo(a,c);
+ d.subTo(b,d);
+ }
+ }
+ if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
+ if(d.compareTo(m) >= 0) return d.subtract(m);
+ if(d.signum() < 0) d.addTo(m,d); else return d;
+ if(d.signum() < 0) return d.add(m); else return d;
+}
+
+var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];
+var lplim = (1<<26)/lowprimes[lowprimes.length-1];
+
+// (public) test primality with certainty >= 1-.5^t
+function bnIsProbablePrime(t) {
+ var i, x = this.abs();
+ var x_array = x.array;
+ if(x.t == 1 && x_array[0] <= lowprimes[lowprimes.length-1]) {
+ for(i = 0; i < lowprimes.length; ++i)
+ if(x_array[0] == lowprimes[i]) return true;
+ return false;
+ }
+ if(x.isEven()) return false;
+ i = 1;
+ while(i < lowprimes.length) {
+ var m = lowprimes[i], j = i+1;
+ while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
+ m = x.modInt(m);
+ while(i < j) if(m%lowprimes[i++] == 0) return false;
+ }
+ return x.millerRabin(t);
+}
+
+// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
+function bnpMillerRabin(t) {
+ var n1 = this.subtract(BigInteger.ONE);
+ var k = n1.getLowestSetBit();
+ if(k <= 0) return false;
+ var r = n1.shiftRight(k);
+ t = (t+1)>>1;
+ if(t > lowprimes.length) t = lowprimes.length;
+ var a = nbi();
+ for(var i = 0; i < t; ++i) {
+ a.fromInt(lowprimes[i]);
+ var y = a.modPow(r,this);
+ if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
+ var j = 1;
+ while(j++ < k && y.compareTo(n1) != 0) {
+ y = y.modPowInt(2,this);
+ if(y.compareTo(BigInteger.ONE) == 0) return false;
+ }
+ if(y.compareTo(n1) != 0) return false;
+ }
+ }
+ return true;
+}
+
+// protected
+BigInteger.prototype.chunkSize = bnpChunkSize;
+BigInteger.prototype.toRadix = bnpToRadix;
+BigInteger.prototype.fromRadix = bnpFromRadix;
+BigInteger.prototype.fromNumber = bnpFromNumber;
+BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
+BigInteger.prototype.changeBit = bnpChangeBit;
+BigInteger.prototype.addTo = bnpAddTo;
+BigInteger.prototype.dMultiply = bnpDMultiply;
+BigInteger.prototype.dAddOffset = bnpDAddOffset;
+BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
+BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
+BigInteger.prototype.modInt = bnpModInt;
+BigInteger.prototype.millerRabin = bnpMillerRabin;
+
+// public
+BigInteger.prototype.clone = bnClone;
+BigInteger.prototype.intValue = bnIntValue;
+BigInteger.prototype.byteValue = bnByteValue;
+BigInteger.prototype.shortValue = bnShortValue;
+BigInteger.prototype.signum = bnSigNum;
+BigInteger.prototype.toByteArray = bnToByteArray;
+BigInteger.prototype.equals = bnEquals;
+BigInteger.prototype.min = bnMin;
+BigInteger.prototype.max = bnMax;
+BigInteger.prototype.and = bnAnd;
+BigInteger.prototype.or = bnOr;
+BigInteger.prototype.xor = bnXor;
+BigInteger.prototype.andNot = bnAndNot;
+BigInteger.prototype.not = bnNot;
+BigInteger.prototype.shiftLeft = bnShiftLeft;
+BigInteger.prototype.shiftRight = bnShiftRight;
+BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
+BigInteger.prototype.bitCount = bnBitCount;
+BigInteger.prototype.testBit = bnTestBit;
+BigInteger.prototype.setBit = bnSetBit;
+BigInteger.prototype.clearBit = bnClearBit;
+BigInteger.prototype.flipBit = bnFlipBit;
+BigInteger.prototype.add = bnAdd;
+BigInteger.prototype.subtract = bnSubtract;
+BigInteger.prototype.multiply = bnMultiply;
+BigInteger.prototype.divide = bnDivide;
+BigInteger.prototype.remainder = bnRemainder;
+BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
+BigInteger.prototype.modPow = bnModPow;
+BigInteger.prototype.modInverse = bnModInverse;
+BigInteger.prototype.pow = bnPow;
+BigInteger.prototype.gcd = bnGCD;
+BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
+
+// BigInteger interfaces not implemented in jsbn:
+
+// BigInteger(int signum, byte[] magnitude)
+// double doubleValue()
+// float floatValue()
+// int hashCode()
+// long longValue()
+// static BigInteger valueOf(long val)
+// prng4.js - uses Arcfour as a PRNG
+
+function Arcfour() {
+ this.i = 0;
+ this.j = 0;
+ this.S = new Array();
+}
+
+// Initialize arcfour context from key, an array of ints, each from [0..255]
+function ARC4init(key) {
+ var i, j, t;
+ for(i = 0; i < 256; ++i)
+ this.S[i] = i;
+ j = 0;
+ for(i = 0; i < 256; ++i) {
+ j = (j + this.S[i] + key[i % key.length]) & 255;
+ t = this.S[i];
+ this.S[i] = this.S[j];
+ this.S[j] = t;
+ }
+ this.i = 0;
+ this.j = 0;
+}
+
+function ARC4next() {
+ var t;
+ this.i = (this.i + 1) & 255;
+ this.j = (this.j + this.S[this.i]) & 255;
+ t = this.S[this.i];
+ this.S[this.i] = this.S[this.j];
+ this.S[this.j] = t;
+ return this.S[(t + this.S[this.i]) & 255];
+}
+
+Arcfour.prototype.init = ARC4init;
+Arcfour.prototype.next = ARC4next;
+
+// Plug in your RNG constructor here
+function prng_newstate() {
+ return new Arcfour();
+}
+
+// Pool size must be a multiple of 4 and greater than 32.
+// An array of bytes the size of the pool will be passed to init()
+var rng_psize = 256;
+// Random number generator - requires a PRNG backend, e.g. prng4.js
+
+// For best results, put code like
+// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
+// in your main HTML document.
+
+var rng_state;
+var rng_pool;
+var rng_pptr;
+
+// Mix in a 32-bit integer into the pool
+function rng_seed_int(x) {
+ rng_pool[rng_pptr++] ^= x & 255;
+ rng_pool[rng_pptr++] ^= (x >> 8) & 255;
+ rng_pool[rng_pptr++] ^= (x >> 16) & 255;
+ rng_pool[rng_pptr++] ^= (x >> 24) & 255;
+ if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
+}
+
+// Mix in the current time (w/milliseconds) into the pool
+function rng_seed_time() {
+ // Use pre-computed date to avoid making the benchmark
+ // results dependent on the current date.
+ rng_seed_int(1122926989487);
+}
+
+// Initialize the pool with junk if needed.
+if(rng_pool == null) {
+ rng_pool = new Array();
+ rng_pptr = 0;
+ var t;
+ while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
+ t = Math.floor(65536 * Math.random());
+ rng_pool[rng_pptr++] = t >>> 8;
+ rng_pool[rng_pptr++] = t & 255;
+ }
+ rng_pptr = 0;
+ rng_seed_time();
+ //rng_seed_int(window.screenX);
+ //rng_seed_int(window.screenY);
+}
+
+function rng_get_byte() {
+ if(rng_state == null) {
+ rng_seed_time();
+ rng_state = prng_newstate();
+ rng_state.init(rng_pool);
+ for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
+ rng_pool[rng_pptr] = 0;
+ rng_pptr = 0;
+ //rng_pool = null;
+ }
+ // TODO: allow reseeding after first request
+ return rng_state.next();
+}
+
+function rng_get_bytes(ba) {
+ var i;
+ for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
+}
+
+function SecureRandom() {}
+
+SecureRandom.prototype.nextBytes = rng_get_bytes;
+// Depends on jsbn.js and rng.js
+
+// convert a (hex) string to a bignum object
+function parseBigInt(str,r) {
+ return new BigInteger(str,r);
+}
+
+function linebrk(s,n) {
+ var ret = "";
+ var i = 0;
+ while(i + n < s.length) {
+ ret += s.substring(i,i+n) + "\n";
+ i += n;
+ }
+ return ret + s.substring(i,s.length);
+}
+
+function byte2Hex(b) {
+ if(b < 0x10)
+ return "0" + b.toString(16);
+ else
+ return b.toString(16);
+}
+
+// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
+function pkcs1pad2(s,n) {
+ if(n < s.length + 11) {
+ alert("Message too long for RSA");
+ return null;
+ }
+ var ba = new Array();
+ var i = s.length - 1;
+ while(i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--);
+ ba[--n] = 0;
+ var rng = new SecureRandom();
+ var x = new Array();
+ while(n > 2) { // random non-zero pad
+ x[0] = 0;
+ while(x[0] == 0) rng.nextBytes(x);
+ ba[--n] = x[0];
+ }
+ ba[--n] = 2;
+ ba[--n] = 0;
+ return new BigInteger(ba);
+}
+
+// "empty" RSA key constructor
+function RSAKey() {
+ this.n = null;
+ this.e = 0;
+ this.d = null;
+ this.p = null;
+ this.q = null;
+ this.dmp1 = null;
+ this.dmq1 = null;
+ this.coeff = null;
+}
+
+// Set the public key fields N and e from hex strings
+function RSASetPublic(N,E) {
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
+ this.n = parseBigInt(N,16);
+ this.e = parseInt(E,16);
+ }
+ else
+ alert("Invalid RSA public key");
+}
+
+// Perform raw public operation on "x": return x^e (mod n)
+function RSADoPublic(x) {
+ return x.modPowInt(this.e, this.n);
+}
+
+// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
+function RSAEncrypt(text) {
+ var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
+ if(m == null) return null;
+ var c = this.doPublic(m);
+ if(c == null) return null;
+ var h = c.toString(16);
+ if((h.length & 1) == 0) return h; else return "0" + h;
+}
+
+// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
+//function RSAEncryptB64(text) {
+// var h = this.encrypt(text);
+// if(h) return hex2b64(h); else return null;
+//}
+
+// protected
+RSAKey.prototype.doPublic = RSADoPublic;
+
+// public
+RSAKey.prototype.setPublic = RSASetPublic;
+RSAKey.prototype.encrypt = RSAEncrypt;
+//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
+// Depends on rsa.js and jsbn2.js
+
+// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext
+function pkcs1unpad2(d,n) {
+ var b = d.toByteArray();
+ var i = 0;
+ while(i < b.length && b[i] == 0) ++i;
+ if(b.length-i != n-1 || b[i] != 2)
+ return null;
+ ++i;
+ while(b[i] != 0)
+ if(++i >= b.length) return null;
+ var ret = "";
+ while(++i < b.length)
+ ret += String.fromCharCode(b[i]);
+ return ret;
+}
+
+// Set the private key fields N, e, and d from hex strings
+function RSASetPrivate(N,E,D) {
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
+ this.n = parseBigInt(N,16);
+ this.e = parseInt(E,16);
+ this.d = parseBigInt(D,16);
+ }
+ else
+ alert("Invalid RSA private key");
+}
+
+// Set the private key fields N, e, d and CRT params from hex strings
+function RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) {
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
+ this.n = parseBigInt(N,16);
+ this.e = parseInt(E,16);
+ this.d = parseBigInt(D,16);
+ this.p = parseBigInt(P,16);
+ this.q = parseBigInt(Q,16);
+ this.dmp1 = parseBigInt(DP,16);
+ this.dmq1 = parseBigInt(DQ,16);
+ this.coeff = parseBigInt(C,16);
+ }
+ else
+ alert("Invalid RSA private key");
+}
+
+// Generate a new random private key B bits long, using public expt E
+function RSAGenerate(B,E) {
+ var rng = new SecureRandom();
+ var qs = B>>1;
+ this.e = parseInt(E,16);
+ var ee = new BigInteger(E,16);
+ for(;;) {
+ for(;;) {
+ this.p = new BigInteger(B-qs,1,rng);
+ if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break;
+ }
+ for(;;) {
+ this.q = new BigInteger(qs,1,rng);
+ if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break;
+ }
+ if(this.p.compareTo(this.q) <= 0) {
+ var t = this.p;
+ this.p = this.q;
+ this.q = t;
+ }
+ var p1 = this.p.subtract(BigInteger.ONE);
+ var q1 = this.q.subtract(BigInteger.ONE);
+ var phi = p1.multiply(q1);
+ if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {
+ this.n = this.p.multiply(this.q);
+ this.d = ee.modInverse(phi);
+ this.dmp1 = this.d.mod(p1);
+ this.dmq1 = this.d.mod(q1);
+ this.coeff = this.q.modInverse(this.p);
+ break;
+ }
+ }
+}
+
+// Perform raw private operation on "x": return x^d (mod n)
+function RSADoPrivate(x) {
+ if(this.p == null || this.q == null)
+ return x.modPow(this.d, this.n);
+
+ // TODO: re-calculate any missing CRT params
+ var xp = x.mod(this.p).modPow(this.dmp1, this.p);
+ var xq = x.mod(this.q).modPow(this.dmq1, this.q);
+
+ while(xp.compareTo(xq) < 0)
+ xp = xp.add(this.p);
+ return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);
+}
+
+// Return the PKCS#1 RSA decryption of "ctext".
+// "ctext" is an even-length hex string and the output is a plain string.
+function RSADecrypt(ctext) {
+ var c = parseBigInt(ctext, 16);
+ var m = this.doPrivate(c);
+ if(m == null) return null;
+ return pkcs1unpad2(m, (this.n.bitLength()+7)>>3);
+}
+
+// Return the PKCS#1 RSA decryption of "ctext".
+// "ctext" is a Base64-encoded string and the output is a plain string.
+//function RSAB64Decrypt(ctext) {
+// var h = b64tohex(ctext);
+// if(h) return this.decrypt(h); else return null;
+//}
+
+// protected
+RSAKey.prototype.doPrivate = RSADoPrivate;
+
+// public
+RSAKey.prototype.setPrivate = RSASetPrivate;
+RSAKey.prototype.setPrivateEx = RSASetPrivateEx;
+RSAKey.prototype.generate = RSAGenerate;
+RSAKey.prototype.decrypt = RSADecrypt;
+//RSAKey.prototype.b64_decrypt = RSAB64Decrypt;
+
+
+nValue="a5261939975948bb7a58dffe5ff54e65f0498f9175f5a09288810b8975871e99af3b5dd94057b0fc07535f5f97444504fa35169d461d0d30cf0192e307727c065168c788771c561a9400fb49175e9e6aa4e23fe11af69e9412dd23b0cb6684c4c2429bce139e848ab26d0829073351f4acd36074eafd036a5eb83359d2a698d3";
+eValue="10001";
+dValue="8e9912f6d3645894e8d38cb58c0db81ff516cf4c7e5a14c7f1eddb1459d2cded4d8d293fc97aee6aefb861859c8b6a3d1dfe710463e1f9ddc72048c09751971c4a580aa51eb523357a3cc48d31cfad1d4a165066ed92d4748fb6571211da5cb14bc11b6e2df7c1a559e6d5ac1cd5c94703a22891464fba23d0d965086277a161";
+pValue="d090ce58a92c75233a6486cb0a9209bf3583b64f540c76f5294bb97d285eed33aec220bde14b2417951178ac152ceab6da7090905b478195498b352048f15e7d";
+qValue="cab575dc652bb66df15a0359609d51d1db184750c00c6698b90ef3465c99655103edbf0d54c56aec0ce3c4d22592338092a126a0cc49f65a4a30d222b411e58f";
+dmp1Value="1a24bca8e273df2f0e47c199bbf678604e7df7215480c77c8db39f49b000ce2cf7500038acfff5433b7d582a01f1826e6f4d42e1c57f5e1fef7b12aabc59fd25";
+dmq1Value="3d06982efbbe47339e1f6d36b1216b8a741d410b0c662f54f7118b27b9a4ec9d914337eb39841d8666f3034408cf94f5b62f11c402fc994fe15a05493150d9fd";
+coeffValue="3a3e731acd8960b7ff9eb81a7ff93bd1cfa74cbd56987db58b4594fb09c09084db1734c8143f98b602b981aaa9243ca28deb69b5b280ee8dcee0fd2625e53250";
+
+setupEngine(am3, 28);
+
+var TEXT = "The quick brown fox jumped over the extremely lazy frog! " +
+ "Now is the time for all good men to come to the party.";
+var encrypted;
+
+function encrypt() {
+ var RSA = new RSAKey();
+ RSA.setPublic(nValue, eValue);
+ RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
+ encrypted = RSA.encrypt(TEXT);
+}
+
+function decrypt() {
+ var RSA = new RSAKey();
+ RSA.setPublic(nValue, eValue);
+ RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
+ var decrypted = RSA.decrypt(encrypted);
+ if (decrypted != TEXT) {
+ throw new Error("Crypto operation failed");
+ }
+}
diff --git a/tests/benchmarks/script/v8/tests/deltablue.js b/tests/benchmarks/script/v8/tests/deltablue.js
new file mode 100644
index 0000000000..548fd96ffb
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/deltablue.js
@@ -0,0 +1,880 @@
+// Copyright 2008 the V8 project authors. All rights reserved.
+// Copyright 1996 John Maloney and Mario Wolczko.
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+// This implementation of the DeltaBlue benchmark is derived
+// from the Smalltalk implementation by John Maloney and Mario
+// Wolczko. Some parts have been translated directly, whereas
+// others have been modified more aggresively to make it feel
+// more like a JavaScript program.
+
+
+var DeltaBlue = new BenchmarkSuite('DeltaBlue', 66118, [
+ new Benchmark('DeltaBlue', deltaBlue)
+]);
+
+
+/**
+ * A JavaScript implementation of the DeltaBlue constraint-solving
+ * algorithm, as described in:
+ *
+ * "The DeltaBlue Algorithm: An Incremental Constraint Hierarchy Solver"
+ * Bjorn N. Freeman-Benson and John Maloney
+ * January 1990 Communications of the ACM,
+ * also available as University of Washington TR 89-08-06.
+ *
+ * Beware: this benchmark is written in a grotesque style where
+ * the constraint model is built by side-effects from constructors.
+ * I've kept it this way to avoid deviating too much from the original
+ * implementation.
+ */
+
+
+/* --- O b j e c t M o d e l --- */
+
+Object.prototype.inheritsFrom = function (shuper) {
+ function Inheriter() { }
+ Inheriter.prototype = shuper.prototype;
+ this.prototype = new Inheriter();
+ this.superConstructor = shuper;
+}
+
+function OrderedCollection() {
+ this.elms = new Array();
+}
+
+OrderedCollection.prototype.add = function (elm) {
+ this.elms.push(elm);
+}
+
+OrderedCollection.prototype.at = function (index) {
+ return this.elms[index];
+}
+
+OrderedCollection.prototype.size = function () {
+ return this.elms.length;
+}
+
+OrderedCollection.prototype.removeFirst = function () {
+ return this.elms.pop();
+}
+
+OrderedCollection.prototype.remove = function (elm) {
+ var index = 0, skipped = 0;
+ for (var i = 0; i < this.elms.length; i++) {
+ var value = this.elms[i];
+ if (value != elm) {
+ this.elms[index] = value;
+ index++;
+ } else {
+ skipped++;
+ }
+ }
+ for (var i = 0; i < skipped; i++)
+ this.elms.pop();
+}
+
+/* --- *
+ * S t r e n g t h
+ * --- */
+
+/**
+ * Strengths are used to measure the relative importance of constraints.
+ * New strengths may be inserted in the strength hierarchy without
+ * disrupting current constraints. Strengths cannot be created outside
+ * this class, so pointer comparison can be used for value comparison.
+ */
+function Strength(strengthValue, name) {
+ this.strengthValue = strengthValue;
+ this.name = name;
+}
+
+Strength.stronger = function (s1, s2) {
+ return s1.strengthValue < s2.strengthValue;
+}
+
+Strength.weaker = function (s1, s2) {
+ return s1.strengthValue > s2.strengthValue;
+}
+
+Strength.weakestOf = function (s1, s2) {
+ return this.weaker(s1, s2) ? s1 : s2;
+}
+
+Strength.strongest = function (s1, s2) {
+ return this.stronger(s1, s2) ? s1 : s2;
+}
+
+Strength.prototype.nextWeaker = function () {
+ switch (this.strengthValue) {
+ case 0: return Strength.WEAKEST;
+ case 1: return Strength.WEAK_DEFAULT;
+ case 2: return Strength.NORMAL;
+ case 3: return Strength.STRONG_DEFAULT;
+ case 4: return Strength.PREFERRED;
+ case 5: return Strength.REQUIRED;
+ }
+}
+
+// Strength constants.
+Strength.REQUIRED = new Strength(0, "required");
+Strength.STONG_PREFERRED = new Strength(1, "strongPreferred");
+Strength.PREFERRED = new Strength(2, "preferred");
+Strength.STRONG_DEFAULT = new Strength(3, "strongDefault");
+Strength.NORMAL = new Strength(4, "normal");
+Strength.WEAK_DEFAULT = new Strength(5, "weakDefault");
+Strength.WEAKEST = new Strength(6, "weakest");
+
+/* --- *
+ * C o n s t r a i n t
+ * --- */
+
+/**
+ * An abstract class representing a system-maintainable relationship
+ * (or "constraint") between a set of variables. A constraint supplies
+ * a strength instance variable; concrete subclasses provide a means
+ * of storing the constrained variables and other information required
+ * to represent a constraint.
+ */
+function Constraint(strength) {
+ this.strength = strength;
+}
+
+/**
+ * Activate this constraint and attempt to satisfy it.
+ */
+Constraint.prototype.addConstraint = function () {
+ this.addToGraph();
+ planner.incrementalAdd(this);
+}
+
+/**
+ * Attempt to find a way to enforce this constraint. If successful,
+ * record the solution, perhaps modifying the current dataflow
+ * graph. Answer the constraint that this constraint overrides, if
+ * there is one, or nil, if there isn't.
+ * Assume: I am not already satisfied.
+ */
+Constraint.prototype.satisfy = function (mark) {
+ this.chooseMethod(mark);
+ if (!this.isSatisfied()) {
+ if (this.strength == Strength.REQUIRED)
+ alert("Could not satisfy a required constraint!");
+ return null;
+ }
+ this.markInputs(mark);
+ var out = this.output();
+ var overridden = out.determinedBy;
+ if (overridden != null) overridden.markUnsatisfied();
+ out.determinedBy = this;
+ if (!planner.addPropagate(this, mark))
+ alert("Cycle encountered");
+ out.mark = mark;
+ return overridden;
+}
+
+Constraint.prototype.destroyConstraint = function () {
+ if (this.isSatisfied()) planner.incrementalRemove(this);
+ else this.removeFromGraph();
+}
+
+/**
+ * Normal constraints are not input constraints. An input constraint
+ * is one that depends on external state, such as the mouse, the
+ * keybord, a clock, or some arbitraty piece of imperative code.
+ */
+Constraint.prototype.isInput = function () {
+ return false;
+}
+
+/* --- *
+ * U n a r y C o n s t r a i n t
+ * --- */
+
+/**
+ * Abstract superclass for constraints having a single possible output
+ * variable.
+ */
+function UnaryConstraint(v, strength) {
+ UnaryConstraint.superConstructor.call(this, strength);
+ this.myOutput = v;
+ this.satisfied = false;
+ this.addConstraint();
+}
+
+UnaryConstraint.inheritsFrom(Constraint);
+
+/**
+ * Adds this constraint to the constraint graph
+ */
+UnaryConstraint.prototype.addToGraph = function () {
+ this.myOutput.addConstraint(this);
+ this.satisfied = false;
+}
+
+/**
+ * Decides if this constraint can be satisfied and records that
+ * decision.
+ */
+UnaryConstraint.prototype.chooseMethod = function (mark) {
+ this.satisfied = (this.myOutput.mark != mark)
+ && Strength.stronger(this.strength, this.myOutput.walkStrength);
+}
+
+/**
+ * Returns true if this constraint is satisfied in the current solution.
+ */
+UnaryConstraint.prototype.isSatisfied = function () {
+ return this.satisfied;
+}
+
+UnaryConstraint.prototype.markInputs = function (mark) {
+ // has no inputs
+}
+
+/**
+ * Returns the current output variable.
+ */
+UnaryConstraint.prototype.output = function () {
+ return this.myOutput;
+}
+
+/**
+ * Calculate the walkabout strength, the stay flag, and, if it is
+ * 'stay', the value for the current output of this constraint. Assume
+ * this constraint is satisfied.
+ */
+UnaryConstraint.prototype.recalculate = function () {
+ this.myOutput.walkStrength = this.strength;
+ this.myOutput.stay = !this.isInput();
+ if (this.myOutput.stay) this.execute(); // Stay optimization
+}
+
+/**
+ * Records that this constraint is unsatisfied
+ */
+UnaryConstraint.prototype.markUnsatisfied = function () {
+ this.satisfied = false;
+}
+
+UnaryConstraint.prototype.inputsKnown = function () {
+ return true;
+}
+
+UnaryConstraint.prototype.removeFromGraph = function () {
+ if (this.myOutput != null) this.myOutput.removeConstraint(this);
+ this.satisfied = false;
+}
+
+/* --- *
+ * S t a y C o n s t r a i n t
+ * --- */
+
+/**
+ * Variables that should, with some level of preference, stay the same.
+ * Planners may exploit the fact that instances, if satisfied, will not
+ * change their output during plan execution. This is called "stay
+ * optimization".
+ */
+function StayConstraint(v, str) {
+ StayConstraint.superConstructor.call(this, v, str);
+}
+
+StayConstraint.inheritsFrom(UnaryConstraint);
+
+StayConstraint.prototype.execute = function () {
+ // Stay constraints do nothing
+}
+
+/* --- *
+ * E d i t C o n s t r a i n t
+ * --- */
+
+/**
+ * A unary input constraint used to mark a variable that the client
+ * wishes to change.
+ */
+function EditConstraint(v, str) {
+ EditConstraint.superConstructor.call(this, v, str);
+}
+
+EditConstraint.inheritsFrom(UnaryConstraint);
+
+/**
+ * Edits indicate that a variable is to be changed by imperative code.
+ */
+EditConstraint.prototype.isInput = function () {
+ return true;
+}
+
+EditConstraint.prototype.execute = function () {
+ // Edit constraints do nothing
+}
+
+/* --- *
+ * B i n a r y C o n s t r a i n t
+ * --- */
+
+var Direction = new Object();
+Direction.NONE = 0;
+Direction.FORWARD = 1;
+Direction.BACKWARD = -1;
+
+/**
+ * Abstract superclass for constraints having two possible output
+ * variables.
+ */
+function BinaryConstraint(var1, var2, strength) {
+ BinaryConstraint.superConstructor.call(this, strength);
+ this.v1 = var1;
+ this.v2 = var2;
+ this.direction = Direction.NONE;
+ this.addConstraint();
+}
+
+BinaryConstraint.inheritsFrom(Constraint);
+
+/**
+ * Decides if this constraint can be satisfied and which way it
+ * should flow based on the relative strength of the variables related,
+ * and record that decision.
+ */
+BinaryConstraint.prototype.chooseMethod = function (mark) {
+ if (this.v1.mark == mark) {
+ this.direction = (this.v2.mark != mark && Strength.stronger(this.strength, this.v2.walkStrength))
+ ? Direction.FORWARD
+ : Direction.NONE;
+ }
+ if (this.v2.mark == mark) {
+ this.direction = (this.v1.mark != mark && Strength.stronger(this.strength, this.v1.walkStrength))
+ ? Direction.BACKWARD
+ : Direction.NONE;
+ }
+ if (Strength.weaker(this.v1.walkStrength, this.v2.walkStrength)) {
+ this.direction = Strength.stronger(this.strength, this.v1.walkStrength)
+ ? Direction.BACKWARD
+ : Direction.NONE;
+ } else {
+ this.direction = Strength.stronger(this.strength, this.v2.walkStrength)
+ ? Direction.FORWARD
+ : Direction.BACKWARD
+ }
+}
+
+/**
+ * Add this constraint to the constraint graph
+ */
+BinaryConstraint.prototype.addToGraph = function () {
+ this.v1.addConstraint(this);
+ this.v2.addConstraint(this);
+ this.direction = Direction.NONE;
+}
+
+/**
+ * Answer true if this constraint is satisfied in the current solution.
+ */
+BinaryConstraint.prototype.isSatisfied = function () {
+ return this.direction != Direction.NONE;
+}
+
+/**
+ * Mark the input variable with the given mark.
+ */
+BinaryConstraint.prototype.markInputs = function (mark) {
+ this.input().mark = mark;
+}
+
+/**
+ * Returns the current input variable
+ */
+BinaryConstraint.prototype.input = function () {
+ return (this.direction == Direction.FORWARD) ? this.v1 : this.v2;
+}
+
+/**
+ * Returns the current output variable
+ */
+BinaryConstraint.prototype.output = function () {
+ return (this.direction == Direction.FORWARD) ? this.v2 : this.v1;
+}
+
+/**
+ * Calculate the walkabout strength, the stay flag, and, if it is
+ * 'stay', the value for the current output of this
+ * constraint. Assume this constraint is satisfied.
+ */
+BinaryConstraint.prototype.recalculate = function () {
+ var ihn = this.input(), out = this.output();
+ out.walkStrength = Strength.weakestOf(this.strength, ihn.walkStrength);
+ out.stay = ihn.stay;
+ if (out.stay) this.execute();
+}
+
+/**
+ * Record the fact that this constraint is unsatisfied.
+ */
+BinaryConstraint.prototype.markUnsatisfied = function () {
+ this.direction = Direction.NONE;
+}
+
+BinaryConstraint.prototype.inputsKnown = function (mark) {
+ var i = this.input();
+ return i.mark == mark || i.stay || i.determinedBy == null;
+}
+
+BinaryConstraint.prototype.removeFromGraph = function () {
+ if (this.v1 != null) this.v1.removeConstraint(this);
+ if (this.v2 != null) this.v2.removeConstraint(this);
+ this.direction = Direction.NONE;
+}
+
+/* --- *
+ * S c a l e C o n s t r a i n t
+ * --- */
+
+/**
+ * Relates two variables by the linear scaling relationship: "v2 =
+ * (v1 * scale) + offset". Either v1 or v2 may be changed to maintain
+ * this relationship but the scale factor and offset are considered
+ * read-only.
+ */
+function ScaleConstraint(src, scale, offset, dest, strength) {
+ this.direction = Direction.NONE;
+ this.scale = scale;
+ this.offset = offset;
+ ScaleConstraint.superConstructor.call(this, src, dest, strength);
+}
+
+ScaleConstraint.inheritsFrom(BinaryConstraint);
+
+/**
+ * Adds this constraint to the constraint graph.
+ */
+ScaleConstraint.prototype.addToGraph = function () {
+ ScaleConstraint.superConstructor.prototype.addToGraph.call(this);
+ this.scale.addConstraint(this);
+ this.offset.addConstraint(this);
+}
+
+ScaleConstraint.prototype.removeFromGraph = function () {
+ ScaleConstraint.superConstructor.prototype.removeFromGraph.call(this);
+ if (this.scale != null) this.scale.removeConstraint(this);
+ if (this.offset != null) this.offset.removeConstraint(this);
+}
+
+ScaleConstraint.prototype.markInputs = function (mark) {
+ ScaleConstraint.superConstructor.prototype.markInputs.call(this, mark);
+ this.scale.mark = this.offset.mark = mark;
+}
+
+/**
+ * Enforce this constraint. Assume that it is satisfied.
+ */
+ScaleConstraint.prototype.execute = function () {
+ if (this.direction == Direction.FORWARD) {
+ this.v2.value = this.v1.value * this.scale.value + this.offset.value;
+ } else {
+ this.v1.value = (this.v2.value - this.offset.value) / this.scale.value;
+ }
+}
+
+/**
+ * Calculate the walkabout strength, the stay flag, and, if it is
+ * 'stay', the value for the current output of this constraint. Assume
+ * this constraint is satisfied.
+ */
+ScaleConstraint.prototype.recalculate = function () {
+ var ihn = this.input(), out = this.output();
+ out.walkStrength = Strength.weakestOf(this.strength, ihn.walkStrength);
+ out.stay = ihn.stay && this.scale.stay && this.offset.stay;
+ if (out.stay) this.execute();
+}
+
+/* --- *
+ * E q u a l i t y C o n s t r a i n t
+ * --- */
+
+/**
+ * Constrains two variables to have the same value.
+ */
+function EqualityConstraint(var1, var2, strength) {
+ EqualityConstraint.superConstructor.call(this, var1, var2, strength);
+}
+
+EqualityConstraint.inheritsFrom(BinaryConstraint);
+
+/**
+ * Enforce this constraint. Assume that it is satisfied.
+ */
+EqualityConstraint.prototype.execute = function () {
+ this.output().value = this.input().value;
+}
+
+/* --- *
+ * V a r i a b l e
+ * --- */
+
+/**
+ * A constrained variable. In addition to its value, it maintain the
+ * structure of the constraint graph, the current dataflow graph, and
+ * various parameters of interest to the DeltaBlue incremental
+ * constraint solver.
+ **/
+function Variable(name, initialValue) {
+ this.value = initialValue || 0;
+ this.constraints = new OrderedCollection();
+ this.determinedBy = null;
+ this.mark = 0;
+ this.walkStrength = Strength.WEAKEST;
+ this.stay = true;
+ this.name = name;
+}
+
+/**
+ * Add the given constraint to the set of all constraints that refer
+ * this variable.
+ */
+Variable.prototype.addConstraint = function (c) {
+ this.constraints.add(c);
+}
+
+/**
+ * Removes all traces of c from this variable.
+ */
+Variable.prototype.removeConstraint = function (c) {
+ this.constraints.remove(c);
+ if (this.determinedBy == c) this.determinedBy = null;
+}
+
+/* --- *
+ * P l a n n e r
+ * --- */
+
+/**
+ * The DeltaBlue planner
+ */
+function Planner() {
+ this.currentMark = 0;
+}
+
+/**
+ * Attempt to satisfy the given constraint and, if successful,
+ * incrementally update the dataflow graph. Details: If satifying
+ * the constraint is successful, it may override a weaker constraint
+ * on its output. The algorithm attempts to resatisfy that
+ * constraint using some other method. This process is repeated
+ * until either a) it reaches a variable that was not previously
+ * determined by any constraint or b) it reaches a constraint that
+ * is too weak to be satisfied using any of its methods. The
+ * variables of constraints that have been processed are marked with
+ * a unique mark value so that we know where we've been. This allows
+ * the algorithm to avoid getting into an infinite loop even if the
+ * constraint graph has an inadvertent cycle.
+ */
+Planner.prototype.incrementalAdd = function (c) {
+ var mark = this.newMark();
+ var overridden = c.satisfy(mark);
+ while (overridden != null)
+ overridden = overridden.satisfy(mark);
+}
+
+/**
+ * Entry point for retracting a constraint. Remove the given
+ * constraint and incrementally update the dataflow graph.
+ * Details: Retracting the given constraint may allow some currently
+ * unsatisfiable downstream constraint to be satisfied. We therefore collect
+ * a list of unsatisfied downstream constraints and attempt to
+ * satisfy each one in turn. This list is traversed by constraint
+ * strength, strongest first, as a heuristic for avoiding
+ * unnecessarily adding and then overriding weak constraints.
+ * Assume: c is satisfied.
+ */
+Planner.prototype.incrementalRemove = function (c) {
+ var out = c.output();
+ c.markUnsatisfied();
+ c.removeFromGraph();
+ var unsatisfied = this.removePropagateFrom(out);
+ var strength = Strength.REQUIRED;
+ do {
+ for (var i = 0; i < unsatisfied.size(); i++) {
+ var u = unsatisfied.at(i);
+ if (u.strength == strength)
+ this.incrementalAdd(u);
+ }
+ strength = strength.nextWeaker();
+ } while (strength != Strength.WEAKEST);
+}
+
+/**
+ * Select a previously unused mark value.
+ */
+Planner.prototype.newMark = function () {
+ return ++this.currentMark;
+}
+
+/**
+ * Extract a plan for resatisfaction starting from the given source
+ * constraints, usually a set of input constraints. This method
+ * assumes that stay optimization is desired; the plan will contain
+ * only constraints whose output variables are not stay. Constraints
+ * that do no computation, such as stay and edit constraints, are
+ * not included in the plan.
+ * Details: The outputs of a constraint are marked when it is added
+ * to the plan under construction. A constraint may be appended to
+ * the plan when all its input variables are known. A variable is
+ * known if either a) the variable is marked (indicating that has
+ * been computed by a constraint appearing earlier in the plan), b)
+ * the variable is 'stay' (i.e. it is a constant at plan execution
+ * time), or c) the variable is not determined by any
+ * constraint. The last provision is for past states of history
+ * variables, which are not stay but which are also not computed by
+ * any constraint.
+ * Assume: sources are all satisfied.
+ */
+Planner.prototype.makePlan = function (sources) {
+ var mark = this.newMark();
+ var plan = new Plan();
+ var todo = sources;
+ while (todo.size() > 0) {
+ var c = todo.removeFirst();
+ if (c.output().mark != mark && c.inputsKnown(mark)) {
+ plan.addConstraint(c);
+ c.output().mark = mark;
+ this.addConstraintsConsumingTo(c.output(), todo);
+ }
+ }
+ return plan;
+}
+
+/**
+ * Extract a plan for resatisfying starting from the output of the
+ * given constraints, usually a set of input constraints.
+ */
+Planner.prototype.extractPlanFromConstraints = function (constraints) {
+ var sources = new OrderedCollection();
+ for (var i = 0; i < constraints.size(); i++) {
+ var c = constraints.at(i);
+ if (c.isInput() && c.isSatisfied())
+ // not in plan already and eligible for inclusion
+ sources.add(c);
+ }
+ return this.makePlan(sources);
+}
+
+/**
+ * Recompute the walkabout strengths and stay flags of all variables
+ * downstream of the given constraint and recompute the actual
+ * values of all variables whose stay flag is true. If a cycle is
+ * detected, remove the given constraint and answer
+ * false. Otherwise, answer true.
+ * Details: Cycles are detected when a marked variable is
+ * encountered downstream of the given constraint. The sender is
+ * assumed to have marked the inputs of the given constraint with
+ * the given mark. Thus, encountering a marked node downstream of
+ * the output constraint means that there is a path from the
+ * constraint's output to one of its inputs.
+ */
+Planner.prototype.addPropagate = function (c, mark) {
+ var todo = new OrderedCollection();
+ todo.add(c);
+ while (todo.size() > 0) {
+ var d = todo.removeFirst();
+ if (d.output().mark == mark) {
+ this.incrementalRemove(c);
+ return false;
+ }
+ d.recalculate();
+ this.addConstraintsConsumingTo(d.output(), todo);
+ }
+ return true;
+}
+
+
+/**
+ * Update the walkabout strengths and stay flags of all variables
+ * downstream of the given constraint. Answer a collection of
+ * unsatisfied constraints sorted in order of decreasing strength.
+ */
+Planner.prototype.removePropagateFrom = function (out) {
+ out.determinedBy = null;
+ out.walkStrength = Strength.WEAKEST;
+ out.stay = true;
+ var unsatisfied = new OrderedCollection();
+ var todo = new OrderedCollection();
+ todo.add(out);
+ while (todo.size() > 0) {
+ var v = todo.removeFirst();
+ for (var i = 0; i < v.constraints.size(); i++) {
+ var c = v.constraints.at(i);
+ if (!c.isSatisfied())
+ unsatisfied.add(c);
+ }
+ var determining = v.determinedBy;
+ for (var i = 0; i < v.constraints.size(); i++) {
+ var next = v.constraints.at(i);
+ if (next != determining && next.isSatisfied()) {
+ next.recalculate();
+ todo.add(next.output());
+ }
+ }
+ }
+ return unsatisfied;
+}
+
+Planner.prototype.addConstraintsConsumingTo = function (v, coll) {
+ var determining = v.determinedBy;
+ var cc = v.constraints;
+ for (var i = 0; i < cc.size(); i++) {
+ var c = cc.at(i);
+ if (c != determining && c.isSatisfied())
+ coll.add(c);
+ }
+}
+
+/* --- *
+ * P l a n
+ * --- */
+
+/**
+ * A Plan is an ordered list of constraints to be executed in sequence
+ * to resatisfy all currently satisfiable constraints in the face of
+ * one or more changing inputs.
+ */
+function Plan() {
+ this.v = new OrderedCollection();
+}
+
+Plan.prototype.addConstraint = function (c) {
+ this.v.add(c);
+}
+
+Plan.prototype.size = function () {
+ return this.v.size();
+}
+
+Plan.prototype.constraintAt = function (index) {
+ return this.v.at(index);
+}
+
+Plan.prototype.execute = function () {
+ for (var i = 0; i < this.size(); i++) {
+ var c = this.constraintAt(i);
+ c.execute();
+ }
+}
+
+/* --- *
+ * M a i n
+ * --- */
+
+/**
+ * This is the standard DeltaBlue benchmark. A long chain of equality
+ * constraints is constructed with a stay constraint on one end. An
+ * edit constraint is then added to the opposite end and the time is
+ * measured for adding and removing this constraint, and extracting
+ * and executing a constraint satisfaction plan. There are two cases.
+ * In case 1, the added constraint is stronger than the stay
+ * constraint and values must propagate down the entire length of the
+ * chain. In case 2, the added constraint is weaker than the stay
+ * constraint so it cannot be accomodated. The cost in this case is,
+ * of course, very low. Typical situations lie somewhere between these
+ * two extremes.
+ */
+function chainTest(n) {
+ planner = new Planner();
+ var prev = null, first = null, last = null;
+
+ // Build chain of n equality constraints
+ for (var i = 0; i <= n; i++) {
+ var name = "v" + i;
+ var v = new Variable(name);
+ if (prev != null)
+ new EqualityConstraint(prev, v, Strength.REQUIRED);
+ if (i == 0) first = v;
+ if (i == n) last = v;
+ prev = v;
+ }
+
+ new StayConstraint(last, Strength.STRONG_DEFAULT);
+ var edit = new EditConstraint(first, Strength.PREFERRED);
+ var edits = new OrderedCollection();
+ edits.add(edit);
+ var plan = planner.extractPlanFromConstraints(edits);
+ for (var i = 0; i < 100; i++) {
+ first.value = i;
+ plan.execute();
+ if (last.value != i)
+ alert("Chain test failed.");
+ }
+}
+
+/**
+ * This test constructs a two sets of variables related to each
+ * other by a simple linear transformation (scale and offset). The
+ * time is measured to change a variable on either side of the
+ * mapping and to change the scale and offset factors.
+ */
+function projectionTest(n) {
+ planner = new Planner();
+ var scale = new Variable("scale", 10);
+ var offset = new Variable("offset", 1000);
+ var src = null, dst = null;
+
+ var dests = new OrderedCollection();
+ for (var i = 0; i < n; i++) {
+ src = new Variable("src" + i, i);
+ dst = new Variable("dst" + i, i);
+ dests.add(dst);
+ new StayConstraint(src, Strength.NORMAL);
+ new ScaleConstraint(src, scale, offset, dst, Strength.REQUIRED);
+ }
+
+ change(src, 17);
+ if (dst.value != 1170) alert("Projection 1 failed");
+ change(dst, 1050);
+ if (src.value != 5) alert("Projection 2 failed");
+ change(scale, 5);
+ for (var i = 0; i < n - 1; i++) {
+ if (dests.at(i).value != i * 5 + 1000)
+ alert("Projection 3 failed");
+ }
+ change(offset, 2000);
+ for (var i = 0; i < n - 1; i++) {
+ if (dests.at(i).value != i * 5 + 2000)
+ alert("Projection 4 failed");
+ }
+}
+
+function change(v, newValue) {
+ var edit = new EditConstraint(v, Strength.PREFERRED);
+ var edits = new OrderedCollection();
+ edits.add(edit);
+ var plan = planner.extractPlanFromConstraints(edits);
+ for (var i = 0; i < 10; i++) {
+ v.value = newValue;
+ plan.execute();
+ }
+ edit.destroyConstraint();
+}
+
+// Global variable holding the current planner.
+var planner = null;
+
+function deltaBlue() {
+ chainTest(100);
+ projectionTest(100);
+}
diff --git a/tests/benchmarks/script/v8/tests/earley-boyer.js b/tests/benchmarks/script/v8/tests/earley-boyer.js
new file mode 100644
index 0000000000..1be480e8ee
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/earley-boyer.js
@@ -0,0 +1,4684 @@
+// This file is automatically generated by scheme2js, except for the
+// benchmark harness code at the beginning and end of the file.
+
+var EarleyBoyer = new BenchmarkSuite('EarleyBoyer', 666463, [
+ new Benchmark("Earley", function () { BgL_earleyzd2benchmarkzd2(); }),
+ new Benchmark("Boyer", function () { BgL_nboyerzd2benchmarkzd2(); })
+]);
+
+
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/*
+ * To use write/prints/... the default-output port has to be set first.
+ * Simply setting SC_DEFAULT_OUT and SC_ERROR_OUT to the desired values
+ * should do the trick.
+ * In the following example the std-out and error-port are redirected to
+ * a DIV.
+function initRuntime() {
+ function escapeHTML(s) {
+ var tmp = s;
+ tmp = tmp.replace(/&/g, "&amp;");
+ tmp = tmp.replace(/</g, "&lt;");
+ tmp = tmp.replace(/>/g, "&gt;");
+ tmp = tmp.replace(/ /g, "&nbsp;");
+ tmp = tmp.replace(/\n/g, "<br />");
+ tmp = tmp.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp");
+ return tmp;
+
+ }
+
+ document.write("<div id='stdout'></div>");
+ SC_DEFAULT_OUT = new sc_GenericOutputPort(
+ function(s) {
+ var stdout = document.getElementById('stdout');
+ stdout.innerHTML = stdout.innerHTML + escapeHTML(s);
+ });
+ SC_ERROR_OUT = SC_DEFAULT_OUT;
+}
+*/
+
+
+function sc_print_debug() {
+ sc_print.apply(null, arguments);
+}
+/*** META ((export *js*)) */
+var sc_JS_GLOBALS = this;
+
+var __sc_LINE=-1;
+var __sc_FILE="";
+
+/*** META ((export #t)) */
+function sc_alert() {
+ var len = arguments.length;
+ var s = "";
+ var i;
+
+ for( i = 0; i < len; i++ ) {
+ s += sc_toDisplayString(arguments[ i ]);
+ }
+
+ return alert( s );
+}
+
+/*** META ((export #t)) */
+function sc_typeof( x ) {
+ return typeof x;
+}
+
+/*** META ((export #t)) */
+function sc_error() {
+ var a = [sc_jsstring2symbol("*error*")];
+ for (var i = 0; i < arguments.length; i++) {
+ a[i+1] = arguments[i];
+ }
+ throw a;
+}
+
+/*** META ((export #t)
+ (peephole (prefix "throw ")))
+*/
+function sc_raise(obj) {
+ throw obj;
+}
+
+/*** META ((export with-handler-lambda)) */
+function sc_withHandlerLambda(handler, body) {
+ try {
+ return body();
+ } catch(e) {
+ if (!e._internalException)
+ return handler(e);
+ else
+ throw e;
+ }
+}
+
+var sc_properties = new Object();
+
+/*** META ((export #t)) */
+function sc_putpropBang(sym, key, val) {
+ var ht = sc_properties[sym];
+ if (!ht) {
+ ht = new Object();
+ sc_properties[sym] = ht;
+ }
+ ht[key] = val;
+}
+
+/*** META ((export #t)) */
+function sc_getprop(sym, key) {
+ var ht = sc_properties[sym];
+ if (ht) {
+ if (key in ht)
+ return ht[key];
+ else
+ return false;
+ } else
+ return false;
+}
+
+/*** META ((export #t)) */
+function sc_rempropBang(sym, key) {
+ var ht = sc_properties[sym];
+ if (ht)
+ delete ht[key];
+}
+
+/*** META ((export #t)) */
+function sc_any2String(o) {
+ return jsstring2string(sc_toDisplayString(o));
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "==="))
+ (type bool))
+*/
+function sc_isEqv(o1, o2) {
+ return (o1 === o2);
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "==="))
+ (type bool))
+*/
+function sc_isEq(o1, o2) {
+ return (o1 === o2);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isNumber(n) {
+ return (typeof n === "number");
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isComplex(n) {
+ return sc_isNumber(n);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isReal(n) {
+ return sc_isNumber(n);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isRational(n) {
+ return sc_isReal(n);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isInteger(n) {
+ return (parseInt(n) === n);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix ", false")))
+*/
+// we don't have exact numbers...
+function sc_isExact(n) {
+ return false;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ", true"))
+ (type bool))
+*/
+function sc_isInexact(n) {
+ return true;
+}
+
+/*** META ((export = =fx =fl)
+ (type bool)
+ (peephole (infix 2 2 "===")))
+*/
+function sc_equal(x) {
+ for (var i = 1; i < arguments.length; i++)
+ if (x !== arguments[i])
+ return false;
+ return true;
+}
+
+/*** META ((export < <fx <fl)
+ (type bool)
+ (peephole (infix 2 2 "<")))
+*/
+function sc_less(x) {
+ for (var i = 1; i < arguments.length; i++) {
+ if (x >= arguments[i])
+ return false;
+ x = arguments[i];
+ }
+ return true;
+}
+
+/*** META ((export > >fx >fl)
+ (type bool)
+ (peephole (infix 2 2 ">")))
+*/
+function sc_greater(x, y) {
+ for (var i = 1; i < arguments.length; i++) {
+ if (x <= arguments[i])
+ return false;
+ x = arguments[i];
+ }
+ return true;
+}
+
+/*** META ((export <= <=fx <=fl)
+ (type bool)
+ (peephole (infix 2 2 "<=")))
+*/
+function sc_lessEqual(x, y) {
+ for (var i = 1; i < arguments.length; i++) {
+ if (x > arguments[i])
+ return false;
+ x = arguments[i];
+ }
+ return true;
+}
+
+/*** META ((export >= >=fl >=fx)
+ (type bool)
+ (peephole (infix 2 2 ">=")))
+*/
+function sc_greaterEqual(x, y) {
+ for (var i = 1; i < arguments.length; i++) {
+ if (x < arguments[i])
+ return false;
+ x = arguments[i];
+ }
+ return true;
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "=== 0")))
+*/
+function sc_isZero(x) {
+ return (x === 0);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "> 0")))
+*/
+function sc_isPositive(x) {
+ return (x > 0);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "< 0")))
+*/
+function sc_isNegative(x) {
+ return (x < 0);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "%2===1")))
+*/
+function sc_isOdd(x) {
+ return (x % 2 === 1);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "%2===0")))
+*/
+function sc_isEven(x) {
+ return (x % 2 === 0);
+}
+
+/*** META ((export #t)) */
+var sc_max = Math.max;
+/*** META ((export #t)) */
+var sc_min = Math.min;
+
+/*** META ((export + +fx +fl)
+ (peephole (infix 0 #f "+" "0")))
+*/
+function sc_plus() {
+ var sum = 0;
+ for (var i = 0; i < arguments.length; i++)
+ sum += arguments[i];
+ return sum;
+}
+
+/*** META ((export * *fx *fl)
+ (peephole (infix 0 #f "*" "1")))
+*/
+function sc_multi() {
+ var product = 1;
+ for (var i = 0; i < arguments.length; i++)
+ product *= arguments[i];
+ return product;
+}
+
+/*** META ((export - -fx -fl)
+ (peephole (minus)))
+*/
+function sc_minus(x) {
+ if (arguments.length === 1)
+ return -x;
+ else {
+ var res = x;
+ for (var i = 1; i < arguments.length; i++)
+ res -= arguments[i];
+ return res;
+ }
+}
+
+/*** META ((export / /fl)
+ (peephole (div)))
+*/
+function sc_div(x) {
+ if (arguments.length === 1)
+ return 1/x;
+ else {
+ var res = x;
+ for (var i = 1; i < arguments.length; i++)
+ res /= arguments[i];
+ return res;
+ }
+}
+
+/*** META ((export #t)) */
+var sc_abs = Math.abs;
+
+/*** META ((export quotient /fx)
+ (peephole (hole 2 "parseInt(" x "/" y ")")))
+*/
+function sc_quotient(x, y) {
+ return parseInt(x / y);
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "%")))
+*/
+function sc_remainder(x, y) {
+ return x % y;
+}
+
+/*** META ((export #t)
+ (peephole (modulo)))
+*/
+function sc_modulo(x, y) {
+ var remainder = x % y;
+ // if they don't have the same sign
+ if ((remainder * y) < 0)
+ return remainder + y;
+ else
+ return remainder;
+}
+
+function sc_euclid_gcd(a, b) {
+ var temp;
+ if (a === 0) return b;
+ if (b === 0) return a;
+ if (a < 0) {a = -a;};
+ if (b < 0) {b = -b;};
+ if (b > a) {temp = a; a = b; b = temp;};
+ while (true) {
+ a %= b;
+ if(a === 0) {return b;};
+ b %= a;
+ if(b === 0) {return a;};
+ };
+ return b;
+}
+
+/*** META ((export #t)) */
+function sc_gcd() {
+ var gcd = 0;
+ for (var i = 0; i < arguments.length; i++)
+ gcd = sc_euclid_gcd(gcd, arguments[i]);
+ return gcd;
+}
+
+/*** META ((export #t)) */
+function sc_lcm() {
+ var lcm = 1;
+ for (var i = 0; i < arguments.length; i++) {
+ var f = Math.round(arguments[i] / sc_euclid_gcd(arguments[i], lcm));
+ lcm *= Math.abs(f);
+ }
+ return lcm;
+}
+
+// LIMITATION: numerator and denominator don't make sense in floating point world.
+//var SC_MAX_DECIMALS = 1000000
+//
+// function sc_numerator(x) {
+// var rounded = Math.round(x * SC_MAX_DECIMALS);
+// return Math.round(rounded / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));
+// }
+
+// function sc_denominator(x) {
+// var rounded = Math.round(x * SC_MAX_DECIMALS);
+// return Math.round(SC_MAX_DECIMALS / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));
+// }
+
+/*** META ((export #t)) */
+var sc_floor = Math.floor;
+/*** META ((export #t)) */
+var sc_ceiling = Math.ceil;
+/*** META ((export #t)) */
+var sc_truncate = parseInt;
+/*** META ((export #t)) */
+var sc_round = Math.round;
+
+// LIMITATION: sc_rationalize doesn't make sense in a floating point world.
+
+/*** META ((export #t)) */
+var sc_exp = Math.exp;
+/*** META ((export #t)) */
+var sc_log = Math.log;
+/*** META ((export #t)) */
+var sc_sin = Math.sin;
+/*** META ((export #t)) */
+var sc_cos = Math.cos;
+/*** META ((export #t)) */
+var sc_tan = Math.tan;
+/*** META ((export #t)) */
+var sc_asin = Math.asin;
+/*** META ((export #t)) */
+var sc_acos = Math.acos;
+/*** META ((export #t)) */
+var sc_atan = Math.atan;
+
+/*** META ((export #t)) */
+var sc_sqrt = Math.sqrt;
+/*** META ((export #t)) */
+var sc_expt = Math.pow;
+
+// LIMITATION: we don't have complex numbers.
+// LIMITATION: the following functions are hence not implemented.
+// LIMITATION: make-rectangular, make-polar, real-part, imag-part, magnitude, angle
+// LIMITATION: 2 argument atan
+
+/*** META ((export #t)
+ (peephole (id)))
+*/
+function sc_exact2inexact(x) {
+ return x;
+}
+
+/*** META ((export #t)
+ (peephole (id)))
+*/
+function sc_inexact2exact(x) {
+ return x;
+}
+
+function sc_number2jsstring(x, radix) {
+ if (radix)
+ return x.toString(radix);
+ else
+ return x.toString();
+}
+
+function sc_jsstring2number(s, radix) {
+ if (s === "") return false;
+
+ if (radix) {
+ var t = parseInt(s, radix);
+ if (!t && t !== 0) return false;
+ // verify that each char is in range. (parseInt ignores leading
+ // white and trailing chars)
+ var allowedChars = "01234567890abcdefghijklmnopqrstuvwxyz".substring(0, radix+1);
+ if ((new RegExp("^["+allowedChars+"]*$", "i")).test(s))
+ return t;
+ else return false;
+ } else {
+ var t = +s; // does not ignore trailing chars.
+ if (!t && t !== 0) return false;
+ // simply verify that first char is not whitespace.
+ var c = s.charAt(0);
+ // if +c is 0, but the char is not "0", then we have a whitespace.
+ if (+c === 0 && c !== "0") return false;
+ return t;
+ }
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (not)))
+*/
+function sc_not(b) {
+ return b === false;
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isBoolean(b) {
+ return (b === true) || (b === false);
+}
+
+function sc_Pair(car, cdr) {
+ this.car = car;
+ this.cdr = cdr;
+}
+
+sc_Pair.prototype.toString = function() {
+ return sc_toDisplayString(this);
+};
+sc_Pair.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {
+ var current = this;
+
+ var res = "(";
+
+ while(true) {
+ res += writeOrDisplay(current.car);
+ if (sc_isPair(current.cdr)) {
+ res += " ";
+ current = current.cdr;
+ } else if (current.cdr !== null) {
+ res += " . " + writeOrDisplay(current.cdr);
+ break;
+ } else // current.cdr == null
+ break;
+ }
+
+ res += ")";
+
+ return res;
+};
+sc_Pair.prototype.sc_toDisplayString = function() {
+ return this.sc_toWriteOrDisplayString(sc_toDisplayString);
+};
+sc_Pair.prototype.sc_toWriteString = function() {
+ return this.sc_toWriteOrDisplayString(sc_toWriteString);
+};
+// sc_Pair.prototype.sc_toWriteCircleString in IO.js
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " instanceof sc_Pair")))
+*/
+function sc_isPair(p) {
+ return (p instanceof sc_Pair);
+}
+
+function sc_isPairEqual(p1, p2, comp) {
+ return (comp(p1.car, p2.car) && comp(p1.cdr, p2.cdr));
+}
+
+/*** META ((export #t)
+ (peephole (hole 2 "new sc_Pair(" car ", " cdr ")")))
+*/
+function sc_cons(car, cdr) {
+ return new sc_Pair(car, cdr);
+}
+
+/*** META ((export cons*)) */
+function sc_consStar() {
+ var res = arguments[arguments.length - 1];
+ for (var i = arguments.length-2; i >= 0; i--)
+ res = new sc_Pair(arguments[i], res);
+ return res;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".car")))
+*/
+function sc_car(p) {
+ return p.car;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".cdr")))
+*/
+function sc_cdr(p) {
+ return p.cdr;
+}
+
+/*** META ((export #t)
+ (peephole (hole 2 p ".car = " val)))
+*/
+function sc_setCarBang(p, val) {
+ p.car = val;
+}
+
+/*** META ((export #t)
+ (peephole (hole 2 p ".cdr = " val)))
+*/
+function sc_setCdrBang(p, val) {
+ p.cdr = val;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".car.car")))
+*/
+function sc_caar(p) { return p.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car")))
+*/
+function sc_cadr(p) { return p.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr")))
+*/
+function sc_cdar(p) { return p.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr")))
+*/
+function sc_cddr(p) { return p.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.car")))
+*/
+function sc_caaar(p) { return p.car.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.car")))
+*/
+function sc_cadar(p) { return p.car.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.car")))
+*/
+function sc_caadr(p) { return p.cdr.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.car")))
+*/
+function sc_caddr(p) { return p.cdr.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.cdr")))
+*/
+function sc_cdaar(p) { return p.car.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.cdr")))
+*/
+function sc_cdadr(p) { return p.cdr.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.cdr")))
+*/
+function sc_cddar(p) { return p.car.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.cdr")))
+*/
+function sc_cdddr(p) { return p.cdr.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.car.car")))
+*/
+function sc_caaaar(p) { return p.car.car.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.car.car")))
+*/
+function sc_caadar(p) { return p.car.cdr.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.car.car")))
+*/
+function sc_caaadr(p) { return p.cdr.car.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.car.car")))
+*/
+function sc_caaddr(p) { return p.cdr.cdr.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.car.cdr")))
+*/
+function sc_cdaaar(p) { return p.car.car.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.car.cdr")))
+*/
+function sc_cdadar(p) { return p.car.cdr.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.car.cdr")))
+*/
+function sc_cdaadr(p) { return p.cdr.car.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.car.cdr")))
+*/
+function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.cdr.car")))
+*/
+function sc_cadaar(p) { return p.car.car.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.cdr.car")))
+*/
+function sc_caddar(p) { return p.car.cdr.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.cdr.car")))
+*/
+function sc_cadadr(p) { return p.cdr.car.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.cdr.car")))
+*/
+function sc_cadddr(p) { return p.cdr.cdr.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.cdr.cdr")))
+*/
+function sc_cddaar(p) { return p.car.car.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.cdr.cdr")))
+*/
+function sc_cdddar(p) { return p.car.cdr.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.cdr.cdr")))
+*/
+function sc_cddadr(p) { return p.cdr.car.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.cdr.cdr")))
+*/
+function sc_cddddr(p) { return p.cdr.cdr.cdr.cdr; }
+
+/*** META ((export #t)) */
+function sc_lastPair(l) {
+ if (!sc_isPair(l)) sc_error("sc_lastPair: pair expected");
+ var res = l;
+ var cdr = l.cdr;
+ while (sc_isPair(cdr)) {
+ res = cdr;
+ cdr = res.cdr;
+ }
+ return res;
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " === null")))
+*/
+function sc_isNull(o) {
+ return (o === null);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isList(o) {
+ var rabbit;
+ var turtle;
+
+ var rabbit = o;
+ var turtle = o;
+ while (true) {
+ if (rabbit === null ||
+ (rabbit instanceof sc_Pair && rabbit.cdr === null))
+ return true; // end of list
+ else if ((rabbit instanceof sc_Pair) &&
+ (rabbit.cdr instanceof sc_Pair)) {
+ rabbit = rabbit.cdr.cdr;
+ turtle = turtle.cdr;
+ if (rabbit === turtle) return false; // cycle
+ } else
+ return false; // not pair
+ }
+}
+
+/*** META ((export #t)) */
+function sc_list() {
+ var res = null;
+ var a = arguments;
+ for (var i = a.length-1; i >= 0; i--)
+ res = new sc_Pair(a[i], res);
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_iota(num, init) {
+ var res = null;
+ if (!init) init = 0;
+ for (var i = num - 1; i >= 0; i--)
+ res = new sc_Pair(i + init, res);
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_makeList(nbEls, fill) {
+ var res = null;
+ for (var i = 0; i < nbEls; i++)
+ res = new sc_Pair(fill, res);
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_length(l) {
+ var res = 0;
+ while (l !== null) {
+ res++;
+ l = l.cdr;
+ }
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_remq(o, l) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ while (l !== null) {
+ if (l.car !== o) {
+ tail.cdr = sc_cons(l.car, null);
+ tail = tail.cdr;
+ }
+ l = l.cdr;
+ }
+ return dummy.cdr;
+}
+
+/*** META ((export #t)) */
+function sc_remqBang(o, l) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ var needsAssig = true;
+ while (l !== null) {
+ if (l.car === o) {
+ needsAssig = true;
+ } else {
+ if (needsAssig) {
+ tail.cdr = l;
+ needsAssig = false;
+ }
+ tail = l;
+ }
+ l = l.cdr;
+ }
+ tail.cdr = null;
+ return dummy.cdr;
+}
+
+/*** META ((export #t)) */
+function sc_delete(o, l) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ while (l !== null) {
+ if (!sc_isEqual(l.car, o)) {
+ tail.cdr = sc_cons(l.car, null);
+ tail = tail.cdr;
+ }
+ l = l.cdr;
+ }
+ return dummy.cdr;
+}
+
+/*** META ((export #t)) */
+function sc_deleteBang(o, l) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ var needsAssig = true;
+ while (l !== null) {
+ if (sc_isEqual(l.car, o)) {
+ needsAssig = true;
+ } else {
+ if (needsAssig) {
+ tail.cdr = l;
+ needsAssig = false;
+ }
+ tail = l;
+ }
+ l = l.cdr;
+ }
+ tail.cdr = null;
+ return dummy.cdr;
+}
+
+function sc_reverseAppendBang(l1, l2) {
+ var res = l2;
+ while (l1 !== null) {
+ var tmp = res;
+ res = l1;
+ l1 = l1.cdr;
+ res.cdr = tmp;
+ }
+ return res;
+}
+
+function sc_dualAppend(l1, l2) {
+ if (l1 === null) return l2;
+ if (l2 === null) return l1;
+ var rev = sc_reverse(l1);
+ return sc_reverseAppendBang(rev, l2);
+}
+
+/*** META ((export #t)) */
+function sc_append() {
+ if (arguments.length === 0)
+ return null;
+ var res = arguments[arguments.length - 1];
+ for (var i = arguments.length - 2; i >= 0; i--)
+ res = sc_dualAppend(arguments[i], res);
+ return res;
+}
+
+function sc_dualAppendBang(l1, l2) {
+ if (l1 === null) return l2;
+ if (l2 === null) return l1;
+ var tmp = l1;
+ while (tmp.cdr !== null) tmp=tmp.cdr;
+ tmp.cdr = l2;
+ return l1;
+}
+
+/*** META ((export #t)) */
+function sc_appendBang() {
+ var res = null;
+ for (var i = 0; i < arguments.length; i++)
+ res = sc_dualAppendBang(res, arguments[i]);
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_reverse(l1) {
+ var res = null;
+ while (l1 !== null) {
+ res = sc_cons(l1.car, res);
+ l1 = l1.cdr;
+ }
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_reverseBang(l) {
+ return sc_reverseAppendBang(l, null);
+}
+
+/*** META ((export #t)) */
+function sc_listTail(l, k) {
+ var res = l;
+ for (var i = 0; i < k; i++) {
+ res = res.cdr;
+ }
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_listRef(l, k) {
+ return sc_listTail(l, k).car;
+}
+
+/* // unoptimized generic versions
+function sc_memX(o, l, comp) {
+ while (l != null) {
+ if (comp(l.car, o))
+ return l;
+ l = l.cdr;
+ }
+ return false;
+}
+function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); }
+function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); }
+function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); }
+*/
+
+/* optimized versions */
+/*** META ((export #t)) */
+function sc_memq(o, l) {
+ while (l !== null) {
+ if (l.car === o)
+ return l;
+ l = l.cdr;
+ }
+ return false;
+}
+/*** META ((export #t)) */
+function sc_memv(o, l) {
+ while (l !== null) {
+ if (l.car === o)
+ return l;
+ l = l.cdr;
+ }
+ return false;
+}
+/*** META ((export #t)) */
+function sc_member(o, l) {
+ while (l !== null) {
+ if (sc_isEqual(l.car,o))
+ return l;
+ l = l.cdr;
+ }
+ return false;
+}
+
+/* // generic unoptimized versions
+function sc_assX(o, al, comp) {
+ while (al != null) {
+ if (comp(al.car.car, o))
+ return al.car;
+ al = al.cdr;
+ }
+ return false;
+}
+function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); }
+function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); }
+function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); }
+*/
+// optimized versions
+/*** META ((export #t)) */
+function sc_assq(o, al) {
+ while (al !== null) {
+ if (al.car.car === o)
+ return al.car;
+ al = al.cdr;
+ }
+ return false;
+}
+/*** META ((export #t)) */
+function sc_assv(o, al) {
+ while (al !== null) {
+ if (al.car.car === o)
+ return al.car;
+ al = al.cdr;
+ }
+ return false;
+}
+/*** META ((export #t)) */
+function sc_assoc(o, al) {
+ while (al !== null) {
+ if (sc_isEqual(al.car.car, o))
+ return al.car;
+ al = al.cdr;
+ }
+ return false;
+}
+
+/* can be used for mutable strings and characters */
+function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; }
+function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; }
+function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; }
+function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; }
+function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; }
+function sc_isCharStringCIEqual(cs1, cs2)
+ { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); }
+function sc_isCharStringCILess(cs1, cs2)
+ { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); }
+function sc_isCharStringCIGreater(cs1, cs2)
+ { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); }
+function sc_isCharStringCILessEqual(cs1, cs2)
+ { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); }
+function sc_isCharStringCIGreaterEqual(cs1, cs2)
+ { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); }
+
+
+
+
+function sc_Char(c) {
+ var cached = sc_Char.lazy[c];
+ if (cached)
+ return cached;
+ this.val = c;
+ sc_Char.lazy[c] = this;
+ // add return, so FF does not complain.
+ return undefined;
+}
+sc_Char.lazy = new Object();
+// thanks to Eric
+sc_Char.char2readable = {
+ "\000": "#\\null",
+ "\007": "#\\bell",
+ "\010": "#\\backspace",
+ "\011": "#\\tab",
+ "\012": "#\\newline",
+ "\014": "#\\page",
+ "\015": "#\\return",
+ "\033": "#\\escape",
+ "\040": "#\\space",
+ "\177": "#\\delete",
+
+ /* poeticless names */
+ "\001": "#\\soh",
+ "\002": "#\\stx",
+ "\003": "#\\etx",
+ "\004": "#\\eot",
+ "\005": "#\\enq",
+ "\006": "#\\ack",
+
+ "\013": "#\\vt",
+ "\016": "#\\so",
+ "\017": "#\\si",
+
+ "\020": "#\\dle",
+ "\021": "#\\dc1",
+ "\022": "#\\dc2",
+ "\023": "#\\dc3",
+ "\024": "#\\dc4",
+ "\025": "#\\nak",
+ "\026": "#\\syn",
+ "\027": "#\\etb",
+
+ "\030": "#\\can",
+ "\031": "#\\em",
+ "\032": "#\\sub",
+ "\033": "#\\esc",
+ "\034": "#\\fs",
+ "\035": "#\\gs",
+ "\036": "#\\rs",
+ "\037": "#\\us"};
+
+sc_Char.readable2char = {
+ "null": "\000",
+ "bell": "\007",
+ "backspace": "\010",
+ "tab": "\011",
+ "newline": "\012",
+ "page": "\014",
+ "return": "\015",
+ "escape": "\033",
+ "space": "\040",
+ "delete": "\000",
+ "soh": "\001",
+ "stx": "\002",
+ "etx": "\003",
+ "eot": "\004",
+ "enq": "\005",
+ "ack": "\006",
+ "bel": "\007",
+ "bs": "\010",
+ "ht": "\011",
+ "nl": "\012",
+ "vt": "\013",
+ "np": "\014",
+ "cr": "\015",
+ "so": "\016",
+ "si": "\017",
+ "dle": "\020",
+ "dc1": "\021",
+ "dc2": "\022",
+ "dc3": "\023",
+ "dc4": "\024",
+ "nak": "\025",
+ "syn": "\026",
+ "etb": "\027",
+ "can": "\030",
+ "em": "\031",
+ "sub": "\032",
+ "esc": "\033",
+ "fs": "\034",
+ "gs": "\035",
+ "rs": "\036",
+ "us": "\037",
+ "sp": "\040",
+ "del": "\177"};
+
+sc_Char.prototype.toString = function() {
+ return this.val;
+};
+// sc_toDisplayString == toString
+sc_Char.prototype.sc_toWriteString = function() {
+ var entry = sc_Char.char2readable[this.val];
+ if (entry)
+ return entry;
+ else
+ return "#\\" + this.val;
+};
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "instanceof sc_Char")))
+*/
+function sc_isChar(c) {
+ return (c instanceof sc_Char);
+}
+
+/*** META ((export char=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val === " c2 ".val")))
+*/
+var sc_isCharEqual = sc_isCharStringEqual;
+/*** META ((export char<?)
+ (type bool)
+ (peephole (hole 2 c1 ".val < " c2 ".val")))
+*/
+var sc_isCharLess = sc_isCharStringLess;
+/*** META ((export char>?)
+ (type bool)
+ (peephole (hole 2 c1 ".val > " c2 ".val")))
+*/
+var sc_isCharGreater = sc_isCharStringGreater;
+/*** META ((export char<=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val <= " c2 ".val")))
+*/
+var sc_isCharLessEqual = sc_isCharStringLessEqual;
+/*** META ((export char>=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val >= " c2 ".val")))
+*/
+var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual;
+/*** META ((export char-ci=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCIEqual = sc_isCharStringCIEqual;
+/*** META ((export char-ci<?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() < " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCILess = sc_isCharStringCILess;
+/*** META ((export char-ci>?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCIGreater = sc_isCharStringCIGreater;
+/*** META ((export char-ci<=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCILessEqual = sc_isCharStringCILessEqual;
+/*** META ((export char-ci>=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual;
+
+var SC_NUMBER_CLASS = "0123456789";
+var SC_WHITESPACE_CLASS = ' \r\n\t\f';
+var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz';
+var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+
+function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); }
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isCharAlphabetic(c)
+ { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||
+ sc_isCharOfClass(c.val, SC_UPPER_CLASS); }
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1")))
+*/
+function sc_isCharNumeric(c)
+ { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isCharWhitespace(c) {
+ var tmp = c.val;
+ return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f";
+}
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1")))
+*/
+function sc_isCharUpperCase(c)
+ { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); }
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1")))
+*/
+function sc_isCharLowerCase(c)
+ { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); }
+
+/*** META ((export #t)
+ (peephole (postfix ".val.charCodeAt(0)")))
+*/
+function sc_char2integer(c)
+ { return c.val.charCodeAt(0); }
+/*** META ((export #t)
+ (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))")))
+*/
+function sc_integer2char(n)
+ { return new sc_Char(String.fromCharCode(n)); }
+
+/*** META ((export #t)
+ (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())")))
+*/
+function sc_charUpcase(c)
+ { return new sc_Char(c.val.toUpperCase()); }
+/*** META ((export #t)
+ (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())")))
+*/
+function sc_charDowncase(c)
+ { return new sc_Char(c.val.toLowerCase()); }
+
+function sc_makeJSStringOfLength(k, c) {
+ var fill;
+ if (c === undefined)
+ fill = " ";
+ else
+ fill = c;
+ var res = "";
+ var len = 1;
+ // every round doubles the size of fill.
+ while (k >= len) {
+ if (k & len)
+ res = res.concat(fill);
+ fill = fill.concat(fill);
+ len *= 2;
+ }
+ return res;
+}
+
+function sc_makejsString(k, c) {
+ var fill;
+ if (c)
+ fill = c.val;
+ else
+ fill = " ";
+ return sc_makeJSStringOfLength(k, fill);
+}
+
+function sc_jsstring2list(s) {
+ var res = null;
+ for (var i = s.length - 1; i >= 0; i--)
+ res = sc_cons(new sc_Char(s.charAt(i)), res);
+ return res;
+}
+
+function sc_list2jsstring(l) {
+ var a = new Array();
+ while(l !== null) {
+ a.push(l.car.val);
+ l = l.cdr;
+ }
+ return "".concat.apply("", a);
+}
+
+var sc_Vector = Array;
+
+sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {
+ if (this.length === 0) return "#()";
+
+ var res = "#(" + writeOrDisplay(this[0]);
+ for (var i = 1; i < this.length; i++)
+ res += " " + writeOrDisplay(this[i]);
+ res += ")";
+ return res;
+};
+sc_Vector.prototype.sc_toDisplayString = function() {
+ return this.sc_toWriteOrDisplayString(sc_toDisplayString);
+};
+sc_Vector.prototype.sc_toWriteString = function() {
+ return this.sc_toWriteOrDisplayString(sc_toWriteString);
+};
+
+/*** META ((export vector? array?)
+ (type bool)
+ (peephole (postfix " instanceof sc_Vector")))
+*/
+function sc_isVector(v) {
+ return (v instanceof sc_Vector);
+}
+
+// only applies to vectors
+function sc_isVectorEqual(v1, v2, comp) {
+ if (v1.length !== v2.length) return false;
+ for (var i = 0; i < v1.length; i++)
+ if (!comp(v1[i], v2[i])) return false;
+ return true;
+}
+
+/*** META ((export make-vector make-array)) */
+function sc_makeVector(size, fill) {
+ var a = new sc_Vector(size);
+ if (fill !== undefined)
+ sc_vectorFillBang(a, fill);
+ return a;
+}
+
+/*** META ((export vector array)
+ (peephole (vector)))
+*/
+function sc_vector() {
+ var a = new sc_Vector();
+ for (var i = 0; i < arguments.length; i++)
+ a.push(arguments[i]);
+ return a;
+}
+
+/*** META ((export vector-length array-length)
+ (peephole (postfix ".length")))
+*/
+function sc_vectorLength(v) {
+ return v.length;
+}
+
+/*** META ((export vector-ref array-ref)
+ (peephole (hole 2 v "[" pos "]")))
+*/
+function sc_vectorRef(v, pos) {
+ return v[pos];
+}
+
+/*** META ((export vector-set! array-set!)
+ (peephole (hole 3 v "[" pos "] = " val)))
+*/
+function sc_vectorSetBang(v, pos, val) {
+ v[pos] = val;
+}
+
+/*** META ((export vector->list array->list)) */
+function sc_vector2list(a) {
+ var res = null;
+ for (var i = a.length-1; i >= 0; i--)
+ res = sc_cons(a[i], res);
+ return res;
+}
+
+/*** META ((export list->vector list->array)) */
+function sc_list2vector(l) {
+ var a = new sc_Vector();
+ while(l !== null) {
+ a.push(l.car);
+ l = l.cdr;
+ }
+ return a;
+}
+
+/*** META ((export vector-fill! array-fill!)) */
+function sc_vectorFillBang(a, fill) {
+ for (var i = 0; i < a.length; i++)
+ a[i] = fill;
+}
+
+
+/*** META ((export #t)) */
+function sc_copyVector(a, len) {
+ if (len <= a.length)
+ return a.slice(0, len);
+ else {
+ var tmp = a.concat();
+ tmp.length = len;
+ return tmp;
+ }
+}
+
+/*** META ((export #t)
+ (peephole (hole 3 a ".slice(" start "," end ")")))
+*/
+function sc_vectorCopy(a, start, end) {
+ return a.slice(start, end);
+}
+
+/*** META ((export #t)) */
+function sc_vectorCopyBang(target, tstart, source, sstart, send) {
+ if (!sstart) sstart = 0;
+ if (!send) send = source.length;
+
+ // if target == source we don't want to overwrite not yet copied elements.
+ if (tstart <= sstart) {
+ for (var i = tstart, j = sstart; j < send; i++, j++) {
+ target[i] = source[j];
+ }
+ } else {
+ var diff = send - sstart;
+ for (var i = tstart + diff - 1, j = send - 1;
+ j >= sstart;
+ i--, j--) {
+ target[i] = source[j];
+ }
+ }
+ return target;
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 1 "typeof " o " === 'function'")))
+*/
+function sc_isProcedure(o) {
+ return (typeof o === "function");
+}
+
+/*** META ((export #t)) */
+function sc_apply(proc) {
+ var args = new Array();
+ // first part of arguments are not in list-form.
+ for (var i = 1; i < arguments.length - 1; i++)
+ args.push(arguments[i]);
+ var l = arguments[arguments.length - 1];
+ while (l !== null) {
+ args.push(l.car);
+ l = l.cdr;
+ }
+ return proc.apply(null, args);
+}
+
+/*** META ((export #t)) */
+function sc_map(proc, l1) {
+ if (l1 === undefined)
+ return null;
+ // else
+ var nbApplyArgs = arguments.length - 1;
+ var applyArgs = new Array(nbApplyArgs);
+ var revres = null;
+ while (l1 !== null) {
+ for (var i = 0; i < nbApplyArgs; i++) {
+ applyArgs[i] = arguments[i + 1].car;
+ arguments[i + 1] = arguments[i + 1].cdr;
+ }
+ revres = sc_cons(proc.apply(null, applyArgs), revres);
+ }
+ return sc_reverseAppendBang(revres, null);
+}
+
+/*** META ((export #t)) */
+function sc_mapBang(proc, l1) {
+ if (l1 === undefined)
+ return null;
+ // else
+ var l1_orig = l1;
+ var nbApplyArgs = arguments.length - 1;
+ var applyArgs = new Array(nbApplyArgs);
+ while (l1 !== null) {
+ var tmp = l1;
+ for (var i = 0; i < nbApplyArgs; i++) {
+ applyArgs[i] = arguments[i + 1].car;
+ arguments[i + 1] = arguments[i + 1].cdr;
+ }
+ tmp.car = proc.apply(null, applyArgs);
+ }
+ return l1_orig;
+}
+
+/*** META ((export #t)) */
+function sc_forEach(proc, l1) {
+ if (l1 === undefined)
+ return undefined;
+ // else
+ var nbApplyArgs = arguments.length - 1;
+ var applyArgs = new Array(nbApplyArgs);
+ while (l1 !== null) {
+ for (var i = 0; i < nbApplyArgs; i++) {
+ applyArgs[i] = arguments[i + 1].car;
+ arguments[i + 1] = arguments[i + 1].cdr;
+ }
+ proc.apply(null, applyArgs);
+ }
+ // add return so FF does not complain.
+ return undefined;
+}
+
+/*** META ((export #t)) */
+function sc_filter(proc, l1) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ while (l1 !== null) {
+ if (proc(l1.car) !== false) {
+ tail.cdr = sc_cons(l1.car, null);
+ tail = tail.cdr;
+ }
+ l1 = l1.cdr;
+ }
+ return dummy.cdr;
+}
+
+/*** META ((export #t)) */
+function sc_filterBang(proc, l1) {
+ var head = sc_cons("dummy", l1);
+ var it = head;
+ var next = l1;
+ while (next !== null) {
+ if (proc(next.car) !== false) {
+ it.cdr = next
+ it = next;
+ }
+ next = next.cdr;
+ }
+ it.cdr = null;
+ return head.cdr;
+}
+
+function sc_filterMap1(proc, l1) {
+ var revres = null;
+ while (l1 !== null) {
+ var tmp = proc(l1.car)
+ if (tmp !== false) revres = sc_cons(tmp, revres);
+ l1 = l1.cdr;
+ }
+ return sc_reverseAppendBang(revres, null);
+}
+function sc_filterMap2(proc, l1, l2) {
+ var revres = null;
+ while (l1 !== null) {
+ var tmp = proc(l1.car, l2.car);
+ if(tmp !== false) revres = sc_cons(tmp, revres);
+ l1 = l1.cdr;
+ l2 = l2.cdr
+ }
+ return sc_reverseAppendBang(revres, null);
+}
+
+/*** META ((export #t)) */
+function sc_filterMap(proc, l1, l2, l3) {
+ if (l2 === undefined)
+ return sc_filterMap1(proc, l1);
+ else if (l3 === undefined)
+ return sc_filterMap2(proc, l1, l2);
+ // else
+ var nbApplyArgs = arguments.length - 1;
+ var applyArgs = new Array(nbApplyArgs);
+ var revres = null;
+ while (l1 !== null) {
+ for (var i = 0; i < nbApplyArgs; i++) {
+ applyArgs[i] = arguments[i + 1].car;
+ arguments[i + 1] = arguments[i + 1].cdr;
+ }
+ var tmp = proc.apply(null, applyArgs);
+ if(tmp !== false) revres = sc_cons(tmp, revres);
+ }
+ return sc_reverseAppendBang(revres, null);
+}
+
+/*** META ((export #t)) */
+function sc_any(proc, l) {
+ var revres = null;
+ while (l !== null) {
+ var tmp = proc(l.car);
+ if(tmp !== false) return tmp;
+ l = l.cdr;
+ }
+ return false;
+}
+
+/*** META ((export any?)
+ (peephole (hole 2 "sc_any(" proc "," l ") !== false")))
+*/
+function sc_anyPred(proc, l) {
+ return sc_any(proc, l)!== false;
+}
+
+/*** META ((export #t)) */
+function sc_every(proc, l) {
+ var revres = null;
+ var tmp = true;
+ while (l !== null) {
+ tmp = proc(l.car);
+ if (tmp === false) return false;
+ l = l.cdr;
+ }
+ return tmp;
+}
+
+/*** META ((export every?)
+ (peephole (hole 2 "sc_every(" proc "," l ") !== false")))
+*/
+function sc_everyPred(proc, l) {
+ var tmp = sc_every(proc, l);
+ if (tmp !== false) return true;
+ return false;
+}
+
+/*** META ((export #t)
+ (peephole (postfix "()")))
+*/
+function sc_force(o) {
+ return o();
+}
+
+/*** META ((export #t)) */
+function sc_makePromise(proc) {
+ var isResultReady = false;
+ var result = undefined;
+ return function() {
+ if (!isResultReady) {
+ var tmp = proc();
+ if (!isResultReady) {
+ isResultReady = true;
+ result = tmp;
+ }
+ }
+ return result;
+ };
+}
+
+function sc_Values(values) {
+ this.values = values;
+}
+
+/*** META ((export #t)
+ (peephole (values)))
+*/
+function sc_values() {
+ if (arguments.length === 1)
+ return arguments[0];
+ else
+ return new sc_Values(arguments);
+}
+
+/*** META ((export #t)) */
+function sc_callWithValues(producer, consumer) {
+ var produced = producer();
+ if (produced instanceof sc_Values)
+ return consumer.apply(null, produced.values);
+ else
+ return consumer(produced);
+}
+
+/*** META ((export #t)) */
+function sc_dynamicWind(before, thunk, after) {
+ before();
+ try {
+ var res = thunk();
+ return res;
+ } finally {
+ after();
+ }
+}
+
+
+// TODO: eval/scheme-report-environment/null-environment/interaction-environment
+
+// LIMITATION: 'load' doesn't exist without files.
+// LIMITATION: transcript-on/transcript-off doesn't exist without files.
+
+
+function sc_Struct(name) {
+ this.name = name;
+}
+sc_Struct.prototype.sc_toDisplayString = function() {
+ return "#<struct" + sc_hash(this) + ">";
+};
+sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString;
+
+/*** META ((export #t)
+ (peephole (hole 1 "new sc_Struct(" name ")")))
+*/
+function sc_makeStruct(name) {
+ return new sc_Struct(name);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " instanceof sc_Struct")))
+*/
+function sc_isStruct(o) {
+ return (o instanceof sc_Struct);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")")))
+*/
+function sc_isStructNamed(name, s) {
+ return ((s instanceof sc_Struct) && (s.name === name));
+}
+
+/*** META ((export struct-field)
+ (peephole (hole 3 0 "[" 2 "]")))
+*/
+function sc_getStructField(s, name, field) {
+ return s[field];
+}
+
+/*** META ((export struct-field-set!)
+ (peephole (hole 4 0 "[" 2 "] = " 3)))
+*/
+function sc_setStructFieldBang(s, name, field, val) {
+ s[field] = val;
+}
+
+/*** META ((export #t)
+ (peephole (prefix "~")))
+*/
+function sc_bitNot(x) {
+ return ~x;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "&")))
+*/
+function sc_bitAnd(x, y) {
+ return x & y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "|")))
+*/
+function sc_bitOr(x, y) {
+ return x | y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "^")))
+*/
+function sc_bitXor(x, y) {
+ return x ^ y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "<<")))
+*/
+function sc_bitLsh(x, y) {
+ return x << y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 ">>")))
+*/
+function sc_bitRsh(x, y) {
+ return x >> y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 ">>>")))
+*/
+function sc_bitUrsh(x, y) {
+ return x >>> y;
+}
+
+/*** META ((export js-field js-property)
+ (peephole (hole 2 o "[" field "]")))
+*/
+function sc_jsField(o, field) {
+ return o[field];
+}
+
+/*** META ((export js-field-set! js-property-set!)
+ (peephole (hole 3 o "[" field "] = " val)))
+*/
+function sc_setJsFieldBang(o, field, val) {
+ return o[field] = val;
+}
+
+/*** META ((export js-field-delete! js-property-delete!)
+ (peephole (hole 2 "delete" o "[" field "]")))
+*/
+function sc_deleteJsFieldBang(o, field) {
+ delete o[field];
+}
+
+/*** META ((export #t)
+ (peephole (jsCall)))
+*/
+function sc_jsCall(o, fun) {
+ var args = new Array();
+ for (var i = 2; i < arguments.length; i++)
+ args[i-2] = arguments[i];
+ return fun.apply(o, args);
+}
+
+/*** META ((export #t)
+ (peephole (jsMethodCall)))
+*/
+function sc_jsMethodCall(o, field) {
+ var args = new Array();
+ for (var i = 2; i < arguments.length; i++)
+ args[i-2] = arguments[i];
+ return o[field].apply(o, args);
+}
+
+/*** META ((export new js-new)
+ (peephole (jsNew)))
+*/
+function sc_jsNew(c) {
+ var evalStr = "new c(";
+ evalStr +=arguments.length > 1? "arguments[1]": "";
+ for (var i = 2; i < arguments.length; i++)
+ evalStr += ", arguments[" + i + "]";
+ evalStr +=")";
+ return eval(evalStr);
+}
+
+// ======================== RegExp ====================
+/*** META ((export #t)) */
+function sc_pregexp(re) {
+ return new RegExp(sc_string2jsstring(re));
+}
+
+/*** META ((export #t)) */
+function sc_pregexpMatch(re, s) {
+ var reg = (re instanceof RegExp) ? re : sc_pregexp(re);
+ var tmp = reg.exec(sc_string2jsstring(s));
+
+ if (tmp == null) return false;
+
+ var res = null;
+ for (var i = tmp.length-1; i >= 0; i--) {
+ if (tmp[i] !== null) {
+ res = sc_cons(sc_jsstring2string(tmp[i]), res);
+ } else {
+ res = sc_cons(false, res);
+ }
+ }
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_pregexpReplace(re, s1, s2) {
+ var reg;
+ var jss1 = sc_string2jsstring(s1);
+ var jss2 = sc_string2jsstring(s2);
+
+ if (re instanceof RegExp) {
+ if (re.global)
+ reg = re;
+ else
+ reg = new RegExp(re.source);
+ } else {
+ reg = new RegExp(sc_string2jsstring(re));
+ }
+
+ return jss1.replace(reg, jss2);
+}
+
+/*** META ((export pregexp-replace*)) */
+function sc_pregexpReplaceAll(re, s1, s2) {
+ var reg;
+ var jss1 = sc_string2jsstring(s1);
+ var jss2 = sc_string2jsstring(s2);
+
+ if (re instanceof RegExp) {
+ if (re.global)
+ reg = re;
+ else
+ reg = new RegExp(re.source, "g");
+ } else {
+ reg = new RegExp(sc_string2jsstring(re), "g");
+ }
+
+ return jss1.replace(reg, jss2);
+}
+
+/*** META ((export #t)) */
+function sc_pregexpSplit(re, s) {
+ var reg = ((re instanceof RegExp) ?
+ re :
+ new RegExp(sc_string2jsstring(re)));
+ var jss = sc_string2jsstring(s);
+ var tmp = jss.split(reg);
+
+ if (tmp == null) return false;
+
+ return sc_vector2list(tmp);
+}
+
+
+/* =========================================================================== */
+/* Other library stuff */
+/* =========================================================================== */
+
+/*** META ((export #t)
+ (peephole (hole 1 "Math.floor(Math.random()*" 'n ")")))
+*/
+function sc_random(n) {
+ return Math.floor(Math.random()*n);
+}
+
+/*** META ((export current-date)
+ (peephole (hole 0 "new Date()")))
+*/
+function sc_currentDate() {
+ return new Date();
+}
+
+function sc_Hashtable() {
+}
+sc_Hashtable.prototype.toString = function() {
+ return "#{%hashtable}";
+};
+// sc_toWriteString == sc_toDisplayString == toString
+
+function sc_HashtableElement(key, val) {
+ this.key = key;
+ this.val = val;
+}
+
+/*** META ((export #t)
+ (peephole (hole 0 "new sc_Hashtable()")))
+*/
+function sc_makeHashtable() {
+ return new sc_Hashtable();
+}
+
+/*** META ((export #t)) */
+function sc_hashtablePutBang(ht, key, val) {
+ var hash = sc_hash(key);
+ ht[hash] = new sc_HashtableElement(key, val);
+}
+
+/*** META ((export #t)) */
+function sc_hashtableGet(ht, key) {
+ var hash = sc_hash(key);
+ if (hash in ht)
+ return ht[hash].val;
+ else
+ return false;
+}
+
+/*** META ((export #t)) */
+function sc_hashtableForEach(ht, f) {
+ for (var v in ht) {
+ if (ht[v] instanceof sc_HashtableElement)
+ f(ht[v].key, ht[v].val);
+ }
+}
+
+/*** META ((export hashtable-contains?)
+ (peephole (hole 2 "sc_hash(" 1 ") in " 0)))
+*/
+function sc_hashtableContains(ht, key) {
+ var hash = sc_hash(key);
+ if (hash in ht)
+ return true;
+ else
+ return false;
+}
+
+var SC_HASH_COUNTER = 0;
+
+function sc_hash(o) {
+ if (o === null)
+ return "null";
+ else if (o === undefined)
+ return "undefined";
+ else if (o === true)
+ return "true";
+ else if (o === false)
+ return "false";
+ else if (typeof o === "number")
+ return "num-" + o;
+ else if (typeof o === "string")
+ return "jsstr-" + o;
+ else if (o.sc_getHash)
+ return o.sc_getHash();
+ else
+ return sc_counterHash.call(o);
+}
+function sc_counterHash() {
+ if (!this.sc_hash) {
+ this.sc_hash = "hash-" + SC_HASH_COUNTER;
+ SC_HASH_COUNTER++;
+ }
+ return this.sc_hash;
+}
+
+function sc_Trampoline(args, maxTailCalls) {
+ this['__trampoline return__'] = true;
+ this.args = args;
+ this.MAX_TAIL_CALLs = maxTailCalls;
+}
+// TODO: call/cc stuff
+sc_Trampoline.prototype.restart = function() {
+ var o = this;
+ while (true) {
+ // set both globals.
+ SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1;
+ var fun = o.args.callee;
+ var res = fun.apply(SC_TAIL_OBJECT, o.args);
+ if (res instanceof sc_Trampoline)
+ o = res;
+ else
+ return res;
+ }
+}
+
+/*** META ((export bind-exit-lambda)) */
+function sc_bindExitLambda(proc) {
+ var escape_obj = new sc_BindExitException();
+ var escape = function(res) {
+ escape_obj.res = res;
+ throw escape_obj;
+ };
+ try {
+ return proc(escape);
+ } catch(e) {
+ if (e === escape_obj) {
+ return e.res;
+ }
+ throw e;
+ }
+}
+function sc_BindExitException() {
+ this._internalException = true;
+}
+
+var SC_SCM2JS_GLOBALS = new Object();
+
+// default tail-call depth.
+// normally the program should set it again. but just in case...
+var SC_TAIL_OBJECT = new Object();
+SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT;
+// ======================== I/O =======================
+
+/*------------------------------------------------------------------*/
+
+function sc_EOF() {
+}
+var SC_EOF_OBJECT = new sc_EOF();
+
+function sc_Port() {
+}
+
+/* --------------- Input ports -------------------------------------*/
+
+function sc_InputPort() {
+}
+sc_InputPort.prototype = new sc_Port();
+
+sc_InputPort.prototype.peekChar = function() {
+ if (!("peeked" in this))
+ this.peeked = this.getNextChar();
+ return this.peeked;
+}
+sc_InputPort.prototype.readChar = function() {
+ var tmp = this.peekChar();
+ delete this.peeked;
+ return tmp;
+}
+sc_InputPort.prototype.isCharReady = function() {
+ return true;
+}
+sc_InputPort.prototype.close = function() {
+ // do nothing
+}
+
+/* .............. String port ..........................*/
+function sc_ErrorInputPort() {
+};
+sc_ErrorInputPort.prototype = new sc_InputPort();
+sc_ErrorInputPort.prototype.getNextChar = function() {
+ throw "can't read from error-port.";
+};
+sc_ErrorInputPort.prototype.isCharReady = function() {
+ return false;
+};
+
+
+/* .............. String port ..........................*/
+
+function sc_StringInputPort(jsStr) {
+ // we are going to do some charAts on the str.
+ // instead of recreating all the time a String-object, we
+ // create one in the beginning. (not sure, if this is really an optim)
+ this.str = new String(jsStr);
+ this.pos = 0;
+}
+sc_StringInputPort.prototype = new sc_InputPort();
+sc_StringInputPort.prototype.getNextChar = function() {
+ if (this.pos >= this.str.length)
+ return SC_EOF_OBJECT;
+ return this.str.charAt(this.pos++);
+};
+
+/* ------------- Read and other lib-funs -------------------------------*/
+function sc_Token(type, val, pos) {
+ this.type = type;
+ this.val = val;
+ this.pos = pos;
+}
+sc_Token.EOF = 0/*EOF*/;
+sc_Token.OPEN_PAR = 1/*OPEN_PAR*/;
+sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/;
+sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/;
+sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/;
+sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/;
+sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/;
+sc_Token.WHITESPACE = 7/*WHITESPACE*/;
+sc_Token.QUOTE = 8/*QUOTE*/;
+sc_Token.ID = 9/*ID*/;
+sc_Token.DOT = 10/*DOT*/;
+sc_Token.STRING = 11/*STRING*/;
+sc_Token.NUMBER = 12/*NUMBER*/;
+sc_Token.ERROR = 13/*ERROR*/;
+sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/;
+sc_Token.TRUE = 15/*TRUE*/;
+sc_Token.FALSE = 16/*FALSE*/;
+sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/;
+sc_Token.REFERENCE = 18/*REFERENCE*/;
+sc_Token.STORE = 19/*STORE*/;
+sc_Token.CHAR = 20/*CHAR*/;
+
+var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~";
+function sc_Tokenizer(port) {
+ this.port = port;
+}
+sc_Tokenizer.prototype.peekToken = function() {
+ if (this.peeked)
+ return this.peeked;
+ var newToken = this.nextToken();
+ this.peeked = newToken;
+ return newToken;
+};
+sc_Tokenizer.prototype.readToken = function() {
+ var tmp = this.peekToken();
+ delete this.peeked;
+ return tmp;
+};
+sc_Tokenizer.prototype.nextToken = function() {
+ var port = this.port;
+
+ function isNumberChar(c) {
+ return (c >= "0" && c <= "9");
+ };
+ function isIdOrNumberChar(c) {
+ return SC_ID_CLASS.indexOf(c) != -1 || // ID-char
+ (c >= "0" && c <= "9");
+ }
+ function isWhitespace(c) {
+ return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f";
+ };
+ function isWhitespaceOrEOF(c) {
+ return isWhitespace(c) || c === SC_EOF_OBJECT;
+ };
+
+ function readString() {
+ res = "";
+ while (true) {
+ var c = port.readChar();
+ switch (c) {
+ case '"':
+ return new sc_Token(11/*STRING*/, res);
+ case "\\":
+ var tmp = port.readChar();
+ switch (tmp) {
+ case '0': res += "\0"; break;
+ case 'a': res += "\a"; break;
+ case 'b': res += "\b"; break;
+ case 'f': res += "\f"; break;
+ case 'n': res += "\n"; break;
+ case 'r': res += "\r"; break;
+ case 't': res += "\t"; break;
+ case 'v': res += "\v"; break;
+ case '"': res += '"'; break;
+ case '\\': res += '\\'; break;
+ case 'x':
+ /* hexa-number */
+ var nb = 0;
+ while (true) {
+ var hexC = port.peekChar();
+ if (hexC >= '0' && hexC <= '9') {
+ port.readChar();
+ nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0);
+ } else if (hexC >= 'a' && hexC <= 'f') {
+ port.readChar();
+ nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0);
+ } else if (hexC >= 'A' && hexC <= 'F') {
+ port.readChar();
+ nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0);
+ } else {
+ // next char isn't part of hex.
+ res += String.fromCharCode(nb);
+ break;
+ }
+ }
+ break;
+ default:
+ if (tmp === SC_EOF_OBJECT) {
+ return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);
+ }
+ res += tmp;
+ }
+ break;
+ default:
+ if (c === SC_EOF_OBJECT) {
+ return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);
+ }
+ res += c;
+ }
+ }
+ };
+ function readIdOrNumber(firstChar) {
+ var res = firstChar;
+ while (isIdOrNumberChar(port.peekChar()))
+ res += port.readChar();
+ if (isNaN(res))
+ return new sc_Token(9/*ID*/, res);
+ else
+ return new sc_Token(12/*NUMBER*/, res - 0);
+ };
+
+ function skipWhitespaceAndComments() {
+ var done = false;
+ while (!done) {
+ done = true;
+ while (isWhitespace(port.peekChar()))
+ port.readChar();
+ if (port.peekChar() === ';') {
+ port.readChar();
+ done = false;
+ while (true) {
+ curChar = port.readChar();
+ if (curChar === SC_EOF_OBJECT ||
+ curChar === '\n')
+ break;
+ }
+ }
+ }
+ };
+
+ function readDot() {
+ if (isWhitespace(port.peekChar()))
+ return new sc_Token(10/*DOT*/);
+ else
+ return readIdOrNumber(".");
+ };
+
+ function readSharp() {
+ var c = port.readChar();
+ if (isWhitespace(c))
+ return new sc_Token(13/*ERROR*/, "bad #-pattern0.");
+
+ // reference
+ if (isNumberChar(c)) {
+ var nb = c - 0;
+ while (isNumberChar(port.peekChar()))
+ nb = nb*10 + (port.readChar() - 0);
+ switch (port.readChar()) {
+ case '#':
+ return new sc_Token(18/*REFERENCE*/, nb);
+ case '=':
+ return new sc_Token(19/*STORE*/, nb);
+ default:
+ return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb);
+ }
+ }
+
+ if (c === "(")
+ return new sc_Token(14/*VECTOR_BEGIN*/);
+
+ if (c === "\\") { // character
+ var tmp = ""
+ while (!isWhitespaceOrEOF(port.peekChar()))
+ tmp += port.readChar();
+ switch (tmp.length) {
+ case 0: // it's escaping a whitespace char:
+ if (sc_isEOFObject(port.peekChar))
+ return new sc_Token(13/*ERROR*/, "bad #-pattern2.");
+ else
+ return new sc_Token(20/*CHAR*/, port.readChar());
+ case 1:
+ return new sc_Token(20/*CHAR*/, tmp);
+ default:
+ var entry = sc_Char.readable2char[tmp.toLowerCase()];
+ if (entry)
+ return new sc_Token(20/*CHAR*/, entry);
+ else
+ return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp);
+ }
+ }
+
+ // some constants (#t, #f, #unspecified)
+ var res;
+ var needing;
+ switch (c) {
+ case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break;
+ case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break;
+ case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break;
+ default:
+ return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c);
+ }
+ while(true) {
+ c = port.peekChar();
+ if ((isWhitespaceOrEOF(c) || c === ')') &&
+ needing == "")
+ return res;
+ else if (isWhitespace(c) || needing == "")
+ return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing);
+ else if (needing.charAt(0) == c) {
+ port.readChar(); // consume
+ needing = needing.slice(1);
+ } else
+ return new sc_Token(13/*ERROR*/, "bad #-pattern5");
+ }
+
+ };
+
+ skipWhitespaceAndComments();
+ var curChar = port.readChar();
+ if (curChar === SC_EOF_OBJECT)
+ return new sc_Token(0/*EOF*/, curChar);
+ switch (curChar)
+ {
+ case " ":
+ case "\n":
+ case "\t":
+ return readWhitespace();
+ case "(":
+ return new sc_Token(1/*OPEN_PAR*/);
+ case ")":
+ return new sc_Token(2/*CLOSE_PAR*/);
+ case "{":
+ return new sc_Token(3/*OPEN_BRACE*/);
+ case "}":
+ return new sc_Token(4/*CLOSE_BRACE*/);
+ case "[":
+ return new sc_Token(5/*OPEN_BRACKET*/);
+ case "]":
+ return new sc_Token(6/*CLOSE_BRACKET*/);
+ case "'":
+ return new sc_Token(8/*QUOTE*/);
+ case "#":
+ return readSharp();
+ case ".":
+ return readDot();
+ case '"':
+ return readString();
+ default:
+ if (isIdOrNumberChar(curChar))
+ return readIdOrNumber(curChar);
+ throw "unexpected character: " + curChar;
+ }
+};
+
+function sc_Reader(tokenizer) {
+ this.tokenizer = tokenizer;
+ this.backref = new Array();
+}
+sc_Reader.prototype.read = function() {
+ function readList(listBeginType) {
+ function matchesPeer(open, close) {
+ return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/
+ || open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/
+ || open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/;
+ };
+ var res = null;
+
+ while (true) {
+ var token = tokenizer.peekToken();
+
+ switch (token.type) {
+ case 2/*CLOSE_PAR*/:
+ case 4/*CLOSE_BRACE*/:
+ case 6/*CLOSE_BRACKET*/:
+ if (matchesPeer(listBeginType, token.type)) {
+ tokenizer.readToken(); // consume token
+ return sc_reverseBang(res);
+ } else
+ throw "closing par doesn't match: " + listBeginType
+ + " " + listEndType;
+
+ case 0/*EOF*/:
+ throw "unexpected end of file";
+
+ case 10/*DOT*/:
+ tokenizer.readToken(); // consume token
+ var cdr = this.read();
+ var par = tokenizer.readToken();
+ if (!matchesPeer(listBeginType, par.type))
+ throw "closing par doesn't match: " + listBeginType
+ + " " + par.type;
+ else
+ return sc_reverseAppendBang(res, cdr);
+
+
+ default:
+ res = sc_cons(this.read(), res);
+ }
+ }
+ };
+ function readQuote() {
+ return sc_cons("quote", sc_cons(this.read(), null));
+ };
+ function readVector() {
+ // opening-parenthesis is already consumed
+ var a = new Array();
+ while (true) {
+ var token = tokenizer.peekToken();
+ switch (token.type) {
+ case 2/*CLOSE_PAR*/:
+ tokenizer.readToken();
+ return a;
+
+ default:
+ a.push(this.read());
+ }
+ }
+ };
+
+ function storeRefence(nb) {
+ var tmp = this.read();
+ this.backref[nb] = tmp;
+ return tmp;
+ };
+
+ function readReference(nb) {
+ if (nb in this.backref)
+ return this.backref[nb];
+ else
+ throw "bad reference: " + nb;
+ };
+
+ var tokenizer = this.tokenizer;
+
+ var token = tokenizer.readToken();
+
+ // handle error
+ if (token.type === 13/*ERROR*/)
+ throw token.val;
+
+ switch (token.type) {
+ case 1/*OPEN_PAR*/:
+ case 3/*OPEN_BRACE*/:
+ case 5/*OPEN_BRACKET*/:
+ return readList.call(this, token.type);
+ case 8/*QUOTE*/:
+ return readQuote.call(this);
+ case 11/*STRING*/:
+ return sc_jsstring2string(token.val);
+ case 20/*CHAR*/:
+ return new sc_Char(token.val);
+ case 14/*VECTOR_BEGIN*/:
+ return readVector.call(this);
+ case 18/*REFERENCE*/:
+ return readReference.call(this, token.val);
+ case 19/*STORE*/:
+ return storeRefence.call(this, token.val);
+ case 9/*ID*/:
+ return sc_jsstring2symbol(token.val);
+ case 0/*EOF*/:
+ case 12/*NUMBER*/:
+ case 15/*TRUE*/:
+ case 16/*FALSE*/:
+ case 17/*UNSPECIFIED*/:
+ return token.val;
+ default:
+ throw "unexpected token " + token.type + " " + token.val;
+ }
+};
+
+/*** META ((export #t)) */
+function sc_read(port) {
+ if (port === undefined) // we assume the port hasn't been given.
+ port = SC_DEFAULT_IN; // THREAD: shared var...
+ var reader = new sc_Reader(new sc_Tokenizer(port));
+ return reader.read();
+}
+/*** META ((export #t)) */
+function sc_readChar(port) {
+ if (port === undefined) // we assume the port hasn't been given.
+ port = SC_DEFAULT_IN; // THREAD: shared var...
+ var t = port.readChar();
+ return t === SC_EOF_OBJECT? t: new sc_Char(t);
+}
+/*** META ((export #t)) */
+function sc_peekChar(port) {
+ if (port === undefined) // we assume the port hasn't been given.
+ port = SC_DEFAULT_IN; // THREAD: shared var...
+ var t = port.peekChar();
+ return t === SC_EOF_OBJECT? t: new sc_Char(t);
+}
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isCharReady(port) {
+ if (port === undefined) // we assume the port hasn't been given.
+ port = SC_DEFAULT_IN; // THREAD: shared var...
+ return port.isCharReady();
+}
+/*** META ((export #t)
+ (peephole (postfix ".close()")))
+*/
+function sc_closeInputPort(p) {
+ return p.close();
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " instanceof sc_InputPort")))
+*/
+function sc_isInputPort(o) {
+ return (o instanceof sc_InputPort);
+}
+
+/*** META ((export eof-object?)
+ (type bool)
+ (peephole (postfix " === SC_EOF_OBJECT")))
+*/
+function sc_isEOFObject(o) {
+ return o === SC_EOF_OBJECT;
+}
+
+/*** META ((export #t)
+ (peephole (hole 0 "SC_DEFAULT_IN")))
+*/
+function sc_currentInputPort() {
+ return SC_DEFAULT_IN;
+}
+
+/* ------------ file operations are not supported -----------*/
+/*** META ((export #t)) */
+function sc_callWithInputFile(s, proc) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_callWithOutputFile(s, proc) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_withInputFromFile(s, thunk) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_withOutputToFile(s, thunk) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_openInputFile(s) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_openOutputFile(s) {
+ throw "can't open " + s;
+}
+
+/* ----------------------------------------------------------------------------*/
+/*** META ((export #t)) */
+function sc_basename(p) {
+ var i = p.lastIndexOf('/');
+
+ if(i >= 0)
+ return p.substring(i + 1, p.length);
+ else
+ return '';
+}
+
+/*** META ((export #t)) */
+function sc_dirname(p) {
+ var i = p.lastIndexOf('/');
+
+ if(i >= 0)
+ return p.substring(0, i);
+ else
+ return '';
+}
+
+/* ----------------------------------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_withInputFromPort(p, thunk) {
+ try {
+ var tmp = SC_DEFAULT_IN; // THREAD: shared var.
+ SC_DEFAULT_IN = p;
+ return thunk();
+ } finally {
+ SC_DEFAULT_IN = tmp;
+ }
+}
+
+/*** META ((export #t)) */
+function sc_withInputFromString(s, thunk) {
+ return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk);
+}
+
+/*** META ((export #t)) */
+function sc_withOutputToPort(p, thunk) {
+ try {
+ var tmp = SC_DEFAULT_OUT; // THREAD: shared var.
+ SC_DEFAULT_OUT = p;
+ return thunk();
+ } finally {
+ SC_DEFAULT_OUT = tmp;
+ }
+}
+
+/*** META ((export #t)) */
+function sc_withOutputToString(thunk) {
+ var p = new sc_StringOutputPort();
+ sc_withOutputToPort(p, thunk);
+ return p.close();
+}
+
+/*** META ((export #t)) */
+function sc_withOutputToProcedure(proc, thunk) {
+ var t = function(s) { proc(sc_jsstring2string(s)); };
+ return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);
+}
+
+/*** META ((export #t)
+ (peephole (hole 0 "new sc_StringOutputPort()")))
+*/
+function sc_openOutputString() {
+ return new sc_StringOutputPort();
+}
+
+/*** META ((export #t)) */
+function sc_openInputString(str) {
+ return new sc_StringInputPort(sc_string2jsstring(str));
+}
+
+/* ----------------------------------------------------------------------------*/
+
+function sc_OutputPort() {
+}
+sc_OutputPort.prototype = new sc_Port();
+sc_OutputPort.prototype.appendJSString = function(obj) {
+ /* do nothing */
+}
+sc_OutputPort.prototype.close = function() {
+ /* do nothing */
+}
+
+function sc_StringOutputPort() {
+ this.res = "";
+}
+sc_StringOutputPort.prototype = new sc_OutputPort();
+sc_StringOutputPort.prototype.appendJSString = function(s) {
+ this.res += s;
+}
+sc_StringOutputPort.prototype.close = function() {
+ return sc_jsstring2string(this.res);
+}
+
+/*** META ((export #t)) */
+function sc_getOutputString(sp) {
+ return sc_jsstring2string(sp.res);
+}
+
+
+function sc_ErrorOutputPort() {
+}
+sc_ErrorOutputPort.prototype = new sc_OutputPort();
+sc_ErrorOutputPort.prototype.appendJSString = function(s) {
+ throw "don't write on ErrorPort!";
+}
+sc_ErrorOutputPort.prototype.close = function() {
+ /* do nothing */
+}
+
+function sc_GenericOutputPort(appendJSString, close) {
+ this.appendJSString = appendJSString;
+ if (close)
+ this.close = close;
+}
+sc_GenericOutputPort.prototype = new sc_OutputPort();
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " instanceof sc_OutputPort")))
+*/
+function sc_isOutputPort(o) {
+ return (o instanceof sc_OutputPort);
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".close()")))
+*/
+function sc_closeOutputPort(p) {
+ return p.close();
+}
+
+/* ------------------ write ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_write(o, p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString(sc_toWriteString(o));
+}
+
+function sc_toWriteString(o) {
+ if (o === null)
+ return "()";
+ else if (o === true)
+ return "#t";
+ else if (o === false)
+ return "#f";
+ else if (o === undefined)
+ return "#unspecified";
+ else if (typeof o === 'function')
+ return "#<procedure " + sc_hash(o) + ">";
+ else if (o.sc_toWriteString)
+ return o.sc_toWriteString();
+ else
+ return o.toString();
+}
+
+function sc_escapeWriteString(s) {
+ var res = "";
+ var j = 0;
+ for (i = 0; i < s.length; i++) {
+ switch (s.charAt(i)) {
+ case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break;
+ case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break;
+ case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break;
+ case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break;
+ case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break;
+ case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break;
+ case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break;
+ case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break;
+ case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break;
+ default:
+ var c = s.charAt(i);
+ if ("\a" !== "a" && c == "\a") {
+ res += s.substring(j, i) + "\\a"; j = i + 1; continue;
+ }
+ if ("\v" !== "v" && c == "\v") {
+ res += s.substring(j, i) + "\\v"; j = i + 1; continue;
+ }
+ //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) {
+ // CARE: Manuel is this OK with HOP?
+ if (s.charAt(i) < ' ') {
+ /* non printable character and special chars */
+ res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16);
+ j = i + 1;
+ }
+ // else just let i increase...
+ }
+ }
+ res += s.substring(j, i);
+ return res;
+}
+
+/* ------------------ display ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_display(o, p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString(sc_toDisplayString(o));
+}
+
+function sc_toDisplayString(o) {
+ if (o === null)
+ return "()";
+ else if (o === true)
+ return "#t";
+ else if (o === false)
+ return "#f";
+ else if (o === undefined)
+ return "#unspecified";
+ else if (typeof o === 'function')
+ return "#<procedure " + sc_hash(o) + ">";
+ else if (o.sc_toDisplayString)
+ return o.sc_toDisplayString();
+ else
+ return o.toString();
+}
+
+/* ------------------ newline ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_newline(p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString("\n");
+}
+
+/* ------------------ write-char ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_writeChar(c, p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString(c.val);
+}
+
+/* ------------------ write-circle ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_writeCircle(o, p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString(sc_toWriteCircleString(o));
+}
+
+function sc_toWriteCircleString(o) {
+ var symb = sc_gensym("writeCircle");
+ var nbPointer = new Object();
+ nbPointer.nb = 0;
+ sc_prepWriteCircle(o, symb, nbPointer);
+ return sc_genToWriteCircleString(o, symb);
+}
+
+function sc_prepWriteCircle(o, symb, nbPointer) {
+ // TODO sc_Struct
+ if (o instanceof sc_Pair ||
+ o instanceof sc_Vector) {
+ if (o[symb] !== undefined) {
+ // not the first visit.
+ o[symb]++;
+ // unless there is already a number, assign one.
+ if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++;
+ return;
+ }
+ o[symb] = 0;
+ if (o instanceof sc_Pair) {
+ sc_prepWriteCircle(o.car, symb, nbPointer);
+ sc_prepWriteCircle(o.cdr, symb, nbPointer);
+ } else {
+ for (var i = 0; i < o.length; i++)
+ sc_prepWriteCircle(o[i], symb, nbPointer);
+ }
+ }
+}
+
+function sc_genToWriteCircleString(o, symb) {
+ if (!(o instanceof sc_Pair ||
+ o instanceof sc_Vector))
+ return sc_toWriteString(o);
+ return o.sc_toWriteCircleString(symb);
+}
+sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {
+ if (this[symb + "use"]) { // use-flag is set. Just use it.
+ var nb = this[symb + "nb"];
+ if (this[symb]-- === 0) { // if we are the last use. remove all fields.
+ delete this[symb];
+ delete this[symb + "nb"];
+ delete this[symb + "use"];
+ }
+ if (inList)
+ return '. #' + nb + '#';
+ else
+ return '#' + nb + '#';
+ }
+ if (this[symb]-- === 0) { // if we are the last use. remove all fields.
+ delete this[symb];
+ delete this[symb + "nb"];
+ delete this[symb + "use"];
+ }
+
+ var res = "";
+
+ if (this[symb] !== undefined) { // implies > 0
+ this[symb + "use"] = true;
+ if (inList)
+ res += '. #' + this[symb + "nb"] + '=';
+ else
+ res += '#' + this[symb + "nb"] + '=';
+ inList = false;
+ }
+
+ if (!inList)
+ res += "(";
+
+ // print car
+ res += sc_genToWriteCircleString(this.car, symb);
+
+ if (sc_isPair(this.cdr)) {
+ res += " " + this.cdr.sc_toWriteCircleString(symb, true);
+ } else if (this.cdr !== null) {
+ res += " . " + sc_genToWriteCircleString(this.cdr, symb);
+ }
+ if (!inList)
+ res += ")";
+ return res;
+};
+sc_Vector.prototype.sc_toWriteCircleString = function(symb) {
+ if (this[symb + "use"]) { // use-flag is set. Just use it.
+ var nb = this[symb + "nb"];
+ if (this[symb]-- === 0) { // if we are the last use. remove all fields.
+ delete this[symb];
+ delete this[symb + "nb"];
+ delete this[symb + "use"];
+ }
+ return '#' + nb + '#';
+ }
+ if (this[symb]-- === 0) { // if we are the last use. remove all fields.
+ delete this[symb];
+ delete this[symb + "nb"];
+ delete this[symb + "use"];
+ }
+
+ var res = "";
+ if (this[symb] !== undefined) { // implies > 0
+ this[symb + "use"] = true;
+ res += '#' + this[symb + "nb"] + '=';
+ }
+ res += "#(";
+ for (var i = 0; i < this.length; i++) {
+ res += sc_genToWriteCircleString(this[i], symb);
+ if (i < this.length - 1) res += " ";
+ }
+ res += ")";
+ return res;
+};
+
+
+/* ------------------ print ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_print(s) {
+ if (arguments.length === 1) {
+ sc_display(s);
+ sc_newline();
+ }
+ else {
+ for (var i = 0; i < arguments.length; i++)
+ sc_display(arguments[i]);
+ sc_newline();
+ }
+}
+
+/* ------------------ format ---------------------------------------------------*/
+/*** META ((export #t)) */
+function sc_format(s, args) {
+ var len = s.length;
+ var p = new sc_StringOutputPort();
+ var i = 0, j = 1;
+
+ while( i < len ) {
+ var i2 = s.indexOf("~", i);
+
+ if (i2 == -1) {
+ p.appendJSString( s.substring( i, len ) );
+ return p.close();
+ } else {
+ if (i2 > i) {
+ if (i2 == (len - 1)) {
+ p.appendJSString(s.substring(i, len));
+ return p.close();
+ } else {
+ p.appendJSString(s.substring(i, i2));
+ i = i2;
+ }
+ }
+
+ switch(s.charCodeAt(i2 + 1)) {
+ case 65:
+ case 97:
+ // a
+ sc_display(arguments[j], p);
+ i += 2; j++;
+ break;
+
+ case 83:
+ case 115:
+ // s
+ sc_write(arguments[j], p);
+ i += 2; j++;
+ break;
+
+ case 86:
+ case 118:
+ // v
+ sc_display(arguments[j], p);
+ p.appendJSString("\n");
+ i += 2; j++;
+ break;
+
+ case 67:
+ case 99:
+ // c
+ p.appendJSString(String.fromCharCode(arguments[j]));
+ i += 2; j++;
+ break;
+
+ case 88:
+ case 120:
+ // x
+ p.appendJSString(arguments[j].toString(6));
+ i += 2; j++;
+ break;
+
+ case 79:
+ case 111:
+ // o
+ p.appendJSString(arguments[j].toString(8));
+ i += 2; j++;
+ break;
+
+ case 66:
+ case 98:
+ // b
+ p.appendJSString(arguments[j].toString(2));
+ i += 2; j++;
+ break;
+
+ case 37:
+ case 110:
+ // %, n
+ p.appendJSString("\n");
+ i += 2; break;
+
+ case 114:
+ // r
+ p.appendJSString("\r");
+ i += 2; break;
+
+ case 126:
+ // ~
+ p.appendJSString("~");
+ i += 2; break;
+
+ default:
+ sc_error( "format: illegal ~"
+ + String.fromCharCode(s.charCodeAt(i2 + 1))
+ + " sequence" );
+ return "";
+ }
+ }
+ }
+
+ return p.close();
+}
+
+/* ------------------ global ports ---------------------------------------------------*/
+
+var SC_DEFAULT_IN = new sc_ErrorInputPort();
+var SC_DEFAULT_OUT = new sc_ErrorOutputPort();
+var SC_ERROR_OUT = new sc_ErrorOutputPort();
+
+var sc_SYMBOL_PREFIX = "\u1E9C";
+var sc_KEYWORD_PREFIX = "\u1E9D";
+
+/*** META ((export #t)
+ (peephole (id))) */
+function sc_jsstring2string(s) {
+ return s;
+}
+
+/*** META ((export #t)
+ (peephole (prefix "'\\u1E9C' +")))
+*/
+function sc_jsstring2symbol(s) {
+ return sc_SYMBOL_PREFIX + s;
+}
+
+/*** META ((export #t)
+ (peephole (id)))
+*/
+function sc_string2jsstring(s) {
+ return s;
+}
+
+/*** META ((export #t)
+ (peephole (symbol2jsstring_immutable)))
+*/
+function sc_symbol2jsstring(s) {
+ return s.slice(1);
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".slice(1)")))
+*/
+function sc_keyword2jsstring(k) {
+ return k.slice(1);
+}
+
+/*** META ((export #t)
+ (peephole (prefix "'\\u1E9D' +")))
+*/
+function sc_jsstring2keyword(s) {
+ return sc_KEYWORD_PREFIX + s;
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isKeyword(s) {
+ return (typeof s === "string") &&
+ (s.charAt(0) === sc_KEYWORD_PREFIX);
+}
+
+
+/*** META ((export #t)) */
+var sc_gensym = function() {
+ var counter = 1000;
+ return function(sym) {
+ counter++;
+ if (!sym) sym = sc_SYMBOL_PREFIX;
+ return sym + "s" + counter + "~" + "^sC-GeNsYm ";
+ };
+}();
+
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isEqual(o1, o2) {
+ return ((o1 === o2) ||
+ (sc_isPair(o1) && sc_isPair(o2)
+ && sc_isPairEqual(o1, o2, sc_isEqual)) ||
+ (sc_isVector(o1) && sc_isVector(o2)
+ && sc_isVectorEqual(o1, o2, sc_isEqual)));
+}
+
+/*** META ((export number->symbol integer->symbol)) */
+function sc_number2symbol(x, radix) {
+ return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix);
+}
+
+/*** META ((export number->string integer->string)) */
+var sc_number2string = sc_number2jsstring;
+
+/*** META ((export #t)) */
+function sc_symbol2number(s, radix) {
+ return sc_jsstring2number(s.slice(1), radix);
+}
+
+/*** META ((export #t)) */
+var sc_string2number = sc_jsstring2number;
+
+/*** META ((export #t)
+ (peephole (prefix "+" s)))
+ ;; peephole will only apply if no radix is given.
+*/
+function sc_string2integer(s, radix) {
+ if (!radix) return +s;
+ return parseInt(s, radix);
+}
+
+/*** META ((export #t)
+ (peephole (prefix "+")))
+*/
+function sc_string2real(s) {
+ return +s;
+}
+
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isSymbol(s) {
+ return (typeof s === "string") &&
+ (s.charAt(0) === sc_SYMBOL_PREFIX);
+}
+
+/*** META ((export #t)
+ (peephole (symbol2string_immutable)))
+*/
+function sc_symbol2string(s) {
+ return s.slice(1);
+}
+
+/*** META ((export #t)
+ (peephole (prefix "'\\u1E9C' +")))
+*/
+function sc_string2symbol(s) {
+ return sc_SYMBOL_PREFIX + s;
+}
+
+/*** META ((export symbol-append)
+ (peephole (symbolAppend_immutable)))
+*/
+function sc_symbolAppend() {
+ var res = sc_SYMBOL_PREFIX;
+ for (var i = 0; i < arguments.length; i++)
+ res += arguments[i].slice(1);
+ return res;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".val")))
+*/
+function sc_char2string(c) { return c.val; }
+
+/*** META ((export #t)
+ (peephole (hole 1 "'\\u1E9C' + " c ".val")))
+*/
+function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; }
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isString(s) {
+ return (typeof s === "string") &&
+ (s.charAt(0) !== sc_SYMBOL_PREFIX);
+}
+
+/*** META ((export #t)) */
+var sc_makeString = sc_makejsString;
+
+
+/*** META ((export #t)) */
+function sc_string() {
+ for (var i = 0; i < arguments.length; i++)
+ arguments[i] = arguments[i].val;
+ return "".concat.apply("", arguments);
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".length")))
+*/
+function sc_stringLength(s) { return s.length; }
+
+/*** META ((export #t)) */
+function sc_stringRef(s, k) {
+ return new sc_Char(s.charAt(k));
+}
+
+/* there's no stringSet in the immutable version
+function sc_stringSet(s, k, c)
+*/
+
+
+/*** META ((export string=?)
+ (type bool)
+ (peephole (hole 2 str1 " === " str2)))
+*/
+function sc_isStringEqual(s1, s2) {
+ return s1 === s2;
+}
+/*** META ((export string<?)
+ (type bool)
+ (peephole (hole 2 str1 " < " str2)))
+*/
+function sc_isStringLess(s1, s2) {
+ return s1 < s2;
+}
+/*** META ((export string>?)
+ (type bool)
+ (peephole (hole 2 str1 " > " str2)))
+*/
+function sc_isStringGreater(s1, s2) {
+ return s1 > s2;
+}
+/*** META ((export string<=?)
+ (type bool)
+ (peephole (hole 2 str1 " <= " str2)))
+*/
+function sc_isStringLessEqual(s1, s2) {
+ return s1 <= s2;
+}
+/*** META ((export string>=?)
+ (type bool)
+ (peephole (hole 2 str1 " >= " str2)))
+*/
+function sc_isStringGreaterEqual(s1, s2) {
+ return s1 >= s2;
+}
+/*** META ((export string-ci=?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()")))
+*/
+function sc_isStringCIEqual(s1, s2) {
+ return s1.toLowerCase() === s2.toLowerCase();
+}
+/*** META ((export string-ci<?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() < " str2 ".toLowerCase()")))
+*/
+function sc_isStringCILess(s1, s2) {
+ return s1.toLowerCase() < s2.toLowerCase();
+}
+/*** META ((export string-ci>?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()")))
+*/
+function sc_isStringCIGreater(s1, s2) {
+ return s1.toLowerCase() > s2.toLowerCase();
+}
+/*** META ((export string-ci<=?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()")))
+*/
+function sc_isStringCILessEqual(s1, s2) {
+ return s1.toLowerCase() <= s2.toLowerCase();
+}
+/*** META ((export string-ci>=?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()")))
+*/
+function sc_isStringCIGreaterEqual(s1, s2) {
+ return s1.toLowerCase() >= s2.toLowerCase();
+}
+
+/*** META ((export #t)
+ (peephole (hole 3 s ".substring(" start ", " end ")")))
+*/
+function sc_substring(s, start, end) {
+ return s.substring(start, end);
+}
+
+/*** META ((export #t))
+*/
+function sc_isSubstring_at(s1, s2, i) {
+ return s2 == s1.substring(i, i+ s2.length);
+}
+
+/*** META ((export #t)
+ (peephole (infix 0 #f "+" "''")))
+*/
+function sc_stringAppend() {
+ return "".concat.apply("", arguments);
+}
+
+/*** META ((export #t)) */
+var sc_string2list = sc_jsstring2list;
+
+/*** META ((export #t)) */
+var sc_list2string = sc_list2jsstring;
+
+/*** META ((export #t)
+ (peephole (id)))
+*/
+function sc_stringCopy(s) {
+ return s;
+}
+
+/* there's no string-fill in the immutable version
+function sc_stringFill(s, c)
+*/
+
+/*** META ((export #t)
+ (peephole (postfix ".slice(1)")))
+*/
+function sc_keyword2string(o) {
+ return o.slice(1);
+}
+
+/*** META ((export #t)
+ (peephole (prefix "'\\u1E9D' +")))
+*/
+function sc_string2keyword(o) {
+ return sc_KEYWORD_PREFIX + o;
+}
+
+String.prototype.sc_toDisplayString = function() {
+ if (this.charAt(0) === sc_SYMBOL_PREFIX)
+ // TODO: care for symbols with spaces (escape-chars symbols).
+ return this.slice(1);
+ else if (this.charAt(0) === sc_KEYWORD_PREFIX)
+ return ":" + this.slice(1);
+ else
+ return this.toString();
+};
+
+String.prototype.sc_toWriteString = function() {
+ if (this.charAt(0) === sc_SYMBOL_PREFIX)
+ // TODO: care for symbols with spaces (escape-chars symbols).
+ return this.slice(1);
+ else if (this.charAt(0) === sc_KEYWORD_PREFIX)
+ return ":" + this.slice(1);
+ else
+ return '"' + sc_escapeWriteString(this) + '"';
+};
+/* Exported Variables */
+var BgL_testzd2boyerzd2;
+var BgL_nboyerzd2benchmarkzd2;
+var BgL_setupzd2boyerzd2;
+/* End Exports */
+
+var translate_term_nboyer;
+var translate_args_nboyer;
+var untranslate_term_nboyer;
+var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer;
+var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer;
+var translate_alist_nboyer;
+var apply_subst_nboyer;
+var apply_subst_lst_nboyer;
+var tautologyp_nboyer;
+var if_constructor_nboyer;
+var rewrite_count_nboyer;
+var rewrite_nboyer;
+var rewrite_args_nboyer;
+var unify_subst_nboyer;
+var one_way_unify1_nboyer;
+var false_term_nboyer;
+var true_term_nboyer;
+var trans_of_implies1_nboyer;
+var is_term_equal_nboyer;
+var is_term_member_nboyer;
+var const_nboyer;
+var sc_const_3_nboyer;
+var sc_const_4_nboyer;
+{
+ (sc_const_4_nboyer = (new sc_Pair("\u1E9Cimplies",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cu",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cw",null)))))),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cw",null)))))),null)))))));
+ (sc_const_3_nboyer = sc_list((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccompile",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Ccodegen",(new sc_Pair((new sc_Pair("\u1E9Coptimize",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreaterp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clesseqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cboolean",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ciff",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceven1",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Codd",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccountps-",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccountps-loop",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfact-",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfact-loop",(new sc_Pair("\u1E9Ci",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdivides",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-true",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-false",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctautology-checker",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctautologyp",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfalsify",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfalsify1",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime1",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair("\u1E9Cp",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))))),(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cc",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cplus-fringe",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair("\u1E9Cenvrn",null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmc-flatten",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cintersect",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Ck",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ck",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Csort-lp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus1",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Ci",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cbase",null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cj",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cj",(new sc_Pair((1),null)))))),null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Ci",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cw",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cz",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnlistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csamefringe",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cz",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cw",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair(sc_list("\u1E9Cand", (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Ca",null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cb",null)))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cl",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cl",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdsort",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx1",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx2",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx3",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx4",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx5",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx6",(new sc_Pair("\u1E9Cx7",null)))))),null)))))),null)))))),null)))))),null)))))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((6),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx7",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cy",(new sc_Pair((2),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csigma",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Ci",null)))),null)))))),(new sc_Pair((2),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cz",null)))),null)))))),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Ca",null)))),null)))),(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Cb",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair("\u1E9Cz",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cassignedp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair((new sc_Pair("\u1E9Cset",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cval",(new sc_Pair("\u1E9Cmem",null)))))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair("\u1E9Cval",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cmem",null)))))),null)))))))),null))))))));
+ (const_nboyer = (new sc_Pair((new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))))),null)))))))))));
+ BgL_nboyerzd2benchmarkzd2 = function() {
+ var args = null;
+ for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {
+ args = sc_cons(arguments[sc_tmp], args);
+ }
+ var n;
+ return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() {
+ return (BgL_testzd2boyerzd2(n));
+ }, function(rewrites) {
+ if ((sc_isNumber(rewrites)))
+ switch (n) {
+ case (0):
+ return (rewrites===(95024));
+ break;
+ case (1):
+ return (rewrites===(591777));
+ break;
+ case (2):
+ return (rewrites===(1813975));
+ break;
+ case (3):
+ return (rewrites===(5375678));
+ break;
+ case (4):
+ return (rewrites===(16445406));
+ break;
+ case (5):
+ return (rewrites===(51507739));
+ break;
+ default:
+ return true;
+ break;
+ }
+ else
+ return false;
+ })));
+ };
+ BgL_setupzd2boyerzd2 = function() {
+ return true;
+ };
+ BgL_testzd2boyerzd2 = function() {
+ return true;
+ };
+ translate_term_nboyer = function(term) {
+ var lst;
+ return (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((translate_term_nboyer((lst.car))), (translate_args_nboyer((lst.cdr))))))))));
+ };
+ translate_args_nboyer = function(lst) {
+ var sc_lst_5;
+ var term;
+ return ((lst === null)?null:(new sc_Pair(((term = (lst.car)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))), ((sc_lst_5 = (lst.cdr)), ((sc_lst_5 === null)?null:(new sc_Pair((translate_term_nboyer((sc_lst_5.car))), (translate_args_nboyer((sc_lst_5.cdr))))))))));
+ };
+ untranslate_term_nboyer = function(term) {
+ var optrOpnd;
+ var tail1131;
+ var L1127;
+ var falseHead1130;
+ var symbol_record;
+ if (!(term instanceof sc_Pair))
+ return term;
+ else
+ {
+ (falseHead1130 = (new sc_Pair(null, null)));
+ (L1127 = (term.cdr));
+ (tail1131 = falseHead1130);
+ while (!(L1127 === null)) {
+ {
+ (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null)));
+ (tail1131 = (tail1131.cdr));
+ (L1127 = (L1127.cdr));
+ }
+ }
+ (optrOpnd = (falseHead1130.cdr));
+ return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd));
+ }
+ };
+ BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) {
+ var r;
+ var x;
+ return ((x = (sc_assq(sym, BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), ((x!== false)?(x.cdr):((r = [sym, null]), (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = (new sc_Pair((new sc_Pair(sym, r)), BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), r)));
+ };
+ (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);
+ translate_alist_nboyer = function(alist) {
+ var sc_alist_6;
+ var term;
+ return ((alist === null)?null:(new sc_Pair((new sc_Pair((alist.car.car), ((term = (alist.car.cdr)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))))), ((sc_alist_6 = (alist.cdr)), ((sc_alist_6 === null)?null:(new sc_Pair((new sc_Pair((sc_alist_6.car.car), (translate_term_nboyer((sc_alist_6.car.cdr))))), (translate_alist_nboyer((sc_alist_6.cdr))))))))));
+ };
+ apply_subst_nboyer = function(alist, term) {
+ var lst;
+ var temp_temp;
+ return (!(term instanceof sc_Pair)?((temp_temp = (sc_assq(term, alist))), ((temp_temp!== false)?(temp_temp.cdr):term)):(new sc_Pair((term.car), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), (apply_subst_lst_nboyer(alist, (lst.cdr))))))))));
+ };
+ apply_subst_lst_nboyer = function(alist, lst) {
+ var sc_lst_7;
+ return ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), ((sc_lst_7 = (lst.cdr)), ((sc_lst_7 === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (sc_lst_7.car))), (apply_subst_lst_nboyer(alist, (sc_lst_7.cdr))))))))));
+ };
+ tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) {
+ var tmp1125;
+ var x;
+ var tmp1126;
+ var sc_x_8;
+ var sc_tmp1125_9;
+ var sc_tmp1126_10;
+ var sc_x_11;
+ var true_lst;
+ var false_lst;
+ while (true) {
+ if ((((sc_tmp1126_10 = (is_term_equal_nboyer(sc_x_11, true_term_nboyer))), ((sc_tmp1126_10!== false)?sc_tmp1126_10:(is_term_member_nboyer(sc_x_11, true_lst))))!== false))
+ return true;
+ else
+ if ((((sc_tmp1125_9 = (is_term_equal_nboyer(sc_x_11, false_term_nboyer))), ((sc_tmp1125_9!== false)?sc_tmp1125_9:(is_term_member_nboyer(sc_x_11, false_lst))))!== false))
+ return false;
+ else
+ if (!(sc_x_11 instanceof sc_Pair))
+ return false;
+ else
+ if (((sc_x_11.car)===if_constructor_nboyer))
+ if ((((sc_x_8 = (sc_x_11.cdr.car)), (tmp1126 = (is_term_equal_nboyer(sc_x_8, true_term_nboyer))), ((tmp1126!== false)?tmp1126:(is_term_member_nboyer(sc_x_8, true_lst))))!== false))
+ (sc_x_11 = (sc_x_11.cdr.cdr.car));
+ else
+ if ((((x = (sc_x_11.cdr.car)), (tmp1125 = (is_term_equal_nboyer(x, false_term_nboyer))), ((tmp1125!== false)?tmp1125:(is_term_member_nboyer(x, false_lst))))!== false))
+ (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));
+ else
+ if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false))
+ {
+ (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst)));
+ (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));
+ }
+ else
+ return false;
+ else
+ return false;
+ }
+ };
+ (if_constructor_nboyer = "\u1E9C*");
+ (rewrite_count_nboyer = (0));
+ rewrite_nboyer = function(term) {
+ var term2;
+ var sc_term_12;
+ var lst;
+ var symbol_record;
+ var sc_lst_13;
+ {
+ (++rewrite_count_nboyer);
+ if (!(term instanceof sc_Pair))
+ return term;
+ else
+ {
+ (sc_term_12 = (new sc_Pair((term.car), ((sc_lst_13 = (term.cdr)), ((sc_lst_13 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_13.car))), (rewrite_args_nboyer((sc_lst_13.cdr))))))))));
+ (lst = ((symbol_record = (term.car)), (symbol_record[(1)])));
+ while (true) {
+ if ((lst === null))
+ return sc_term_12;
+ else
+ if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false))
+ return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car)))));
+ else
+ (lst = (lst.cdr));
+ }
+ }
+ }
+ };
+ rewrite_args_nboyer = function(lst) {
+ var sc_lst_14;
+ return ((lst === null)?null:(new sc_Pair((rewrite_nboyer((lst.car))), ((sc_lst_14 = (lst.cdr)), ((sc_lst_14 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_14.car))), (rewrite_args_nboyer((sc_lst_14.cdr))))))))));
+ };
+ (unify_subst_nboyer = "\u1E9C*");
+ one_way_unify1_nboyer = function(term1, term2) {
+ var lst1;
+ var lst2;
+ var temp_temp;
+ if (!(term2 instanceof sc_Pair))
+ {
+ (temp_temp = (sc_assq(term2, unify_subst_nboyer)));
+ if ((temp_temp!== false))
+ return (is_term_equal_nboyer(term1, (temp_temp.cdr)));
+ else
+ if ((sc_isNumber(term2)))
+ return (sc_isEqual(term1, term2));
+ else
+ {
+ (unify_subst_nboyer = (new sc_Pair((new sc_Pair(term2, term1)), unify_subst_nboyer)));
+ return true;
+ }
+ }
+ else
+ if (!(term1 instanceof sc_Pair))
+ return false;
+ else
+ if (((term1.car)===(term2.car)))
+ {
+ (lst1 = (term1.cdr));
+ (lst2 = (term2.cdr));
+ while (true) {
+ if ((lst1 === null))
+ return (lst2 === null);
+ else
+ if ((lst2 === null))
+ return false;
+ else
+ if (((one_way_unify1_nboyer((lst1.car), (lst2.car)))!== false))
+ {
+ (lst1 = (lst1.cdr));
+ (lst2 = (lst2.cdr));
+ }
+ else
+ return false;
+ }
+ }
+ else
+ return false;
+ };
+ (false_term_nboyer = "\u1E9C*");
+ (true_term_nboyer = "\u1E9C*");
+ trans_of_implies1_nboyer = function(n) {
+ var sc_n_15;
+ return ((sc_isEqual(n, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (n-(1)), n)), ((sc_n_15 = (n-(1))), ((sc_isEqual(sc_n_15, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (sc_n_15-(1)), sc_n_15)), (trans_of_implies1_nboyer((sc_n_15-(1)))))))))));
+ };
+ is_term_equal_nboyer = function(x, y) {
+ var lst1;
+ var lst2;
+ var r2;
+ var r1;
+ if ((x instanceof sc_Pair))
+ if ((y instanceof sc_Pair))
+ if ((((r1 = (x.car)), (r2 = (y.car)), (r1===r2))!== false))
+ {
+ (lst1 = (x.cdr));
+ (lst2 = (y.cdr));
+ while (true) {
+ if ((lst1 === null))
+ return (lst2 === null);
+ else
+ if ((lst2 === null))
+ return false;
+ else
+ if (((is_term_equal_nboyer((lst1.car), (lst2.car)))!== false))
+ {
+ (lst1 = (lst1.cdr));
+ (lst2 = (lst2.cdr));
+ }
+ else
+ return false;
+ }
+ }
+ else
+ return false;
+ else
+ return false;
+ else
+ return (sc_isEqual(x, y));
+ };
+ is_term_member_nboyer = function(x, lst) {
+ var x;
+ var lst;
+ while (true) {
+ if ((lst === null))
+ return false;
+ else
+ if (((is_term_equal_nboyer(x, (lst.car)))!== false))
+ return true;
+ else
+ (lst = (lst.cdr));
+ }
+ };
+ BgL_setupzd2boyerzd2 = function() {
+ var symbol_record;
+ var value;
+ var BgL_sc_symbolzd2record_16zd2;
+ var sym;
+ var sc_sym_17;
+ var term;
+ var lst;
+ var sc_term_18;
+ var sc_term_19;
+ {
+ (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);
+ (if_constructor_nboyer = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer("\u1E9Cif")));
+ (false_term_nboyer = ((sc_term_19 = (new sc_Pair("\u1E9Cf",null))), (!(sc_term_19 instanceof sc_Pair)?sc_term_19:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_19.car))), (translate_args_nboyer((sc_term_19.cdr))))))));
+ (true_term_nboyer = ((sc_term_18 = (new sc_Pair("\u1E9Ct",null))), (!(sc_term_18 instanceof sc_Pair)?sc_term_18:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_18.car))), (translate_args_nboyer((sc_term_18.cdr))))))));
+ (lst = sc_const_3_nboyer);
+ while (!(lst === null)) {
+ {
+ (term = (lst.car));
+ if (((term instanceof sc_Pair)&&(((term.car)==="\u1E9Cequal")&&((term.cdr.car) instanceof sc_Pair))))
+ {
+ (sc_sym_17 = ((term.cdr.car).car));
+ (value = (new sc_Pair((!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr)))))), ((sym = ((term.cdr.car).car)), (BgL_sc_symbolzd2record_16zd2 = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sym))), (BgL_sc_symbolzd2record_16zd2[(1)])))));
+ (symbol_record = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sc_sym_17)));
+ (symbol_record[(1)] = value);
+ }
+ else
+ (sc_error("ADD-LEMMA did not like term: ", term));
+ (lst = (lst.cdr));
+ }
+ }
+ return true;
+ }
+ };
+ BgL_testzd2boyerzd2 = function(n) {
+ var optrOpnd;
+ var term;
+ var sc_n_20;
+ var answer;
+ var sc_term_21;
+ var sc_term_22;
+ {
+ (rewrite_count_nboyer = (0));
+ (term = sc_const_4_nboyer);
+ (sc_n_20 = n);
+ while (!(sc_n_20=== 0)) {
+ {
+ (term = (sc_list("\u1E9Cor", term, (new sc_Pair("\u1E9Cf",null)))));
+ (--sc_n_20);
+ }
+ }
+ (sc_term_22 = term);
+ if (!(sc_term_22 instanceof sc_Pair))
+ (optrOpnd = sc_term_22);
+ else
+ (optrOpnd = (new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_22.car))), (translate_args_nboyer((sc_term_22.cdr))))));
+ (sc_term_21 = (apply_subst_nboyer(((const_nboyer === null)?null:(new sc_Pair((new sc_Pair((const_nboyer.car.car), (translate_term_nboyer((const_nboyer.car.cdr))))), (translate_alist_nboyer((const_nboyer.cdr)))))), optrOpnd)));
+ (answer = (tautologyp_nboyer((rewrite_nboyer(sc_term_21)), null, null)));
+ (sc_write(rewrite_count_nboyer));
+ (sc_display(" rewrites"));
+ (sc_newline());
+ if ((answer!== false))
+ return rewrite_count_nboyer;
+ else
+ return false;
+ }
+ };
+}
+/* Exported Variables */
+var BgL_parsezd2ze3nbzd2treesze3;
+var BgL_earleyzd2benchmarkzd2;
+var BgL_parsezd2ze3parsedzf3zc2;
+var test;
+var BgL_parsezd2ze3treesz31;
+var BgL_makezd2parserzd2;
+/* End Exports */
+
+var const_earley;
+{
+ (const_earley = (new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair((new sc_Pair("\u1E9Ca",null)),(new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair("\u1E9Cs",null)))),null)))))),null)));
+ BgL_makezd2parserzd2 = function(grammar, lexer) {
+ var i;
+ var parser_descr;
+ var def_loop;
+ var nb_nts;
+ var names;
+ var steps;
+ var predictors;
+ var enders;
+ var starters;
+ var nts;
+ var sc_names_1;
+ var sc_steps_2;
+ var sc_predictors_3;
+ var sc_enders_4;
+ var sc_starters_5;
+ var nb_confs;
+ var BgL_sc_defzd2loop_6zd2;
+ var BgL_sc_nbzd2nts_7zd2;
+ var sc_nts_8;
+ var BgL_sc_defzd2loop_9zd2;
+ var ind;
+ {
+ ind = function(nt, sc_nts_10) {
+ var i;
+ {
+ (i = ((sc_nts_10.length)-(1)));
+ while (true) {
+ if ((i>=(0)))
+ if ((sc_isEqual((sc_nts_10[i]), nt)))
+ return i;
+ else
+ (--i);
+ else
+ return false;
+ }
+ }
+ };
+ (sc_nts_8 = ((BgL_sc_defzd2loop_9zd2 = function(defs, sc_nts_11) {
+ var rule_loop;
+ var head;
+ var def;
+ return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, sc_nts_12) {
+ var nt;
+ var l;
+ var sc_nts_13;
+ var rule;
+ if ((rules instanceof sc_Pair))
+ {
+ (rule = (rules.car));
+ (l = rule);
+ (sc_nts_13 = sc_nts_12);
+ while ((l instanceof sc_Pair)) {
+ {
+ (nt = (l.car));
+ (l = (l.cdr));
+ (sc_nts_13 = (((sc_member(nt, sc_nts_13))!== false)?sc_nts_13:(new sc_Pair(nt, sc_nts_13))));
+ }
+ }
+ return (rule_loop((rules.cdr), sc_nts_13));
+ }
+ else
+ return (BgL_sc_defzd2loop_9zd2((defs.cdr), sc_nts_12));
+ }), (rule_loop((def.cdr), (((sc_member(head, sc_nts_11))!== false)?sc_nts_11:(new sc_Pair(head, sc_nts_11)))))):(sc_list2vector((sc_reverse(sc_nts_11)))));
+ }), (BgL_sc_defzd2loop_9zd2(grammar, null))));
+ (BgL_sc_nbzd2nts_7zd2 = (sc_nts_8.length));
+ (nb_confs = (((BgL_sc_defzd2loop_6zd2 = function(defs, BgL_sc_nbzd2confs_14zd2) {
+ var rule_loop;
+ var def;
+ return ((defs instanceof sc_Pair)?((def = (defs.car)), (rule_loop = function(rules, BgL_sc_nbzd2confs_15zd2) {
+ var l;
+ var BgL_sc_nbzd2confs_16zd2;
+ var rule;
+ if ((rules instanceof sc_Pair))
+ {
+ (rule = (rules.car));
+ (l = rule);
+ (BgL_sc_nbzd2confs_16zd2 = BgL_sc_nbzd2confs_15zd2);
+ while ((l instanceof sc_Pair)) {
+ {
+ (l = (l.cdr));
+ (++BgL_sc_nbzd2confs_16zd2);
+ }
+ }
+ return (rule_loop((rules.cdr), (BgL_sc_nbzd2confs_16zd2+(1))));
+ }
+ else
+ return (BgL_sc_defzd2loop_6zd2((defs.cdr), BgL_sc_nbzd2confs_15zd2));
+ }), (rule_loop((def.cdr), BgL_sc_nbzd2confs_14zd2))):BgL_sc_nbzd2confs_14zd2);
+ }), (BgL_sc_defzd2loop_6zd2(grammar, (0))))+BgL_sc_nbzd2nts_7zd2));
+ (sc_starters_5 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
+ (sc_enders_4 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
+ (sc_predictors_3 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
+ (sc_steps_2 = (sc_makeVector(nb_confs, false)));
+ (sc_names_1 = (sc_makeVector(nb_confs, false)));
+ (nts = sc_nts_8);
+ (starters = sc_starters_5);
+ (enders = sc_enders_4);
+ (predictors = sc_predictors_3);
+ (steps = sc_steps_2);
+ (names = sc_names_1);
+ (nb_nts = (sc_nts_8.length));
+ (i = (nb_nts-(1)));
+ while ((i>=(0))) {
+ {
+ (sc_steps_2[i] = (i-nb_nts));
+ (sc_names_1[i] = (sc_list((sc_nts_8[i]), (0))));
+ (sc_enders_4[i] = (sc_list(i)));
+ (--i);
+ }
+ }
+ def_loop = function(defs, conf) {
+ var rule_loop;
+ var head;
+ var def;
+ return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, conf, rule_num) {
+ var i;
+ var sc_i_17;
+ var nt;
+ var l;
+ var sc_conf_18;
+ var sc_i_19;
+ var rule;
+ if ((rules instanceof sc_Pair))
+ {
+ (rule = (rules.car));
+ (names[conf] = (sc_list(head, rule_num)));
+ (sc_i_19 = (ind(head, nts)));
+ (starters[sc_i_19] = (new sc_Pair(conf, (starters[sc_i_19]))));
+ (l = rule);
+ (sc_conf_18 = conf);
+ while ((l instanceof sc_Pair)) {
+ {
+ (nt = (l.car));
+ (steps[sc_conf_18] = (ind(nt, nts)));
+ (sc_i_17 = (ind(nt, nts)));
+ (predictors[sc_i_17] = (new sc_Pair(sc_conf_18, (predictors[sc_i_17]))));
+ (l = (l.cdr));
+ (++sc_conf_18);
+ }
+ }
+ (steps[sc_conf_18] = ((ind(head, nts))-nb_nts));
+ (i = (ind(head, nts)));
+ (enders[i] = (new sc_Pair(sc_conf_18, (enders[i]))));
+ return (rule_loop((rules.cdr), (sc_conf_18+(1)), (rule_num+(1))));
+ }
+ else
+ return (def_loop((defs.cdr), conf));
+ }), (rule_loop((def.cdr), conf, (1)))):undefined);
+ };
+ (def_loop(grammar, (sc_nts_8.length)));
+ (parser_descr = [lexer, sc_nts_8, sc_starters_5, sc_enders_4, sc_predictors_3, sc_steps_2, sc_names_1]);
+ return function(input) {
+ var optrOpnd;
+ var sc_optrOpnd_20;
+ var sc_optrOpnd_21;
+ var sc_optrOpnd_22;
+ var loop1;
+ var BgL_sc_stateza2_23za2;
+ var toks;
+ var BgL_sc_nbzd2nts_24zd2;
+ var sc_steps_25;
+ var sc_enders_26;
+ var state_num;
+ var BgL_sc_statesza2_27za2;
+ var states;
+ var i;
+ var conf;
+ var l;
+ var tok_nts;
+ var sc_i_28;
+ var sc_i_29;
+ var l1;
+ var l2;
+ var tok;
+ var tail1129;
+ var L1125;
+ var goal_enders;
+ var BgL_sc_statesza2_30za2;
+ var BgL_sc_nbzd2nts_31zd2;
+ var BgL_sc_nbzd2confs_32zd2;
+ var nb_toks;
+ var goal_starters;
+ var sc_states_33;
+ var BgL_sc_nbzd2confs_34zd2;
+ var BgL_sc_nbzd2toks_35zd2;
+ var sc_toks_36;
+ var falseHead1128;
+ var sc_names_37;
+ var sc_steps_38;
+ var sc_predictors_39;
+ var sc_enders_40;
+ var sc_starters_41;
+ var sc_nts_42;
+ var lexer;
+ var sc_ind_43;
+ var make_states;
+ var BgL_sc_confzd2setzd2getza2_44za2;
+ var conf_set_merge_new_bang;
+ var conf_set_adjoin;
+ var BgL_sc_confzd2setzd2adjoinza2_45za2;
+ var BgL_sc_confzd2setzd2adjoinza2za2_46z00;
+ var conf_set_union;
+ var forw;
+ var is_parsed;
+ var deriv_trees;
+ var BgL_sc_derivzd2treesza2_47z70;
+ var nb_deriv_trees;
+ var BgL_sc_nbzd2derivzd2treesza2_48za2;
+ {
+ sc_ind_43 = function(nt, sc_nts_49) {
+ var i;
+ {
+ (i = ((sc_nts_49.length)-(1)));
+ while (true) {
+ if ((i>=(0)))
+ if ((sc_isEqual((sc_nts_49[i]), nt)))
+ return i;
+ else
+ (--i);
+ else
+ return false;
+ }
+ }
+ };
+ make_states = function(BgL_sc_nbzd2toks_50zd2, BgL_sc_nbzd2confs_51zd2) {
+ var v;
+ var i;
+ var sc_states_52;
+ {
+ (sc_states_52 = (sc_makeVector((BgL_sc_nbzd2toks_50zd2+(1)), false)));
+ (i = BgL_sc_nbzd2toks_50zd2);
+ while ((i>=(0))) {
+ {
+ (v = (sc_makeVector((BgL_sc_nbzd2confs_51zd2+(1)), false)));
+ (v[(0)] = (-1));
+ (sc_states_52[i] = v);
+ (--i);
+ }
+ }
+ return sc_states_52;
+ }
+ };
+ BgL_sc_confzd2setzd2getza2_44za2 = function(state, BgL_sc_statezd2num_53zd2, sc_conf_54) {
+ var conf_set;
+ var BgL_sc_confzd2set_55zd2;
+ return ((BgL_sc_confzd2set_55zd2 = (state[(sc_conf_54+(1))])), ((BgL_sc_confzd2set_55zd2!== false)?BgL_sc_confzd2set_55zd2:((conf_set = (sc_makeVector((BgL_sc_statezd2num_53zd2+(6)), false))), (conf_set[(1)] = (-3)), (conf_set[(2)] = (-1)), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)), (state[(sc_conf_54+(1))] = conf_set), conf_set)));
+ };
+ conf_set_merge_new_bang = function(conf_set) {
+ return ((conf_set[((conf_set[(1)])+(5))] = (conf_set[(4)])), (conf_set[(1)] = (conf_set[(3)])), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)));
+ };
+ conf_set_adjoin = function(state, conf_set, sc_conf_56, i) {
+ var tail;
+ return ((tail = (conf_set[(3)])), (conf_set[(i+(5))] = (-1)), (conf_set[(tail+(5))] = i), (conf_set[(3)] = i), ((tail<(0))?((conf_set[(0)] = (state[(0)])), (state[(0)] = sc_conf_56)):undefined));
+ };
+ BgL_sc_confzd2setzd2adjoinza2_45za2 = function(sc_states_57, BgL_sc_statezd2num_58zd2, l, i) {
+ var conf_set;
+ var sc_conf_59;
+ var l1;
+ var state;
+ {
+ (state = (sc_states_57[BgL_sc_statezd2num_58zd2]));
+ (l1 = l);
+ while ((l1 instanceof sc_Pair)) {
+ {
+ (sc_conf_59 = (l1.car));
+ (conf_set = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_58zd2, sc_conf_59)));
+ if (((conf_set[(i+(5))])=== false))
+ {
+ (conf_set_adjoin(state, conf_set, sc_conf_59, i));
+ (l1 = (l1.cdr));
+ }
+ else
+ (l1 = (l1.cdr));
+ }
+ }
+ return undefined;
+ }
+ };
+ BgL_sc_confzd2setzd2adjoinza2za2_46z00 = function(sc_states_60, BgL_sc_statesza2_61za2, BgL_sc_statezd2num_62zd2, sc_conf_63, i) {
+ var BgL_sc_confzd2setza2_64z70;
+ var BgL_sc_stateza2_65za2;
+ var conf_set;
+ var state;
+ return ((state = (sc_states_60[BgL_sc_statezd2num_62zd2])), ((((conf_set = (state[(sc_conf_63+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)?((BgL_sc_stateza2_65za2 = (BgL_sc_statesza2_61za2[BgL_sc_statezd2num_62zd2])), (BgL_sc_confzd2setza2_64z70 = (BgL_sc_confzd2setzd2getza2_44za2(BgL_sc_stateza2_65za2, BgL_sc_statezd2num_62zd2, sc_conf_63))), (((BgL_sc_confzd2setza2_64z70[(i+(5))])=== false)?(conf_set_adjoin(BgL_sc_stateza2_65za2, BgL_sc_confzd2setza2_64z70, sc_conf_63, i)):undefined), true):false));
+ };
+ conf_set_union = function(state, conf_set, sc_conf_66, other_set) {
+ var i;
+ {
+ (i = (other_set[(2)]));
+ while ((i>=(0))) {
+ if (((conf_set[(i+(5))])=== false))
+ {
+ (conf_set_adjoin(state, conf_set, sc_conf_66, i));
+ (i = (other_set[(i+(5))]));
+ }
+ else
+ (i = (other_set[(i+(5))]));
+ }
+ return undefined;
+ }
+ };
+ forw = function(sc_states_67, BgL_sc_statezd2num_68zd2, sc_starters_69, sc_enders_70, sc_predictors_71, sc_steps_72, sc_nts_73) {
+ var next_set;
+ var next;
+ var conf_set;
+ var ender;
+ var l;
+ var starter_set;
+ var starter;
+ var sc_l_74;
+ var sc_loop1_75;
+ var head;
+ var BgL_sc_confzd2set_76zd2;
+ var BgL_sc_statezd2num_77zd2;
+ var state;
+ var sc_states_78;
+ var preds;
+ var BgL_sc_confzd2set_79zd2;
+ var step;
+ var sc_conf_80;
+ var BgL_sc_nbzd2nts_81zd2;
+ var sc_state_82;
+ {
+ (sc_state_82 = (sc_states_67[BgL_sc_statezd2num_68zd2]));
+ (BgL_sc_nbzd2nts_81zd2 = (sc_nts_73.length));
+ while (true) {
+ {
+ (sc_conf_80 = (sc_state_82[(0)]));
+ if ((sc_conf_80>=(0)))
+ {
+ (step = (sc_steps_72[sc_conf_80]));
+ (BgL_sc_confzd2set_79zd2 = (sc_state_82[(sc_conf_80+(1))]));
+ (head = (BgL_sc_confzd2set_79zd2[(4)]));
+ (sc_state_82[(0)] = (BgL_sc_confzd2set_79zd2[(0)]));
+ (conf_set_merge_new_bang(BgL_sc_confzd2set_79zd2));
+ if ((step>=(0)))
+ {
+ (sc_l_74 = (sc_starters_69[step]));
+ while ((sc_l_74 instanceof sc_Pair)) {
+ {
+ (starter = (sc_l_74.car));
+ (starter_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, starter)));
+ if (((starter_set[(BgL_sc_statezd2num_68zd2+(5))])=== false))
+ {
+ (conf_set_adjoin(sc_state_82, starter_set, starter, BgL_sc_statezd2num_68zd2));
+ (sc_l_74 = (sc_l_74.cdr));
+ }
+ else
+ (sc_l_74 = (sc_l_74.cdr));
+ }
+ }
+ (l = (sc_enders_70[step]));
+ while ((l instanceof sc_Pair)) {
+ {
+ (ender = (l.car));
+ if ((((conf_set = (sc_state_82[(ender+(1))])), ((conf_set!== false)?(conf_set[(BgL_sc_statezd2num_68zd2+(5))]):false))!== false))
+ {
+ (next = (sc_conf_80+(1)));
+ (next_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, next)));
+ (conf_set_union(sc_state_82, next_set, next, BgL_sc_confzd2set_79zd2));
+ (l = (l.cdr));
+ }
+ else
+ (l = (l.cdr));
+ }
+ }
+ }
+ else
+ {
+ (preds = (sc_predictors_71[(step+BgL_sc_nbzd2nts_81zd2)]));
+ (sc_states_78 = sc_states_67);
+ (state = sc_state_82);
+ (BgL_sc_statezd2num_77zd2 = BgL_sc_statezd2num_68zd2);
+ (BgL_sc_confzd2set_76zd2 = BgL_sc_confzd2set_79zd2);
+ sc_loop1_75 = function(l) {
+ var sc_state_83;
+ var BgL_sc_nextzd2set_84zd2;
+ var sc_next_85;
+ var pred_set;
+ var i;
+ var pred;
+ if ((l instanceof sc_Pair))
+ {
+ (pred = (l.car));
+ (i = head);
+ while ((i>=(0))) {
+ {
+ (pred_set = ((sc_state_83 = (sc_states_78[i])), (sc_state_83[(pred+(1))])));
+ if ((pred_set!== false))
+ {
+ (sc_next_85 = (pred+(1)));
+ (BgL_sc_nextzd2set_84zd2 = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_77zd2, sc_next_85)));
+ (conf_set_union(state, BgL_sc_nextzd2set_84zd2, sc_next_85, pred_set));
+ }
+ (i = (BgL_sc_confzd2set_76zd2[(i+(5))]));
+ }
+ }
+ return (sc_loop1_75((l.cdr)));
+ }
+ else
+ return undefined;
+ };
+ (sc_loop1_75(preds));
+ }
+ }
+ else
+ return undefined;
+ }
+ }
+ }
+ };
+ is_parsed = function(nt, i, j, sc_nts_86, sc_enders_87, sc_states_88) {
+ var conf_set;
+ var state;
+ var sc_conf_89;
+ var l;
+ var BgL_sc_ntza2_90za2;
+ {
+ (BgL_sc_ntza2_90za2 = (sc_ind_43(nt, sc_nts_86)));
+ if ((BgL_sc_ntza2_90za2!== false))
+ {
+ (sc_nts_86.length);
+ (l = (sc_enders_87[BgL_sc_ntza2_90za2]));
+ while (true) {
+ if ((l instanceof sc_Pair))
+ {
+ (sc_conf_89 = (l.car));
+ if ((((state = (sc_states_88[j])), (conf_set = (state[(sc_conf_89+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
+ return true;
+ else
+ (l = (l.cdr));
+ }
+ else
+ return false;
+ }
+ }
+ else
+ return false;
+ }
+ };
+ deriv_trees = function(sc_conf_91, i, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2) {
+ var sc_loop1_98;
+ var prev;
+ var name;
+ return ((name = (sc_names_94[sc_conf_91])), ((name!== false)?((sc_conf_91<BgL_sc_nbzd2nts_97zd2)?(sc_list((sc_list(name, ((sc_toks_95[i]).car))))):(sc_list((sc_list(name))))):((prev = (sc_conf_91-(1))), (sc_loop1_98 = function(l1, l2) {
+ var loop2;
+ var ender_set;
+ var state;
+ var ender;
+ var l1;
+ var l2;
+ while (true) {
+ if ((l1 instanceof sc_Pair))
+ {
+ (ender = (l1.car));
+ (ender_set = ((state = (sc_states_96[j])), (state[(ender+(1))])));
+ if ((ender_set!== false))
+ {
+ loop2 = function(k, l2) {
+ var loop3;
+ var ender_trees;
+ var prev_trees;
+ var conf_set;
+ var sc_state_99;
+ var k;
+ var l2;
+ while (true) {
+ if ((k>=(0)))
+ if (((k>=i)&&(((sc_state_99 = (sc_states_96[k])), (conf_set = (sc_state_99[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))
+ {
+ (prev_trees = (deriv_trees(prev, i, k, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2)));
+ (ender_trees = (deriv_trees(ender, k, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2)));
+ loop3 = function(l3, l2) {
+ var l4;
+ var sc_l2_100;
+ var ender_tree;
+ if ((l3 instanceof sc_Pair))
+ {
+ (ender_tree = (sc_list((l3.car))));
+ (l4 = prev_trees);
+ (sc_l2_100 = l2);
+ while ((l4 instanceof sc_Pair)) {
+ {
+ (sc_l2_100 = (new sc_Pair((sc_append((l4.car), ender_tree)), sc_l2_100)));
+ (l4 = (l4.cdr));
+ }
+ }
+ return (loop3((l3.cdr), sc_l2_100));
+ }
+ else
+ return (loop2((ender_set[(k+(5))]), l2));
+ };
+ return (loop3(ender_trees, l2));
+ }
+ else
+ (k = (ender_set[(k+(5))]));
+ else
+ return (sc_loop1_98((l1.cdr), l2));
+ }
+ };
+ return (loop2((ender_set[(2)]), l2));
+ }
+ else
+ (l1 = (l1.cdr));
+ }
+ else
+ return l2;
+ }
+ }), (sc_loop1_98((sc_enders_92[(sc_steps_93[prev])]), null)))));
+ };
+ BgL_sc_derivzd2treesza2_47z70 = function(nt, i, j, sc_nts_101, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106) {
+ var conf_set;
+ var state;
+ var sc_conf_107;
+ var l;
+ var trees;
+ var BgL_sc_nbzd2nts_108zd2;
+ var BgL_sc_ntza2_109za2;
+ {
+ (BgL_sc_ntza2_109za2 = (sc_ind_43(nt, sc_nts_101)));
+ if ((BgL_sc_ntza2_109za2!== false))
+ {
+ (BgL_sc_nbzd2nts_108zd2 = (sc_nts_101.length));
+ (l = (sc_enders_102[BgL_sc_ntza2_109za2]));
+ (trees = null);
+ while ((l instanceof sc_Pair)) {
+ {
+ (sc_conf_107 = (l.car));
+ if ((((state = (sc_states_106[j])), (conf_set = (state[(sc_conf_107+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
+ {
+ (l = (l.cdr));
+ (trees = (sc_append((deriv_trees(sc_conf_107, i, j, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106, BgL_sc_nbzd2nts_108zd2)), trees)));
+ }
+ else
+ (l = (l.cdr));
+ }
+ }
+ return trees;
+ }
+ else
+ return false;
+ }
+ };
+ nb_deriv_trees = function(sc_conf_110, i, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2) {
+ var sc_loop1_116;
+ var tmp1124;
+ var prev;
+ return ((prev = (sc_conf_110-(1))), ((((tmp1124 = (sc_conf_110<BgL_sc_nbzd2nts_115zd2)), ((tmp1124!== false)?tmp1124:((sc_steps_112[prev])<(0))))!== false)?(1):((sc_loop1_116 = function(l, sc_n_118) {
+ var nb_ender_trees;
+ var nb_prev_trees;
+ var conf_set;
+ var state;
+ var k;
+ var n;
+ var ender_set;
+ var sc_state_117;
+ var ender;
+ var l;
+ var sc_n_118;
+ while (true) {
+ if ((l instanceof sc_Pair))
+ {
+ (ender = (l.car));
+ (ender_set = ((sc_state_117 = (sc_states_114[j])), (sc_state_117[(ender+(1))])));
+ if ((ender_set!== false))
+ {
+ (k = (ender_set[(2)]));
+ (n = sc_n_118);
+ while ((k>=(0))) {
+ if (((k>=i)&&(((state = (sc_states_114[k])), (conf_set = (state[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))
+ {
+ (nb_prev_trees = (nb_deriv_trees(prev, i, k, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2)));
+ (nb_ender_trees = (nb_deriv_trees(ender, k, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2)));
+ (k = (ender_set[(k+(5))]));
+ (n +=(nb_prev_trees*nb_ender_trees));
+ }
+ else
+ (k = (ender_set[(k+(5))]));
+ }
+ return (sc_loop1_116((l.cdr), n));
+ }
+ else
+ (l = (l.cdr));
+ }
+ else
+ return sc_n_118;
+ }
+ }), (sc_loop1_116((sc_enders_111[(sc_steps_112[prev])]), (0))))));
+ };
+ BgL_sc_nbzd2derivzd2treesza2_48za2 = function(nt, i, j, sc_nts_119, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123) {
+ var conf_set;
+ var state;
+ var sc_conf_124;
+ var l;
+ var nb_trees;
+ var BgL_sc_nbzd2nts_125zd2;
+ var BgL_sc_ntza2_126za2;
+ {
+ (BgL_sc_ntza2_126za2 = (sc_ind_43(nt, sc_nts_119)));
+ if ((BgL_sc_ntza2_126za2!== false))
+ {
+ (BgL_sc_nbzd2nts_125zd2 = (sc_nts_119.length));
+ (l = (sc_enders_120[BgL_sc_ntza2_126za2]));
+ (nb_trees = (0));
+ while ((l instanceof sc_Pair)) {
+ {
+ (sc_conf_124 = (l.car));
+ if ((((state = (sc_states_123[j])), (conf_set = (state[(sc_conf_124+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
+ {
+ (l = (l.cdr));
+ (nb_trees = ((nb_deriv_trees(sc_conf_124, i, j, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123, BgL_sc_nbzd2nts_125zd2))+nb_trees));
+ }
+ else
+ (l = (l.cdr));
+ }
+ }
+ return nb_trees;
+ }
+ else
+ return false;
+ }
+ };
+ (lexer = (parser_descr[(0)]));
+ (sc_nts_42 = (parser_descr[(1)]));
+ (sc_starters_41 = (parser_descr[(2)]));
+ (sc_enders_40 = (parser_descr[(3)]));
+ (sc_predictors_39 = (parser_descr[(4)]));
+ (sc_steps_38 = (parser_descr[(5)]));
+ (sc_names_37 = (parser_descr[(6)]));
+ (falseHead1128 = (new sc_Pair(null, null)));
+ (L1125 = (lexer(input)));
+ (tail1129 = falseHead1128);
+ while (!(L1125 === null)) {
+ {
+ (tok = (L1125.car));
+ (l1 = (tok.cdr));
+ (l2 = null);
+ while ((l1 instanceof sc_Pair)) {
+ {
+ (sc_i_29 = (sc_ind_43((l1.car), sc_nts_42)));
+ if ((sc_i_29!== false))
+ {
+ (l1 = (l1.cdr));
+ (l2 = (new sc_Pair(sc_i_29, l2)));
+ }
+ else
+ (l1 = (l1.cdr));
+ }
+ }
+ (sc_optrOpnd_22 = (new sc_Pair((tok.car), (sc_reverse(l2)))));
+ (sc_optrOpnd_21 = (new sc_Pair(sc_optrOpnd_22, null)));
+ (tail1129.cdr = sc_optrOpnd_21);
+ (tail1129 = (tail1129.cdr));
+ (L1125 = (L1125.cdr));
+ }
+ }
+ (sc_optrOpnd_20 = (falseHead1128.cdr));
+ (sc_toks_36 = (sc_list2vector(sc_optrOpnd_20)));
+ (BgL_sc_nbzd2toks_35zd2 = (sc_toks_36.length));
+ (BgL_sc_nbzd2confs_34zd2 = (sc_steps_38.length));
+ (sc_states_33 = (make_states(BgL_sc_nbzd2toks_35zd2, BgL_sc_nbzd2confs_34zd2)));
+ (goal_starters = (sc_starters_41[(0)]));
+ (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (0), goal_starters, (0)));
+ (forw(sc_states_33, (0), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));
+ (sc_i_28 = (0));
+ while ((sc_i_28<BgL_sc_nbzd2toks_35zd2)) {
+ {
+ (tok_nts = ((sc_toks_36[sc_i_28]).cdr));
+ (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (sc_i_28+(1)), tok_nts, sc_i_28));
+ (forw(sc_states_33, (sc_i_28+(1)), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));
+ (++sc_i_28);
+ }
+ }
+ (nb_toks = (sc_toks_36.length));
+ (BgL_sc_nbzd2confs_32zd2 = (sc_steps_38.length));
+ (BgL_sc_nbzd2nts_31zd2 = (sc_nts_42.length));
+ (BgL_sc_statesza2_30za2 = (make_states(nb_toks, BgL_sc_nbzd2confs_32zd2)));
+ (goal_enders = (sc_enders_40[(0)]));
+ (l = goal_enders);
+ while ((l instanceof sc_Pair)) {
+ {
+ (conf = (l.car));
+ (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_33, BgL_sc_statesza2_30za2, nb_toks, conf, (0)));
+ (l = (l.cdr));
+ }
+ }
+ (i = nb_toks);
+ while ((i>=(0))) {
+ {
+ (states = sc_states_33);
+ (BgL_sc_statesza2_27za2 = BgL_sc_statesza2_30za2);
+ (state_num = i);
+ (sc_enders_26 = sc_enders_40);
+ (sc_steps_25 = sc_steps_38);
+ (BgL_sc_nbzd2nts_24zd2 = BgL_sc_nbzd2nts_31zd2);
+ (toks = sc_toks_36);
+ (BgL_sc_stateza2_23za2 = (BgL_sc_statesza2_30za2[i]));
+ loop1 = function() {
+ var sc_loop1_127;
+ var prev;
+ var BgL_sc_statesza2_128za2;
+ var sc_states_129;
+ var j;
+ var i;
+ var sc_i_130;
+ var head;
+ var conf_set;
+ var sc_conf_131;
+ {
+ (sc_conf_131 = (BgL_sc_stateza2_23za2[(0)]));
+ if ((sc_conf_131>=(0)))
+ {
+ (conf_set = (BgL_sc_stateza2_23za2[(sc_conf_131+(1))]));
+ (head = (conf_set[(4)]));
+ (BgL_sc_stateza2_23za2[(0)] = (conf_set[(0)]));
+ (conf_set_merge_new_bang(conf_set));
+ (sc_i_130 = head);
+ while ((sc_i_130>=(0))) {
+ {
+ (i = sc_i_130);
+ (j = state_num);
+ (sc_states_129 = states);
+ (BgL_sc_statesza2_128za2 = BgL_sc_statesza2_27za2);
+ (prev = (sc_conf_131-(1)));
+ if (((sc_conf_131>=BgL_sc_nbzd2nts_24zd2)&&((sc_steps_25[prev])>=(0))))
+ {
+ sc_loop1_127 = function(l) {
+ var k;
+ var ender_set;
+ var state;
+ var ender;
+ var l;
+ while (true) {
+ if ((l instanceof sc_Pair))
+ {
+ (ender = (l.car));
+ (ender_set = ((state = (sc_states_129[j])), (state[(ender+(1))])));
+ if ((ender_set!== false))
+ {
+ (k = (ender_set[(2)]));
+ while ((k>=(0))) {
+ {
+ if ((k>=i))
+ if (((BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, k, prev, i))!== false))
+ (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, j, ender, k));
+ (k = (ender_set[(k+(5))]));
+ }
+ }
+ return (sc_loop1_127((l.cdr)));
+ }
+ else
+ (l = (l.cdr));
+ }
+ else
+ return undefined;
+ }
+ };
+ (sc_loop1_127((sc_enders_26[(sc_steps_25[prev])])));
+ }
+ (sc_i_130 = (conf_set[(sc_i_130+(5))]));
+ }
+ }
+ return (loop1());
+ }
+ else
+ return undefined;
+ }
+ };
+ (loop1());
+ (--i);
+ }
+ }
+ (optrOpnd = BgL_sc_statesza2_30za2);
+ return [sc_nts_42, sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_names_37, sc_toks_36, optrOpnd, is_parsed, BgL_sc_derivzd2treesza2_47z70, BgL_sc_nbzd2derivzd2treesza2_48za2];
+ }
+ };
+ }
+ };
+ BgL_parsezd2ze3parsedzf3zc2 = function(parse, nt, i, j) {
+ var is_parsed;
+ var states;
+ var enders;
+ var nts;
+ return ((nts = (parse[(0)])), (enders = (parse[(2)])), (states = (parse[(7)])), (is_parsed = (parse[(8)])), (is_parsed(nt, i, j, nts, enders, states)));
+ };
+ BgL_parsezd2ze3treesz31 = function(parse, nt, i, j) {
+ var BgL_sc_derivzd2treesza2_132z70;
+ var states;
+ var toks;
+ var names;
+ var steps;
+ var enders;
+ var nts;
+ return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (names = (parse[(5)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_derivzd2treesza2_132z70 = (parse[(9)])), (BgL_sc_derivzd2treesza2_132z70(nt, i, j, nts, enders, steps, names, toks, states)));
+ };
+ BgL_parsezd2ze3nbzd2treesze3 = function(parse, nt, i, j) {
+ var BgL_sc_nbzd2derivzd2treesza2_133za2;
+ var states;
+ var toks;
+ var steps;
+ var enders;
+ var nts;
+ return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_nbzd2derivzd2treesza2_133za2 = (parse[(10)])), (BgL_sc_nbzd2derivzd2treesza2_133za2(nt, i, j, nts, enders, steps, toks, states)));
+ };
+ test = function(k) {
+ var x;
+ var p;
+ return ((p = (BgL_makezd2parserzd2(const_earley, function(l) {
+ var sc_x_134;
+ var tail1134;
+ var L1130;
+ var falseHead1133;
+ {
+ (falseHead1133 = (new sc_Pair(null, null)));
+ (tail1134 = falseHead1133);
+ (L1130 = l);
+ while (!(L1130 === null)) {
+ {
+ (tail1134.cdr = (new sc_Pair(((sc_x_134 = (L1130.car)), (sc_list(sc_x_134, sc_x_134))), null)));
+ (tail1134 = (tail1134.cdr));
+ (L1130 = (L1130.cdr));
+ }
+ }
+ return (falseHead1133.cdr);
+ }
+ }))), (x = (p((sc_vector2list((sc_makeVector(k, "\u1E9Ca"))))))), (sc_length((BgL_parsezd2ze3treesz31(x, "\u1E9Cs", (0), k)))));
+ };
+ BgL_earleyzd2benchmarkzd2 = function() {
+ var args = null;
+ for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {
+ args = sc_cons(arguments[sc_tmp], args);
+ }
+ var k;
+ return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() {
+ return (test(k));
+ }, function(result) {
+ return ((sc_display(result)), (sc_newline()), result == 132);
+ })));
+ };
+}
+
+
+/************* END OF GENERATED CODE *************/
+// Invoke this function to run a benchmark.
+// The first argument is a string identifying the benchmark.
+// The second argument is the number of times to run the benchmark.
+// The third argument is a function that runs the benchmark.
+// The fourth argument is a unary function that warns if the result
+// returned by the benchmark is incorrect.
+//
+// Example:
+// RunBenchmark("new Array()",
+// 1,
+// function () { new Array(1000000); }
+// function (v) {
+// return (v instanceof Array) && (v.length == 1000000);
+// });
+
+SC_DEFAULT_OUT = new sc_GenericOutputPort(function(s) {});
+SC_ERROR_OUT = SC_DEFAULT_OUT;
+
+function RunBenchmark(name, count, run, warn) {
+ for (var n = 0; n < count; ++n) {
+ result = run();
+ if (!warn(result)) {
+ throw new Error("Earley or Boyer did incorrect number of rewrites");
+ }
+ }
+}
+
+var BgL_runzd2benchmarkzd2 = RunBenchmark;
diff --git a/tests/benchmarks/script/v8/tests/raytrace.js b/tests/benchmarks/script/v8/tests/raytrace.js
new file mode 100644
index 0000000000..971ef7218e
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/raytrace.js
@@ -0,0 +1,904 @@
+// The ray tracer code in this file is written by Adam Burmister. It
+// is available in its original form from:
+//
+// http://labs.flog.nz.co/raytracer/
+//
+// It has been modified slightly by Google to work as a standalone
+// benchmark, but the all the computational code remains
+// untouched. This file also contains a copy of parts of the Prototype
+// JavaScript framework which is used by the ray tracer.
+
+var RayTrace = new BenchmarkSuite('RayTrace', 739989, [
+ new Benchmark('RayTrace', renderScene)
+]);
+
+
+// Variable used to hold a number that can be used to verify that
+// the scene was ray traced correctly.
+var checkNumber;
+
+
+// ------------------------------------------------------------------------
+// ------------------------------------------------------------------------
+
+// The following is a copy of parts of the Prototype JavaScript library:
+
+// Prototype JavaScript framework, version 1.5.0
+// (c) 2005-2007 Sam Stephenson
+//
+// Prototype is freely distributable under the terms of an MIT-style license.
+// For details, see the Prototype web site: http://prototype.conio.net/
+
+
+var Class = {
+ create: function() {
+ return function() {
+ this.initialize.apply(this, arguments);
+ }
+ }
+};
+
+
+Object.extend = function(destination, source) {
+ for (var property in source) {
+ destination[property] = source[property];
+ }
+ return destination;
+};
+
+
+// ------------------------------------------------------------------------
+// ------------------------------------------------------------------------
+
+// The rest of this file is the actual ray tracer written by Adam
+// Burmister. It's a concatenation of the following files:
+//
+// flog/color.js
+// flog/light.js
+// flog/vector.js
+// flog/ray.js
+// flog/scene.js
+// flog/material/basematerial.js
+// flog/material/solid.js
+// flog/material/chessboard.js
+// flog/shape/baseshape.js
+// flog/shape/sphere.js
+// flog/shape/plane.js
+// flog/intersectioninfo.js
+// flog/camera.js
+// flog/background.js
+// flog/engine.js
+
+
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Color = Class.create();
+
+Flog.RayTracer.Color.prototype = {
+ red : 0.0,
+ green : 0.0,
+ blue : 0.0,
+
+ initialize : function(r, g, b) {
+ if(!r) r = 0.0;
+ if(!g) g = 0.0;
+ if(!b) b = 0.0;
+
+ this.red = r;
+ this.green = g;
+ this.blue = b;
+ },
+
+ add : function(c1, c2){
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red + c2.red;
+ result.green = c1.green + c2.green;
+ result.blue = c1.blue + c2.blue;
+
+ return result;
+ },
+
+ addScalar: function(c1, s){
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red + s;
+ result.green = c1.green + s;
+ result.blue = c1.blue + s;
+
+ result.limit();
+
+ return result;
+ },
+
+ subtract: function(c1, c2){
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red - c2.red;
+ result.green = c1.green - c2.green;
+ result.blue = c1.blue - c2.blue;
+
+ return result;
+ },
+
+ multiply : function(c1, c2) {
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red * c2.red;
+ result.green = c1.green * c2.green;
+ result.blue = c1.blue * c2.blue;
+
+ return result;
+ },
+
+ multiplyScalar : function(c1, f) {
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red * f;
+ result.green = c1.green * f;
+ result.blue = c1.blue * f;
+
+ return result;
+ },
+
+ divideFactor : function(c1, f) {
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red / f;
+ result.green = c1.green / f;
+ result.blue = c1.blue / f;
+
+ return result;
+ },
+
+ limit: function(){
+ this.red = (this.red > 0.0) ? ( (this.red > 1.0) ? 1.0 : this.red ) : 0.0;
+ this.green = (this.green > 0.0) ? ( (this.green > 1.0) ? 1.0 : this.green ) : 0.0;
+ this.blue = (this.blue > 0.0) ? ( (this.blue > 1.0) ? 1.0 : this.blue ) : 0.0;
+ },
+
+ distance : function(color) {
+ var d = Math.abs(this.red - color.red) + Math.abs(this.green - color.green) + Math.abs(this.blue - color.blue);
+ return d;
+ },
+
+ blend: function(c1, c2, w){
+ var result = new Flog.RayTracer.Color(0,0,0);
+ result = Flog.RayTracer.Color.prototype.add(
+ Flog.RayTracer.Color.prototype.multiplyScalar(c1, 1 - w),
+ Flog.RayTracer.Color.prototype.multiplyScalar(c2, w)
+ );
+ return result;
+ },
+
+ brightness : function() {
+ var r = Math.floor(this.red*255);
+ var g = Math.floor(this.green*255);
+ var b = Math.floor(this.blue*255);
+ return (r * 77 + g * 150 + b * 29) >> 8;
+ },
+
+ toString : function () {
+ var r = Math.floor(this.red*255);
+ var g = Math.floor(this.green*255);
+ var b = Math.floor(this.blue*255);
+
+ return "rgb("+ r +","+ g +","+ b +")";
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Light = Class.create();
+
+Flog.RayTracer.Light.prototype = {
+ position: null,
+ color: null,
+ intensity: 10.0,
+
+ initialize : function(pos, color, intensity) {
+ this.position = pos;
+ this.color = color;
+ this.intensity = (intensity ? intensity : 10.0);
+ },
+
+ toString : function () {
+ return 'Light [' + this.position.x + ',' + this.position.y + ',' + this.position.z + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Vector = Class.create();
+
+Flog.RayTracer.Vector.prototype = {
+ x : 0.0,
+ y : 0.0,
+ z : 0.0,
+
+ initialize : function(x, y, z) {
+ this.x = (x ? x : 0);
+ this.y = (y ? y : 0);
+ this.z = (z ? z : 0);
+ },
+
+ copy: function(vector){
+ this.x = vector.x;
+ this.y = vector.y;
+ this.z = vector.z;
+ },
+
+ normalize : function() {
+ var m = this.magnitude();
+ return new Flog.RayTracer.Vector(this.x / m, this.y / m, this.z / m);
+ },
+
+ magnitude : function() {
+ return Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z));
+ },
+
+ cross : function(w) {
+ return new Flog.RayTracer.Vector(
+ -this.z * w.y + this.y * w.z,
+ this.z * w.x - this.x * w.z,
+ -this.y * w.x + this.x * w.y);
+ },
+
+ dot : function(w) {
+ return this.x * w.x + this.y * w.y + this.z * w.z;
+ },
+
+ add : function(v, w) {
+ return new Flog.RayTracer.Vector(w.x + v.x, w.y + v.y, w.z + v.z);
+ },
+
+ subtract : function(v, w) {
+ if(!w || !v) throw 'Vectors must be defined [' + v + ',' + w + ']';
+ return new Flog.RayTracer.Vector(v.x - w.x, v.y - w.y, v.z - w.z);
+ },
+
+ multiplyVector : function(v, w) {
+ return new Flog.RayTracer.Vector(v.x * w.x, v.y * w.y, v.z * w.z);
+ },
+
+ multiplyScalar : function(v, w) {
+ return new Flog.RayTracer.Vector(v.x * w, v.y * w, v.z * w);
+ },
+
+ toString : function () {
+ return 'Vector [' + this.x + ',' + this.y + ',' + this.z + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Ray = Class.create();
+
+Flog.RayTracer.Ray.prototype = {
+ position : null,
+ direction : null,
+ initialize : function(pos, dir) {
+ this.position = pos;
+ this.direction = dir;
+ },
+
+ toString : function () {
+ return 'Ray [' + this.position + ',' + this.direction + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Scene = Class.create();
+
+Flog.RayTracer.Scene.prototype = {
+ camera : null,
+ shapes : [],
+ lights : [],
+ background : null,
+
+ initialize : function() {
+ this.camera = new Flog.RayTracer.Camera(
+ new Flog.RayTracer.Vector(0,0,-5),
+ new Flog.RayTracer.Vector(0,0,1),
+ new Flog.RayTracer.Vector(0,1,0)
+ );
+ this.shapes = new Array();
+ this.lights = new Array();
+ this.background = new Flog.RayTracer.Background(new Flog.RayTracer.Color(0,0,0.5), 0.2);
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+if(typeof(Flog.RayTracer.Material) == 'undefined') Flog.RayTracer.Material = {};
+
+Flog.RayTracer.Material.BaseMaterial = Class.create();
+
+Flog.RayTracer.Material.BaseMaterial.prototype = {
+
+ gloss: 2.0, // [0...infinity] 0 = matt
+ transparency: 0.0, // 0=opaque
+ reflection: 0.0, // [0...infinity] 0 = no reflection
+ refraction: 0.50,
+ hasTexture: false,
+
+ initialize : function() {
+
+ },
+
+ getColor: function(u, v){
+
+ },
+
+ wrapUp: function(t){
+ t = t % 2.0;
+ if(t < -1) t += 2.0;
+ if(t >= 1) t -= 2.0;
+ return t;
+ },
+
+ toString : function () {
+ return 'Material [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Material.Solid = Class.create();
+
+Flog.RayTracer.Material.Solid.prototype = Object.extend(
+ new Flog.RayTracer.Material.BaseMaterial(), {
+ initialize : function(color, reflection, refraction, transparency, gloss) {
+ this.color = color;
+ this.reflection = reflection;
+ this.transparency = transparency;
+ this.gloss = gloss;
+ this.hasTexture = false;
+ },
+
+ getColor: function(u, v){
+ return this.color;
+ },
+
+ toString : function () {
+ return 'SolidMaterial [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']';
+ }
+ }
+);
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Material.Chessboard = Class.create();
+
+Flog.RayTracer.Material.Chessboard.prototype = Object.extend(
+ new Flog.RayTracer.Material.BaseMaterial(), {
+ colorEven: null,
+ colorOdd: null,
+ density: 0.5,
+
+ initialize : function(colorEven, colorOdd, reflection, transparency, gloss, density) {
+ this.colorEven = colorEven;
+ this.colorOdd = colorOdd;
+ this.reflection = reflection;
+ this.transparency = transparency;
+ this.gloss = gloss;
+ this.density = density;
+ this.hasTexture = true;
+ },
+
+ getColor: function(u, v){
+ var t = this.wrapUp(u * this.density) * this.wrapUp(v * this.density);
+
+ if(t < 0.0)
+ return this.colorEven;
+ else
+ return this.colorOdd;
+ },
+
+ toString : function () {
+ return 'ChessMaterial [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']';
+ }
+ }
+);
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {};
+
+Flog.RayTracer.Shape.Sphere = Class.create();
+
+Flog.RayTracer.Shape.Sphere.prototype = {
+ initialize : function(pos, radius, material) {
+ this.radius = radius;
+ this.position = pos;
+ this.material = material;
+ },
+
+ intersect: function(ray){
+ var info = new Flog.RayTracer.IntersectionInfo();
+ info.shape = this;
+
+ var dst = Flog.RayTracer.Vector.prototype.subtract(ray.position, this.position);
+
+ var B = dst.dot(ray.direction);
+ var C = dst.dot(dst) - (this.radius * this.radius);
+ var D = (B * B) - C;
+
+ if(D > 0){ // intersection!
+ info.isHit = true;
+ info.distance = (-B) - Math.sqrt(D);
+ info.position = Flog.RayTracer.Vector.prototype.add(
+ ray.position,
+ Flog.RayTracer.Vector.prototype.multiplyScalar(
+ ray.direction,
+ info.distance
+ )
+ );
+ info.normal = Flog.RayTracer.Vector.prototype.subtract(
+ info.position,
+ this.position
+ ).normalize();
+
+ info.color = this.material.getColor(0,0);
+ } else {
+ info.isHit = false;
+ }
+ return info;
+ },
+
+ toString : function () {
+ return 'Sphere [position=' + this.position + ', radius=' + this.radius + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {};
+
+Flog.RayTracer.Shape.Plane = Class.create();
+
+Flog.RayTracer.Shape.Plane.prototype = {
+ d: 0.0,
+
+ initialize : function(pos, d, material) {
+ this.position = pos;
+ this.d = d;
+ this.material = material;
+ },
+
+ intersect: function(ray){
+ var info = new Flog.RayTracer.IntersectionInfo();
+
+ var Vd = this.position.dot(ray.direction);
+ if(Vd == 0) return info; // no intersection
+
+ var t = -(this.position.dot(ray.position) + this.d) / Vd;
+ if(t <= 0) return info;
+
+ info.shape = this;
+ info.isHit = true;
+ info.position = Flog.RayTracer.Vector.prototype.add(
+ ray.position,
+ Flog.RayTracer.Vector.prototype.multiplyScalar(
+ ray.direction,
+ t
+ )
+ );
+ info.normal = this.position;
+ info.distance = t;
+
+ if(this.material.hasTexture){
+ var vU = new Flog.RayTracer.Vector(this.position.y, this.position.z, -this.position.x);
+ var vV = vU.cross(this.position);
+ var u = info.position.dot(vU);
+ var v = info.position.dot(vV);
+ info.color = this.material.getColor(u,v);
+ } else {
+ info.color = this.material.getColor(0,0);
+ }
+
+ return info;
+ },
+
+ toString : function () {
+ return 'Plane [' + this.position + ', d=' + this.d + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.IntersectionInfo = Class.create();
+
+Flog.RayTracer.IntersectionInfo.prototype = {
+ isHit: false,
+ hitCount: 0,
+ shape: null,
+ position: null,
+ normal: null,
+ color: null,
+ distance: null,
+
+ initialize : function() {
+ this.color = new Flog.RayTracer.Color(0,0,0);
+ },
+
+ toString : function () {
+ return 'Intersection [' + this.position + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Camera = Class.create();
+
+Flog.RayTracer.Camera.prototype = {
+ position: null,
+ lookAt: null,
+ equator: null,
+ up: null,
+ screen: null,
+
+ initialize : function(pos, lookAt, up) {
+ this.position = pos;
+ this.lookAt = lookAt;
+ this.up = up;
+ this.equator = lookAt.normalize().cross(this.up);
+ this.screen = Flog.RayTracer.Vector.prototype.add(this.position, this.lookAt);
+ },
+
+ getRay: function(vx, vy){
+ var pos = Flog.RayTracer.Vector.prototype.subtract(
+ this.screen,
+ Flog.RayTracer.Vector.prototype.subtract(
+ Flog.RayTracer.Vector.prototype.multiplyScalar(this.equator, vx),
+ Flog.RayTracer.Vector.prototype.multiplyScalar(this.up, vy)
+ )
+ );
+ pos.y = pos.y * -1;
+ var dir = Flog.RayTracer.Vector.prototype.subtract(
+ pos,
+ this.position
+ );
+
+ var ray = new Flog.RayTracer.Ray(pos, dir.normalize());
+
+ return ray;
+ },
+
+ toString : function () {
+ return 'Ray []';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Background = Class.create();
+
+Flog.RayTracer.Background.prototype = {
+ color : null,
+ ambience : 0.0,
+
+ initialize : function(color, ambience) {
+ this.color = color;
+ this.ambience = ambience;
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Engine = Class.create();
+
+Flog.RayTracer.Engine.prototype = {
+ canvas: null, /* 2d context we can render to */
+
+ initialize: function(options){
+ this.options = Object.extend({
+ canvasHeight: 100,
+ canvasWidth: 100,
+ pixelWidth: 2,
+ pixelHeight: 2,
+ renderDiffuse: false,
+ renderShadows: false,
+ renderHighlights: false,
+ renderReflections: false,
+ rayDepth: 2
+ }, options || {});
+
+ this.options.canvasHeight /= this.options.pixelHeight;
+ this.options.canvasWidth /= this.options.pixelWidth;
+
+ /* TODO: dynamically include other scripts */
+ },
+
+ setPixel: function(x, y, color){
+ var pxW, pxH;
+ pxW = this.options.pixelWidth;
+ pxH = this.options.pixelHeight;
+
+ if (this.canvas) {
+ this.canvas.fillStyle = color.toString();
+ this.canvas.fillRect (x * pxW, y * pxH, pxW, pxH);
+ } else {
+ if (x === y) {
+ checkNumber += color.brightness();
+ }
+ // print(x * pxW, y * pxH, pxW, pxH);
+ }
+ },
+
+ renderScene: function(scene, canvas){
+ checkNumber = 0;
+ /* Get canvas */
+ if (canvas) {
+ this.canvas = canvas.getContext("2d");
+ } else {
+ this.canvas = null;
+ }
+
+ var canvasHeight = this.options.canvasHeight;
+ var canvasWidth = this.options.canvasWidth;
+
+ for(var y=0; y < canvasHeight; y++){
+ for(var x=0; x < canvasWidth; x++){
+ var yp = y * 1.0 / canvasHeight * 2 - 1;
+ var xp = x * 1.0 / canvasWidth * 2 - 1;
+
+ var ray = scene.camera.getRay(xp, yp);
+
+ var color = this.getPixelColor(ray, scene);
+
+ this.setPixel(x, y, color);
+ }
+ }
+ if (checkNumber !== 2321) {
+ throw new Error("Scene rendered incorrectly");
+ }
+ },
+
+ getPixelColor: function(ray, scene){
+ var info = this.testIntersection(ray, scene, null);
+ if(info.isHit){
+ var color = this.rayTrace(info, ray, scene, 0);
+ return color;
+ }
+ return scene.background.color;
+ },
+
+ testIntersection: function(ray, scene, exclude){
+ var hits = 0;
+ var best = new Flog.RayTracer.IntersectionInfo();
+ best.distance = 2000;
+
+ for(var i=0; i<scene.shapes.length; i++){
+ var shape = scene.shapes[i];
+
+ if(shape != exclude){
+ var info = shape.intersect(ray);
+ if(info.isHit && info.distance >= 0 && info.distance < best.distance){
+ best = info;
+ hits++;
+ }
+ }
+ }
+ best.hitCount = hits;
+ return best;
+ },
+
+ getReflectionRay: function(P,N,V){
+ var c1 = -N.dot(V);
+ var R1 = Flog.RayTracer.Vector.prototype.add(
+ Flog.RayTracer.Vector.prototype.multiplyScalar(N, 2*c1),
+ V
+ );
+ return new Flog.RayTracer.Ray(P, R1);
+ },
+
+ rayTrace: function(info, ray, scene, depth){
+ // Calc ambient
+ var color = Flog.RayTracer.Color.prototype.multiplyScalar(info.color, scene.background.ambience);
+ var oldColor = color;
+ var shininess = Math.pow(10, info.shape.material.gloss + 1);
+
+ for(var i=0; i<scene.lights.length; i++){
+ var light = scene.lights[i];
+
+ // Calc diffuse lighting
+ var v = Flog.RayTracer.Vector.prototype.subtract(
+ light.position,
+ info.position
+ ).normalize();
+
+ if(this.options.renderDiffuse){
+ var L = v.dot(info.normal);
+ if(L > 0.0){
+ color = Flog.RayTracer.Color.prototype.add(
+ color,
+ Flog.RayTracer.Color.prototype.multiply(
+ info.color,
+ Flog.RayTracer.Color.prototype.multiplyScalar(
+ light.color,
+ L
+ )
+ )
+ );
+ }
+ }
+
+ // The greater the depth the more accurate the colours, but
+ // this is exponentially (!) expensive
+ if(depth <= this.options.rayDepth){
+ // calculate reflection ray
+ if(this.options.renderReflections && info.shape.material.reflection > 0)
+ {
+ var reflectionRay = this.getReflectionRay(info.position, info.normal, ray.direction);
+ var refl = this.testIntersection(reflectionRay, scene, info.shape);
+
+ if (refl.isHit && refl.distance > 0){
+ refl.color = this.rayTrace(refl, reflectionRay, scene, depth + 1);
+ } else {
+ refl.color = scene.background.color;
+ }
+
+ color = Flog.RayTracer.Color.prototype.blend(
+ color,
+ refl.color,
+ info.shape.material.reflection
+ );
+ }
+
+ // Refraction
+ /* TODO */
+ }
+
+ /* Render shadows and highlights */
+
+ var shadowInfo = new Flog.RayTracer.IntersectionInfo();
+
+ if(this.options.renderShadows){
+ var shadowRay = new Flog.RayTracer.Ray(info.position, v);
+
+ shadowInfo = this.testIntersection(shadowRay, scene, info.shape);
+ if(shadowInfo.isHit && shadowInfo.shape != info.shape /*&& shadowInfo.shape.type != 'PLANE'*/){
+ var vA = Flog.RayTracer.Color.prototype.multiplyScalar(color, 0.5);
+ var dB = (0.5 * Math.pow(shadowInfo.shape.material.transparency, 0.5));
+ color = Flog.RayTracer.Color.prototype.addScalar(vA,dB);
+ }
+ }
+
+ // Phong specular highlights
+ if(this.options.renderHighlights && !shadowInfo.isHit && info.shape.material.gloss > 0){
+ var Lv = Flog.RayTracer.Vector.prototype.subtract(
+ info.shape.position,
+ light.position
+ ).normalize();
+
+ var E = Flog.RayTracer.Vector.prototype.subtract(
+ scene.camera.position,
+ info.shape.position
+ ).normalize();
+
+ var H = Flog.RayTracer.Vector.prototype.subtract(
+ E,
+ Lv
+ ).normalize();
+
+ var glossWeight = Math.pow(Math.max(info.normal.dot(H), 0), shininess);
+ color = Flog.RayTracer.Color.prototype.add(
+ Flog.RayTracer.Color.prototype.multiplyScalar(light.color, glossWeight),
+ color
+ );
+ }
+ }
+ color.limit();
+ return color;
+ }
+};
+
+
+function renderScene(){
+ var scene = new Flog.RayTracer.Scene();
+
+ scene.camera = new Flog.RayTracer.Camera(
+ new Flog.RayTracer.Vector(0, 0, -15),
+ new Flog.RayTracer.Vector(-0.2, 0, 5),
+ new Flog.RayTracer.Vector(0, 1, 0)
+ );
+
+ scene.background = new Flog.RayTracer.Background(
+ new Flog.RayTracer.Color(0.5, 0.5, 0.5),
+ 0.4
+ );
+
+ var sphere = new Flog.RayTracer.Shape.Sphere(
+ new Flog.RayTracer.Vector(-1.5, 1.5, 2),
+ 1.5,
+ new Flog.RayTracer.Material.Solid(
+ new Flog.RayTracer.Color(0,0.5,0.5),
+ 0.3,
+ 0.0,
+ 0.0,
+ 2.0
+ )
+ );
+
+ var sphere1 = new Flog.RayTracer.Shape.Sphere(
+ new Flog.RayTracer.Vector(1, 0.25, 1),
+ 0.5,
+ new Flog.RayTracer.Material.Solid(
+ new Flog.RayTracer.Color(0.9,0.9,0.9),
+ 0.1,
+ 0.0,
+ 0.0,
+ 1.5
+ )
+ );
+
+ var plane = new Flog.RayTracer.Shape.Plane(
+ new Flog.RayTracer.Vector(0.1, 0.9, -0.5).normalize(),
+ 1.2,
+ new Flog.RayTracer.Material.Chessboard(
+ new Flog.RayTracer.Color(1,1,1),
+ new Flog.RayTracer.Color(0,0,0),
+ 0.2,
+ 0.0,
+ 1.0,
+ 0.7
+ )
+ );
+
+ scene.shapes.push(plane);
+ scene.shapes.push(sphere);
+ scene.shapes.push(sphere1);
+
+ var light = new Flog.RayTracer.Light(
+ new Flog.RayTracer.Vector(5, 10, -1),
+ new Flog.RayTracer.Color(0.8, 0.8, 0.8)
+ );
+
+ var light1 = new Flog.RayTracer.Light(
+ new Flog.RayTracer.Vector(-3, 5, -15),
+ new Flog.RayTracer.Color(0.8, 0.8, 0.8),
+ 100
+ );
+
+ scene.lights.push(light);
+ scene.lights.push(light1);
+
+ var imageWidth = 100; // $F('imageWidth');
+ var imageHeight = 100; // $F('imageHeight');
+ var pixelSize = "5,5".split(','); // $F('pixelSize').split(',');
+ var renderDiffuse = true; // $F('renderDiffuse');
+ var renderShadows = true; // $F('renderShadows');
+ var renderHighlights = true; // $F('renderHighlights');
+ var renderReflections = true; // $F('renderReflections');
+ var rayDepth = 2;//$F('rayDepth');
+
+ var raytracer = new Flog.RayTracer.Engine(
+ {
+ canvasWidth: imageWidth,
+ canvasHeight: imageHeight,
+ pixelWidth: pixelSize[0],
+ pixelHeight: pixelSize[1],
+ "renderDiffuse": renderDiffuse,
+ "renderHighlights": renderHighlights,
+ "renderShadows": renderShadows,
+ "renderReflections": renderReflections,
+ "rayDepth": rayDepth
+ }
+ );
+
+ raytracer.renderScene(scene, null, 0);
+}
diff --git a/tests/benchmarks/script/v8/tests/regexp.js b/tests/benchmarks/script/v8/tests/regexp.js
new file mode 100644
index 0000000000..71b9e6362c
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/regexp.js
@@ -0,0 +1,1764 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Automatically generated on 2009-01-30. Manually updated on 2010-09-17.
+
+// This benchmark is generated by loading 50 of the most popular pages
+// on the web and logging all regexp operations performed. Each
+// operation is given a weight that is calculated from an estimate of
+// the popularity of the pages where it occurs and the number of times
+// it is executed while loading each page. Furthermore the literal
+// letters in the data are encoded using ROT13 in a way that does not
+// affect how the regexps match their input. Finally the strings are
+// scrambled to exercise the regexp engine on different input strings.
+
+
+var RegExp = new BenchmarkSuite('RegExp', 910985, [
+ new Benchmark("RegExp", RegExpRun, RegExpSetup, RegExpTearDown)
+]);
+
+var regExpBenchmark = null;
+
+function RegExpSetup() {
+ regExpBenchmark = new RegExpBenchmark();
+ RegExpRun(); // run once to get system initialized
+}
+
+function RegExpRun() {
+ regExpBenchmark.run();
+}
+
+function RegExpTearDown() {
+ regExpBenchmark = null;
+}
+
+// Returns an array of n different variants of the input string str.
+// The variants are computed by randomly rotating one random
+// character.
+function computeInputVariants(str, n) {
+ var variants = [ str ];
+ for (var i = 1; i < n; i++) {
+ var pos = Math.floor(Math.random() * str.length);
+ var chr = String.fromCharCode((str.charCodeAt(pos) + Math.floor(Math.random() * 128)) % 128);
+ variants[i] = str.substring(0, pos) + chr + str.substring(pos + 1, str.length);
+ }
+ return variants;
+}
+
+function RegExpBenchmark() {
+ var re0 = /^ba/;
+ var re1 = /(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/;
+ var re2 = /^\s*|\s*$/g;
+ var re3 = /\bQBZPbageby_cynprubyqre\b/;
+ var re4 = /,/;
+ var re5 = /\bQBZPbageby_cynprubyqre\b/g;
+ var re6 = /^[\s\xa0]+|[\s\xa0]+$/g;
+ var re7 = /(\d*)(\D*)/g;
+ var re8 = /=/;
+ var re9 = /(^|\s)lhv\-h(\s|$)/;
+ var str0 = 'Zbmvyyn/5.0 (Jvaqbjf; H; Jvaqbjf AG 5.1; ra-HF) NccyrJroXvg/528.9 (XUGZY, yvxr Trpxb) Puebzr/2.0.157.0 Fnsnev/528.9';
+ var re10 = /\#/g;
+ var re11 = /\./g;
+ var re12 = /'/g;
+ var re13 = /\?[\w\W]*(sevraqvq|punaaryvq|tebhcvq)=([^\&\?#]*)/i;
+ var str1 = 'Fubpxjnir Synfu 9.0 e115';
+ var re14 = /\s+/g;
+ var re15 = /^\s*(\S*(\s+\S+)*)\s*$/;
+ var re16 = /(-[a-z])/i;
+
+ var s0 = computeInputVariants('pyvpx', 6511);
+ var s1 = computeInputVariants('uggc://jjj.snprobbx.pbz/ybtva.cuc', 1844);
+ var s2 = computeInputVariants('QBZPbageby_cynprubyqre', 739);
+ var s3 = computeInputVariants('uggc://jjj.snprobbx.pbz/', 598);
+ var s4 = computeInputVariants('uggc://jjj.snprobbx.pbz/fepu.cuc', 454);
+ var s5 = computeInputVariants('qqqq, ZZZ q, llll', 352);
+ var s6 = computeInputVariants('vachggrkg QBZPbageby_cynprubyqre', 312);
+ var s7 = computeInputVariants('/ZlFcnprUbzrcntr/Vaqrk-FvgrUbzr,10000000', 282);
+ var s8 = computeInputVariants('vachggrkg', 177);
+ var s9 = computeInputVariants('528.9', 170);
+ var s10 = computeInputVariants('528', 170);
+ var s11 = computeInputVariants('VCPhygher=ra-HF', 156);
+ var s12 = computeInputVariants('CersreerqPhygher=ra-HF', 156);
+ var s13 = computeInputVariants('xrlcerff', 144);
+ var s14 = computeInputVariants('521', 139);
+ var s15 = computeInputVariants(str0, 139);
+ var s16 = computeInputVariants('qvi .so_zrah', 137);
+ var s17 = computeInputVariants('qvi.so_zrah', 137);
+ var s18 = computeInputVariants('uvqqra_ryrz', 117);
+ var s19 = computeInputVariants('sevraqfgre_naba=nvq%3Qn6ss9p85n868ro9s059pn854735956o3%26ers%3Q%26df%3Q%26vpgl%3QHF', 95);
+ var s20 = computeInputVariants('uggc://ubzr.zlfcnpr.pbz/vaqrk.psz', 93);
+ var s21 = computeInputVariants(str1, 92);
+ var s22 = computeInputVariants('svefg', 85);
+ var s23 = computeInputVariants('uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz', 85);
+ var s24 = computeInputVariants('ynfg', 85);
+ var s25 = computeInputVariants('qvfcynl', 85);
+
+ function runBlock0() {
+ for (var i = 0; i < 6511; i++) {
+ re0.exec(s0[i]);
+ }
+ for (var i = 0; i < 1844; i++) {
+ re1.exec(s1[i]);
+ }
+ for (var i = 0; i < 739; i++) {
+ s2[i].replace(re2, '');
+ }
+ for (var i = 0; i < 598; i++) {
+ re1.exec(s3[i]);
+ }
+ for (var i = 0; i < 454; i++) {
+ re1.exec(s4[i]);
+ }
+ for (var i = 0; i < 352; i++) {
+ /qqqq|qqq|qq|q|ZZZZ|ZZZ|ZZ|Z|llll|ll|l|uu|u|UU|U|zz|z|ff|f|gg|g|sss|ss|s|mmm|mm|m/g.exec(s5[i]);
+ }
+ for (var i = 0; i < 312; i++) {
+ re3.exec(s6[i]);
+ }
+ for (var i = 0; i < 282; i++) {
+ re4.exec(s7[i]);
+ }
+ for (var i = 0; i < 177; i++) {
+ s8[i].replace(re5, '');
+ }
+ for (var i = 0; i < 170; i++) {
+ s9[i].replace(re6, '');
+ re7.exec(s10[i]);
+ }
+ for (var i = 0; i < 156; i++) {
+ re8.exec(s11[i]);
+ re8.exec(s12[i]);
+ }
+ for (var i = 0; i < 144; i++) {
+ re0.exec(s13[i]);
+ }
+ for (var i = 0; i < 139; i++) {
+ s14[i].replace(re6, '');
+ re7.exec(s14[i]);
+ re9.exec('');
+ /JroXvg\/(\S+)/.exec(s15[i]);
+ }
+ for (var i = 0; i < 137; i++) {
+ s16[i].replace(re10, '');
+ s16[i].replace(/\[/g, '');
+ s17[i].replace(re11, '');
+ }
+ for (var i = 0; i < 117; i++) {
+ s18[i].replace(re2, '');
+ }
+ for (var i = 0; i < 95; i++) {
+ /(?:^|;)\s*sevraqfgre_ynat=([^;]*)/.exec(s19[i]);
+ }
+ for (var i = 0; i < 93; i++) {
+ s20[i].replace(re12, '');
+ re13.exec(s20[i]);
+ }
+ for (var i = 0; i < 92; i++) {
+ s21[i].replace(/([a-zA-Z]|\s)+/, '');
+ }
+ for (var i = 0; i < 85; i++) {
+ s22[i].replace(re14, '');
+ s22[i].replace(re15, '');
+ s23[i].replace(re12, '');
+ s24[i].replace(re14, '');
+ s24[i].replace(re15, '');
+ re16.exec(s25[i]);
+ re13.exec(s23[i]);
+ }
+ }
+ var re17 = /(^|[^\\])\"\\\/Qngr\((-?[0-9]+)\)\\\/\"/g;
+ var str2 = '{"anzr":"","ahzoreSbezng":{"PheeraplQrpvznyQvtvgf":2,"PheeraplQrpvznyFrcnengbe":".","VfErnqBayl":gehr,"PheeraplTebhcFvmrf":[3],"AhzoreTebhcFvmrf":[3],"CrepragTebhcFvmrf":[3],"PheeraplTebhcFrcnengbe":",","PheeraplFlzoby":"\xa4","AnAFlzoby":"AnA","PheeraplArtngvirCnggrea":0,"AhzoreArtngvirCnggrea":1,"CrepragCbfvgvirCnggrea":0,"CrepragArtngvirCnggrea":0,"ArtngvirVasvavglFlzoby":"-Vasvavgl","ArtngvirFvta":"-","AhzoreQrpvznyQvtvgf":2,"AhzoreQrpvznyFrcnengbe":".","AhzoreTebhcFrcnengbe":",","PheeraplCbfvgvirCnggrea":0,"CbfvgvirVasvavglFlzoby":"Vasvavgl","CbfvgvirFvta":"+","CrepragQrpvznyQvtvgf":2,"CrepragQrpvznyFrcnengbe":".","CrepragTebhcFrcnengbe":",","CrepragFlzoby":"%","CreZvyyrFlzoby":"\u2030","AngvirQvtvgf":["0","1","2","3","4","5","6","7","8","9"],"QvtvgFhofgvghgvba":1},"qngrGvzrSbezng":{"NZQrfvtangbe":"NZ","Pnyraqne":{"ZvaFhccbegrqQngrGvzr":"@-62135568000000@","ZnkFhccbegrqQngrGvzr":"@253402300799999@","NytbevguzGlcr":1,"PnyraqneGlcr":1,"Renf":[1],"GjbQvtvgLrneZnk":2029,"VfErnqBayl":gehr},"QngrFrcnengbe":"/","SvefgQnlBsJrrx":0,"PnyraqneJrrxEhyr":0,"ShyyQngrGvzrCnggrea":"qqqq, qq ZZZZ llll UU:zz:ff","YbatQngrCnggrea":"qqqq, qq ZZZZ llll","YbatGvzrCnggrea":"UU:zz:ff","ZbaguQnlCnggrea":"ZZZZ qq","CZQrfvtangbe":"CZ","ESP1123Cnggrea":"qqq, qq ZZZ llll UU\':\'zz\':\'ff \'TZG\'","FubegQngrCnggrea":"ZZ/qq/llll","FubegGvzrCnggrea":"UU:zz","FbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq\'G\'UU\':\'zz\':\'ff","GvzrFrcnengbe":":","HavirefnyFbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq UU\':\'zz\':\'ff\'M\'","LrneZbaguCnggrea":"llll ZZZZ","NooerivngrqQnlAnzrf":["Fha","Zba","Ghr","Jrq","Guh","Sev","Fng"],"FubegrfgQnlAnzrf":["Fh","Zb","Gh","Jr","Gu","Se","Fn"],"QnlAnzrf":["Fhaqnl","Zbaqnl","Ghrfqnl","Jrqarfqnl","Guhefqnl","Sevqnl","Fngheqnl"],"NooerivngrqZbaguAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""],"VfErnqBayl":gehr,"AngvirPnyraqneAnzr":"Tertbevna Pnyraqne","NooerivngrqZbaguTravgvirAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguTravgvirAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""]}}';
+ var str3 = '{"anzr":"ra-HF","ahzoreSbezng":{"PheeraplQrpvznyQvtvgf":2,"PheeraplQrpvznyFrcnengbe":".","VfErnqBayl":snyfr,"PheeraplTebhcFvmrf":[3],"AhzoreTebhcFvmrf":[3],"CrepragTebhcFvmrf":[3],"PheeraplTebhcFrcnengbe":",","PheeraplFlzoby":"$","AnAFlzoby":"AnA","PheeraplArtngvirCnggrea":0,"AhzoreArtngvirCnggrea":1,"CrepragCbfvgvirCnggrea":0,"CrepragArtngvirCnggrea":0,"ArtngvirVasvavglFlzoby":"-Vasvavgl","ArtngvirFvta":"-","AhzoreQrpvznyQvtvgf":2,"AhzoreQrpvznyFrcnengbe":".","AhzoreTebhcFrcnengbe":",","PheeraplCbfvgvirCnggrea":0,"CbfvgvirVasvavglFlzoby":"Vasvavgl","CbfvgvirFvta":"+","CrepragQrpvznyQvtvgf":2,"CrepragQrpvznyFrcnengbe":".","CrepragTebhcFrcnengbe":",","CrepragFlzoby":"%","CreZvyyrFlzoby":"\u2030","AngvirQvtvgf":["0","1","2","3","4","5","6","7","8","9"],"QvtvgFhofgvghgvba":1},"qngrGvzrSbezng":{"NZQrfvtangbe":"NZ","Pnyraqne":{"ZvaFhccbegrqQngrGvzr":"@-62135568000000@","ZnkFhccbegrqQngrGvzr":"@253402300799999@","NytbevguzGlcr":1,"PnyraqneGlcr":1,"Renf":[1],"GjbQvtvgLrneZnk":2029,"VfErnqBayl":snyfr},"QngrFrcnengbe":"/","SvefgQnlBsJrrx":0,"PnyraqneJrrxEhyr":0,"ShyyQngrGvzrCnggrea":"qqqq, ZZZZ qq, llll u:zz:ff gg","YbatQngrCnggrea":"qqqq, ZZZZ qq, llll","YbatGvzrCnggrea":"u:zz:ff gg","ZbaguQnlCnggrea":"ZZZZ qq","CZQrfvtangbe":"CZ","ESP1123Cnggrea":"qqq, qq ZZZ llll UU\':\'zz\':\'ff \'TZG\'","FubegQngrCnggrea":"Z/q/llll","FubegGvzrCnggrea":"u:zz gg","FbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq\'G\'UU\':\'zz\':\'ff","GvzrFrcnengbe":":","HavirefnyFbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq UU\':\'zz\':\'ff\'M\'","LrneZbaguCnggrea":"ZZZZ, llll","NooerivngrqQnlAnzrf":["Fha","Zba","Ghr","Jrq","Guh","Sev","Fng"],"FubegrfgQnlAnzrf":["Fh","Zb","Gh","Jr","Gu","Se","Fn"],"QnlAnzrf":["Fhaqnl","Zbaqnl","Ghrfqnl","Jrqarfqnl","Guhefqnl","Sevqnl","Fngheqnl"],"NooerivngrqZbaguAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""],"VfErnqBayl":snyfr,"AngvirPnyraqneAnzr":"Tertbevna Pnyraqne","NooerivngrqZbaguTravgvirAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguTravgvirAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""]}}';
+ var str4 = 'HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str5 = 'HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var re18 = /^\s+|\s+$/g;
+ var str6 = 'uggc://jjj.snprobbx.pbz/vaqrk.cuc';
+ var re19 = /(?:^|\s+)ba(?:\s+|$)/;
+ var re20 = /[+, ]/;
+ var re21 = /ybnqrq|pbzcyrgr/;
+ var str7 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(d1)c=d1.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+d1.Cnaryf[c].Jvqgu,o=g+d1.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(d1&&d1.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(d1)d1.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(d1)d1.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;d1.IjTc=d2(n,c){ine nq=d1;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;d1.IjTpy=d2(n,c,p){ine cn=d1.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;d1.IjGenpr=d2(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;d1.IjYvzvg1=d2(n,f){ine nq=d1,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;d1.IjYvzvg0=d2(n,f){ine nq=d1,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;d1.IjRVST=d2(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",d1.rvsg);};;d1.IjNavzSHC=d2(n,c){ine nq=d1;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;d1.IjTrgErnyCbfvgvba=d2(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;d1.IjPnapryGvzrbhg=d2(n,c){c=IjTc(n,c);ine cay=d1.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;d1.IjPnapryNyyGvzrbhgf=d2(n){vs(d1.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<d1.bac;c++)IjPnapryGvzrbhg(n,c);};;d1.IjFgnegGvzrbhg=d2(n,c,bG){c=IjTc(n,c);ine cay=d1.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;d1.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;d1.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c<d1.bac;c++)IjErfrgGvzrbhg(n,c);};;d1.IjQrgnpure=d2(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbirRiragYvfgrare(\'"+rig+"\',"+sap+"NQ_VQ,snyfr)");}pngpu(r){}};;d1.IjPyrnaHc=d2(n){IjCvat(n,"G");ine nq=d1;sbe(ine v=0;v<nq.Cnaryf.yratgu;v++){IjUvqrCnary(n,v,gehr);}gel{IjTrgBow(nq.gya).vaareUGZY="";}pngpu(r){}vs(nq.gya!=nq.gya2)gel{IjTrgBow(nq.gya2).vaareUGZY="";}pngpu(r){}gel{d1=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"haybnq","IjHayNQ_VQ");}pngpu(r){}gel{jvaqbj.IjHayNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"fpebyy","IjFeNQ_VQ");}pngpu(r){}gel{jvaqbj.IjFeNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"erfvmr","IjEmNQ_VQ");}pngpu(r){}gel{jvaqbj.IjEmNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n';
+ var str8 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(jvaqbj.IjNqNQ_VQ)c=jvaqbj.IjNqNQ_VQ.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Jvqgu,o=g+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(jvaqbj.IjNqNQ_VQ&&jvaqbj.IjNqNQ_VQ.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjTc=shapgvba(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;jvaqbj.IjNqNQ_VQ.IjTpy=shapgvba(n,c,p){ine cn=jvaqbj.IjNqNQ_VQ.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;jvaqbj.IjNqNQ_VQ.IjGenpr=shapgvba(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjYvzvg1=shapgvba(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;jvaqbj.IjNqNQ_VQ.IjYvzvg0=shapgvba(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;jvaqbj.IjNqNQ_VQ.IjRVST=shapgvba(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",jvaqbj.IjNqNQ_VQ.rvsg);};;jvaqbj.IjNqNQ_VQ.IjNavzSHC=shapgvba(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;jvaqbj.IjNqNQ_VQ.IjTrgErnyCbfvgvba=shapgvba(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;jvaqbj.IjNqNQ_VQ.IjPnapryGvzrbhg=shapgvba(n,c){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;jvaqbj.IjNqNQ_VQ.IjPnapryNyyGvzrbhgf=shapgvba(n){vs(jvaqbj.IjNqNQ_VQ.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjPnapryGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjFgnegGvzrbhg=shapgvba(n,c,bG){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;jvaqbj.IjNqNQ_VQ.IjErfrgGvzrbhg=shapgvba(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;jvaqbj.IjNqNQ_VQ.IjErfrgNyyGvzrbhgf=shapgvba(n){sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjErfrgGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjQrgnpure=shapgvba(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbir';
+ var str9 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(jvaqbj.IjNqNQ_VQ)c=jvaqbj.IjNqNQ_VQ.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Jvqgu,o=g+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(jvaqbj.IjNqNQ_VQ&&jvaqbj.IjNqNQ_VQ.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjTc=d2(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;jvaqbj.IjNqNQ_VQ.IjTpy=d2(n,c,p){ine cn=jvaqbj.IjNqNQ_VQ.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;jvaqbj.IjNqNQ_VQ.IjGenpr=d2(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjYvzvg1=d2(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;jvaqbj.IjNqNQ_VQ.IjYvzvg0=d2(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;jvaqbj.IjNqNQ_VQ.IjRVST=d2(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",jvaqbj.IjNqNQ_VQ.rvsg);};;jvaqbj.IjNqNQ_VQ.IjNavzSHC=d2(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;jvaqbj.IjNqNQ_VQ.IjTrgErnyCbfvgvba=d2(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;jvaqbj.IjNqNQ_VQ.IjPnapryGvzrbhg=d2(n,c){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;jvaqbj.IjNqNQ_VQ.IjPnapryNyyGvzrbhgf=d2(n){vs(jvaqbj.IjNqNQ_VQ.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjPnapryGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjFgnegGvzrbhg=d2(n,c,bG){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;jvaqbj.IjNqNQ_VQ.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;jvaqbj.IjNqNQ_VQ.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjErfrgGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjQrgnpure=d2(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbirRiragYvfgrare(\'"+rig+"\',"+sap+"NQ_VQ,snyfr)");}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjPyrna';
+
+ var s26 = computeInputVariants('VC=74.125.75.1', 81);
+ var s27 = computeInputVariants('9.0 e115', 78);
+ var s28 = computeInputVariants('k',78);
+ var s29 = computeInputVariants(str2, 81);
+ var s30 = computeInputVariants(str3, 81);
+ var s31 = computeInputVariants('144631658', 78);
+ var s32 = computeInputVariants('Pbhagel=IIZ%3Q', 78);
+ var s33 = computeInputVariants('Pbhagel=IIZ=', 78);
+ var s34 = computeInputVariants('CersreerqPhygherCraqvat=', 78);
+ var s35 = computeInputVariants(str4, 78);
+ var s36 = computeInputVariants(str5, 78);
+ var s37 = computeInputVariants('__hgzp=144631658', 78);
+ var s38 = computeInputVariants('gvzrMbar=-8', 78);
+ var s39 = computeInputVariants('gvzrMbar=0', 78);
+ // var s40 = computeInputVariants(s15[i], 78);
+ var s41 = computeInputVariants('vachggrkg QBZPbageby_cynprubyqre', 78);
+ var s42 = computeInputVariants('xrlqbja', 78);
+ var s43 = computeInputVariants('xrlhc', 78);
+ var s44 = computeInputVariants('uggc://zrffntvat.zlfcnpr.pbz/vaqrk.psz', 77);
+ var s45 = computeInputVariants('FrffvbaFgbentr=%7O%22GnoThvq%22%3N%7O%22thvq%22%3N1231367125017%7Q%7Q', 73);
+ var s46 = computeInputVariants(str6, 72);
+ var s47 = computeInputVariants('3.5.0.0', 70);
+ var s48 = computeInputVariants(str7, 70);
+ var s49 = computeInputVariants(str8, 70);
+ var s50 = computeInputVariants(str9, 70);
+ var s51 = computeInputVariants('NI%3Q1_CI%3Q1_PI%3Q1_EI%3Q1_HI%3Q1_HP%3Q1_IC%3Q0.0.0.0_IH%3Q0', 70);
+ var s52 = computeInputVariants('svz_zlfcnpr_ubzrcntr_abgybttrqva,svz_zlfcnpr_aba_HTP,svz_zlfcnpr_havgrq-fgngrf', 70);
+ var s53 = computeInputVariants('ybnqvat', 70);
+ var s54 = computeInputVariants('#', 68);
+ var s55 = computeInputVariants('ybnqrq', 68);
+ var s56 = computeInputVariants('pbybe', 49);
+ var s57 = computeInputVariants('uggc://sevraqf.zlfcnpr.pbz/vaqrk.psz', 44);
+
+ function runBlock1() {
+ for (var i = 0; i < 81; i++) {
+ re8.exec(s26[i]);
+ }
+ for (var i = 0; i < 78; i++) {
+ s27[i].replace(/(\s)+e/, '');
+ s28[i].replace(/./, '');
+ s29[i].replace(re17, '');
+ s30[i].replace(re17, '');
+ re8.exec(s31[i]);
+ re8.exec(s32[i]);
+ re8.exec(s33[i]);
+ re8.exec(s34[i]);
+ re8.exec(s35[i]);
+ re8.exec(s36[i]);
+ re8.exec(s37[i]);
+ re8.exec(s38[i]);
+ re8.exec(s39[i]);
+ /Fnsnev\/(\d+\.\d+)/.exec(s15[i]);
+ re3.exec(s41[i]);
+ re0.exec(s42[i]);
+ re0.exec(s43[i]);
+ }
+ for (var i = 0; i < 77; i++) {
+ s44[i].replace(re12, '');
+ re13.exec(s44[i]);
+ }
+ for (var i = 0; i < 73; i++) {
+ s45[i].replace(re18, '');
+ }
+ for (var i = 0; i < 72; i++) {
+ re1.exec(s46[i]);
+ }
+ for (var i = 0; i < 71; i++) {
+ re19.exec('');
+ }
+ for (var i = 0; i < 70; i++) {
+ s47[i].replace(re11, '');
+ s48[i].replace(/d1/g, '');
+ s49[i].replace(/NQ_VQ/g, '');
+ s50[i].replace(/d2/g, '');
+ s51[i].replace(/_/g, '');
+ s52[i].split(re20);
+ re21.exec(s53[i]);
+ }
+ for (var i = 0; i < 68; i++) {
+ re1.exec(s54[i]);
+ /(?:ZFVR.(\d+\.\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\d+\.\d+))|(?:Bcren.(\d+\.\d+))|(?:NccyrJroXvg.(\d+(?:\.\d+)?))/.exec(s15[i]);
+ /(Znp BF K)|(Jvaqbjf;)/.exec(s15[i]);
+ /Trpxb\/([0-9]+)/.exec(s15[i]);
+ re21.exec(s55[i]);
+ }
+ for (var i = 0; i < 49; i++) {
+ re16.exec(s56[i]);
+ }
+ for (var i = 0; i < 44; i++) {
+ s57[i].replace(re12, '');
+ re13.exec(s57[i]);
+ }
+ }
+ var re22 = /\bso_zrah\b/;
+ var re23 = /^(?:(?:[^:\/?#]+):)?(?:\/\/(?:[^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/;
+ var re24 = /uggcf?:\/\/([^\/]+\.)?snprobbx\.pbz\//;
+ var re25 = /"/g;
+ var re26 = /^([^?#]+)(?:\?([^#]*))?(#.*)?/;
+ var s57a = computeInputVariants('fryrpgrq', 40);
+ var s58 = computeInputVariants('vachggrkg uvqqra_ryrz', 40);
+ var s59 = computeInputVariants('vachggrkg ', 40);
+ var s60 = computeInputVariants('vachggrkg', 40);
+ var s61 = computeInputVariants('uggc://jjj.snprobbx.pbz/', 40);
+ var s62 = computeInputVariants('uggc://jjj.snprobbx.pbz/ybtva.cuc', 40);
+ var s63 = computeInputVariants('Funer guvf tnqtrg', 40);
+ var s64 = computeInputVariants('uggc://jjj.tbbtyr.pbz/vt/qverpgbel', 40);
+ var s65 = computeInputVariants('419', 40);
+ var s66 = computeInputVariants('gvzrfgnzc', 40);
+
+ function runBlock2() {
+ for (var i = 0; i < 40; i++) {
+ s57a[i].replace(re14, '');
+ s57a[i].replace(re15, '');
+ }
+ for (var i = 0; i < 39; i++) {
+ s58[i].replace(/\buvqqra_ryrz\b/g, '');
+ re3.exec(s59[i]);
+ re3.exec(s60[i]);
+ re22.exec('HVYvaxOhggba');
+ re22.exec('HVYvaxOhggba_E');
+ re22.exec('HVYvaxOhggba_EJ');
+ re22.exec('zrah_ybtva_pbagnvare');
+ /\buvqqra_ryrz\b/.exec('vachgcnffjbeq');
+ }
+ for (var i = 0; i < 37; i++) {
+ re8.exec('111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904');
+ re8.exec('SbeprqRkcvengvba=633669315660164980');
+ re8.exec('FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904');
+ }
+ for (var i = 0; i < 35; i++) {
+ 'puvyq p1 svefg'.replace(re14, '');
+ 'puvyq p1 svefg'.replace(re15, '');
+ 'sylbhg pybfrq'.replace(re14, '');
+ 'sylbhg pybfrq'.replace(re15, '');
+ }
+ for (var i = 0; i < 34; i++) {
+ re19.exec('gno2');
+ re19.exec('gno3');
+ re8.exec('44132r503660');
+ re8.exec('SbeprqRkcvengvba=633669316860113296');
+ re8.exec('AFP_zp_dfctwzs-aowb_80=44132r503660');
+ re8.exec('FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696');
+ re8.exec('s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696');
+ }
+ for (var i = 0; i < 32; i++) {
+ /puebzr/i.exec(s15[i]);
+ }
+ for (var i = 0; i < 31; i++) {
+ s61[i].replace(re23, '');
+ re8.exec('SbeprqRkcvengvba=633669358527244818');
+ re8.exec('VC=66.249.85.130');
+ re8.exec('FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58');
+ re8.exec('s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58');
+ re24.exec(s61[i]);
+ }
+ for (var i = 0; i < 30; i++) {
+ s65[i].replace(re6, '');
+ /(?:^|\s+)gvzrfgnzc(?:\s+|$)/.exec(s66[i]);
+ re7.exec(s65[i]);
+ }
+ for (var i = 0; i < 29; i++) {
+ s62[i].replace(re23, '');
+ }
+ for (var i = 0; i < 28; i++) {
+ s63[i].replace(re25, '');
+ s63[i].replace(re12, '');
+ re26.exec(s64[i]);
+ }
+ }
+ var re27 = /-\D/g;
+ var re28 = /\bnpgvingr\b/;
+ var re29 = /%2R/gi;
+ var re30 = /%2S/gi;
+ var re31 = /^(mu-(PA|GJ)|wn|xb)$/;
+ var re32 = /\s?;\s?/;
+ var re33 = /%\w?$/;
+ var re34 = /TNQP=([^;]*)/i;
+ var str10 = 'FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669315660164980&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var str11 = 'FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904; __hgzm=144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.3426875219718084000.1231363570.1231363570.1231363570.1; __hgzo=144631658.0.10.1231363570; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669315660164980&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str12 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231363514065&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231363514065&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Subzr.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1326469221.1231363557&tn_fvq=1231363557&tn_uvq=1114636509&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str13 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669315660164980&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str14 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669315660164980&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var re35 = /[<>]/g;
+ var str15 = 'FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzs-aowb_80=44132r503660';
+ var str16 = 'FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696; AFP_zp_dfctwzs-aowb_80=44132r503660; __hgzm=144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.965867047679498800.1231363638.1231363638.1231363638.1; __hgzo=144631658.0.10.1231363638; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str17 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231363621014&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231363621014&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyr.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=348699119.1231363624&tn_fvq=1231363624&tn_uvq=895511034&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str18 = 'uggc://jjj.yrobapbva.se/yv';
+ var str19 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str20 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+
+ var s67 = computeInputVariants('e115', 27);
+ var s68 = computeInputVariants('qvfcynl', 27);
+ var s69 = computeInputVariants('cbfvgvba', 27);
+ var s70 = computeInputVariants('uggc://jjj.zlfcnpr.pbz/', 27);
+ var s71 = computeInputVariants('cntrivrj', 27);
+ var s72 = computeInputVariants('VC=74.125.75.3', 27);
+ var s73 = computeInputVariants('ra', 27);
+ var s74 = computeInputVariants(str10, 27);
+ var s75 = computeInputVariants(str11, 27);
+ var s76 = computeInputVariants(str12, 27);
+ var s77 = computeInputVariants(str17, 27);
+ var s78 = computeInputVariants(str18, 27);
+
+ function runBlock3() {
+ for (var i = 0; i < 27; i++) {
+ s67[i].replace(/[A-Za-z]/g, '');
+ }
+ for (var i = 0; i < 23; i++) {
+ s68[i].replace(re27, '');
+ s69[i].replace(re27, '');
+ }
+ for (var i = 0; i < 22; i++) {
+ 'unaqyr'.replace(re14, '');
+ 'unaqyr'.replace(re15, '');
+ 'yvar'.replace(re14, '');
+ 'yvar'.replace(re15, '');
+ 'cnerag puebzr6 fvatyr1 gno'.replace(re14, '');
+ 'cnerag puebzr6 fvatyr1 gno'.replace(re15, '');
+ 'fyvqre'.replace(re14, '');
+ 'fyvqre'.replace(re15, '');
+ re28.exec('');
+ }
+ for (var i = 0; i < 21; i++) {
+ s70[i].replace(re12, '');
+ re13.exec(s70[i]);
+ }
+ for (var i = 0; i < 20; i++) {
+ s71[i].replace(re29, '');
+ s71[i].replace(re30, '');
+ re19.exec('ynfg');
+ re19.exec('ba svefg');
+ re8.exec(s72[i]);
+ }
+ for (var i = 0; i < 19; i++) {
+ re31.exec(s73[i]);
+ }
+ for (var i = 0; i < 18; i++) {
+ s74[i].split(re32);
+ s75[i].split(re32);
+ s76[i].replace(re33, '');
+ re8.exec('144631658.0.10.1231363570');
+ re8.exec('144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.3426875219718084000.1231363570.1231363570.1231363570.1');
+ re8.exec(str13);
+ re8.exec(str14);
+ re8.exec('__hgzn=144631658.3426875219718084000.1231363570.1231363570.1231363570.1');
+ re8.exec('__hgzo=144631658.0.10.1231363570');
+ re8.exec('__hgzm=144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re34.exec(s74[i]);
+ re34.exec(s75[i]);
+ }
+ for (var i = 0; i < 17; i++) {
+ s15[i].match(/zfvr/gi);
+ s15[i].match(/bcren/gi);
+ str15.split(re32);
+ str16.split(re32);
+ 'ohggba'.replace(re14, '');
+ 'ohggba'.replace(re15, '');
+ 'puvyq p1 svefg sylbhg pybfrq'.replace(re14, '');
+ 'puvyq p1 svefg sylbhg pybfrq'.replace(re15, '');
+ 'pvgvrf'.replace(re14, '');
+ 'pvgvrf'.replace(re15, '');
+ 'pybfrq'.replace(re14, '');
+ 'pybfrq'.replace(re15, '');
+ 'qry'.replace(re14, '');
+ 'qry'.replace(re15, '');
+ 'uqy_zba'.replace(re14, '');
+ 'uqy_zba'.replace(re15, '');
+ s77[i].replace(re33, '');
+ s78[i].replace(/%3P/g, '');
+ s78[i].replace(/%3R/g, '');
+ s78[i].replace(/%3q/g, '');
+ s78[i].replace(re35, '');
+ 'yvaxyvfg16'.replace(re14, '');
+ 'yvaxyvfg16'.replace(re15, '');
+ 'zvahf'.replace(re14, '');
+ 'zvahf'.replace(re15, '');
+ 'bcra'.replace(re14, '');
+ 'bcra'.replace(re15, '');
+ 'cnerag puebzr5 fvatyr1 ps NU'.replace(re14, '');
+ 'cnerag puebzr5 fvatyr1 ps NU'.replace(re15, '');
+ 'cynlre'.replace(re14, '');
+ 'cynlre'.replace(re15, '');
+ 'cyhf'.replace(re14, '');
+ 'cyhf'.replace(re15, '');
+ 'cb_uqy'.replace(re14, '');
+ 'cb_uqy'.replace(re15, '');
+ 'hyJVzt'.replace(re14, '');
+ 'hyJVzt'.replace(re15, '');
+ re8.exec('144631658.0.10.1231363638');
+ re8.exec('144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.965867047679498800.1231363638.1231363638.1231363638.1');
+ re8.exec('4413268q3660');
+ re8.exec('4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n');
+ re8.exec('SbeprqRkcvengvba=633669321699093060');
+ re8.exec('VC=74.125.75.20');
+ re8.exec(str19);
+ re8.exec(str20);
+ re8.exec('AFP_zp_tfwsbrg-aowb_80=4413268q3660');
+ re8.exec('FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n');
+ re8.exec('__hgzn=144631658.965867047679498800.1231363638.1231363638.1231363638.1');
+ re8.exec('__hgzo=144631658.0.10.1231363638');
+ re8.exec('__hgzm=144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re34.exec(str15);
+ re34.exec(str16);
+ }
+ }
+ var re36 = /uers|fep|fryrpgrq/;
+ var re37 = /\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g;
+ var re38 = /^(\w+|\*)$/;
+ var str21 = 'FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58; ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669358527244818&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var str22 = 'FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58; __hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1; __hgzo=144631658.0.10.1231367822; __hgzp=144631658; ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669358527244818&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str23 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231367803797&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367803797&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Szrffntvat.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1192552091.1231367807&tn_fvq=1231367807&tn_uvq=1155446857&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str24 = 'ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669358527244818&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str25 = 'ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669358527244818&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var str26 = 'hy.ynat-fryrpgbe';
+ var re39 = /\\/g;
+ var re40 = / /g;
+ var re41 = /\/\xc4\/t/;
+ var re42 = /\/\xd6\/t/;
+ var re43 = /\/\xdc\/t/;
+ var re44 = /\/\xdf\/t/;
+ var re45 = /\/\xe4\/t/;
+ var re46 = /\/\xf6\/t/;
+ var re47 = /\/\xfc\/t/;
+ var re48 = /\W/g;
+ var re49 = /uers|fep|fglyr/;
+ var s79 = computeInputVariants(str21, 16);
+ var s80 = computeInputVariants(str22, 16);
+ var s81 = computeInputVariants(str23, 16);
+ var s82 = computeInputVariants(str26, 16);
+
+ function runBlock4() {
+ for (var i = 0; i < 16; i++) {
+ ''.replace(/\*/g, '');
+ /\bnpgvir\b/.exec('npgvir');
+ /sversbk/i.exec(s15[i]);
+ re36.exec('glcr');
+ /zfvr/i.exec(s15[i]);
+ /bcren/i.exec(s15[i]);
+ }
+ for (var i = 0; i < 15; i++) {
+ s79[i].split(re32);
+ s80[i].split(re32);
+ 'uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');
+ s81[i].replace(re33, '');
+ 'yv'.replace(re37, '');
+ 'yv'.replace(re18, '');
+ re8.exec('144631658.0.10.1231367822');
+ re8.exec('144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.4127520630321984500.1231367822.1231367822.1231367822.1');
+ re8.exec(str24);
+ re8.exec(str25);
+ re8.exec('__hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1');
+ re8.exec('__hgzo=144631658.0.10.1231367822');
+ re8.exec('__hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re34.exec(s79[i]);
+ re34.exec(s80[i]);
+ /\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)["']?(.*?)["']?)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g.exec(s82[i]);
+ re13.exec('uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz');
+ re38.exec('yv');
+ }
+ for (var i = 0; i < 14; i++) {
+ ''.replace(re18, '');
+ '9.0 e115'.replace(/(\s+e|\s+o[0-9]+)/, '');
+ 'Funer guvf tnqtrg'.replace(/</g, '');
+ 'Funer guvf tnqtrg'.replace(/>/g, '');
+ 'Funer guvf tnqtrg'.replace(re39, '');
+ 'uggc://cebsvyrrqvg.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');
+ 'grnfre'.replace(re40, '');
+ 'grnfre'.replace(re41, '');
+ 'grnfre'.replace(re42, '');
+ 'grnfre'.replace(re43, '');
+ 'grnfre'.replace(re44, '');
+ 'grnfre'.replace(re45, '');
+ 'grnfre'.replace(re46, '');
+ 'grnfre'.replace(re47, '');
+ 'grnfre'.replace(re48, '');
+ re16.exec('znetva-gbc');
+ re16.exec('cbfvgvba');
+ re19.exec('gno1');
+ re9.exec('qz');
+ re9.exec('qg');
+ re9.exec('zbqobk');
+ re9.exec('zbqobkva');
+ re9.exec('zbqgvgyr');
+ re13.exec('uggc://cebsvyrrqvg.zlfcnpr.pbz/vaqrk.psz');
+ re26.exec('/vt/znvytnqtrg');
+ re49.exec('glcr');
+ }
+ }
+ var re50 = /(?:^|\s+)fryrpgrq(?:\s+|$)/;
+ var re51 = /\&/g;
+ var re52 = /\+/g;
+ var re53 = /\?/g;
+ var re54 = /\t/g;
+ var re55 = /(\$\{nqiHey\})|(\$nqiHey\b)/g;
+ var re56 = /(\$\{cngu\})|(\$cngu\b)/g;
+ function runBlock5() {
+ for (var i = 0; i < 13; i++) {
+ 'purpx'.replace(re14, '');
+ 'purpx'.replace(re15, '');
+ 'pvgl'.replace(re14, '');
+ 'pvgl'.replace(re15, '');
+ 'qrpe fyvqrgrkg'.replace(re14, '');
+ 'qrpe fyvqrgrkg'.replace(re15, '');
+ 'svefg fryrpgrq'.replace(re14, '');
+ 'svefg fryrpgrq'.replace(re15, '');
+ 'uqy_rag'.replace(re14, '');
+ 'uqy_rag'.replace(re15, '');
+ 'vape fyvqrgrkg'.replace(re14, '');
+ 'vape fyvqrgrkg'.replace(re15, '');
+ 'vachggrkg QBZPbageby_cynprubyqre'.replace(re5, '');
+ 'cnerag puebzr6 fvatyr1 gno fryrpgrq'.replace(re14, '');
+ 'cnerag puebzr6 fvatyr1 gno fryrpgrq'.replace(re15, '');
+ 'cb_guz'.replace(re14, '');
+ 'cb_guz'.replace(re15, '');
+ 'fhozvg'.replace(re14, '');
+ 'fhozvg'.replace(re15, '');
+ re50.exec('');
+ /NccyrJroXvg\/([^\s]*)/.exec(s15[i]);
+ /XUGZY/.exec(s15[i]);
+ }
+ for (var i = 0; i < 12; i++) {
+ '${cebg}://${ubfg}${cngu}/${dz}'.replace(/(\$\{cebg\})|(\$cebg\b)/g, '');
+ '1'.replace(re40, '');
+ '1'.replace(re10, '');
+ '1'.replace(re51, '');
+ '1'.replace(re52, '');
+ '1'.replace(re53, '');
+ '1'.replace(re39, '');
+ '1'.replace(re54, '');
+ '9.0 e115'.replace(/^(.*)\..*$/, '');
+ '9.0 e115'.replace(/^.*e(.*)$/, '');
+ '<!-- ${nqiHey} -->'.replace(re55, '');
+ '<fpevcg glcr="grkg/wninfpevcg" fep="${nqiHey}"></fpevcg>'.replace(re55, '');
+ s21[i].replace(/^.*\s+(\S+\s+\S+$)/, '');
+ 'tzk%2Subzrcntr%2Sfgneg%2Sqr%2S'.replace(re30, '');
+ 'tzk'.replace(re30, '');
+ 'uggc://${ubfg}${cngu}/${dz}'.replace(/(\$\{ubfg\})|(\$ubfg\b)/g, '');
+ 'uggc://nqpyvrag.hvzfrei.arg${cngu}/${dz}'.replace(re56, '');
+ 'uggc://nqpyvrag.hvzfrei.arg/wf.at/${dz}'.replace(/(\$\{dz\})|(\$dz\b)/g, '');
+ 'frpgvba'.replace(re29, '');
+ 'frpgvba'.replace(re30, '');
+ 'fvgr'.replace(re29, '');
+ 'fvgr'.replace(re30, '');
+ 'fcrpvny'.replace(re29, '');
+ 'fcrpvny'.replace(re30, '');
+ re36.exec('anzr');
+ /e/.exec('9.0 e115');
+ }
+ }
+ var re57 = /##yv4##/gi;
+ var re58 = /##yv16##/gi;
+ var re59 = /##yv19##/gi;
+ var str27 = '<hy pynff="nqi">##yv4##Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.##yv16##Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>';
+ var str28 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.##yv16##Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>';
+ var str29 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq="YvOYG16" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)">Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>';
+ var str30 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq="YvOYG19" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq="YvOYG16" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)">Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>';
+ var str31 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq="YvOYG19" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq="YvOYG16" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)">Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.<oe> <oe> ##N##Yrnea zber##/N##</hy>';
+ var str32 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq="YvOYG19" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq="YvOYG16" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)">Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.<oe> <oe> <n uers="uggc://znvy.yvir.pbz/znvy/nobhg.nfck" gnetrg="_oynax">Yrnea zber##/N##</hy>';
+ var str33 = 'Bar Jvaqbjf Yvir VQ trgf lbh vagb <o>Ubgznvy</o>, <o>Zrffratre</o>, <o>Kobk YVIR</o> \u2014 naq bgure cynprf lbh frr #~#argjbexybtb#~#';
+ var re60 = /(?:^|\s+)bss(?:\s+|$)/;
+ var re61 = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/;
+ var re62 = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
+ var str34 = '${1}://${2}${3}${4}${5}';
+ var str35 = ' O=6gnyg0g4znrrn&o=3&f=gc; Q=_lyu=K3bQZGSxnT4lZzD3OS9GNmV3ZGLkAQxRpTyxNmRlZmRmAmNkAQLRqTImqNZjOUEgpTjQnJ5xMKtgoN--; SCF=qy';
+ var s83 = computeInputVariants(str27, 11);
+ var s84 = computeInputVariants(str28, 11);
+ var s85 = computeInputVariants(str29, 11);
+ var s86 = computeInputVariants(str30, 11);
+ var s87 = computeInputVariants(str31, 11);
+ var s88 = computeInputVariants(str32, 11);
+ var s89 = computeInputVariants(str33, 11);
+ var s90 = computeInputVariants(str34, 11);
+
+ function runBlock6() {
+ for (var i = 0; i < 11; i++) {
+ s83[i].replace(/##yv0##/gi, '');
+ s83[i].replace(re57, '');
+ s84[i].replace(re58, '');
+ s85[i].replace(re59, '');
+ s86[i].replace(/##\/o##/gi, '');
+ s86[i].replace(/##\/v##/gi, '');
+ s86[i].replace(/##\/h##/gi, '');
+ s86[i].replace(/##o##/gi, '');
+ s86[i].replace(/##oe##/gi, '');
+ s86[i].replace(/##v##/gi, '');
+ s86[i].replace(/##h##/gi, '');
+ s87[i].replace(/##n##/gi, '');
+ s88[i].replace(/##\/n##/gi, '');
+ s89[i].replace(/#~#argjbexybtb#~#/g, '');
+ / Zbovyr\//.exec(s15[i]);
+ /##yv1##/gi.exec(s83[i]);
+ /##yv10##/gi.exec(s84[i]);
+ /##yv11##/gi.exec(s84[i]);
+ /##yv12##/gi.exec(s84[i]);
+ /##yv13##/gi.exec(s84[i]);
+ /##yv14##/gi.exec(s84[i]);
+ /##yv15##/gi.exec(s84[i]);
+ re58.exec(s84[i]);
+ /##yv17##/gi.exec(s85[i]);
+ /##yv18##/gi.exec(s85[i]);
+ re59.exec(s85[i]);
+ /##yv2##/gi.exec(s83[i]);
+ /##yv20##/gi.exec(s86[i]);
+ /##yv21##/gi.exec(s86[i]);
+ /##yv22##/gi.exec(s86[i]);
+ /##yv23##/gi.exec(s86[i]);
+ /##yv3##/gi.exec(s83[i]);
+ re57.exec(s83[i]);
+ /##yv5##/gi.exec(s84[i]);
+ /##yv6##/gi.exec(s84[i]);
+ /##yv7##/gi.exec(s84[i]);
+ /##yv8##/gi.exec(s84[i]);
+ /##yv9##/gi.exec(s84[i]);
+ re8.exec('473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29');
+ re8.exec('SbeprqRkcvengvba=633669325184628362');
+ re8.exec('FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29');
+ /AbxvnA[^\/]*/.exec(s15[i]);
+ }
+ for (var i = 0; i < 10; i++) {
+ ' bss'.replace(/(?:^|\s+)bss(?:\s+|$)/g, '');
+ s90[i].replace(/(\$\{0\})|(\$0\b)/g, '');
+ s90[i].replace(/(\$\{1\})|(\$1\b)/g, '');
+ s90[i].replace(/(\$\{pbzcyrgr\})|(\$pbzcyrgr\b)/g, '');
+ s90[i].replace(/(\$\{sentzrag\})|(\$sentzrag\b)/g, '');
+ s90[i].replace(/(\$\{ubfgcbeg\})|(\$ubfgcbeg\b)/g, '');
+ s90[i].replace(re56, '');
+ s90[i].replace(/(\$\{cebgbpby\})|(\$cebgbpby\b)/g, '');
+ s90[i].replace(/(\$\{dhrel\})|(\$dhrel\b)/g, '');
+ 'nqfvmr'.replace(re29, '');
+ 'nqfvmr'.replace(re30, '');
+ 'uggc://${2}${3}${4}${5}'.replace(/(\$\{2\})|(\$2\b)/g, '');
+ 'uggc://wf.hv-cbegny.qr${3}${4}${5}'.replace(/(\$\{3\})|(\$3\b)/g, '');
+ 'arjf'.replace(re40, '');
+ 'arjf'.replace(re41, '');
+ 'arjf'.replace(re42, '');
+ 'arjf'.replace(re43, '');
+ 'arjf'.replace(re44, '');
+ 'arjf'.replace(re45, '');
+ 'arjf'.replace(re46, '');
+ 'arjf'.replace(re47, '');
+ 'arjf'.replace(re48, '');
+ / PC=i=(\d+)&oe=(.)/.exec(str35);
+ re60.exec(' ');
+ re60.exec(' bss');
+ re60.exec('');
+ re19.exec(' ');
+ re19.exec('svefg ba');
+ re19.exec('ynfg vtaber');
+ re19.exec('ba');
+ re9.exec('scnq so ');
+ re9.exec('zrqvgobk');
+ re9.exec('hsgy');
+ re9.exec('lhv-h');
+ /Fnsnev|Xbadhrebe|XUGZY/gi.exec(s15[i]);
+ re61.exec('uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf');
+ re62.exec('#Ybtva_rznvy');
+ }
+ }
+ var re63 = /\{0\}/g;
+ var str36 = 'FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n; ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_tfwsbrg-aowb_80=4413268q3660';
+ var str37 = 'FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n; AFP_zp_tfwsbrg-aowb_80=4413268q3660; __hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.2294274870215848400.1231364074.1231364074.1231364074.1; __hgzo=144631658.0.10.1231364074; __hgzp=144631658; ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str38 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231364057761&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364057761&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Ssevraqf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1667363813.1231364061&tn_fvq=1231364061&tn_uvq=1917563877&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str39 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str40 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var s91 = computeInputVariants(str36, 9);
+ var s92 = computeInputVariants(str37, 9);
+ var s93 = computeInputVariants(str38, 9);
+ function runBlock7() {
+ for (var i = 0; i < 9; i++) {
+ '0'.replace(re40, '');
+ '0'.replace(re10, '');
+ '0'.replace(re51, '');
+ '0'.replace(re52, '');
+ '0'.replace(re53, '');
+ '0'.replace(re39, '');
+ '0'.replace(re54, '');
+ 'Lrf'.replace(re40, '');
+ 'Lrf'.replace(re10, '');
+ 'Lrf'.replace(re51, '');
+ 'Lrf'.replace(re52, '');
+ 'Lrf'.replace(re53, '');
+ 'Lrf'.replace(re39, '');
+ 'Lrf'.replace(re54, '');
+ }
+ for (var i = 0; i < 8; i++) {
+ 'Pybfr {0}'.replace(re63, '');
+ 'Bcra {0}'.replace(re63, '');
+ s91[i].split(re32);
+ s92[i].split(re32);
+ 'puvyq p1 svefg gnournqref'.replace(re14, '');
+ 'puvyq p1 svefg gnournqref'.replace(re15, '');
+ 'uqy_fcb'.replace(re14, '');
+ 'uqy_fcb'.replace(re15, '');
+ 'uvag'.replace(re14, '');
+ 'uvag'.replace(re15, '');
+ s93[i].replace(re33, '');
+ 'yvfg'.replace(re14, '');
+ 'yvfg'.replace(re15, '');
+ 'at_bhgre'.replace(re30, '');
+ 'cnerag puebzr5 qbhoyr2 NU'.replace(re14, '');
+ 'cnerag puebzr5 qbhoyr2 NU'.replace(re15, '');
+ 'cnerag puebzr5 dhnq5 ps NU osyvax zbarl'.replace(re14, '');
+ 'cnerag puebzr5 dhnq5 ps NU osyvax zbarl'.replace(re15, '');
+ 'cnerag puebzr6 fvatyr1'.replace(re14, '');
+ 'cnerag puebzr6 fvatyr1'.replace(re15, '');
+ 'cb_qrs'.replace(re14, '');
+ 'cb_qrs'.replace(re15, '');
+ 'gnopbagrag'.replace(re14, '');
+ 'gnopbagrag'.replace(re15, '');
+ 'iv_svefg_gvzr'.replace(re30, '');
+ /(^|.)(ronl|qri-ehf3.wbg)(|fgberf|zbgbef|yvirnhpgvbaf|jvxv|rkcerff|punggre).(pbz(|.nh|.pa|.ux|.zl|.ft|.oe|.zk)|pb(.hx|.xe|.am)|pn|qr|se|vg|ay|or|ng|pu|vr|va|rf|cy|cu|fr)$/i.exec('cntrf.ronl.pbz');
+ re8.exec('144631658.0.10.1231364074');
+ re8.exec('144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.2294274870215848400.1231364074.1231364074.1231364074.1');
+ re8.exec('4413241q3660');
+ re8.exec('SbeprqRkcvengvba=633669357391353591');
+ re8.exec(str39);
+ re8.exec(str40);
+ re8.exec('AFP_zp_kkk-gdzogv_80=4413241q3660');
+ re8.exec('FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7');
+ re8.exec('__hgzn=144631658.2294274870215848400.1231364074.1231364074.1231364074.1');
+ re8.exec('__hgzo=144631658.0.10.1231364074');
+ re8.exec('__hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7');
+ re34.exec(s91[i]);
+ re34.exec(s92[i]);
+ }
+ }
+ var re64 = /\b[a-z]/g;
+ var re65 = /^uggc:\/\//;
+ var re66 = /(?:^|\s+)qvfnoyrq(?:\s+|$)/;
+ var str41 = 'uggc://cebsvyr.zlfcnpr.pbz/Zbqhyrf/Nccyvpngvbaf/Cntrf/Pnainf.nfck';
+ function runBlock8() {
+ for (var i = 0; i < 7; i++) {
+ s21[i].match(/\d+/g);
+ 'nsgre'.replace(re64, '');
+ 'orsber'.replace(re64, '');
+ 'obggbz'.replace(re64, '');
+ 'ohvygva_jrngure.kzy'.replace(re65, '');
+ 'ohggba'.replace(re37, '');
+ 'ohggba'.replace(re18, '');
+ 'qngrgvzr.kzy'.replace(re65, '');
+ 'uggc://eff.paa.pbz/eff/paa_gbcfgbevrf.eff'.replace(re65, '');
+ 'vachg'.replace(re37, '');
+ 'vachg'.replace(re18, '');
+ 'vafvqr'.replace(re64, '');
+ 'cbvagre'.replace(re27, '');
+ 'cbfvgvba'.replace(/[A-Z]/g, '');
+ 'gbc'.replace(re27, '');
+ 'gbc'.replace(re64, '');
+ 'hy'.replace(re37, '');
+ 'hy'.replace(re18, '');
+ str26.replace(re37, '');
+ str26.replace(re18, '');
+ 'lbhghor_vtbbtyr/i2/lbhghor.kzy'.replace(re65, '');
+ 'm-vaqrk'.replace(re27, '');
+ /#([\w-]+)/.exec(str26);
+ re16.exec('urvtug');
+ re16.exec('znetvaGbc');
+ re16.exec('jvqgu');
+ re19.exec('gno0 svefg ba');
+ re19.exec('gno0 ba');
+ re19.exec('gno4 ynfg');
+ re19.exec('gno4');
+ re19.exec('gno5');
+ re19.exec('gno6');
+ re19.exec('gno7');
+ re19.exec('gno8');
+ /NqborNVE\/([^\s]*)/.exec(s15[i]);
+ /NccyrJroXvg\/([^ ]*)/.exec(s15[i]);
+ /XUGZY/gi.exec(s15[i]);
+ /^(?:obql|ugzy)$/i.exec('YV');
+ re38.exec('ohggba');
+ re38.exec('vachg');
+ re38.exec('hy');
+ re38.exec(str26);
+ /^(\w+|\*)/.exec(str26);
+ /znp|jva|yvahk/i.exec('Jva32');
+ /eton?\([\d\s,]+\)/.exec('fgngvp');
+ }
+ for (var i = 0; i < 6; i++) {
+ ''.replace(/\r/g, '');
+ '/'.replace(re40, '');
+ '/'.replace(re10, '');
+ '/'.replace(re51, '');
+ '/'.replace(re52, '');
+ '/'.replace(re53, '');
+ '/'.replace(re39, '');
+ '/'.replace(re54, '');
+ 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/{0}?[NDO]&{1}&{2}&[NDR]'.replace(re63, '');
+ str41.replace(re12, '');
+ 'uggc://jjj.snprobbx.pbz/fepu.cuc'.replace(re23, '');
+ 'freivpr'.replace(re40, '');
+ 'freivpr'.replace(re41, '');
+ 'freivpr'.replace(re42, '');
+ 'freivpr'.replace(re43, '');
+ 'freivpr'.replace(re44, '');
+ 'freivpr'.replace(re45, '');
+ 'freivpr'.replace(re46, '');
+ 'freivpr'.replace(re47, '');
+ 'freivpr'.replace(re48, '');
+ /((ZFVR\s+([6-9]|\d\d)\.))/.exec(s15[i]);
+ re66.exec('');
+ re50.exec('fryrpgrq');
+ re8.exec('8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn');
+ re8.exec('SbeprqRkcvengvba=633669340386893867');
+ re8.exec('VC=74.125.75.17');
+ re8.exec('FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn');
+ /Xbadhrebe|Fnsnev|XUGZY/.exec(s15[i]);
+ re13.exec(str41);
+ re49.exec('unfsbphf');
+ }
+ }
+ var re67 = /zrah_byq/g;
+ var str42 = 'FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669325184628362&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var str43 = 'FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29; __hgzm=144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.3931862196947939300.1231364380.1231364380.1231364380.1; __hgzo=144631658.0.10.1231364380; __hgzp=144631658; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669325184628362&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str44 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_vzntrf_wf&qg=1231364373088&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364373088&punaary=svz_zlfcnpr_hfre-ivrj-pbzzragf%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Spbzzrag.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1158737789.1231364375&tn_fvq=1231364375&tn_uvq=415520832&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str45 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669325184628362&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str46 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669325184628362&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var re68 = /^([#.]?)((?:[\w\u0128-\uffff*_-]|\\.)*)/;
+ var re69 = /\{1\}/g;
+ var re70 = /\s+/;
+ var re71 = /(\$\{4\})|(\$4\b)/g;
+ var re72 = /(\$\{5\})|(\$5\b)/g;
+ var re73 = /\{2\}/g;
+ var re74 = /[^+>] [^+>]/;
+ var re75 = /\bucpyv\s*=\s*([^;]*)/i;
+ var re76 = /\bucuvqr\s*=\s*([^;]*)/i;
+ var re77 = /\bucfie\s*=\s*([^;]*)/i;
+ var re78 = /\bhfucjrn\s*=\s*([^;]*)/i;
+ var re79 = /\bmvc\s*=\s*([^;]*)/i;
+ var re80 = /^((?:[\w\u0128-\uffff*_-]|\\.)+)(#)((?:[\w\u0128-\uffff*_-]|\\.)+)/;
+ var re81 = /^([>+~])\s*(\w*)/i;
+ var re82 = /^>\s*((?:[\w\u0128-\uffff*_-]|\\.)+)/;
+ var re83 = /^[\s[]?shapgvba/;
+ var re84 = /v\/g.tvs#(.*)/i;
+ var str47 = '#Zbq-Vasb-Vasb-WninFpevcgUvag';
+ var str48 = ',n.svryqOgaPnapry';
+ var str49 = 'FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669357391353591&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_kkk-gdzogv_80=4413241q3660';
+ var str50 = 'FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7; AFP_zp_kkk-gdzogv_80=4413241q3660; AFP_zp_kkk-aowb_80=4413235p3660; __hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1; __hgzo=144631658.0.10.1231367708; __hgzp=144631658; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669357391353591&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str51 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231367691141&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367691141&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Sjjj.zlfcnpr.pbz%2S&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=320757904.1231367694&tn_fvq=1231367694&tn_uvq=1758792003&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str52 = 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&aqu=1&g=7%2S0%2S2009%2014%3N38%3N42%203%20480&af=zfacbegny&cntrAnzr=HF%20UCZFSGJ&t=uggc%3N%2S%2Sjjj.zfa.pbz%2S&f=1024k768&p=24&x=L&oj=994&ou=634&uc=A&{2}&[NDR]';
+ var str53 = 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq qbhoyr2 ps';
+ var str54 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669357391353591&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str55 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669357391353591&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var str56 = 'ne;ng;nh;or;oe;pn;pu;py;pa;qr;qx;rf;sv;se;to;ux;vq;vr;va;vg;wc;xe;zk;zl;ay;ab;am;cu;cy;cg;eh;fr;ft;gu;ge;gj;mn;';
+ var str57 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886&GHVQ=1';
+ var str58 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886';
+ var str59 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886; mvc=m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1';
+ var str60 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886; mvc=m:94043|yn:37.4154|yb:-122.0585|p:HF';
+ var str61 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/29/4RQP4969777N048NPS4RRR3PO2S7S.wct';
+ var str62 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/OQ/63NP9O94NS5OQP1249Q9S1ROP7NS3.wct';
+ var str63 = 'zbmvyyn/5.0 (jvaqbjf; h; jvaqbjf ag 5.1; ra-hf) nccyrjroxvg/528.9 (xugzy, yvxr trpxb) puebzr/2.0.157.0 fnsnev/528.9';
+ var s94 = computeInputVariants(str42, 5);
+ var s95 = computeInputVariants(str43, 5);
+ var s96 = computeInputVariants(str44, 5);
+ var s97 = computeInputVariants(str47, 5);
+ var s98 = computeInputVariants(str48, 5);
+ var s99 = computeInputVariants(str49, 5);
+ var s100 = computeInputVariants(str50, 5);
+ var s101 = computeInputVariants(str51, 5);
+ var s102 = computeInputVariants(str52, 5);
+ var s103 = computeInputVariants(str53, 5);
+
+ function runBlock9() {
+ for (var i = 0; i < 5; i++) {
+ s94[i].split(re32);
+ s95[i].split(re32);
+ 'svz_zlfcnpr_hfre-ivrj-pbzzragf,svz_zlfcnpr_havgrq-fgngrf'.split(re20);
+ s96[i].replace(re33, '');
+ 'zrah_arj zrah_arj_gbttyr zrah_gbttyr'.replace(re67, '');
+ 'zrah_byq zrah_byq_gbttyr zrah_gbttyr'.replace(re67, '');
+ re8.exec('102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98');
+ re8.exec('144631658.0.10.1231364380');
+ re8.exec('144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.3931862196947939300.1231364380.1231364380.1231364380.1');
+ re8.exec('441326q33660');
+ re8.exec('SbeprqRkcvengvba=633669341278771470');
+ re8.exec(str45);
+ re8.exec(str46);
+ re8.exec('AFP_zp_dfctwzssrwh-aowb_80=441326q33660');
+ re8.exec('FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98');
+ re8.exec('__hgzn=144631658.3931862196947939300.1231364380.1231364380.1231364380.1');
+ re8.exec('__hgzo=144631658.0.10.1231364380');
+ re8.exec('__hgzm=144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ }
+ for (var i = 0; i < 4; i++) {
+ ' yvfg1'.replace(re14, '');
+ ' yvfg1'.replace(re15, '');
+ ' yvfg2'.replace(re14, '');
+ ' yvfg2'.replace(re15, '');
+ ' frneputebhc1'.replace(re14, '');
+ ' frneputebhc1'.replace(re15, '');
+ s97[i].replace(re68, '');
+ s97[i].replace(re18, '');
+ ''.replace(/&/g, '');
+ ''.replace(re35, '');
+ '(..-{0})(\|(\d+)|)'.replace(re63, '');
+ s98[i].replace(re18, '');
+ '//vzt.jro.qr/vij/FC/${cngu}/${anzr}/${inyhr}?gf=${abj}'.replace(re56, '');
+ '//vzt.jro.qr/vij/FC/tzk_uc/${anzr}/${inyhr}?gf=${abj}'.replace(/(\$\{anzr\})|(\$anzr\b)/g, '');
+ '<fcna pynff="urnq"><o>Jvaqbjf Yvir Ubgznvy</o></fcna><fcna pynff="zft">{1}</fcna>'.replace(re69, '');
+ '<fcna pynff="urnq"><o>{0}</o></fcna><fcna pynff="zft">{1}</fcna>'.replace(re63, '');
+ '<fcna pynff="fvtahc"><n uers=uggc://jjj.ubgznvy.pbz><o>{1}</o></n></fcna>'.replace(re69, '');
+ '<fcna pynff="fvtahc"><n uers={0}><o>{1}</o></n></fcna>'.replace(re63, '');
+ 'Vzntrf'.replace(re15, '');
+ 'ZFA'.replace(re15, '');
+ 'Zncf'.replace(re15, '');
+ 'Zbq-Vasb-Vasb-WninFpevcgUvag'.replace(re39, '');
+ 'Arjf'.replace(re15, '');
+ s99[i].split(re32);
+ s100[i].split(re32);
+ 'Ivqrb'.replace(re15, '');
+ 'Jro'.replace(re15, '');
+ 'n'.replace(re39, '');
+ 'nwnkFgneg'.split(re70);
+ 'nwnkFgbc'.split(re70);
+ 'ovaq'.replace(re14, '');
+ 'ovaq'.replace(re15, '');
+ 'oevatf lbh zber. Zber fcnpr (5TO), zber frphevgl, fgvyy serr.'.replace(re63, '');
+ 'puvyq p1 svefg qrpx'.replace(re14, '');
+ 'puvyq p1 svefg qrpx'.replace(re15, '');
+ 'puvyq p1 svefg qbhoyr2'.replace(re14, '');
+ 'puvyq p1 svefg qbhoyr2'.replace(re15, '');
+ 'puvyq p2 ynfg'.replace(re14, '');
+ 'puvyq p2 ynfg'.replace(re15, '');
+ 'puvyq p2'.replace(re14, '');
+ 'puvyq p2'.replace(re15, '');
+ 'puvyq p3'.replace(re14, '');
+ 'puvyq p3'.replace(re15, '');
+ 'puvyq p4 ynfg'.replace(re14, '');
+ 'puvyq p4 ynfg'.replace(re15, '');
+ 'pbclevtug'.replace(re14, '');
+ 'pbclevtug'.replace(re15, '');
+ 'qZFAZR_1'.replace(re14, '');
+ 'qZFAZR_1'.replace(re15, '');
+ 'qbhoyr2 ps'.replace(re14, '');
+ 'qbhoyr2 ps'.replace(re15, '');
+ 'qbhoyr2'.replace(re14, '');
+ 'qbhoyr2'.replace(re15, '');
+ 'uqy_arj'.replace(re14, '');
+ 'uqy_arj'.replace(re15, '');
+ 'uc_fubccvatobk'.replace(re30, '');
+ 'ugzy%2Rvq'.replace(re29, '');
+ 'ugzy%2Rvq'.replace(re30, '');
+ s101[i].replace(re33, '');
+ 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${4}${5}'.replace(re71, '');
+ 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${5}'.replace(re72, '');
+ s102[i].replace(re73, '');
+ 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&{1}&{2}&[NDR]'.replace(re69, '');
+ 'vztZFSG'.replace(re14, '');
+ 'vztZFSG'.replace(re15, '');
+ 'zfasbbg1 ps'.replace(re14, '');
+ 'zfasbbg1 ps'.replace(re15, '');
+ s103[i].replace(re14, '');
+ s103[i].replace(re15, '');
+ 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re14, '');
+ 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re15, '');
+ 'cevznel'.replace(re14, '');
+ 'cevznel'.replace(re15, '');
+ 'erpgnatyr'.replace(re30, '');
+ 'frpbaqnel'.replace(re14, '');
+ 'frpbaqnel'.replace(re15, '');
+ 'haybnq'.split(re70);
+ '{0}{1}1'.replace(re63, '');
+ '|{1}1'.replace(re69, '');
+ /(..-HF)(\|(\d+)|)/i.exec('xb-xe,ra-va,gu-gu');
+ re4.exec('/ZlFcnprNccf/NccPnainf,45000012');
+ re8.exec('144631658.0.10.1231367708');
+ re8.exec('144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.2770915348920628700.1231367708.1231367708.1231367708.1');
+ re8.exec('4413235p3660');
+ re8.exec('441327q73660');
+ re8.exec('9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473');
+ re8.exec('SbeprqRkcvengvba=633669350559478880');
+ re8.exec(str54);
+ re8.exec(str55);
+ re8.exec('AFP_zp_dfctwzs-aowb_80=441327q73660');
+ re8.exec('AFP_zp_kkk-aowb_80=4413235p3660');
+ re8.exec('FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473');
+ re8.exec('__hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1');
+ re8.exec('__hgzo=144631658.0.10.1231367708');
+ re8.exec('__hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re34.exec(s99[i]);
+ re34.exec(s100[i]);
+ /ZFVR\s+5[.]01/.exec(s15[i]);
+ /HF(?=;)/i.exec(str56);
+ re74.exec(s97[i]);
+ re28.exec('svefg npgvir svefgNpgvir');
+ re28.exec('ynfg');
+ /\bp:(..)/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF');
+ re75.exec(str57);
+ re75.exec(str58);
+ re76.exec(str57);
+ re76.exec(str58);
+ re77.exec(str57);
+ re77.exec(str58);
+ /\bhfucce\s*=\s*([^;]*)/i.exec(str59);
+ re78.exec(str57);
+ re78.exec(str58);
+ /\bjci\s*=\s*([^;]*)/i.exec(str59);
+ re79.exec(str58);
+ re79.exec(str60);
+ re79.exec(str59);
+ /\|p:([a-z]{2})/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1');
+ re80.exec(s97[i]);
+ re61.exec('cebgbglcr.wf');
+ re68.exec(s97[i]);
+ re81.exec(s97[i]);
+ re82.exec(s97[i]);
+ /^Fubpxjnir Synfu (\d)/.exec(s21[i]);
+ /^Fubpxjnir Synfu (\d+)/.exec(s21[i]);
+ re83.exec('[bowrpg tybony]');
+ re62.exec(s97[i]);
+ re84.exec(str61);
+ re84.exec(str62);
+ /jroxvg/.exec(str63);
+ }
+ }
+ var re85 = /eaq_zbqobkva/;
+ var str64 = '1231365729213';
+ var str65 = '74.125.75.3-1057165600.29978900';
+ var str66 = '74.125.75.3-1057165600.29978900.1231365730214';
+ var str67 = 'Frnepu%20Zvpebfbsg.pbz';
+ var str68 = 'FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn; ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669340386893867&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var str69 = 'FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn; __hgzm=144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1877536177953918500.1231365779.1231365779.1231365779.1; __hgzo=144631658.0.10.1231365779; __hgzp=144631658; ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669340386893867&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str70 = 'I=3%26THVQ=757q3ss871q44o7o805n8113n5p72q52';
+ var str71 = 'I=3&THVQ=757q3ss871q44o7o805n8113n5p72q52';
+ var str72 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231365765292&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231365765292&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Sohyyrgvaf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1579793869.1231365768&tn_fvq=1231365768&tn_uvq=2056210897&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str73 = 'frnepu.zvpebfbsg.pbz';
+ var str74 = 'frnepu.zvpebfbsg.pbz/';
+ var str75 = 'ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669340386893867&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str76 = 'ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669340386893867&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ function runBlock10() {
+ for (var i = 0; i < 3; i++) {
+ '%3Szxg=ra-HF'.replace(re39, '');
+ '-8'.replace(re40, '');
+ '-8'.replace(re10, '');
+ '-8'.replace(re51, '');
+ '-8'.replace(re52, '');
+ '-8'.replace(re53, '');
+ '-8'.replace(re39, '');
+ '-8'.replace(re54, '');
+ '1.5'.replace(re40, '');
+ '1.5'.replace(re10, '');
+ '1.5'.replace(re51, '');
+ '1.5'.replace(re52, '');
+ '1.5'.replace(re53, '');
+ '1.5'.replace(re39, '');
+ '1.5'.replace(re54, '');
+ '1024k768'.replace(re40, '');
+ '1024k768'.replace(re10, '');
+ '1024k768'.replace(re51, '');
+ '1024k768'.replace(re52, '');
+ '1024k768'.replace(re53, '');
+ '1024k768'.replace(re39, '');
+ '1024k768'.replace(re54, '');
+ str64.replace(re40, '');
+ str64.replace(re10, '');
+ str64.replace(re51, '');
+ str64.replace(re52, '');
+ str64.replace(re53, '');
+ str64.replace(re39, '');
+ str64.replace(re54, '');
+ '14'.replace(re40, '');
+ '14'.replace(re10, '');
+ '14'.replace(re51, '');
+ '14'.replace(re52, '');
+ '14'.replace(re53, '');
+ '14'.replace(re39, '');
+ '14'.replace(re54, '');
+ '24'.replace(re40, '');
+ '24'.replace(re10, '');
+ '24'.replace(re51, '');
+ '24'.replace(re52, '');
+ '24'.replace(re53, '');
+ '24'.replace(re39, '');
+ '24'.replace(re54, '');
+ str65.replace(re40, '');
+ str65.replace(re10, '');
+ str65.replace(re51, '');
+ str65.replace(re52, '');
+ str65.replace(re53, '');
+ str65.replace(re39, '');
+ str65.replace(re54, '');
+ str66.replace(re40, '');
+ str66.replace(re10, '');
+ str66.replace(re51, '');
+ str66.replace(re52, '');
+ str66.replace(re53, '');
+ str66.replace(re39, '');
+ str66.replace(re54, '');
+ '9.0'.replace(re40, '');
+ '9.0'.replace(re10, '');
+ '9.0'.replace(re51, '');
+ '9.0'.replace(re52, '');
+ '9.0'.replace(re53, '');
+ '9.0'.replace(re39, '');
+ '9.0'.replace(re54, '');
+ '994k634'.replace(re40, '');
+ '994k634'.replace(re10, '');
+ '994k634'.replace(re51, '');
+ '994k634'.replace(re52, '');
+ '994k634'.replace(re53, '');
+ '994k634'.replace(re39, '');
+ '994k634'.replace(re54, '');
+ '?zxg=ra-HF'.replace(re40, '');
+ '?zxg=ra-HF'.replace(re10, '');
+ '?zxg=ra-HF'.replace(re51, '');
+ '?zxg=ra-HF'.replace(re52, '');
+ '?zxg=ra-HF'.replace(re53, '');
+ '?zxg=ra-HF'.replace(re54, '');
+ 'PAA.pbz'.replace(re25, '');
+ 'PAA.pbz'.replace(re12, '');
+ 'PAA.pbz'.replace(re39, '');
+ 'Qngr & Gvzr'.replace(re25, '');
+ 'Qngr & Gvzr'.replace(re12, '');
+ 'Qngr & Gvzr'.replace(re39, '');
+ 'Frnepu Zvpebfbsg.pbz'.replace(re40, '');
+ 'Frnepu Zvpebfbsg.pbz'.replace(re54, '');
+ str67.replace(re10, '');
+ str67.replace(re51, '');
+ str67.replace(re52, '');
+ str67.replace(re53, '');
+ str67.replace(re39, '');
+ str68.split(re32);
+ str69.split(re32);
+ str70.replace(re52, '');
+ str70.replace(re53, '');
+ str70.replace(re39, '');
+ str71.replace(re40, '');
+ str71.replace(re10, '');
+ str71.replace(re51, '');
+ str71.replace(re54, '');
+ 'Jrngure'.replace(re25, '');
+ 'Jrngure'.replace(re12, '');
+ 'Jrngure'.replace(re39, '');
+ 'LbhGhor'.replace(re25, '');
+ 'LbhGhor'.replace(re12, '');
+ 'LbhGhor'.replace(re39, '');
+ str72.replace(re33, '');
+ 'erzbgr_vsenzr_1'.replace(/^erzbgr_vsenzr_/, '');
+ str73.replace(re40, '');
+ str73.replace(re10, '');
+ str73.replace(re51, '');
+ str73.replace(re52, '');
+ str73.replace(re53, '');
+ str73.replace(re39, '');
+ str73.replace(re54, '');
+ str74.replace(re40, '');
+ str74.replace(re10, '');
+ str74.replace(re51, '');
+ str74.replace(re52, '');
+ str74.replace(re53, '');
+ str74.replace(re39, '');
+ str74.replace(re54, '');
+ 'lhv-h'.replace(/\-/g, '');
+ re9.exec('p');
+ re9.exec('qz p');
+ re9.exec('zbqynory');
+ re9.exec('lhv-h svefg');
+ re8.exec('144631658.0.10.1231365779');
+ re8.exec('144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.1877536177953918500.1231365779.1231365779.1231365779.1');
+ re8.exec(str75);
+ re8.exec(str76);
+ re8.exec('__hgzn=144631658.1877536177953918500.1231365779.1231365779.1231365779.1');
+ re8.exec('__hgzo=144631658.0.10.1231365779');
+ re8.exec('__hgzm=144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re34.exec(str68);
+ re34.exec(str69);
+ /^$/.exec('');
+ re31.exec('qr');
+ /^znk\d+$/.exec('');
+ /^zva\d+$/.exec('');
+ /^erfgber$/.exec('');
+ re85.exec('zbqobkva zbqobk_abcnqqvat ');
+ re85.exec('zbqgvgyr');
+ re85.exec('eaq_zbqobkva ');
+ re85.exec('eaq_zbqgvgyr ');
+ /frpgvba\d+_pbagragf/.exec('obggbz_ani');
+ }
+ }
+ var re86 = /;\s*/;
+ var re87 = /(\$\{inyhr\})|(\$inyhr\b)/g;
+ var re88 = /(\$\{abj\})|(\$abj\b)/g;
+ var re89 = /\s+$/;
+ var re90 = /^\s+/;
+ var re91 = /(\\\"|\x00-|\x1f|\x7f-|\x9f|\u00ad|\u0600-|\u0604|\u070f|\u17b4|\u17b5|\u200c-|\u200f|\u2028-|\u202f|\u2060-|\u206f|\ufeff|\ufff0-|\uffff)/g;
+ var re92 = /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/;
+ var re93 = /^([:.#]*)((?:[\w\u0128-\uffff*_-]|\\.)+)/;
+ var re94 = /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/;
+ var str77 = '#fubhgobk .pybfr';
+ var str78 = 'FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669341278771470&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzssrwh-aowb_80=441326q33660';
+ var str79 = 'FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98; AFP_zp_dfctwzssrwh-aowb_80=441326q33660; __hgzm=144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1670816052019209000.1231365869.1231365869.1231365869.1; __hgzo=144631658.0.10.1231365869; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669341278771470&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str80 = 'FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669350559478880&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzs-aowb_80=441327q73660';
+ var str81 = 'FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473; AFP_zp_dfctwzs-aowb_80=441327q73660; __hgzm=144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1796080716621419500.1231367054.1231367054.1231367054.1; __hgzo=144631658.0.10.1231367054; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669350559478880&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str82 = '[glcr=fhozvg]';
+ var str83 = 'n.svryqOga,n.svryqOgaPnapry';
+ var str84 = 'n.svryqOgaPnapry';
+ var str85 = 'oyvpxchaxg';
+ var str86 = 'qvi.bow-nppbeqvba qg';
+ var str87 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_nccf_wf&qg=1231367052227&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367052227&punaary=svz_zlfcnpr_nccf-pnainf%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyr.zlfcnpr.pbz%2SZbqhyrf%2SNccyvpngvbaf%2SCntrf%2SPnainf.nfck&nq_glcr=grkg&rvq=6083027&rn=0&sez=1&tn_ivq=716357910.1231367056&tn_fvq=1231367056&tn_uvq=1387206491&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str88 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231365851658&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231365851658&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyrrqvg.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1979828129.1231365855&tn_fvq=1231365855&tn_uvq=2085229649&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
+ var str89 = 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55023338617756?[NDO]&aqu=1&g=7%2S0%2S2009%2014%3N12%3N47%203%20480&af=zfacbegny&cntrAnzr=HF%20UCZFSGJ&t=uggc%3N%2S%2Sjjj.zfa.pbz%2S&f=0k0&p=43835816&x=A&oj=994&ou=634&uc=A&{2}&[NDR]';
+ var str90 = 'zrgn[anzr=nwnkHey]';
+ var str91 = 'anpuevpugra';
+ var str92 = 'b oS={\'oT\':1.1};x $8n(B){z(B!=o9)};x $S(B){O(!$8n(B))z A;O(B.4L)z\'T\';b S=7t B;O(S==\'2P\'&&B.p4){23(B.7f){12 1:z\'T\';12 3:z/\S/.2g(B.8M)?\'ox\':\'oh\'}}O(S==\'2P\'||S==\'x\'){23(B.nE){12 2V:z\'1O\';12 7I:z\'5a\';12 18:z\'4B\'}O(7t B.I==\'4F\'){O(B.3u)z\'pG\';O(B.8e)z\'1p\'}}z S};x $2p(){b 4E={};Z(b v=0;v<1p.I;v++){Z(b X 1o 1p[v]){b nc=1p[v][X];b 6E=4E[X];O(6E&&$S(nc)==\'2P\'&&$S(6E)==\'2P\')4E[X]=$2p(6E,nc);17 4E[X]=nc}}z 4E};b $E=7p.E=x(){b 1d=1p;O(!1d[1])1d=[p,1d[0]];Z(b X 1o 1d[1])1d[0][X]=1d[1][X];z 1d[0]};b $4D=7p.pJ=x(){Z(b v=0,y=1p.I;v<y;v++){1p[v].E=x(1J){Z(b 1I 1o 1J){O(!p.1Y[1I])p.1Y[1I]=1J[1I];O(!p[1I])p[1I]=$4D.6C(1I)}}}};$4D.6C=x(1I){z x(L){z p.1Y[1I].3H(L,2V.1Y.nV.1F(1p,1))}};$4D(7F,2V,6J,nb);b 3l=x(B){B=B||{};B.E=$E;z B};b pK=Y 3l(H);b pZ=Y 3l(C);C.6f=C.35(\'6f\')[0];x $2O(B){z!!(B||B===0)};x $5S(B,n8){z $8n(B)?B:n8};x $7K(3c,1m){z 1q.na(1q.7K()*(1m-3c+1)+3c)};x $3N(){z Y 97().os()};x $4M(1U){pv(1U);pa(1U);z 1S};H.43=!!(C.5Z);O(H.nB)H.31=H[H.7q?\'py\':\'nL\']=1r;17 O(C.9N&&!C.om&&!oy.oZ)H.pF=H.4Z=H[H.43?\'pt\':\'65\']=1r;17 O(C.po!=1S)H.7J=1r;O(7t 5B==\'o9\'){b 5B=x(){};O(H.4Z)C.nd("pW");5B.1Y=(H.4Z)?H["[[oN.1Y]]"]:{}}5B.1Y.4L=1r;O(H.nL)5s{C.oX("pp",A,1r)}4K(r){};b 18=x(1X){b 63=x(){z(1p[0]!==1S&&p.1w&&$S(p.1w)==\'x\')?p.1w.3H(p,1p):p};$E(63,p);63.1Y=1X;63.nE=18;z 63};18.1z=x(){};18.1Y={E:x(1X){b 7x=Y p(1S);Z(b X 1o 1X){b nC=7x[X];7x[X]=18.nY(nC,1X[X])}z Y 18(7x)},3d:x(){Z(b v=0,y=1p.I;v<y;v++)$E(p.1Y,1p[v])}};18.nY=x(2b,2n){O(2b&&2b!=2n){b S=$S(2n);O(S!=$S(2b))z 2n;23(S){12\'x\':b 7R=x(){p.1e=1p.8e.1e;z 2n.3H(p,1p)};7R.1e=2b;z 7R;12\'2P\':z $2p(2b,2n)}}z 2n};b 8o=Y 18({oQ:x(J){p.4w=p.4w||[];p.4w.1x(J);z p},7g:x(){O(p.4w&&p.4w.I)p.4w.9J().2x(10,p)},oP:x(){p.4w=[]}});b 2d=Y 18({1V:x(S,J){O(J!=18.1z){p.$19=p.$19||{};p.$19[S]=p.$19[S]||[];p.$19[S].5j(J)}z p},1v:x(S,1d,2x){O(p.$19&&p.$19[S]){p.$19[S].1b(x(J){J.3n({\'L\':p,\'2x\':2x,\'1p\':1d})()},p)}z p},3M:x(S,J){O(p.$19&&p.$19[S])p.$19[S].2U(J);z p}});b 4v=Y 18({2H:x(){p.P=$2p.3H(1S,[p.P].E(1p));O(!p.1V)z p;Z(b 3O 1o p.P){O($S(p.P[3O]==\'x\')&&3O.2g(/^5P[N-M]/))p.1V(3O,p.P[3O])}z p}});2V.E({7y:x(J,L){Z(b v=0,w=p.I;v<w;v++)J.1F(L,p[v],v,p)},3s:x(J,L){b 54=[];Z(b v=0,w=p.I;v<w;v++){O(J.1F(L,p[v],v,p))54.1x(p[v])}z 54},2X:x(J,L){b 54=[];Z(b v=0,w=p.I;v<w;v++)54[v]=J.1F(L,p[v],v,p);z 54},4i:x(J,L){Z(b v=0,w=p.I;v<w;v++){O(!J.1F(L,p[v],v,p))z A}z 1r},ob:x(J,L){Z(b v=0,w=p.I;v<w;v++){O(J.1F(L,p[v],v,p))z 1r}z A},3F:x(3u,15){b 3A=p.I;Z(b v=(15<0)?1q.1m(0,3A+15):15||0;v<3A;v++){O(p[v]===3u)z v}z-1},8z:x(1u,I){1u=1u||0;O(1u<0)1u=p.I+1u;I=I||(p.I-1u);b 89=[];Z(b v=0;v<I;v++)89[v]=p[1u++];z 89},2U:x(3u){b v=0;b 3A=p.I;6L(v<3A){O(p[v]===3u){p.6l(v,1);3A--}17{v++}}z p},1y:x(3u,15){z p.3F(3u,15)!=-1},oz:x(1C){b B={},I=1q.3c(p.I,1C.I);Z(b v=0;v<I;v++)B[1C[v]]=p[v];z B},E:x(1O){Z(b v=0,w=1O.I;v<w;v++)p.1x(1O[v]);z p},2p:x(1O){Z(b v=0,y=1O.I;v<y;v++)p.5j(1O[v]);z p},5j:x(3u){O(!p.1y(3u))p.1x(3u);z p},oc:x(){z p[$7K(0,p.I-1)]||A},7L:x(){z p[p.I-1]||A}});2V.1Y.1b=2V.1Y.7y;2V.1Y.2g=2V.1Y.1y;x $N(1O){z 2V.8z(1O)};x $1b(3J,J,L){O(3J&&7t 3J.I==\'4F\'&&$S(3J)!=\'2P\')2V.7y(3J,J,L);17 Z(b 1j 1o 3J)J.1F(L||3J,3J[1j],1j)};6J.E({2g:x(6b,2F){z(($S(6b)==\'2R\')?Y 7I(6b,2F):6b).2g(p)},3p:x(){z 5K(p,10)},o4:x(){z 69(p)},7A:x(){z p.3y(/-\D/t,x(2G){z 2G.7G(1).nW()})},9b:x(){z p.3y(/\w[N-M]/t,x(2G){z(2G.7G(0)+\'-\'+2G.7G(1).5O())})},8V:x(){z p.3y(/\b[n-m]/t,x(2G){z 2G.nW()})},5L:x(){z p.3y(/^\s+|\s+$/t,\'\')},7j:x(){z p.3y(/\s{2,}/t,\' \').5L()},5V:x(1O){b 1i=p.2G(/\d{1,3}/t);z(1i)?1i.5V(1O):A},5U:x(1O){b 3P=p.2G(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);z(3P)?3P.nV(1).5U(1O):A},1y:x(2R,f){z(f)?(f+p+f).3F(f+2R+f)>-1:p.3F(2R)>-1},nX:x(){z p.3y(/([.*+?^${}()|[\]\/\\])/t,\'\\$1\')}});2V.E({5V:x(1O){O(p.I<3)z A;O(p.I==4&&p[3]==0&&!1O)z\'p5\';b 3P=[];Z(b v=0;v<3;v++){b 52=(p[v]-0).4h(16);3P.1x((52.I==1)?\'0\'+52:52)}z 1O?3P:\'#\'+3P.2u(\'\')},5U:x(1O){O(p.I!=3)z A;b 1i=[];Z(b v=0;v<3;v++){1i.1x(5K((p[v].I==1)?p[v]+p[v]:p[v],16))}z 1O?1i:\'1i(\'+1i.2u(\',\')+\')\'}});7F.E({3n:x(P){b J=p;P=$2p({\'L\':J,\'V\':A,\'1p\':1S,\'2x\':A,\'4s\':A,\'6W\':A},P);O($2O(P.1p)&&$S(P.1p)!=\'1O\')P.1p=[P.1p];z x(V){b 1d;O(P.V){V=V||H.V;1d=[(P.V===1r)?V:Y P.V(V)];O(P.1p)1d.E(P.1p)}17 1d=P.1p||1p;b 3C=x(){z J.3H($5S(P';
+ var str93 = 'hagreunyghat';
+ var str94 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669341278771470&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str95 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669350559478880&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
+ var str96 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669341278771470&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var str97 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669350559478880&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+ var str98 = 'shapgvba (){Cuk.Nccyvpngvba.Frghc.Pber();Cuk.Nccyvpngvba.Frghc.Nwnk();Cuk.Nccyvpngvba.Frghc.Synfu();Cuk.Nccyvpngvba.Frghc.Zbqhyrf()}';
+ function runBlock11() {
+ for (var i = 0; i < 2; i++) {
+ ' .pybfr'.replace(re18, '');
+ ' n.svryqOgaPnapry'.replace(re18, '');
+ ' qg'.replace(re18, '');
+ str77.replace(re68, '');
+ str77.replace(re18, '');
+ ''.replace(re39, '');
+ ''.replace(/^/, '');
+ ''.split(re86);
+ '*'.replace(re39, '');
+ '*'.replace(re68, '');
+ '*'.replace(re18, '');
+ '.pybfr'.replace(re68, '');
+ '.pybfr'.replace(re18, '');
+ '//vzt.jro.qr/vij/FC/tzk_uc/fperra/${inyhr}?gf=${abj}'.replace(re87, '');
+ '//vzt.jro.qr/vij/FC/tzk_uc/fperra/1024?gf=${abj}'.replace(re88, '');
+ '//vzt.jro.qr/vij/FC/tzk_uc/jvafvmr/${inyhr}?gf=${abj}'.replace(re87, '');
+ '//vzt.jro.qr/vij/FC/tzk_uc/jvafvmr/992/608?gf=${abj}'.replace(re88, '');
+ '300k120'.replace(re30, '');
+ '300k250'.replace(re30, '');
+ '310k120'.replace(re30, '');
+ '310k170'.replace(re30, '');
+ '310k250'.replace(re30, '');
+ '9.0 e115'.replace(/^.*\.(.*)\s.*$/, '');
+ 'Nppbeqvba'.replace(re2, '');
+ 'Nxghryy\x0a'.replace(re89, '');
+ 'Nxghryy\x0a'.replace(re90, '');
+ 'Nccyvpngvba'.replace(re2, '');
+ 'Oyvpxchaxg\x0a'.replace(re89, '');
+ 'Oyvpxchaxg\x0a'.replace(re90, '');
+ 'Svanamra\x0a'.replace(re89, '');
+ 'Svanamra\x0a'.replace(re90, '');
+ 'Tnzrf\x0a'.replace(re89, '');
+ 'Tnzrf\x0a'.replace(re90, '');
+ 'Ubebfxbc\x0a'.replace(re89, '');
+ 'Ubebfxbc\x0a'.replace(re90, '');
+ 'Xvab\x0a'.replace(re89, '');
+ 'Xvab\x0a'.replace(re90, '');
+ 'Zbqhyrf'.replace(re2, '');
+ 'Zhfvx\x0a'.replace(re89, '');
+ 'Zhfvx\x0a'.replace(re90, '');
+ 'Anpuevpugra\x0a'.replace(re89, '');
+ 'Anpuevpugra\x0a'.replace(re90, '');
+ 'Cuk'.replace(re2, '');
+ 'ErdhrfgSvavfu'.split(re70);
+ 'ErdhrfgSvavfu.NWNK.Cuk'.split(re70);
+ 'Ebhgr\x0a'.replace(re89, '');
+ 'Ebhgr\x0a'.replace(re90, '');
+ str78.split(re32);
+ str79.split(re32);
+ str80.split(re32);
+ str81.split(re32);
+ 'Fcbeg\x0a'.replace(re89, '');
+ 'Fcbeg\x0a'.replace(re90, '');
+ 'GI-Fcbg\x0a'.replace(re89, '');
+ 'GI-Fcbg\x0a'.replace(re90, '');
+ 'Gbhe\x0a'.replace(re89, '');
+ 'Gbhe\x0a'.replace(re90, '');
+ 'Hagreunyghat\x0a'.replace(re89, '');
+ 'Hagreunyghat\x0a'.replace(re90, '');
+ 'Ivqrb\x0a'.replace(re89, '');
+ 'Ivqrb\x0a'.replace(re90, '');
+ 'Jrggre\x0a'.replace(re89, '');
+ 'Jrggre\x0a'.replace(re90, '');
+ str82.replace(re68, '');
+ str82.replace(re18, '');
+ str83.replace(re68, '');
+ str83.replace(re18, '');
+ str84.replace(re68, '');
+ str84.replace(re18, '');
+ 'nqiFreivprObk'.replace(re30, '');
+ 'nqiFubccvatObk'.replace(re30, '');
+ 'nwnk'.replace(re39, '');
+ 'nxghryy'.replace(re40, '');
+ 'nxghryy'.replace(re41, '');
+ 'nxghryy'.replace(re42, '');
+ 'nxghryy'.replace(re43, '');
+ 'nxghryy'.replace(re44, '');
+ 'nxghryy'.replace(re45, '');
+ 'nxghryy'.replace(re46, '');
+ 'nxghryy'.replace(re47, '');
+ 'nxghryy'.replace(re48, '');
+ str85.replace(re40, '');
+ str85.replace(re41, '');
+ str85.replace(re42, '');
+ str85.replace(re43, '');
+ str85.replace(re44, '');
+ str85.replace(re45, '');
+ str85.replace(re46, '');
+ str85.replace(re47, '');
+ str85.replace(re48, '');
+ 'pngrtbel'.replace(re29, '');
+ 'pngrtbel'.replace(re30, '');
+ 'pybfr'.replace(re39, '');
+ 'qvi'.replace(re39, '');
+ str86.replace(re68, '');
+ str86.replace(re18, '');
+ 'qg'.replace(re39, '');
+ 'qg'.replace(re68, '');
+ 'qg'.replace(re18, '');
+ 'rzorq'.replace(re39, '');
+ 'rzorq'.replace(re68, '');
+ 'rzorq'.replace(re18, '');
+ 'svryqOga'.replace(re39, '');
+ 'svryqOgaPnapry'.replace(re39, '');
+ 'svz_zlfcnpr_nccf-pnainf,svz_zlfcnpr_havgrq-fgngrf'.split(re20);
+ 'svanamra'.replace(re40, '');
+ 'svanamra'.replace(re41, '');
+ 'svanamra'.replace(re42, '');
+ 'svanamra'.replace(re43, '');
+ 'svanamra'.replace(re44, '');
+ 'svanamra'.replace(re45, '');
+ 'svanamra'.replace(re46, '');
+ 'svanamra'.replace(re47, '');
+ 'svanamra'.replace(re48, '');
+ 'sbphf'.split(re70);
+ 'sbphf.gno sbphfva.gno'.split(re70);
+ 'sbphfva'.split(re70);
+ 'sbez'.replace(re39, '');
+ 'sbez.nwnk'.replace(re68, '');
+ 'sbez.nwnk'.replace(re18, '');
+ 'tnzrf'.replace(re40, '');
+ 'tnzrf'.replace(re41, '');
+ 'tnzrf'.replace(re42, '');
+ 'tnzrf'.replace(re43, '');
+ 'tnzrf'.replace(re44, '');
+ 'tnzrf'.replace(re45, '');
+ 'tnzrf'.replace(re46, '');
+ 'tnzrf'.replace(re47, '');
+ 'tnzrf'.replace(re48, '');
+ 'ubzrcntr'.replace(re30, '');
+ 'ubebfxbc'.replace(re40, '');
+ 'ubebfxbc'.replace(re41, '');
+ 'ubebfxbc'.replace(re42, '');
+ 'ubebfxbc'.replace(re43, '');
+ 'ubebfxbc'.replace(re44, '');
+ 'ubebfxbc'.replace(re45, '');
+ 'ubebfxbc'.replace(re46, '');
+ 'ubebfxbc'.replace(re47, '');
+ 'ubebfxbc'.replace(re48, '');
+ 'uc_cebzbobk_ugzy%2Puc_cebzbobk_vzt'.replace(re30, '');
+ 'uc_erpgnatyr'.replace(re30, '');
+ str87.replace(re33, '');
+ str88.replace(re33, '');
+ 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf${4}${5}'.replace(re71, '');
+ 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf${5}'.replace(re72, '');
+ 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/qlaYvo.wf${4}${5}'.replace(re71, '');
+ 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/qlaYvo.wf${5}'.replace(re72, '');
+ 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/rssrpgYvo.wf${4}${5}'.replace(re71, '');
+ 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/rssrpgYvo.wf${5}'.replace(re72, '');
+ str89.replace(re73, '');
+ 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55023338617756?[NDO]&{1}&{2}&[NDR]'.replace(re69, '');
+ str6.replace(re23, '');
+ 'xvab'.replace(re40, '');
+ 'xvab'.replace(re41, '');
+ 'xvab'.replace(re42, '');
+ 'xvab'.replace(re43, '');
+ 'xvab'.replace(re44, '');
+ 'xvab'.replace(re45, '');
+ 'xvab'.replace(re46, '');
+ 'xvab'.replace(re47, '');
+ 'xvab'.replace(re48, '');
+ 'ybnq'.split(re70);
+ 'zrqvnzbqgno lhv-anifrg lhv-anifrg-gbc'.replace(re18, '');
+ 'zrgn'.replace(re39, '');
+ str90.replace(re68, '');
+ str90.replace(re18, '');
+ 'zbhfrzbir'.split(re70);
+ 'zbhfrzbir.gno'.split(re70);
+ str63.replace(/^.*jroxvg\/(\d+(\.\d+)?).*$/, '');
+ 'zhfvx'.replace(re40, '');
+ 'zhfvx'.replace(re41, '');
+ 'zhfvx'.replace(re42, '');
+ 'zhfvx'.replace(re43, '');
+ 'zhfvx'.replace(re44, '');
+ 'zhfvx'.replace(re45, '');
+ 'zhfvx'.replace(re46, '');
+ 'zhfvx'.replace(re47, '');
+ 'zhfvx'.replace(re48, '');
+ 'zlfcnpr_nccf_pnainf'.replace(re52, '');
+ str91.replace(re40, '');
+ str91.replace(re41, '');
+ str91.replace(re42, '');
+ str91.replace(re43, '');
+ str91.replace(re44, '');
+ str91.replace(re45, '');
+ str91.replace(re46, '');
+ str91.replace(re47, '');
+ str91.replace(re48, '');
+ 'anzr'.replace(re39, '');
+ str92.replace(/\b\w+\b/g, '');
+ 'bow-nppbeqvba'.replace(re39, '');
+ 'bowrpg'.replace(re39, '');
+ 'bowrpg'.replace(re68, '');
+ 'bowrpg'.replace(re18, '');
+ 'cnenzf%2Rfglyrf'.replace(re29, '');
+ 'cnenzf%2Rfglyrf'.replace(re30, '');
+ 'cbchc'.replace(re30, '');
+ 'ebhgr'.replace(re40, '');
+ 'ebhgr'.replace(re41, '');
+ 'ebhgr'.replace(re42, '');
+ 'ebhgr'.replace(re43, '');
+ 'ebhgr'.replace(re44, '');
+ 'ebhgr'.replace(re45, '');
+ 'ebhgr'.replace(re46, '');
+ 'ebhgr'.replace(re47, '');
+ 'ebhgr'.replace(re48, '');
+ 'freivprobk_uc'.replace(re30, '');
+ 'fubccvatobk_uc'.replace(re30, '');
+ 'fubhgobk'.replace(re39, '');
+ 'fcbeg'.replace(re40, '');
+ 'fcbeg'.replace(re41, '');
+ 'fcbeg'.replace(re42, '');
+ 'fcbeg'.replace(re43, '');
+ 'fcbeg'.replace(re44, '');
+ 'fcbeg'.replace(re45, '');
+ 'fcbeg'.replace(re46, '');
+ 'fcbeg'.replace(re47, '');
+ 'fcbeg'.replace(re48, '');
+ 'gbhe'.replace(re40, '');
+ 'gbhe'.replace(re41, '');
+ 'gbhe'.replace(re42, '');
+ 'gbhe'.replace(re43, '');
+ 'gbhe'.replace(re44, '');
+ 'gbhe'.replace(re45, '');
+ 'gbhe'.replace(re46, '');
+ 'gbhe'.replace(re47, '');
+ 'gbhe'.replace(re48, '');
+ 'gi-fcbg'.replace(re40, '');
+ 'gi-fcbg'.replace(re41, '');
+ 'gi-fcbg'.replace(re42, '');
+ 'gi-fcbg'.replace(re43, '');
+ 'gi-fcbg'.replace(re44, '');
+ 'gi-fcbg'.replace(re45, '');
+ 'gi-fcbg'.replace(re46, '');
+ 'gi-fcbg'.replace(re47, '');
+ 'gi-fcbg'.replace(re48, '');
+ 'glcr'.replace(re39, '');
+ 'haqrsvarq'.replace(/\//g, '');
+ str93.replace(re40, '');
+ str93.replace(re41, '');
+ str93.replace(re42, '');
+ str93.replace(re43, '');
+ str93.replace(re44, '');
+ str93.replace(re45, '');
+ str93.replace(re46, '');
+ str93.replace(re47, '');
+ str93.replace(re48, '');
+ 'ivqrb'.replace(re40, '');
+ 'ivqrb'.replace(re41, '');
+ 'ivqrb'.replace(re42, '');
+ 'ivqrb'.replace(re43, '');
+ 'ivqrb'.replace(re44, '');
+ 'ivqrb'.replace(re45, '');
+ 'ivqrb'.replace(re46, '');
+ 'ivqrb'.replace(re47, '');
+ 'ivqrb'.replace(re48, '');
+ 'ivfvgf=1'.split(re86);
+ 'jrggre'.replace(re40, '');
+ 'jrggre'.replace(re41, '');
+ 'jrggre'.replace(re42, '');
+ 'jrggre'.replace(re43, '');
+ 'jrggre'.replace(re44, '');
+ 'jrggre'.replace(re45, '');
+ 'jrggre'.replace(re46, '');
+ 'jrggre'.replace(re47, '');
+ 'jrggre'.replace(re48, '');
+ /#[a-z0-9]+$/i.exec('uggc://jjj.fpuhryreim.arg/Qrsnhyg');
+ re66.exec('fryrpgrq');
+ /(?:^|\s+)lhv-ani(?:\s+|$)/.exec('sff lhv-ani');
+ /(?:^|\s+)lhv-anifrg(?:\s+|$)/.exec('zrqvnzbqgno lhv-anifrg');
+ /(?:^|\s+)lhv-anifrg-gbc(?:\s+|$)/.exec('zrqvnzbqgno lhv-anifrg');
+ re91.exec('GnoThvq');
+ re91.exec('thvq');
+ /(pbzcngvoyr|jroxvg)/.exec(str63);
+ /.+(?:ei|vg|en|vr)[\/: ]([\d.]+)/.exec(str63);
+ re8.exec('144631658.0.10.1231365869');
+ re8.exec('144631658.0.10.1231367054');
+ re8.exec('144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('144631658.1670816052019209000.1231365869.1231365869.1231365869.1');
+ re8.exec('144631658.1796080716621419500.1231367054.1231367054.1231367054.1');
+ re8.exec(str94);
+ re8.exec(str95);
+ re8.exec(str96);
+ re8.exec(str97);
+ re8.exec('__hgzn=144631658.1670816052019209000.1231365869.1231365869.1231365869.1');
+ re8.exec('__hgzn=144631658.1796080716621419500.1231367054.1231367054.1231367054.1');
+ re8.exec('__hgzo=144631658.0.10.1231365869');
+ re8.exec('__hgzo=144631658.0.10.1231367054');
+ re8.exec('__hgzm=144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re8.exec('__hgzm=144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
+ re34.exec(str78);
+ re34.exec(str79);
+ re34.exec(str81);
+ re74.exec(str77);
+ re74.exec('*');
+ re74.exec(str82);
+ re74.exec(str83);
+ re74.exec(str86);
+ re74.exec('rzorq');
+ re74.exec('sbez.nwnk');
+ re74.exec(str90);
+ re74.exec('bowrpg');
+ /\/onfr.wf(\?.+)?$/.exec('/uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf');
+ re28.exec('uvag ynfgUvag ynfg');
+ re75.exec('');
+ re76.exec('');
+ re77.exec('');
+ re78.exec('');
+ re80.exec(str77);
+ re80.exec('*');
+ re80.exec('.pybfr');
+ re80.exec(str82);
+ re80.exec(str83);
+ re80.exec(str84);
+ re80.exec(str86);
+ re80.exec('qg');
+ re80.exec('rzorq');
+ re80.exec('sbez.nwnk');
+ re80.exec(str90);
+ re80.exec('bowrpg');
+ re61.exec('qlaYvo.wf');
+ re61.exec('rssrpgYvo.wf');
+ re61.exec('uggc://jjj.tzk.arg/qr/?fgnghf=uvajrvf');
+ re92.exec(' .pybfr');
+ re92.exec(' n.svryqOgaPnapry');
+ re92.exec(' qg');
+ re92.exec(str48);
+ re92.exec('.nwnk');
+ re92.exec('.svryqOga,n.svryqOgaPnapry');
+ re92.exec('.svryqOgaPnapry');
+ re92.exec('.bow-nppbeqvba qg');
+ re68.exec(str77);
+ re68.exec('*');
+ re68.exec('.pybfr');
+ re68.exec(str82);
+ re68.exec(str83);
+ re68.exec(str84);
+ re68.exec(str86);
+ re68.exec('qg');
+ re68.exec('rzorq');
+ re68.exec('sbez.nwnk');
+ re68.exec(str90);
+ re68.exec('bowrpg');
+ re93.exec(' .pybfr');
+ re93.exec(' n.svryqOgaPnapry');
+ re93.exec(' qg');
+ re93.exec(str48);
+ re93.exec('.nwnk');
+ re93.exec('.svryqOga,n.svryqOgaPnapry');
+ re93.exec('.svryqOgaPnapry');
+ re93.exec('.bow-nppbeqvba qg');
+ re81.exec(str77);
+ re81.exec('*');
+ re81.exec(str48);
+ re81.exec('.pybfr');
+ re81.exec(str82);
+ re81.exec(str83);
+ re81.exec(str84);
+ re81.exec(str86);
+ re81.exec('qg');
+ re81.exec('rzorq');
+ re81.exec('sbez.nwnk');
+ re81.exec(str90);
+ re81.exec('bowrpg');
+ re94.exec(' .pybfr');
+ re94.exec(' n.svryqOgaPnapry');
+ re94.exec(' qg');
+ re94.exec(str48);
+ re94.exec('.nwnk');
+ re94.exec('.svryqOga,n.svryqOgaPnapry');
+ re94.exec('.svryqOgaPnapry');
+ re94.exec('.bow-nppbeqvba qg');
+ re94.exec('[anzr=nwnkHey]');
+ re94.exec(str82);
+ re31.exec('rf');
+ re31.exec('wn');
+ re82.exec(str77);
+ re82.exec('*');
+ re82.exec(str48);
+ re82.exec('.pybfr');
+ re82.exec(str82);
+ re82.exec(str83);
+ re82.exec(str84);
+ re82.exec(str86);
+ re82.exec('qg');
+ re82.exec('rzorq');
+ re82.exec('sbez.nwnk');
+ re82.exec(str90);
+ re82.exec('bowrpg');
+ re83.exec(str98);
+ re83.exec('shapgvba sbphf() { [angvir pbqr] }');
+ re62.exec('#Ybtva');
+ re62.exec('#Ybtva_cnffjbeq');
+ re62.exec(str77);
+ re62.exec('#fubhgobkWf');
+ re62.exec('#fubhgobkWfReebe');
+ re62.exec('#fubhgobkWfFhpprff');
+ re62.exec('*');
+ re62.exec(str82);
+ re62.exec(str83);
+ re62.exec(str86);
+ re62.exec('rzorq');
+ re62.exec('sbez.nwnk');
+ re62.exec(str90);
+ re62.exec('bowrpg');
+ re49.exec('pbagrag');
+ re24.exec(str6);
+ /xbadhrebe/.exec(str63);
+ /znp/.exec('jva32');
+ /zbmvyyn/.exec(str63);
+ /zfvr/.exec(str63);
+ /ag\s5\.1/.exec(str63);
+ /bcren/.exec(str63);
+ /fnsnev/.exec(str63);
+ /jva/.exec('jva32');
+ /jvaqbjf/.exec(str63);
+ }
+ }
+
+ function run() {
+ for (var i = 0; i < 5; i++) {
+ runBlock0();
+ runBlock1();
+ runBlock2();
+ runBlock3();
+ runBlock4();
+ runBlock5();
+ runBlock6();
+ runBlock7();
+ runBlock8();
+ runBlock9();
+ runBlock10();
+ runBlock11();
+ }
+ }
+
+ this.run = run;
+}
diff --git a/tests/benchmarks/script/v8/tests/richards.js b/tests/benchmarks/script/v8/tests/richards.js
new file mode 100644
index 0000000000..054928db16
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/richards.js
@@ -0,0 +1,539 @@
+// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// This is a JavaScript implementation of the Richards
+// benchmark from:
+//
+// http://www.cl.cam.ac.uk/~mr10/Bench.html
+//
+// The benchmark was originally implemented in BCPL by
+// Martin Richards.
+
+
+var Richards = new BenchmarkSuite('Richards', 35302, [
+ new Benchmark("Richards", runRichards)
+]);
+
+
+/**
+ * The Richards benchmark simulates the task dispatcher of an
+ * operating system.
+ **/
+function runRichards() {
+ var scheduler = new Scheduler();
+ scheduler.addIdleTask(ID_IDLE, 0, null, COUNT);
+
+ var queue = new Packet(null, ID_WORKER, KIND_WORK);
+ queue = new Packet(queue, ID_WORKER, KIND_WORK);
+ scheduler.addWorkerTask(ID_WORKER, 1000, queue);
+
+ queue = new Packet(null, ID_DEVICE_A, KIND_DEVICE);
+ queue = new Packet(queue, ID_DEVICE_A, KIND_DEVICE);
+ queue = new Packet(queue, ID_DEVICE_A, KIND_DEVICE);
+ scheduler.addHandlerTask(ID_HANDLER_A, 2000, queue);
+
+ queue = new Packet(null, ID_DEVICE_B, KIND_DEVICE);
+ queue = new Packet(queue, ID_DEVICE_B, KIND_DEVICE);
+ queue = new Packet(queue, ID_DEVICE_B, KIND_DEVICE);
+ scheduler.addHandlerTask(ID_HANDLER_B, 3000, queue);
+
+ scheduler.addDeviceTask(ID_DEVICE_A, 4000, null);
+
+ scheduler.addDeviceTask(ID_DEVICE_B, 5000, null);
+
+ scheduler.schedule();
+
+ if (scheduler.queueCount != EXPECTED_QUEUE_COUNT ||
+ scheduler.holdCount != EXPECTED_HOLD_COUNT) {
+ var msg =
+ "Error during execution: queueCount = " + scheduler.queueCount +
+ ", holdCount = " + scheduler.holdCount + ".";
+ throw new Error(msg);
+ }
+}
+
+var COUNT = 1000;
+
+/**
+ * These two constants specify how many times a packet is queued and
+ * how many times a task is put on hold in a correct run of richards.
+ * They don't have any meaning a such but are characteristic of a
+ * correct run so if the actual queue or hold count is different from
+ * the expected there must be a bug in the implementation.
+ **/
+var EXPECTED_QUEUE_COUNT = 2322;
+var EXPECTED_HOLD_COUNT = 928;
+
+
+/**
+ * A scheduler can be used to schedule a set of tasks based on their relative
+ * priorities. Scheduling is done by maintaining a list of task control blocks
+ * which holds tasks and the data queue they are processing.
+ * @constructor
+ */
+function Scheduler() {
+ this.queueCount = 0;
+ this.holdCount = 0;
+ this.blocks = new Array(NUMBER_OF_IDS);
+ this.list = null;
+ this.currentTcb = null;
+ this.currentId = null;
+}
+
+var ID_IDLE = 0;
+var ID_WORKER = 1;
+var ID_HANDLER_A = 2;
+var ID_HANDLER_B = 3;
+var ID_DEVICE_A = 4;
+var ID_DEVICE_B = 5;
+var NUMBER_OF_IDS = 6;
+
+var KIND_DEVICE = 0;
+var KIND_WORK = 1;
+
+/**
+ * Add an idle task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ * @param {int} count the number of times to schedule the task
+ */
+Scheduler.prototype.addIdleTask = function (id, priority, queue, count) {
+ this.addRunningTask(id, priority, queue, new IdleTask(this, 1, count));
+};
+
+/**
+ * Add a work task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ */
+Scheduler.prototype.addWorkerTask = function (id, priority, queue) {
+ this.addTask(id, priority, queue, new WorkerTask(this, ID_HANDLER_A, 0));
+};
+
+/**
+ * Add a handler task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ */
+Scheduler.prototype.addHandlerTask = function (id, priority, queue) {
+ this.addTask(id, priority, queue, new HandlerTask(this));
+};
+
+/**
+ * Add a handler task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ */
+Scheduler.prototype.addDeviceTask = function (id, priority, queue) {
+ this.addTask(id, priority, queue, new DeviceTask(this))
+};
+
+/**
+ * Add the specified task and mark it as running.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ * @param {Task} task the task to add
+ */
+Scheduler.prototype.addRunningTask = function (id, priority, queue, task) {
+ this.addTask(id, priority, queue, task);
+ this.currentTcb.setRunning();
+};
+
+/**
+ * Add the specified task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ * @param {Task} task the task to add
+ */
+Scheduler.prototype.addTask = function (id, priority, queue, task) {
+ this.currentTcb = new TaskControlBlock(this.list, id, priority, queue, task);
+ this.list = this.currentTcb;
+ this.blocks[id] = this.currentTcb;
+};
+
+/**
+ * Execute the tasks managed by this scheduler.
+ */
+Scheduler.prototype.schedule = function () {
+ this.currentTcb = this.list;
+ while (this.currentTcb != null) {
+ if (this.currentTcb.isHeldOrSuspended()) {
+ this.currentTcb = this.currentTcb.link;
+ } else {
+ this.currentId = this.currentTcb.id;
+ this.currentTcb = this.currentTcb.run();
+ }
+ }
+};
+
+/**
+ * Release a task that is currently blocked and return the next block to run.
+ * @param {int} id the id of the task to suspend
+ */
+Scheduler.prototype.release = function (id) {
+ var tcb = this.blocks[id];
+ if (tcb == null) return tcb;
+ tcb.markAsNotHeld();
+ if (tcb.priority > this.currentTcb.priority) {
+ return tcb;
+ } else {
+ return this.currentTcb;
+ }
+};
+
+/**
+ * Block the currently executing task and return the next task control block
+ * to run. The blocked task will not be made runnable until it is explicitly
+ * released, even if new work is added to it.
+ */
+Scheduler.prototype.holdCurrent = function () {
+ this.holdCount++;
+ this.currentTcb.markAsHeld();
+ return this.currentTcb.link;
+};
+
+/**
+ * Suspend the currently executing task and return the next task control block
+ * to run. If new work is added to the suspended task it will be made runnable.
+ */
+Scheduler.prototype.suspendCurrent = function () {
+ this.currentTcb.markAsSuspended();
+ return this.currentTcb;
+};
+
+/**
+ * Add the specified packet to the end of the worklist used by the task
+ * associated with the packet and make the task runnable if it is currently
+ * suspended.
+ * @param {Packet} packet the packet to add
+ */
+Scheduler.prototype.queue = function (packet) {
+ var t = this.blocks[packet.id];
+ if (t == null) return t;
+ this.queueCount++;
+ packet.link = null;
+ packet.id = this.currentId;
+ return t.checkPriorityAdd(this.currentTcb, packet);
+};
+
+/**
+ * A task control block manages a task and the queue of work packages associated
+ * with it.
+ * @param {TaskControlBlock} link the preceding block in the linked block list
+ * @param {int} id the id of this block
+ * @param {int} priority the priority of this block
+ * @param {Packet} queue the queue of packages to be processed by the task
+ * @param {Task} task the task
+ * @constructor
+ */
+function TaskControlBlock(link, id, priority, queue, task) {
+ this.link = link;
+ this.id = id;
+ this.priority = priority;
+ this.queue = queue;
+ this.task = task;
+ if (queue == null) {
+ this.state = STATE_SUSPENDED;
+ } else {
+ this.state = STATE_SUSPENDED_RUNNABLE;
+ }
+}
+
+/**
+ * The task is running and is currently scheduled.
+ */
+var STATE_RUNNING = 0;
+
+/**
+ * The task has packets left to process.
+ */
+var STATE_RUNNABLE = 1;
+
+/**
+ * The task is not currently running. The task is not blocked as such and may
+* be started by the scheduler.
+ */
+var STATE_SUSPENDED = 2;
+
+/**
+ * The task is blocked and cannot be run until it is explicitly released.
+ */
+var STATE_HELD = 4;
+
+var STATE_SUSPENDED_RUNNABLE = STATE_SUSPENDED | STATE_RUNNABLE;
+var STATE_NOT_HELD = ~STATE_HELD;
+
+TaskControlBlock.prototype.setRunning = function () {
+ this.state = STATE_RUNNING;
+};
+
+TaskControlBlock.prototype.markAsNotHeld = function () {
+ this.state = this.state & STATE_NOT_HELD;
+};
+
+TaskControlBlock.prototype.markAsHeld = function () {
+ this.state = this.state | STATE_HELD;
+};
+
+TaskControlBlock.prototype.isHeldOrSuspended = function () {
+ return (this.state & STATE_HELD) != 0 || (this.state == STATE_SUSPENDED);
+};
+
+TaskControlBlock.prototype.markAsSuspended = function () {
+ this.state = this.state | STATE_SUSPENDED;
+};
+
+TaskControlBlock.prototype.markAsRunnable = function () {
+ this.state = this.state | STATE_RUNNABLE;
+};
+
+/**
+ * Runs this task, if it is ready to be run, and returns the next task to run.
+ */
+TaskControlBlock.prototype.run = function () {
+ var packet;
+ if (this.state == STATE_SUSPENDED_RUNNABLE) {
+ packet = this.queue;
+ this.queue = packet.link;
+ if (this.queue == null) {
+ this.state = STATE_RUNNING;
+ } else {
+ this.state = STATE_RUNNABLE;
+ }
+ } else {
+ packet = null;
+ }
+ return this.task.run(packet);
+};
+
+/**
+ * Adds a packet to the worklist of this block's task, marks this as runnable if
+ * necessary, and returns the next runnable object to run (the one
+ * with the highest priority).
+ */
+TaskControlBlock.prototype.checkPriorityAdd = function (task, packet) {
+ if (this.queue == null) {
+ this.queue = packet;
+ this.markAsRunnable();
+ if (this.priority > task.priority) return this;
+ } else {
+ this.queue = packet.addTo(this.queue);
+ }
+ return task;
+};
+
+TaskControlBlock.prototype.toString = function () {
+ return "tcb { " + this.task + "@" + this.state + " }";
+};
+
+/**
+ * An idle task doesn't do any work itself but cycles control between the two
+ * device tasks.
+ * @param {Scheduler} scheduler the scheduler that manages this task
+ * @param {int} v1 a seed value that controls how the device tasks are scheduled
+ * @param {int} count the number of times this task should be scheduled
+ * @constructor
+ */
+function IdleTask(scheduler, v1, count) {
+ this.scheduler = scheduler;
+ this.v1 = v1;
+ this.count = count;
+}
+
+IdleTask.prototype.run = function (packet) {
+ this.count--;
+ if (this.count == 0) return this.scheduler.holdCurrent();
+ if ((this.v1 & 1) == 0) {
+ this.v1 = this.v1 >> 1;
+ return this.scheduler.release(ID_DEVICE_A);
+ } else {
+ this.v1 = (this.v1 >> 1) ^ 0xD008;
+ return this.scheduler.release(ID_DEVICE_B);
+ }
+};
+
+IdleTask.prototype.toString = function () {
+ return "IdleTask"
+};
+
+/**
+ * A task that suspends itself after each time it has been run to simulate
+ * waiting for data from an external device.
+ * @param {Scheduler} scheduler the scheduler that manages this task
+ * @constructor
+ */
+function DeviceTask(scheduler) {
+ this.scheduler = scheduler;
+ this.v1 = null;
+}
+
+DeviceTask.prototype.run = function (packet) {
+ if (packet == null) {
+ if (this.v1 == null) return this.scheduler.suspendCurrent();
+ var v = this.v1;
+ this.v1 = null;
+ return this.scheduler.queue(v);
+ } else {
+ this.v1 = packet;
+ return this.scheduler.holdCurrent();
+ }
+};
+
+DeviceTask.prototype.toString = function () {
+ return "DeviceTask";
+};
+
+/**
+ * A task that manipulates work packets.
+ * @param {Scheduler} scheduler the scheduler that manages this task
+ * @param {int} v1 a seed used to specify how work packets are manipulated
+ * @param {int} v2 another seed used to specify how work packets are manipulated
+ * @constructor
+ */
+function WorkerTask(scheduler, v1, v2) {
+ this.scheduler = scheduler;
+ this.v1 = v1;
+ this.v2 = v2;
+}
+
+WorkerTask.prototype.run = function (packet) {
+ if (packet == null) {
+ return this.scheduler.suspendCurrent();
+ } else {
+ if (this.v1 == ID_HANDLER_A) {
+ this.v1 = ID_HANDLER_B;
+ } else {
+ this.v1 = ID_HANDLER_A;
+ }
+ packet.id = this.v1;
+ packet.a1 = 0;
+ for (var i = 0; i < DATA_SIZE; i++) {
+ this.v2++;
+ if (this.v2 > 26) this.v2 = 1;
+ packet.a2[i] = this.v2;
+ }
+ return this.scheduler.queue(packet);
+ }
+};
+
+WorkerTask.prototype.toString = function () {
+ return "WorkerTask";
+};
+
+/**
+ * A task that manipulates work packets and then suspends itself.
+ * @param {Scheduler} scheduler the scheduler that manages this task
+ * @constructor
+ */
+function HandlerTask(scheduler) {
+ this.scheduler = scheduler;
+ this.v1 = null;
+ this.v2 = null;
+}
+
+HandlerTask.prototype.run = function (packet) {
+ if (packet != null) {
+ if (packet.kind == KIND_WORK) {
+ this.v1 = packet.addTo(this.v1);
+ } else {
+ this.v2 = packet.addTo(this.v2);
+ }
+ }
+ if (this.v1 != null) {
+ var count = this.v1.a1;
+ var v;
+ if (count < DATA_SIZE) {
+ if (this.v2 != null) {
+ v = this.v2;
+ this.v2 = this.v2.link;
+ v.a1 = this.v1.a2[count];
+ this.v1.a1 = count + 1;
+ return this.scheduler.queue(v);
+ }
+ } else {
+ v = this.v1;
+ this.v1 = this.v1.link;
+ return this.scheduler.queue(v);
+ }
+ }
+ return this.scheduler.suspendCurrent();
+};
+
+HandlerTask.prototype.toString = function () {
+ return "HandlerTask";
+};
+
+/* --- *
+ * P a c k e t
+ * --- */
+
+var DATA_SIZE = 4;
+
+/**
+ * A simple package of data that is manipulated by the tasks. The exact layout
+ * of the payload data carried by a packet is not importaint, and neither is the
+ * nature of the work performed on packets by the tasks.
+ *
+ * Besides carrying data, packets form linked lists and are hence used both as
+ * data and worklists.
+ * @param {Packet} link the tail of the linked list of packets
+ * @param {int} id an ID for this packet
+ * @param {int} kind the type of this packet
+ * @constructor
+ */
+function Packet(link, id, kind) {
+ this.link = link;
+ this.id = id;
+ this.kind = kind;
+ this.a1 = 0;
+ this.a2 = new Array(DATA_SIZE);
+}
+
+/**
+ * Add this packet to the end of a worklist, and return the worklist.
+ * @param {Packet} queue the worklist to add this packet to
+ */
+Packet.prototype.addTo = function (queue) {
+ this.link = null;
+ if (queue == null) return this;
+ var peek, next = queue;
+ while ((peek = next.link) != null)
+ next = peek;
+ next.link = this;
+ return queue;
+};
+
+Packet.prototype.toString = function () {
+ return "Packet";
+};
diff --git a/tests/benchmarks/script/v8/tests/splay.js b/tests/benchmarks/script/v8/tests/splay.js
new file mode 100644
index 0000000000..6b4f56d321
--- /dev/null
+++ b/tests/benchmarks/script/v8/tests/splay.js
@@ -0,0 +1,394 @@
+// Copyright 2009 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This benchmark is based on a JavaScript log processing module used
+// by the V8 profiler to generate execution time profiles for runs of
+// JavaScript applications, and it effectively measures how fast the
+// JavaScript engine is at allocating nodes and reclaiming the memory
+// used for old nodes. Because of the way splay trees work, the engine
+// also has to deal with a lot of changes to the large tree object
+// graph.
+
+var Splay = new BenchmarkSuite('Splay', 81491, [
+ new Benchmark("Splay", SplayRun, SplaySetup, SplayTearDown)
+]);
+
+
+// Configuration.
+var kSplayTreeSize = 8000;
+var kSplayTreeModifications = 80;
+var kSplayTreePayloadDepth = 5;
+
+var splayTree = null;
+
+
+function GeneratePayloadTree(depth, tag) {
+ if (depth == 0) {
+ return {
+ array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
+ string : 'String for key ' + tag + ' in leaf node'
+ };
+ } else {
+ return {
+ left: GeneratePayloadTree(depth - 1, tag),
+ right: GeneratePayloadTree(depth - 1, tag)
+ };
+ }
+}
+
+
+function GenerateKey() {
+ // The benchmark framework guarantees that Math.random is
+ // deterministic; see base.js.
+ return Math.random();
+}
+
+
+function InsertNewNode() {
+ // Insert new node with a unique key.
+ var key;
+ do {
+ key = GenerateKey();
+ } while (splayTree.find(key) != null);
+ var payload = GeneratePayloadTree(kSplayTreePayloadDepth, String(key));
+ splayTree.insert(key, payload);
+ return key;
+}
+
+
+
+function SplaySetup() {
+ splayTree = new SplayTree();
+ for (var i = 0; i < kSplayTreeSize; i++) InsertNewNode();
+}
+
+
+function SplayTearDown() {
+ // Allow the garbage collector to reclaim the memory
+ // used by the splay tree no matter how we exit the
+ // tear down function.
+ var keys = splayTree.exportKeys();
+ splayTree = null;
+
+ // Verify that the splay tree has the right size.
+ var length = keys.length;
+ if (length != kSplayTreeSize) {
+ throw new Error("Splay tree has wrong size");
+ }
+
+ // Verify that the splay tree has sorted, unique keys.
+ for (var i = 0; i < length - 1; i++) {
+ if (keys[i] >= keys[i + 1]) {
+ throw new Error("Splay tree not sorted");
+ }
+ }
+}
+
+
+function SplayRun() {
+ // Replace a few nodes in the splay tree.
+ for (var i = 0; i < kSplayTreeModifications; i++) {
+ var key = InsertNewNode();
+ var greatest = splayTree.findGreatestLessThan(key);
+ if (greatest == null) splayTree.remove(key);
+ else splayTree.remove(greatest.key);
+ }
+}
+
+
+/**
+ * Constructs a Splay tree. A splay tree is a self-balancing binary
+ * search tree with the additional property that recently accessed
+ * elements are quick to access again. It performs basic operations
+ * such as insertion, look-up and removal in O(log(n)) amortized time.
+ *
+ * @constructor
+ */
+function SplayTree() {
+};
+
+
+/**
+ * Pointer to the root node of the tree.
+ *
+ * @type {SplayTree.Node}
+ * @private
+ */
+SplayTree.prototype.root_ = null;
+
+
+/**
+ * @return {boolean} Whether the tree is empty.
+ */
+SplayTree.prototype.isEmpty = function() {
+ return !this.root_;
+};
+
+
+/**
+ * Inserts a node into the tree with the specified key and value if
+ * the tree does not already contain a node with the specified key. If
+ * the value is inserted, it becomes the root of the tree.
+ *
+ * @param {number} key Key to insert into the tree.
+ * @param {*} value Value to insert into the tree.
+ */
+SplayTree.prototype.insert = function(key, value) {
+ if (this.isEmpty()) {
+ this.root_ = new SplayTree.Node(key, value);
+ return;
+ }
+ // Splay on the key to move the last node on the search path for
+ // the key to the root of the tree.
+ this.splay_(key);
+ if (this.root_.key == key) {
+ return;
+ }
+ var node = new SplayTree.Node(key, value);
+ if (key > this.root_.key) {
+ node.left = this.root_;
+ node.right = this.root_.right;
+ this.root_.right = null;
+ } else {
+ node.right = this.root_;
+ node.left = this.root_.left;
+ this.root_.left = null;
+ }
+ this.root_ = node;
+};
+
+
+/**
+ * Removes a node with the specified key from the tree if the tree
+ * contains a node with this key. The removed node is returned. If the
+ * key is not found, an exception is thrown.
+ *
+ * @param {number} key Key to find and remove from the tree.
+ * @return {SplayTree.Node} The removed node.
+ */
+SplayTree.prototype.remove = function(key) {
+ if (this.isEmpty()) {
+ throw Error('Key not found: ' + key);
+ }
+ this.splay_(key);
+ if (this.root_.key != key) {
+ throw Error('Key not found: ' + key);
+ }
+ var removed = this.root_;
+ if (!this.root_.left) {
+ this.root_ = this.root_.right;
+ } else {
+ var right = this.root_.right;
+ this.root_ = this.root_.left;
+ // Splay to make sure that the new root has an empty right child.
+ this.splay_(key);
+ // Insert the original right child as the right child of the new
+ // root.
+ this.root_.right = right;
+ }
+ return removed;
+};
+
+
+/**
+ * Returns the node having the specified key or null if the tree doesn't contain
+ * a node with the specified key.
+ *
+ * @param {number} key Key to find in the tree.
+ * @return {SplayTree.Node} Node having the specified key.
+ */
+SplayTree.prototype.find = function(key) {
+ if (this.isEmpty()) {
+ return null;
+ }
+ this.splay_(key);
+ return this.root_.key == key ? this.root_ : null;
+};
+
+
+/**
+ * @return {SplayTree.Node} Node having the maximum key value.
+ */
+SplayTree.prototype.findMax = function(opt_startNode) {
+ if (this.isEmpty()) {
+ return null;
+ }
+ var current = opt_startNode || this.root_;
+ while (current.right) {
+ current = current.right;
+ }
+ return current;
+};
+
+
+/**
+ * @return {SplayTree.Node} Node having the maximum key value that
+ * is less than the specified key value.
+ */
+SplayTree.prototype.findGreatestLessThan = function(key) {
+ if (this.isEmpty()) {
+ return null;
+ }
+ // Splay on the key to move the node with the given key or the last
+ // node on the search path to the top of the tree.
+ this.splay_(key);
+ // Now the result is either the root node or the greatest node in
+ // the left subtree.
+ if (this.root_.key < key) {
+ return this.root_;
+ } else if (this.root_.left) {
+ return this.findMax(this.root_.left);
+ } else {
+ return null;
+ }
+};
+
+
+/**
+ * @return {Array<*>} An array containing all the keys of tree's nodes.
+ */
+SplayTree.prototype.exportKeys = function() {
+ var result = [];
+ if (!this.isEmpty()) {
+ this.root_.traverse_(function(node) { result.push(node.key); });
+ }
+ return result;
+};
+
+
+/**
+ * Perform the splay operation for the given key. Moves the node with
+ * the given key to the top of the tree. If no node has the given
+ * key, the last node on the search path is moved to the top of the
+ * tree. This is the simplified top-down splaying algorithm from:
+ * "Self-adjusting Binary Search Trees" by Sleator and Tarjan
+ *
+ * @param {number} key Key to splay the tree on.
+ * @private
+ */
+SplayTree.prototype.splay_ = function(key) {
+ if (this.isEmpty()) {
+ return;
+ }
+ // Create a dummy node. The use of the dummy node is a bit
+ // counter-intuitive: The right child of the dummy node will hold
+ // the L tree of the algorithm. The left child of the dummy node
+ // will hold the R tree of the algorithm. Using a dummy node, left
+ // and right will always be nodes and we avoid special cases.
+ var dummy, left, right;
+ dummy = left = right = new SplayTree.Node(null, null);
+ var current = this.root_;
+ while (true) {
+ if (key < current.key) {
+ if (!current.left) {
+ break;
+ }
+ if (key < current.left.key) {
+ // Rotate right.
+ var tmp = current.left;
+ current.left = tmp.right;
+ tmp.right = current;
+ current = tmp;
+ if (!current.left) {
+ break;
+ }
+ }
+ // Link right.
+ right.left = current;
+ right = current;
+ current = current.left;
+ } else if (key > current.key) {
+ if (!current.right) {
+ break;
+ }
+ if (key > current.right.key) {
+ // Rotate left.
+ var tmp = current.right;
+ current.right = tmp.left;
+ tmp.left = current;
+ current = tmp;
+ if (!current.right) {
+ break;
+ }
+ }
+ // Link left.
+ left.right = current;
+ left = current;
+ current = current.right;
+ } else {
+ break;
+ }
+ }
+ // Assemble.
+ left.right = current.left;
+ right.left = current.right;
+ current.left = dummy.right;
+ current.right = dummy.left;
+ this.root_ = current;
+};
+
+
+/**
+ * Constructs a Splay tree node.
+ *
+ * @param {number} key Key.
+ * @param {*} value Value.
+ */
+SplayTree.Node = function(key, value) {
+ this.key = key;
+ this.value = value;
+};
+
+
+/**
+ * @type {SplayTree.Node}
+ */
+SplayTree.Node.prototype.left = null;
+
+
+/**
+ * @type {SplayTree.Node}
+ */
+SplayTree.Node.prototype.right = null;
+
+
+/**
+ * Performs an ordered traversal of the subtree starting at
+ * this SplayTree.Node.
+ *
+ * @param {function(SplayTree.Node)} f Visitor function.
+ * @private
+ */
+SplayTree.Node.prototype.traverse_ = function(f) {
+ var current = this;
+ while (current) {
+ var left = current.left;
+ if (left) left.traverse_(f);
+ f(current);
+ current = current.right;
+ }
+};
diff --git a/tests/benchmarks/script/v8/tst_v8.cpp b/tests/benchmarks/script/v8/tst_v8.cpp
new file mode 100644
index 0000000000..841e2f3685
--- /dev/null
+++ b/tests/benchmarks/script/v8/tst_v8.cpp
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qtextstream.h>
+#include <QtScript/qscriptengine.h>
+#include <QtScript/qscriptvalue.h>
+
+//TESTED_FILES=
+
+static QString readFile(const QString &filename)
+{
+ QFile file(filename);
+ if (!file.open(QFile::ReadOnly))
+ return QString();
+ QTextStream stream(&file);
+ stream.setCodec("UTF-8");
+ return stream.readAll();
+}
+
+class tst_V8 : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_V8();
+ virtual ~tst_V8();
+
+public slots:
+ void init();
+ void cleanup();
+
+private slots:
+ void benchmark_data();
+ void benchmark();
+
+private:
+ QDir testsDir;
+};
+
+tst_V8::tst_V8()
+{
+ testsDir = QDir(":/tests");
+ if (!testsDir.exists())
+ qWarning("*** no tests/ dir!");
+}
+
+tst_V8::~tst_V8()
+{
+}
+
+void tst_V8::init()
+{
+}
+
+void tst_V8::cleanup()
+{
+}
+
+void tst_V8::benchmark_data()
+{
+ QTest::addColumn<QString>("testName");
+ QFileInfoList testFileInfos = testsDir.entryInfoList(QStringList() << "*.js", QDir::Files);
+ foreach (QFileInfo tfi, testFileInfos) {
+ QString name = tfi.baseName();
+ if (name == QString::fromLatin1("base")) {
+ // base.js contains the benchmark library, it's not a test.
+ continue;
+ }
+ QTest::newRow(name.toLatin1().constData()) << name;
+ }
+}
+
+void tst_V8::benchmark()
+{
+ QFETCH(QString, testName);
+
+ QString baseDotJsContents = readFile(testsDir.absoluteFilePath("base.js"));
+ QVERIFY(!baseDotJsContents.isEmpty());
+
+ QString testContents = readFile(testsDir.absoluteFilePath(testName + ".js"));
+ QVERIFY(!testContents.isEmpty());
+
+ QScriptEngine engine;
+ engine.evaluate(baseDotJsContents);
+ QVERIFY(!engine.hasUncaughtException());
+ engine.evaluate(testContents);
+ QVERIFY(!engine.hasUncaughtException());
+
+ QBENCHMARK {
+ engine.evaluate("BenchmarkSuite.RunSuites({})");
+ }
+ QVERIFY(!engine.hasUncaughtException());
+}
+
+QTEST_MAIN(tst_V8)
+#include "tst_v8.moc"
diff --git a/tests/benchmarks/script/v8/v8.pro b/tests/benchmarks/script/v8/v8.pro
new file mode 100644
index 0000000000..547eecc8d8
--- /dev/null
+++ b/tests/benchmarks/script/v8/v8.pro
@@ -0,0 +1,12 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_v8
+RESOURCES += v8.qrc
+SOURCES += tst_v8.cpp
+
+QT = core script
+
+symbian* {
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 // Min 128kB, Max 32MB
+ TARGET.EPOCSTACKSIZE = 0x14000
+}
diff --git a/tests/benchmarks/script/v8/v8.qrc b/tests/benchmarks/script/v8/v8.qrc
new file mode 100644
index 0000000000..a894ee5859
--- /dev/null
+++ b/tests/benchmarks/script/v8/v8.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>tests</file>
+</qresource>
+</RCC>
diff --git a/tests/benchmarks/svg/svg.pro b/tests/benchmarks/svg/svg.pro
index cdc2ca5716..d84eb7187a 100644
--- a/tests/benchmarks/svg/svg.pro
+++ b/tests/benchmarks/svg/svg.pro
@@ -1,3 +1,5 @@
TEMPLATE = subdirs
SUBDIRS = \
qsvgrenderer
+
+include(../trusted-benchmarks.pri) \ No newline at end of file
diff --git a/tests/benchmarks/trusted-benchmarks.pri b/tests/benchmarks/trusted-benchmarks.pri
new file mode 100644
index 0000000000..a835cbdf1e
--- /dev/null
+++ b/tests/benchmarks/trusted-benchmarks.pri
@@ -0,0 +1,11 @@
+# Edit the list of trusted benchmarks in each of the sub-targets
+
+# command terminating newline in Makefile
+NL=$$escape_expand(\\n\\t)
+
+check-trusted.depends = qmake
+for(benchmark, TRUSTED_BENCHMARKS) {
+ check-trusted.commands += -cd $$benchmark && $(MAKE) -f $(MAKEFILE) check$${NL}
+}
+
+QMAKE_EXTRA_TARGETS += check-trusted
diff --git a/tests/manual/mkspecs/.gitignore b/tests/manual/mkspecs/.gitignore
new file mode 100644
index 0000000000..403e028f8e
--- /dev/null
+++ b/tests/manual/mkspecs/.gitignore
@@ -0,0 +1,2 @@
+tmp
+specs
diff --git a/tests/manual/mkspecs/test.sh b/tests/manual/mkspecs/test.sh
new file mode 100755
index 0000000000..7e942a4ee6
--- /dev/null
+++ b/tests/manual/mkspecs/test.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+#############################################################################
+##
+## 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 manual tests 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$
+##
+#############################################################################
+
+
+if [ "$1" == "--help" ]; then
+ echo "Init a clean git repository somewhere and run this test script from that directory. The first run will"
+ echo "produce a bunch of specs. This is your baseline. Run 'git add specs' and commit the baseline. Then run"
+ echo "this script again, after making changes to the mkspecs. You should see any diffs you produced."
+ exit 0
+fi
+
+
+QMAKE_ARGS="-nocache -d"
+SPECS_DIR=$(qmake -query QMAKE_MKSPECS)
+SPECS=$(find -L $SPECS_DIR | grep "qmake.conf" | grep -Ev "common|default" | grep "$1")
+
+SEDI="sed -i"
+if [ $(uname) == "Darwin" ]; then
+ # Mac OS X requires an extension, Linux will barf on it being present
+ SEDI='sed -i .backup'
+fi
+
+if [ ! -d tmp ]; then
+ mkdir tmp
+ touch tmp/empty.pro
+fi
+
+if [ ! -d specs ]; then
+ mkdir specs
+fi
+
+git checkout -- specs > /dev/null 2>&1
+
+cd tmp
+for spec in $SPECS; do
+ spec=$(echo $spec | sed "s|$SPECS_DIR/||" | sed "s|/qmake.conf||")
+ output_file=$(echo "$spec.txt" | sed "s|/|-|g")
+ echo "Dumping qmake variables for spec '$spec' to 'specs/$output_file'..."
+ qmake $QMAKE_ARGS -spec $spec empty.pro 2>&1 |
+ sed -n '/Dumping all variables/,$p' |
+ grep -Ev "(QMAKE_INTERNAL_INCLUDED_FILES|DISTFILES) ===" > ../specs/$output_file
+
+ if [ -n $QTDIR ]; then
+ $SEDI "s|$QTDIR|\$QTDIR|g" ../specs/$output_file
+ fi
+
+ if [ -n $QTSRCDIR ]; then
+ $SEDI "s|$QTSRCDIR|\$QTDIR|g" ../specs/$output_file
+ fi
+done
+cd ..
+
+rm -f specs/*.backup
+
+git diff --exit-code -- specs > /dev/null
+exit_code=$?
+
+if [ $exit_code -eq 0 ]; then
+ echo -e "\nNo diff produced (you did good)"
+else
+ # Show the resulting diff
+ git diff -- specs
+fi
+
+exit $exit_code
+
diff --git a/tests/manual/textrendering/glyphshaping/glyphshaping.pro b/tests/manual/textrendering/glyphshaping/glyphshaping.pro
index caa9028bc9..1d78aa3351 100644
--- a/tests/manual/textrendering/glyphshaping/glyphshaping.pro
+++ b/tests/manual/textrendering/glyphshaping/glyphshaping.pro
@@ -1,5 +1,5 @@
SOURCES = main.cpp
OTHER_FILES = glyphshaping_data.xml
glyphshaping_data.path = .
-glyphshaping_data.sources = $$PWD/glyphshaping_data.xml
+glyphshaping_data.files = $$PWD/glyphshaping_data.xml
DEPLOYMENT += glyphshaping_data
diff --git a/tests/shared/filesystem.h b/tests/shared/filesystem.h
index 18dac91d01..285ceb8de6 100644
--- a/tests/shared/filesystem.h
+++ b/tests/shared/filesystem.h
@@ -48,6 +48,18 @@
#include <QDir>
#include <QFile>
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#include <windows.h>
+#include <winioctl.h>
+#ifndef IO_REPARSE_TAG_MOUNT_POINT
+#define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L)
+#endif
+#define REPARSE_MOUNTPOINT_HEADER_SIZE 8
+#ifndef FSCTL_SET_REPARSE_POINT
+#define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
+#endif
+#endif
+
struct FileSystem
{
~FileSystem()
@@ -78,6 +90,16 @@ struct FileSystem
return false;
}
+ qint64 createFileWithContent(const QString &fileName)
+ {
+ QFile file(fileName);
+ if (file.open(QIODevice::WriteOnly)) {
+ createdFiles << fileName;
+ return file.write(fileName.toUtf8());
+ }
+ return -1;
+ }
+
bool createLink(const QString &destination, const QString &linkName)
{
if (QFile::link(destination, linkName)) {
@@ -86,6 +108,59 @@ struct FileSystem
}
return false;
}
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ static void createNtfsJunction(QString target, QString linkName)
+ {
+ typedef struct {
+ DWORD ReparseTag;
+ DWORD ReparseDataLength;
+ WORD Reserved;
+ WORD ReparseTargetLength;
+ WORD ReparseTargetMaximumLength;
+ WORD Reserved1;
+ WCHAR ReparseTarget[1];
+ } REPARSE_MOUNTPOINT_DATA_BUFFER, *PREPARSE_MOUNTPOINT_DATA_BUFFER;
+
+ char reparseBuffer[MAX_PATH*3];
+ HANDLE hFile;
+ DWORD returnedLength;
+ wchar_t fileSystem[MAX_PATH] = L"";
+ PREPARSE_MOUNTPOINT_DATA_BUFFER reparseInfo = (PREPARSE_MOUNTPOINT_DATA_BUFFER) reparseBuffer;
+
+ QFileInfo junctionInfo(linkName);
+ linkName = QDir::toNativeSeparators(junctionInfo.absoluteFilePath());
+
+ GetVolumeInformationW( (wchar_t*)linkName.left(3).utf16(), NULL, 0, NULL, NULL, NULL,
+ fileSystem, sizeof(fileSystem)/sizeof(WCHAR));
+ if(QString().fromWCharArray(fileSystem) != "NTFS")
+ QSKIP("This seems not to be an NTFS volume. Junctions are not allowed.",SkipSingle);
+
+ if (!target.startsWith("\\??\\") && !target.startsWith("\\\\?\\")) {
+ QFileInfo targetInfo(target);
+ target = QDir::toNativeSeparators(targetInfo.absoluteFilePath());
+ target.prepend("\\??\\");
+ if(target.endsWith('\\') && target.at(target.length()-2) != ':')
+ target.chop(1);
+ }
+ QDir().mkdir(linkName);
+ hFile = CreateFileW( (wchar_t*)linkName.utf16(), GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL );
+ QVERIFY(hFile != INVALID_HANDLE_VALUE );
+
+ memset( reparseInfo, 0, sizeof( *reparseInfo ));
+ reparseInfo->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
+ reparseInfo->ReparseTargetLength = target.size() * sizeof(wchar_t);
+ reparseInfo->ReparseTargetMaximumLength = reparseInfo->ReparseTargetLength + sizeof(wchar_t);
+ target.toWCharArray(reparseInfo->ReparseTarget);
+ reparseInfo->ReparseDataLength = reparseInfo->ReparseTargetLength + 12;
+
+ bool ioc = DeviceIoControl(hFile, FSCTL_SET_REPARSE_POINT, reparseInfo,
+ reparseInfo->ReparseDataLength + REPARSE_MOUNTPOINT_HEADER_SIZE,
+ NULL, 0, &returnedLength, NULL);
+ CloseHandle( hFile );
+ QVERIFY(ioc);
+ }
+#endif
private:
QDir currentDir;