mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2024-12-02 16:43:00 +08:00
32 lines
632 B
C++
32 lines
632 B
C++
// 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"
|