summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/failfetchtype/tst_failfetchtype.cpp
blob: 4516b76461956194458f26504c0a527b6ca6121e (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
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only


#include <QTest>

class tst_FailFetchType: public QObject
{
Q_OBJECT
private slots:
    void fetch_data() const;
    void fetch() const;
};

void tst_FailFetchType::fetch_data() const
{
    QTest::addColumn<bool>("value");

    QTest::newRow("bool") << true;
}

void tst_FailFetchType::fetch() const
{
    QFETCH(QString, value); // assertion should fail here
    QFAIL("ERROR: this function is NOT supposed to be run.");
}

QTEST_APPLESS_MAIN(tst_FailFetchType)

#include "tst_failfetchtype.moc"