summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/exceptionthrow/tst_exceptionthrow.cpp
blob: 4fd22e30488ce3e0464b146d2de21f4e08626816 (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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0


#include <QTest>

class tst_Exception: public QObject
{
    Q_OBJECT

private slots:
    void throwException() const;
};

/*!
 \internal

 We simply throw an exception to check that we get sane output/reporting.
 */
void tst_Exception::throwException() const
{
    /* When exceptions are disabled, some compilers, at least linux-g++, treat
     * exception clauses as hard errors. */
#ifndef QT_NO_EXCEPTIONS
    throw 3;
#endif
}

QTEST_MAIN(tst_Exception)

#include "tst_exceptionthrow.moc"