summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/anchors/tst_anchors.cpp
blob: 7d920af4dcd333602134b4b3ff7027b3ad399490 (plain)
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
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
52
#include <qtest.h>
#include <QtDeclarative/qmlengine.h>
#include <QtDeclarative/qmlcomponent.h>
#include <QtDeclarative/qfxview.h>
#include <QtDeclarative/qfximage.h>
#include <QtDeclarative/qfxtext.h>

class tst_anchors : public QObject
{
    Q_OBJECT
public:
    tst_anchors() {}

private slots:
    void loops();
};

// mostly testing that we don't crash
void tst_anchors::loops()
{
    {
        QFxView *view = new QFxView;

        view->setUrl(QUrl("file://" SRCDIR "/data/loop1.qml"));

        //### ignoreMessage doesn't seem to work
        //QTest::ignoreMessage(QtWarningMsg, "QML QFxText (unknown location): Anchor loop detected on horizontal anchor.");
        //QTest::ignoreMessage(QtWarningMsg, "QML QFxText (unknown location): Anchor loop detected on horizontal anchor.");
        view->execute();
        qApp->processEvents();

        delete view;
    }

    {
        QFxView *view = new QFxView;

        view->setUrl(QUrl("file://" SRCDIR "/data/loop2.qml"));

        //### ignoreMessage doesn't seem to work
        //QTest::ignoreMessage(QtWarningMsg, "QML QFxImage (unknown location): Anchor loop detected on horizontal anchor.");
        //QTest::ignoreMessage(QtWarningMsg, "QML QFxImage (unknown location): Anchor loop detected on horizontal anchor.");
        view->execute();
        qApp->processEvents();

        delete view;
    }
}

QTEST_MAIN(tst_anchors)

#include "tst_anchors.moc"