Debian Codegraph @

tests/manual/qmetatype/tst_qmetatype.cpp

raw
1 // Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Marc Mutz <[email protected]>
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 #include <QtCore>
5
6 #include "declare_metatype_noninline.h"
7
8 int main(int argc, char **argv)
9 {
10 qDebug("expect no warning here");
11 const int id = qRegisterMetaType<ToBeDeclaredMetaTypeNonInline>("ToBeDeclaredMetaTypeNonInline");
12 qDebug("expect a qfatal now");
13 const int result = ToBeDeclaredMetaTypeNonInline::triggerRegistration();
14 Q_ASSERT(id == result);
15 qDebug("if you read this, check that a qFatal was seen, "
16 "otherwise the test failed.");
17 }