File indexing completed on 2024-04-28 15:31:51
0001 /* 0002 This file is part of the KDE libraries 0003 SPDX-FileCopyrightText: 2019 David Faure <faure@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.1-or-later 0006 */ 0007 #include <kcharselect.h> 0008 0009 #include <QComboBox> 0010 #include <QTest> 0011 0012 class KCharSelectTest : public QObject 0013 { 0014 Q_OBJECT 0015 0016 private Q_SLOTS: 0017 void initTestCase() 0018 { 0019 } 0020 0021 void createInstance() 0022 { 0023 KCharSelect selector(nullptr, nullptr); 0024 QCOMPARE(selector.displayedCodePoints().count(), 128); 0025 QCOMPARE(selector.currentCodePoint(), 0); 0026 } 0027 0028 void changeBlock() 0029 { 0030 KCharSelect selector(nullptr, nullptr); 0031 QComboBox *blockCombo = selector.findChild<QComboBox *>(QStringLiteral("blockCombo")); 0032 QVERIFY(blockCombo); 0033 blockCombo->setCurrentIndex(1); 0034 QCOMPARE(selector.currentCodePoint(), 128); 0035 } 0036 }; 0037 0038 QTEST_MAIN(KCharSelectTest) 0039 0040 #include "kcharselect_unittest.moc"