/* * * Copyright 2015 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "loadertest.h" #include #define COMMA , QTEST_MAIN(LoaderTest); void LoaderTest::initTestCase() { m_loader = new Loader; } void LoaderTest::cleanupTestCase() { delete m_loader; } void LoaderTest::init() { // Called before each testfunction is executed } void LoaderTest::cleanup() { // Called after every testfunction } void LoaderTest::getEntryNumbersTest_data() { QTest::addColumn("entry"); QTest::addColumn >("result"); QTest::newRow("valid1") << "hwmon0/temp1" << QPair(0, 0); QTest::newRow("valid2") << "hwmon1/pwm2" << QPair(1, 1); QTest::newRow("valid3") << "hwmon2/temp8_input" << QPair(2, 7); QTest::newRow("valid4") << "hwmon3/fan1" << QPair(3, 0); QTest::newRow("invalid1") << "hwmo0/temp1" << QPair(-1, -1); QTest::newRow("invalid2") << "hwmonn0/temp1" << QPair(-1, -1); QTest::newRow("invalid3") << "hwmon0/1" << QPair(-1, -1); QTest::newRow("invalid4") << "hwmon0/pwmfan1" << QPair(-1, -1); QTest::newRow("invalid5") << "hwmon0/fan1/temp3" << QPair(-1, -1); } void LoaderTest::getEntryNumbersTest() { QFETCH(QString, entry); QFETCH(QPair, result); QCOMPARE(Loader::getEntryNumbers(entry), result); } void LoaderTest::parseConfigLineTest_data() { QTest::addColumn("line"); QTest::addColumn("result"); } void LoaderTest::parseConfigLineTest() { } #include "loadertest.moc"