From df7dce62777fb953d26fcd30d6f56dc16c945ac0 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 8 May 2009 15:04:29 +1000 Subject: Autotest format conversion. --- .../auto/declarative/layouts/data/grid-margin.qml | 38 +++++++++ .../auto/declarative/layouts/data/grid-margin.xml | 9 --- .../layouts/data/grid-spacing-margin.qml | 39 +++++++++ .../layouts/data/grid-spacing-margin.xml | 9 --- .../auto/declarative/layouts/data/grid-spacing.qml | 38 +++++++++ .../auto/declarative/layouts/data/grid-spacing.xml | 9 --- tests/auto/declarative/layouts/data/grid.qml | 37 +++++++++ tests/auto/declarative/layouts/data/grid.xml | 9 --- .../declarative/layouts/data/horizontal-margin.qml | 25 ++++++ .../declarative/layouts/data/horizontal-margin.xml | 7 -- .../layouts/data/horizontal-spacing-margin.qml | 26 ++++++ .../layouts/data/horizontal-spacing-margin.xml | 7 -- .../layouts/data/horizontal-spacing.qml | 25 ++++++ .../layouts/data/horizontal-spacing.xml | 7 -- tests/auto/declarative/layouts/data/horizontal.qml | 24 ++++++ tests/auto/declarative/layouts/data/horizontal.xml | 7 -- .../declarative/layouts/data/vertical-margin.qml | 25 ++++++ .../declarative/layouts/data/vertical-margin.xml | 7 -- .../layouts/data/vertical-spacing-margin.qml | 26 ++++++ .../layouts/data/vertical-spacing-margin.xml | 7 -- .../declarative/layouts/data/vertical-spacing.qml | 25 ++++++ .../declarative/layouts/data/vertical-spacing.xml | 7 -- tests/auto/declarative/layouts/data/vertical.qml | 24 ++++++ tests/auto/declarative/layouts/data/vertical.xml | 7 -- tests/auto/declarative/layouts/tst_layouts.cpp | 24 +++--- tests/auto/declarative/listview/data/listview.qml | 39 +++++++++ tests/auto/declarative/listview/data/listview.xml | 14 ---- .../auto/declarative/namespaces/data/Red/Rect.qml | 2 - tests/auto/declarative/namespaces/namespaces.pro | 6 -- .../auto/declarative/namespaces/tst_namespaces.cpp | 94 ---------------------- tests/auto/declarative/pathview/data/pathview.qml | 60 ++++++++++++++ tests/auto/declarative/pathview/data/pathview.xml | 20 ----- .../qmlbindengine/tst_qmlbindengine.cpp | 12 +-- .../qmlmetaproperty/tst_qmlmetaproperty.cpp | 6 +- tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 64 +++++++-------- tests/auto/declarative/repeater/data/repeater.qml | 18 +++++ tests/auto/declarative/repeater/data/repeater.xml | 7 -- .../declarative/simplecanvasitem/data/test.qml | 58 +++++++++++++ .../declarative/simplecanvasitem/data/test.xml | 12 --- .../simplecanvasitem/tst_simplecanvasitem.cpp | 4 +- 40 files changed, 582 insertions(+), 302 deletions(-) create mode 100644 tests/auto/declarative/layouts/data/grid-margin.qml delete mode 100644 tests/auto/declarative/layouts/data/grid-margin.xml create mode 100644 tests/auto/declarative/layouts/data/grid-spacing-margin.qml delete mode 100644 tests/auto/declarative/layouts/data/grid-spacing-margin.xml create mode 100644 tests/auto/declarative/layouts/data/grid-spacing.qml delete mode 100644 tests/auto/declarative/layouts/data/grid-spacing.xml create mode 100644 tests/auto/declarative/layouts/data/grid.qml delete mode 100644 tests/auto/declarative/layouts/data/grid.xml create mode 100644 tests/auto/declarative/layouts/data/horizontal-margin.qml delete mode 100644 tests/auto/declarative/layouts/data/horizontal-margin.xml create mode 100644 tests/auto/declarative/layouts/data/horizontal-spacing-margin.qml delete mode 100644 tests/auto/declarative/layouts/data/horizontal-spacing-margin.xml create mode 100644 tests/auto/declarative/layouts/data/horizontal-spacing.qml delete mode 100644 tests/auto/declarative/layouts/data/horizontal-spacing.xml create mode 100644 tests/auto/declarative/layouts/data/horizontal.qml delete mode 100644 tests/auto/declarative/layouts/data/horizontal.xml create mode 100644 tests/auto/declarative/layouts/data/vertical-margin.qml delete mode 100644 tests/auto/declarative/layouts/data/vertical-margin.xml create mode 100644 tests/auto/declarative/layouts/data/vertical-spacing-margin.qml delete mode 100644 tests/auto/declarative/layouts/data/vertical-spacing-margin.xml create mode 100644 tests/auto/declarative/layouts/data/vertical-spacing.qml delete mode 100644 tests/auto/declarative/layouts/data/vertical-spacing.xml create mode 100644 tests/auto/declarative/layouts/data/vertical.qml delete mode 100644 tests/auto/declarative/layouts/data/vertical.xml create mode 100644 tests/auto/declarative/listview/data/listview.qml delete mode 100644 tests/auto/declarative/listview/data/listview.xml delete mode 100644 tests/auto/declarative/namespaces/data/Red/Rect.qml delete mode 100644 tests/auto/declarative/namespaces/namespaces.pro delete mode 100644 tests/auto/declarative/namespaces/tst_namespaces.cpp create mode 100644 tests/auto/declarative/pathview/data/pathview.qml delete mode 100644 tests/auto/declarative/pathview/data/pathview.xml create mode 100644 tests/auto/declarative/repeater/data/repeater.qml delete mode 100644 tests/auto/declarative/repeater/data/repeater.xml create mode 100644 tests/auto/declarative/simplecanvasitem/data/test.qml delete mode 100644 tests/auto/declarative/simplecanvasitem/data/test.xml diff --git a/tests/auto/declarative/layouts/data/grid-margin.qml b/tests/auto/declarative/layouts/data/grid-margin.qml new file mode 100644 index 0000000..bae47f9 --- /dev/null +++ b/tests/auto/declarative/layouts/data/grid-margin.qml @@ -0,0 +1,38 @@ +Item { + width: 640 + height: 480 + GridLayout { + columns: 3 + margin: 8 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "green" + width: 20 + height: 50 + } + Rect { + id: three + color: "blue" + width: 50 + height: 20 + } + Rect { + id: four + color: "cyan" + width: 50 + height: 50 + } + Rect { + id: five + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/declarative/layouts/data/grid-margin.xml b/tests/auto/declarative/layouts/data/grid-margin.xml deleted file mode 100644 index fe58eef..0000000 --- a/tests/auto/declarative/layouts/data/grid-margin.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/auto/declarative/layouts/data/grid-spacing-margin.qml b/tests/auto/declarative/layouts/data/grid-spacing-margin.qml new file mode 100644 index 0000000..100d8c5 --- /dev/null +++ b/tests/auto/declarative/layouts/data/grid-spacing-margin.qml @@ -0,0 +1,39 @@ +Item { + width: 640 + height: 480 + GridLayout { + columns: 3 + spacing: 4 + margin: 8 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "green" + width: 20 + height: 50 + } + Rect { + id: three + color: "blue" + width: 50 + height: 20 + } + Rect { + id: four + color: "cyan" + width: 50 + height: 50 + } + Rect { + id: five + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/declarative/layouts/data/grid-spacing-margin.xml b/tests/auto/declarative/layouts/data/grid-spacing-margin.xml deleted file mode 100644 index 807b653..0000000 --- a/tests/auto/declarative/layouts/data/grid-spacing-margin.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/auto/declarative/layouts/data/grid-spacing.qml b/tests/auto/declarative/layouts/data/grid-spacing.qml new file mode 100644 index 0000000..494127b --- /dev/null +++ b/tests/auto/declarative/layouts/data/grid-spacing.qml @@ -0,0 +1,38 @@ +Item { + width: 640 + height: 480 + GridLayout { + columns: 3 + spacing: 4 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "green" + width: 20 + height: 50 + } + Rect { + id: three + color: "blue" + width: 50 + height: 20 + } + Rect { + id: four + color: "cyan" + width: 50 + height: 50 + } + Rect { + id: five + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/declarative/layouts/data/grid-spacing.xml b/tests/auto/declarative/layouts/data/grid-spacing.xml deleted file mode 100644 index 55ef5a5..0000000 --- a/tests/auto/declarative/layouts/data/grid-spacing.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/auto/declarative/layouts/data/grid.qml b/tests/auto/declarative/layouts/data/grid.qml new file mode 100644 index 0000000..598915f --- /dev/null +++ b/tests/auto/declarative/layouts/data/grid.qml @@ -0,0 +1,37 @@ +Item { + width: 640 + height: 480 + GridLayout { + columns: 3 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "green" + width: 20 + height: 50 + } + Rect { + id: three + color: "blue" + width: 50 + height: 20 + } + Rect { + id: four + color: "cyan" + width: 50 + height: 50 + } + Rect { + id: five + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/declarative/layouts/data/grid.xml b/tests/auto/declarative/layouts/data/grid.xml deleted file mode 100644 index abef813..0000000 --- a/tests/auto/declarative/layouts/data/grid.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/auto/declarative/layouts/data/horizontal-margin.qml b/tests/auto/declarative/layouts/data/horizontal-margin.qml new file mode 100644 index 0000000..8bf2329 --- /dev/null +++ b/tests/auto/declarative/layouts/data/horizontal-margin.qml @@ -0,0 +1,25 @@ +Item { + width: 640 + height: 480 + HorizontalLayout { + margin: 10 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "red" + width: 20 + height: 10 + } + Rect { + id: three + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/declarative/layouts/data/horizontal-margin.xml b/tests/auto/declarative/layouts/data/horizontal-margin.xml deleted file mode 100644 index 7ee9706..0000000 --- a/tests/auto/declarative/layouts/data/horizontal-margin.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing-margin.qml b/tests/auto/declarative/layouts/data/horizontal-spacing-margin.qml new file mode 100644 index 0000000..79652f6 --- /dev/null +++ b/tests/auto/declarative/layouts/data/horizontal-spacing-margin.qml @@ -0,0 +1,26 @@ +Item { + width: 640 + height: 480 + HorizontalLayout { + spacing: 5 + margin: 10 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "red" + width: 20 + height: 10 + } + Rect { + id: three + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing-margin.xml b/tests/auto/declarative/layouts/data/horizontal-spacing-margin.xml deleted file mode 100644 index 8767818..0000000 --- a/tests/auto/declarative/layouts/data/horizontal-spacing-margin.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing.qml b/tests/auto/declarative/layouts/data/horizontal-spacing.qml new file mode 100644 index 0000000..5130e4a --- /dev/null +++ b/tests/auto/declarative/layouts/data/horizontal-spacing.qml @@ -0,0 +1,25 @@ +Item { + width: 640 + height: 480 + HorizontalLayout { + spacing: 10 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "red" + width: 20 + height: 10 + } + Rect { + id: three + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing.xml b/tests/auto/declarative/layouts/data/horizontal-spacing.xml deleted file mode 100644 index cb58711..0000000 --- a/tests/auto/declarative/layouts/data/horizontal-spacing.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/layouts/data/horizontal.qml b/tests/auto/declarative/layouts/data/horizontal.qml new file mode 100644 index 0000000..7ad6b55 --- /dev/null +++ b/tests/auto/declarative/layouts/data/horizontal.qml @@ -0,0 +1,24 @@ +Item { + width: 640 + height: 480 + HorizontalLayout { + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "red" + width: 20 + height: 10 + } + Rect { + id: three + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/declarative/layouts/data/horizontal.xml b/tests/auto/declarative/layouts/data/horizontal.xml deleted file mode 100644 index f9deaf1..0000000 --- a/tests/auto/declarative/layouts/data/horizontal.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/layouts/data/vertical-margin.qml b/tests/auto/declarative/layouts/data/vertical-margin.qml new file mode 100644 index 0000000..ad34906 --- /dev/null +++ b/tests/auto/declarative/layouts/data/vertical-margin.qml @@ -0,0 +1,25 @@ +Item { + width: 640 + height: 480 + VerticalLayout { + margin: 10 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "red" + width: 20 + height: 10 + } + Rect { + id: three + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/declarative/layouts/data/vertical-margin.xml b/tests/auto/declarative/layouts/data/vertical-margin.xml deleted file mode 100644 index abd7635..0000000 --- a/tests/auto/declarative/layouts/data/vertical-margin.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/layouts/data/vertical-spacing-margin.qml b/tests/auto/declarative/layouts/data/vertical-spacing-margin.qml new file mode 100644 index 0000000..5de50b3 --- /dev/null +++ b/tests/auto/declarative/layouts/data/vertical-spacing-margin.qml @@ -0,0 +1,26 @@ +Item { + width: 640 + height: 480 + VerticalLayout { + spacing: 5 + margin: 10 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "red" + width: 20 + height: 10 + } + Rect { + id: three + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/declarative/layouts/data/vertical-spacing-margin.xml b/tests/auto/declarative/layouts/data/vertical-spacing-margin.xml deleted file mode 100644 index 3d41ca0..0000000 --- a/tests/auto/declarative/layouts/data/vertical-spacing-margin.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/layouts/data/vertical-spacing.qml b/tests/auto/declarative/layouts/data/vertical-spacing.qml new file mode 100644 index 0000000..c364e3f --- /dev/null +++ b/tests/auto/declarative/layouts/data/vertical-spacing.qml @@ -0,0 +1,25 @@ +Item { + width: 640 + height: 480 + VerticalLayout { + spacing: 10 + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "red" + width: 20 + height: 10 + } + Rect { + id: three + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/declarative/layouts/data/vertical-spacing.xml b/tests/auto/declarative/layouts/data/vertical-spacing.xml deleted file mode 100644 index e25f981..0000000 --- a/tests/auto/declarative/layouts/data/vertical-spacing.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/layouts/data/vertical.qml b/tests/auto/declarative/layouts/data/vertical.qml new file mode 100644 index 0000000..50931cd --- /dev/null +++ b/tests/auto/declarative/layouts/data/vertical.qml @@ -0,0 +1,24 @@ +Item { + width: 640 + height: 480 + VerticalLayout { + Rect { + id: one + color: "red" + width: 50 + height: 50 + } + Rect { + id: two + color: "red" + width: 20 + height: 10 + } + Rect { + id: three + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/declarative/layouts/data/vertical.xml b/tests/auto/declarative/layouts/data/vertical.xml deleted file mode 100644 index 198d99f..0000000 --- a/tests/auto/declarative/layouts/data/vertical.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index 3fc4678..732551c 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -36,7 +36,7 @@ tst_QFxLayouts::tst_QFxLayouts() void tst_QFxLayouts::test_horizontal() { - QFxView *canvas = createView(SRCDIR "/data/horizontal.xml"); + QFxView *canvas = createView(SRCDIR "/data/horizontal.qml"); canvas->execute(); qApp->processEvents(); @@ -60,7 +60,7 @@ void tst_QFxLayouts::test_horizontal() void tst_QFxLayouts::test_horizontal_spacing() { - QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing.xml"); + QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing.qml"); canvas->execute(); qApp->processEvents(); @@ -84,7 +84,7 @@ void tst_QFxLayouts::test_horizontal_spacing() void tst_QFxLayouts::test_horizontal_margin() { - QFxView *canvas = createView(SRCDIR "/data/horizontal-margin.xml"); + QFxView *canvas = createView(SRCDIR "/data/horizontal-margin.qml"); canvas->execute(); qApp->processEvents(); @@ -108,7 +108,7 @@ void tst_QFxLayouts::test_horizontal_margin() void tst_QFxLayouts::test_horizontal_spacing_margin() { - QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing-margin.xml"); + QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing-margin.qml"); canvas->execute(); qApp->processEvents(); @@ -132,7 +132,7 @@ void tst_QFxLayouts::test_horizontal_spacing_margin() void tst_QFxLayouts::test_vertical() { - QFxView *canvas = createView(SRCDIR "/data/vertical.xml"); + QFxView *canvas = createView(SRCDIR "/data/vertical.qml"); canvas->execute(); qApp->processEvents(); @@ -156,7 +156,7 @@ void tst_QFxLayouts::test_vertical() void tst_QFxLayouts::test_vertical_spacing() { - QFxView *canvas = createView(SRCDIR "/data/vertical-spacing.xml"); + QFxView *canvas = createView(SRCDIR "/data/vertical-spacing.qml"); canvas->execute(); qApp->processEvents(); @@ -180,7 +180,7 @@ void tst_QFxLayouts::test_vertical_spacing() void tst_QFxLayouts::test_vertical_margin() { - QFxView *canvas = createView(SRCDIR "/data/vertical-margin.xml"); + QFxView *canvas = createView(SRCDIR "/data/vertical-margin.qml"); canvas->execute(); qApp->processEvents(); @@ -204,7 +204,7 @@ void tst_QFxLayouts::test_vertical_margin() void tst_QFxLayouts::test_vertical_spacing_margin() { - QFxView *canvas = createView(SRCDIR "/data/vertical-spacing-margin.xml"); + QFxView *canvas = createView(SRCDIR "/data/vertical-spacing-margin.qml"); canvas->execute(); qApp->processEvents(); @@ -228,7 +228,7 @@ void tst_QFxLayouts::test_vertical_spacing_margin() void tst_QFxLayouts::test_grid() { - QFxView *canvas = createView("data/grid.xml"); + QFxView *canvas = createView("data/grid.qml"); canvas->execute(); qApp->processEvents(); @@ -258,7 +258,7 @@ void tst_QFxLayouts::test_grid() void tst_QFxLayouts::test_grid_spacing() { - QFxView *canvas = createView("data/grid-spacing.xml"); + QFxView *canvas = createView("data/grid-spacing.qml"); canvas->execute(); qApp->processEvents(); @@ -288,7 +288,7 @@ void tst_QFxLayouts::test_grid_spacing() void tst_QFxLayouts::test_grid_margin() { - QFxView *canvas = createView("data/grid-margin.xml"); + QFxView *canvas = createView("data/grid-margin.qml"); canvas->execute(); qApp->processEvents(); @@ -319,7 +319,7 @@ void tst_QFxLayouts::test_grid_margin() void tst_QFxLayouts::test_grid_spacing_margin() { - QFxView *canvas = createView("data/grid-spacing-margin.xml"); + QFxView *canvas = createView("data/grid-spacing-margin.qml"); canvas->execute(); qApp->processEvents(); diff --git a/tests/auto/declarative/listview/data/listview.qml b/tests/auto/declarative/listview/data/listview.qml new file mode 100644 index 0000000..891f9a8 --- /dev/null +++ b/tests/auto/declarative/listview/data/listview.qml @@ -0,0 +1,39 @@ +Rect { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: Delegate + Item { + id: wrapper + height: 20 + width: 240 + Text { + text: index + } + Text { + x: 30 + id: textName + text: name + } + Text { + x: 120 + id: textNumber + text: number + } + Text { + x: 200 + text: wrapper.y + } + } + } + ] + ListView { + id: list + width: 240 + height: 320 + model: testModel + delegate: Delegate + } +} diff --git a/tests/auto/declarative/listview/data/listview.xml b/tests/auto/declarative/listview/data/listview.xml deleted file mode 100644 index 7fda2b5..0000000 --- a/tests/auto/declarative/listview/data/listview.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/tests/auto/declarative/namespaces/data/Red/Rect.qml b/tests/auto/declarative/namespaces/data/Red/Rect.qml deleted file mode 100644 index c7b3d8c..0000000 --- a/tests/auto/declarative/namespaces/data/Red/Rect.qml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/auto/declarative/namespaces/namespaces.pro b/tests/auto/declarative/namespaces/namespaces.pro deleted file mode 100644 index f232770..0000000 --- a/tests/auto/declarative/namespaces/namespaces.pro +++ /dev/null @@ -1,6 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_namespaces.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/namespaces/tst_namespaces.cpp b/tests/auto/declarative/namespaces/tst_namespaces.cpp deleted file mode 100644 index e9529ff..0000000 --- a/tests/auto/declarative/namespaces/tst_namespaces.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -class tst_namespaces : public QObject - -{ - Q_OBJECT -public: - tst_namespaces(); - -private slots: - void simple(); - void simple_data(); -}; - -tst_namespaces::tst_namespaces() -{ -} - -void tst_namespaces::simple_data() -{ - QTest::addColumn("qml"); - QTest::addColumn("valid"); - QTest::addColumn("texts"); - QTest::addColumn("rects"); - - QTest::newRow("Control") << - "" - "" - "" - << true << "" << "ab"; - - QTest::newRow("Control2") << - "" - "" - "" - << true << "b" << "a"; - - QTest::newRow("Replace builtin") << - "" - "" - "" - << true << "b" << "a"; -} - -void tst_namespaces::simple() -{ - QFETCH(QString, qml); - QFETCH(bool, valid); - QFETCH(QString, texts); - QFETCH(QString, rects); - - QFxView canvas(0); - canvas.rootContext()->engine()->addNameSpacePath("http://nokia.com/qml", SRCDIR "/data"); - canvas.setQml(qml); - canvas.execute(); - qApp->processEvents(); - - QFxItem *testObject = qobject_cast(canvas.root()); - - QCOMPARE((testObject != 0),valid); - - if (valid && testObject != 0) { - QString textids; - QList textobjects = testObject->findChildren(); - if (qobject_cast(testObject)) - textids += testObject->objectName(); - foreach (QFxText *obj, textobjects) { - textids += obj->objectName(); - } - if (textids != texts) - testObject->dump(); - QCOMPARE(textids,texts); - - QString rectids; - QList rectobjects = testObject->findChildren(); - if (qobject_cast(testObject)) - rectids += testObject->objectName(); - foreach (QFxRect *obj, rectobjects) - rectids += obj->objectName(); - if (rectids != rects) - testObject->dump(); - QCOMPARE(rectids,rects); - } -} - -QTEST_MAIN(tst_namespaces) - -#include "tst_namespaces.moc" diff --git a/tests/auto/declarative/pathview/data/pathview.qml b/tests/auto/declarative/pathview/data/pathview.qml new file mode 100644 index 0000000..0fec1e9 --- /dev/null +++ b/tests/auto/declarative/pathview/data/pathview.qml @@ -0,0 +1,60 @@ +Rect { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: Delegate + Rect { + id: wrapper + height: 20 + width: 60 + color: "white" + pen.color: "black" + Text { + text: index + } + Text { + x: 20 + id: textName + text: name + } + Text { + x: 40 + id: textNumber + text: number + } + } + } + ] + PathView { + id: view + width: 240 + height: 320 + model: testModel + delegate: Delegate + snapPos: 0.01 + path: Path { + startY: 120 + startX: 160 + PathQuad { + y: 120 + x: 80 + controlY: 330 + controlX: 100 + } + PathLine { + y: 160 + x: 20 + } + PathCubic { + y: 120 + x: 160 + control1Y: 0 + control1X: 100 + control2Y: 000 + control2X: 200 + } + } + } +} diff --git a/tests/auto/declarative/pathview/data/pathview.xml b/tests/auto/declarative/pathview/data/pathview.xml deleted file mode 100644 index 26b426c..0000000 --- a/tests/auto/declarative/pathview/data/pathview.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp index f5b32e8..0875690 100644 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp @@ -59,13 +59,13 @@ private: void tst_qmlbindengine::boolPropertiesEvaluateAsBool() { { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { stringProperty: trueProperty?'pass':'fail' }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->stringProperty(), QLatin1String("pass")); } { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { stringProperty: falseProperty?'fail':'pass' }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->stringProperty(), QLatin1String("pass")); @@ -75,7 +75,7 @@ void tst_qmlbindengine::boolPropertiesEvaluateAsBool() void tst_qmlbindengine::signalAssignment() { { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { onBasicSignal: setString('pass') }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->string(), QString()); @@ -84,7 +84,7 @@ void tst_qmlbindengine::signalAssignment() } { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c) }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->string(), QString()); @@ -96,7 +96,7 @@ void tst_qmlbindengine::signalAssignment() void tst_qmlbindengine::methods() { { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { id: MyObject; onBasicSignal: MyObject.method() }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->methodCalled(), false); @@ -107,7 +107,7 @@ void tst_qmlbindengine::methods() } { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { id: MyObject; onBasicSignal: MyObject.method(163) }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->methodCalled(), false); diff --git a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp index 1163dda..e35a006 100644 --- a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp +++ b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp @@ -52,7 +52,7 @@ private: void tst_QmlMetaProperty::writeObjectToList() { - QmlComponent containerComponent(&engine, ""); + QmlComponent containerComponent(&engine, "MyContainer { children: MyQmlObject {} }"); MyContainer *container = qobject_cast(containerComponent.create()); QVERIFY(container != 0); QVERIFY(container->children()->size() == 1); @@ -67,7 +67,7 @@ void tst_QmlMetaProperty::writeObjectToList() Q_DECLARE_METATYPE(QList); void tst_QmlMetaProperty::writeListToList() { - QmlComponent containerComponent(&engine, ""); + QmlComponent containerComponent(&engine, "MyContainer { children: MyQmlObject {} }"); MyContainer *container = qobject_cast(containerComponent.create()); QVERIFY(container != 0); QVERIFY(container->children()->size() == 1); @@ -87,7 +87,7 @@ void tst_QmlMetaProperty::writeListToList() void tst_QmlMetaProperty::writeObjectToQmlList() { - QmlComponent containerComponent(&engine, ""); + QmlComponent containerComponent(&engine, "MyContainer { qmlChildren: MyQmlObject {} }"); MyContainer *container = qobject_cast(containerComponent.create()); QVERIFY(container != 0); QVERIFY(container->qmlChildren()->size() == 1); diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index 24d3c22..96f6f4f 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -147,13 +147,13 @@ private slots: //void readWriteDotProperty(); void emptyInput(); void missingObject(); - void invalidXML(); + //void invalidXML(); void duplicateIDs(); void invalidID(); void interfaceProperty(); void interfaceQmlList(); void interfaceQList(); - void cannotAssignBindingToSignal(); + //void cannotAssignBindingToSignal(); void assignObjectToSignal(); private: @@ -162,14 +162,14 @@ private: void tst_qmlparser::simpleObject() { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject {}"); QObject *object = component.create(); QVERIFY(object != 0); } void tst_qmlparser::simpleContainer() { - QmlComponent component(&engine, "\n\n\n"); + QmlComponent component(&engine, "MyContainer {\nMyQmlObject{}\nMyQmlObject{}\n}"); MyContainer *container= qobject_cast(component.create()); QVERIFY(container != 0); QCOMPARE(container->children()->count(),2); @@ -177,7 +177,7 @@ void tst_qmlparser::simpleContainer() void tst_qmlparser::unregisteredObject() { - QmlComponent component(&engine, "", QUrl("myprogram.qml")); + QmlComponent component(&engine, "UnRegisteredObject {}", QUrl("myprogram.qml")); QTest::ignoreMessage(QtWarningMsg, "Unable to create object of type 'UnRegisteredObject' @myprogram.qml:1"); QObject *object = component.create(); QVERIFY(object == 0); @@ -187,14 +187,14 @@ void tst_qmlparser::nonexistantProperty() { //NOTE: these first 3 should all have the same error message { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { something: 24 }"); QTest::ignoreMessage(QtWarningMsg, "Unknown property 'something' @:1"); QObject *object = component.create(); QVERIFY(object == 0); } { - QmlComponent component(&engine, "\n24\n"); + QmlComponent component(&engine, "MyQmlObject {\n something: 24\n}"); QTest::ignoreMessage(QtWarningMsg, "Unknown property 'something' @:2"); QObject *object = component.create(); QVERIFY(object == 0); @@ -202,21 +202,21 @@ void tst_qmlparser::nonexistantProperty() //non-existant using binding { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { something: 1 + 1 }"); QTest::ignoreMessage(QtWarningMsg, "Unknown property 'something' @:1"); QObject *object = component.create(); QVERIFY(object == 0); } { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { something: }"); QObject *object = component.create(); QVERIFY(object != 0); } //non-existant value-type default property { - QmlComponent component(&engine, "\n24\n"); + QmlComponent component(&engine, "MyQmlObject {\n24\n}"); QTest::ignoreMessage(QtWarningMsg, "Unable to resolve default property @:3"); // XXX would 2 be a better line number in this case? Message should also be improved. QObject *object = component.create(); @@ -225,7 +225,7 @@ void tst_qmlparser::nonexistantProperty() //non-existant object-type default property { - QmlComponent component(&engine, "\n\n"); + QmlComponent component(&engine, "MyQmlObject {\nMyQmlObject{}\n}"); QTest::ignoreMessage(QtWarningMsg, "Unable to assign to non-existant property @:2"); // XXX Message needs to be improved (and should be closer to value-type message). QObject *object = component.create(); @@ -236,7 +236,7 @@ void tst_qmlparser::nonexistantProperty() void tst_qmlparser::unsupportedProperty() { QTest::ignoreMessage(QtWarningMsg, "Property 'matrix' is of an unknown type @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { matrix: \"1,0,0,0,1,0,0,0,1\" }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object == 0); } @@ -246,7 +246,7 @@ void tst_qmlparser::wrongType() //string for int { QTest::ignoreMessage(QtWarningMsg, "Can't assign value 'hello' to property 'value' @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { value: \"hello\" }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object == 0); } @@ -254,7 +254,7 @@ void tst_qmlparser::wrongType() //int for bool { QTest::ignoreMessage(QtWarningMsg, "Can't assign value '5' to property 'enabled' @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { enabled: 5 }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object == 0); } @@ -262,7 +262,7 @@ void tst_qmlparser::wrongType() //bad format for rect { QTest::ignoreMessage(QtWarningMsg, "Can't assign value '5,5x10' to property 'rect' @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { rect: \"5,5x10\" }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object == 0); } @@ -274,14 +274,14 @@ void tst_qmlparser::readOnly() { { QTest::ignoreMessage(QtWarningMsg, "Can't assign value 'hello' to property 'readOnlyString' because 'readOnlyString' is read-only @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { readOnlyString: \"hello\" }"); QObject *object = component.create(); QVERIFY(object == 0); } { QTest::ignoreMessage(QtWarningMsg, "Can't assign a binding to property 'readOnlyString' because 'readOnlyString' is read-only @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { readOnlyString: {'hello'} }"); QObject *object = component.create(); QVERIFY(object == 0); } @@ -290,7 +290,7 @@ void tst_qmlparser::readOnly() void tst_qmlparser::nullDotProperty() { QTest::ignoreMessage(QtWarningMsg, "Can't set properties on 'obj' because it is null @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyDotPropertyObject { obj.value: 1 }"); QObject *object = component.create(); QVERIFY(object == 0); } @@ -298,7 +298,7 @@ void tst_qmlparser::nullDotProperty() void tst_qmlparser::fakeDotProperty() { QTest::ignoreMessage(QtWarningMsg, "Can't set properties on 'value' because it isn't a known object type @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { value.something: \"hello\" }"); QObject *object = component.create(); QVERIFY(object == 0); } @@ -306,13 +306,13 @@ void tst_qmlparser::fakeDotProperty() //XXX need to define correct behavior first /*void tst_qmlparser::readWriteDotProperty() { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyDotPropertyObject { readWriteObj.value: 1 }"); MyDotPropertyObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->readWriteObj()->value(),1); { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyContainer { MyQmlObject { id: Obj value: 1 } MyDotPropertyObject { readWriteObj: Obj } }"); MyContainer *object = qobject_cast(component.create()); QVERIFY(object != 0); MyDotPropertyObject *dpo = qobject_cast(object->children()->at(1)); @@ -333,13 +333,13 @@ void tst_qmlparser::missingObject() { QTest::ignoreMessage(QtCriticalMsg, "Can't have a property with no object @:1"); QTest::ignoreMessage(QtWarningMsg, "Can't compile because of earlier errors @:-1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "something:"); QObject *object = component.create(); QVERIFY(object == 0); } -void tst_qmlparser::invalidXML() +/*void tst_qmlparser::invalidXML() { //extra stuff on end { @@ -375,12 +375,12 @@ void tst_qmlparser::invalidXML() QVERIFY(object == 0); } -} +}*/ void tst_qmlparser::duplicateIDs() { QTest::ignoreMessage(QtWarningMsg, "An id (\"MyID\") is not unique within its scope. @:3"); - QmlComponent component(&engine, "\n\n\n"); + QmlComponent component(&engine, "MyContainer {\nMyQmlObject { id: MyID }\nMyQmlObject { id: MyID }\n}"); QObject *object = component.create(); QVERIFY(object == 0); } @@ -388,14 +388,14 @@ void tst_qmlparser::duplicateIDs() void tst_qmlparser::invalidID() { QTest::ignoreMessage(QtWarningMsg, "'1' is not a valid id @:1"); - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { id: 1 }"); QObject *object = component.create(); QVERIFY(object == 0); } void tst_qmlparser::interfaceProperty() { - QmlComponent component(&engine, "\n\n"); + QmlComponent component(&engine, "MyQmlObject { interface: MyQmlObject }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QVERIFY(object->interface()); @@ -404,7 +404,7 @@ void tst_qmlparser::interfaceProperty() void tst_qmlparser::interfaceQmlList() { - QmlComponent component(&engine, "\n\n\n\n"); + QmlComponent component(&engine, "MyContainer { qmllistInterfaces: MyQmlObject {} }"); MyContainer *container= qobject_cast(component.create()); QVERIFY(container != 0); QVERIFY(container->qmllistAccessor().count() == 2); @@ -414,7 +414,7 @@ void tst_qmlparser::interfaceQmlList() void tst_qmlparser::interfaceQList() { - QmlComponent component(&engine, "\n\n\n\n"); + QmlComponent component(&engine, "MyContainer { qlistInterfaces: MyQmlObject {} }"); MyContainer *container= qobject_cast(component.create()); QVERIFY(container != 0); QVERIFY(container->qlistInterfaces()->count() == 2); @@ -422,17 +422,17 @@ void tst_qmlparser::interfaceQList() QVERIFY(container->qlistInterfaces()->at(ii)->id == 913); } -void tst_qmlparser::cannotAssignBindingToSignal() +/*void tst_qmlparser::cannotAssignBindingToSignal() { QTest::ignoreMessage(QtWarningMsg, "Cannot assign binding to signal property @:1"); QmlComponent component(&engine, ""); MyContainer *container= qobject_cast(component.create()); QVERIFY(container == 0); -} +}*/ void tst_qmlparser::assignObjectToSignal() { - QmlComponent component(&engine, ""); + QmlComponent component(&engine, "MyQmlObject { onBasicSignal: MyQmlObject {} }"); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot"); diff --git a/tests/auto/declarative/repeater/data/repeater.qml b/tests/auto/declarative/repeater/data/repeater.qml new file mode 100644 index 0000000..2498646 --- /dev/null +++ b/tests/auto/declarative/repeater/data/repeater.qml @@ -0,0 +1,18 @@ +Rect { + id: container + width: 240 + height: 320 + color: "white" + Repeater { + id: repeater + width: 240 + height: 320 + dataSource: testData + Component { + Text { + y: index*20 + text: modelData + } + } + } +} diff --git a/tests/auto/declarative/repeater/data/repeater.xml b/tests/auto/declarative/repeater/data/repeater.xml deleted file mode 100644 index f863716..0000000 --- a/tests/auto/declarative/repeater/data/repeater.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/auto/declarative/simplecanvasitem/data/test.qml b/tests/auto/declarative/simplecanvasitem/data/test.qml new file mode 100644 index 0000000..d206a6b --- /dev/null +++ b/tests/auto/declarative/simplecanvasitem/data/test.qml @@ -0,0 +1,58 @@ +Item { + width: 320 + height: 480 + Rect { + color: "blue" + x: 20 + y: 20 + width: 20 + height: 20 + Rect { + color: "black" + x: 20 + y: 20 + width: 10 + height: 10 + } + } + Rect { + color: "red" + x: 40 + y: 20 + width: 20 + height: 20 + } + Rect { + color: "green" + x: 60 + y: 20 + width: 20 + height: 20 + } + Rect { + color: "yellow" + x: 20 + y: 40 + width: 20 + height: 20 + } + Rect { + color: "purple" + x: 20 + y: 60 + width: 20 + height: 20 + } + Rect { + color: "white" + x: 40 + y: 40 + width: 20 + height: 20 + } + Rect { + anchors.fill: parent + color: "gray" + z: -1 + } +} diff --git a/tests/auto/declarative/simplecanvasitem/data/test.xml b/tests/auto/declarative/simplecanvasitem/data/test.xml deleted file mode 100644 index 9b8f10a..0000000 --- a/tests/auto/declarative/simplecanvasitem/data/test.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp b/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp index 4098a28..cce4df1 100644 --- a/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp +++ b/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp @@ -26,7 +26,7 @@ tst_SimpleCanvasItem::tst_SimpleCanvasItem() void tst_SimpleCanvasItem::test_pos() { - QFxView *canvas = createView(SRCDIR "/data/test.xml"); + QFxView *canvas = createView(SRCDIR "/data/test.qml"); canvas->execute(); qApp->processEvents(); QSimpleCanvasItem* root = qobject_cast(canvas->root()); @@ -42,7 +42,7 @@ void tst_SimpleCanvasItem::test_pos() void tst_SimpleCanvasItem::test_scenePos() { - QFxView *canvas = createView(SRCDIR "/data/test.xml"); + QFxView *canvas = createView(SRCDIR "/data/test.qml"); canvas->execute(); qApp->processEvents(); QSimpleCanvasItem* root = qobject_cast(canvas->root()); -- cgit v0.12