| 1 |
// Copyright (C) 2019 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
#include <QtTest/qtest.h> |
| 5 |
|
| 6 |
#include <QtCore/qobject.h> |
| 7 |
#include <QtCore/qmetaobject.h> |
| 8 |
|
| 9 |
#include <qpa/qplatforminputcontextfactory_p.h> |
| 10 |
#include <qpa/qplatforminputcontext.h> |
| 11 |
|
| 12 |
class tst_XkbKeyboard : public QObject |
| 13 |
{ |
| 14 |
Q_OBJECT |
| 15 |
private slots: |
| 16 |
void verifyComposeInputContextInterface(); |
| 17 |
}; |
| 18 |
|
| 19 |
void tst_XkbKeyboard::verifyComposeInputContextInterface() |
| 20 |
{ |
| 21 |
QPlatformInputContext *inputContext = QPlatformInputContextFactory::create(QStringLiteral("compose")); |
| 22 |
QVERIFY(inputContext); |
| 23 |
|
| 24 |
const char *const inputContextClassName = "QComposeInputContext"; |
| 25 |
const char *const normalizedSignature = "setXkbContext(xkb_context*)"; |
| 26 |
|
| 27 |
QVERIFY(inputContext->objectName() == QLatin1String(inputContextClassName)); |
| 28 |
|
| 29 |
int methodIndex = inputContext->metaObject()->indexOfMethod(normalizedSignature); |
| 30 |
QMetaMethod method = inputContext->metaObject()->method(methodIndex); |
| 31 |
Q_ASSERT(method.isValid()); |
| 32 |
} |
| 33 |
|
| 34 |
QTEST_MAIN(tst_XkbKeyboard) |
| 35 |
#include "tst_xkbkeyboard.moc" |
| 36 |
|