File indexing completed on 2024-05-05 04:35:28
0001 /* 0002 * This file is part of KDevelop Krazy2 Plugin. 0003 * 0004 * Copyright 2012 Daniel Calviño Sánchez <danxuliu@gmail.com> 0005 * 0006 * This program is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU General Public License 0008 * as published by the Free Software Foundation; either version 2 0009 * of the License, or (at your option) any later version. 0010 * 0011 * This program is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0014 * GNU General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU General Public License 0017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0018 */ 0019 0020 #include <QTest> 0021 0022 #include "../checker.h" 0023 0024 class CheckerTest: public QObject { 0025 Q_OBJECT 0026 private slots: 0027 0028 void testConstructor(); 0029 0030 void testSetName(); 0031 0032 void testSetDescription(); 0033 0034 void testSetExplanation(); 0035 0036 void testSetFileType(); 0037 0038 void testSetExtra(); 0039 0040 }; 0041 0042 void CheckerTest::testConstructor() { 0043 Checker checker; 0044 0045 QCOMPARE(checker.name(), QString()); 0046 QCOMPARE(checker.description(), QString()); 0047 QCOMPARE(checker.explanation(), QString()); 0048 QCOMPARE(checker.fileType(), QString()); 0049 QCOMPARE(checker.isExtra(), false); 0050 } 0051 0052 void CheckerTest::testSetName() { 0053 Checker checker; 0054 checker.setName("The name"); 0055 0056 QCOMPARE(checker.name(), QString("The name")); 0057 } 0058 0059 void CheckerTest::testSetDescription() { 0060 Checker checker; 0061 checker.setDescription("The description"); 0062 0063 QCOMPARE(checker.description(), QString("The description")); 0064 } 0065 0066 void CheckerTest::testSetExplanation() { 0067 Checker checker; 0068 checker.setExplanation("The explanation"); 0069 0070 QCOMPARE(checker.explanation(), QString("The explanation")); 0071 } 0072 0073 void CheckerTest::testSetFileType() { 0074 Checker checker; 0075 checker.setFileType("The file type"); 0076 0077 QCOMPARE(checker.fileType(), QString("The file type")); 0078 } 0079 0080 void CheckerTest::testSetExtra() { 0081 Checker checker; 0082 checker.setExtra(true); 0083 0084 QCOMPARE(checker.isExtra(), true); 0085 } 0086 0087 QTEST_GUILESS_MAIN(CheckerTest) 0088 0089 #include "checkertest.moc"