File indexing completed on 2024-04-28 16:49:46

0001 /*
0002     SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include <QAbstractItemModelTester>
0008 #include <QTest>
0009 
0010 #include "process_data_model.h"
0011 
0012 #define qs QStringLiteral
0013 
0014 class ProcessDataModelTest : public QObject
0015 {
0016     Q_OBJECT
0017 private Q_SLOTS:
0018     void testModel()
0019     {
0020         auto model = new KSysGuard::ProcessDataModel();
0021         auto tester = new QAbstractItemModelTester(model);
0022 
0023         model->setEnabledAttributes({qs("pid"), qs("name"), qs("usage"), qs("vmPSS")});
0024 
0025         QTest::qWait(100);
0026 
0027         QVERIFY(model->rowCount() > 0);
0028     }
0029 };
0030 
0031 QTEST_MAIN(ProcessDataModelTest);
0032 
0033 #include "processdatamodeltest.moc"