diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-04-14 02:00:02 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-04-14 02:00:02 (GMT) |
commit | 071f008b7f41575de364baa606652ef54502d636 (patch) | |
tree | b3a6880e7f7351c60815219bc8c6dd79729b5b46 /tests | |
parent | 428317f83fd8b7a62244a446b76299de050d1325 (diff) | |
parent | a5ed6df017603118372f338d336c5e79f56886cd (diff) | |
download | Qt-071f008b7f41575de364baa606652ef54502d636.zip Qt-071f008b7f41575de364baa606652ef54502d636.tar.gz Qt-071f008b7f41575de364baa606652ef54502d636.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests')
4 files changed, 85 insertions, 271 deletions
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml new file mode 100644 index 0000000..052d96b --- /dev/null +++ b/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml @@ -0,0 +1,40 @@ +import Qt 4.6 + +Item { + width: 640 + height: 480 + Grid { + objectName: "grid" + columns: 0 + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "green" + width: 20 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 50 + height: 20 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp index 08eac0a..8692596 100644 --- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp +++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp @@ -63,6 +63,7 @@ private slots: void test_grid(); void test_grid_spacing(); void test_grid_animated(); + void test_grid_zero_columns(); void test_propertychanges(); void test_repeater(); void test_flow(); @@ -414,6 +415,38 @@ void tst_QDeclarativePositioners::test_grid_animated() QTRY_COMPARE(five->y(), 50.0); } + +void tst_QDeclarativePositioners::test_grid_zero_columns() +{ + QDeclarativeView *canvas = createView(SRCDIR "/data/gridzerocolumns.qml"); + + QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one"); + QVERIFY(one != 0); + QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two"); + QVERIFY(two != 0); + QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three"); + QVERIFY(three != 0); + QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four"); + QVERIFY(four != 0); + QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five"); + QVERIFY(five != 0); + + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(two->x(), 50.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(three->x(), 70.0); + QCOMPARE(three->y(), 0.0); + QCOMPARE(four->x(), 120.0); + QCOMPARE(four->y(), 0.0); + QCOMPARE(five->x(), 0.0); + QCOMPARE(five->y(), 50.0); + + QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid"); + QCOMPARE(grid->width(), 170.0); + QCOMPARE(grid->height(), 60.0); +} + void tst_QDeclarativePositioners::test_propertychanges() { QDeclarativeView *canvas = createView(SRCDIR "/data/propertychangestest.qml"); diff --git a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml index 7ac6f51..08ed609 100644 --- a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml +++ b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml @@ -6,274 +6,6 @@ VisualTest { } Frame { msec: 16 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 32 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 48 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 64 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 80 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 96 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 112 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 128 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 144 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 160 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 176 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 192 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 208 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 224 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 240 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 256 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 272 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 288 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 304 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 320 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 336 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 352 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 368 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 384 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 400 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 416 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 432 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 448 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 464 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 480 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 496 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 512 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 528 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 544 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 560 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 576 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 592 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 608 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 624 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 640 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 656 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 672 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 688 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 704 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Key { - type: 6 - key: 16777249 - modifiers: 0 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 720 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 736 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 752 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 768 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 784 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 800 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 816 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 832 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 848 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 864 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 880 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 896 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 912 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 928 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 944 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 960 image: "fillmode.0.png" - } - Frame { - msec: 976 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 992 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 1008 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 1024 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 1040 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } - Frame { - msec: 1056 - hash: "c8cb8d51ca04231dc272133faaf2fb6d" - } + } } diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp index 05c2ebd..718e3a6 100644 --- a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp +++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp @@ -47,7 +47,7 @@ #include <QProcess> #include <QFile> -enum Mode { Record, RecordNoVisuals, Play, TestVisuals, RemoveVisuals, UpdateVisuals, UpdatePlatformVisuals, Test }; +enum Mode { Record, RecordNoVisuals, RecordSnapshot, Play, TestVisuals, RemoveVisuals, UpdateVisuals, UpdatePlatformVisuals, Test }; static QString testdir; class tst_qmlvisual : public QObject @@ -133,7 +133,7 @@ void tst_qmlvisual::visual() QStringList arguments; arguments << "-script" << testdata << "-scriptopts" << "play,testimages,testerror,exitoncomplete,exitonfailure" - << file << "-graphicssystem" << "raster"; + << file; #ifdef Q_WS_QWS arguments << "-qws"; #endif @@ -246,6 +246,11 @@ void action(Mode mode, const QString &file) << "-scriptopts" << "record,saveonexit" << file; break; + case RecordSnapshot: + arguments << "-script" << testdata + << "-scriptopts" << "record,testimages,snapshot,saveonexit" + << file; + break; case Play: arguments << "-script" << testdata << "-scriptopts" << "play,testimages,testerror,exitoncomplete" @@ -283,6 +288,7 @@ void usage() fprintf(stderr, " -listtests : list all the tests seen by tst_qmlvisual, and then exit immediately\n"); fprintf(stderr, " -record file : record new test data for file\n"); fprintf(stderr, " -recordnovisuals file : record new test data for file, but ignore visuals\n"); + fprintf(stderr, " -recordsnapshot file : record new snapshot for file (like record but only records a single frame and then exits)\n"); fprintf(stderr, " -play file : playback test data for file, printing errors\n"); fprintf(stderr, " -testvisuals file : playback test data for file, without errors\n"); fprintf(stderr, " -updatevisuals file : playback test data for file, accept new visuals for file\n"); @@ -340,6 +346,9 @@ int main(int argc, char **argv) } else if (arg == "-recordnovisuals" && (ii + 1) < argc) { mode = RecordNoVisuals; file = argv[++ii]; + } else if (arg == "-recordsnapshot" && (ii + 1) < argc) { + mode = RecordSnapshot; + file = argv[++ii]; } else if (arg == "-testvisuals" && (ii + 1) < argc) { mode = TestVisuals; file = argv[++ii]; |