1 /* 2 * Copyright 2013 Thomas Schöps 3 * Copyright 2015, 2016, 2019 Kai Pastor 4 * 5 * This file is part of OpenOrienteering. 6 * 7 * OpenOrienteering is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * OpenOrienteering is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with OpenOrienteering. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 22 #ifndef OPENORIENTEERING_PATH_OBJECT_T_H 23 #define OPENORIENTEERING_PATH_OBJECT_T_H 24 25 #include <QObject> 26 27 28 /** 29 * @test Tests PathObject, MapCoord(F) and VirtualPath. 30 * 31 * @todo Extent this test. 32 */ 33 class PathObjectTest : public QObject 34 { 35 Q_OBJECT 36 public: 37 /** Constructor */ 38 explicit PathObjectTest(QObject* parent = nullptr); 39 40 private slots: 41 void initTestCase(); 42 43 /** Tests MapCoordF. */ 44 void mapCoordTest(); 45 46 /** Tests VirtualPath. */ 47 void virtualPathTest(); 48 49 /** Tests PathObject constructors. */ 50 void constructorTest(); 51 52 /** Tests PathObject::copyFrom(). */ 53 void copyFromTest(); 54 void copyFromTest_data(); 55 56 /** Basic test for PathObject::changePathBounds(), focus on flags. */ 57 void changePathBoundsBasicTest(); 58 void changePathBoundsBasicTest_data(); 59 60 /** Tests PathObject::changePathBounds(). */ 61 void changePathBoundsTest(); 62 void changePathBoundsTest_data(); 63 64 /** Tests properties of lines after splitting. */ 65 void splitLineTest(); 66 void splitLineTest_data(); 67 68 /** Tests PathObject::removeFromLine(). */ 69 void removeFromLineTest(); 70 void removeFromLineTest_data(); 71 72 /** Tests finding intersections with calcAllIntersectionsWith(). */ 73 void calcIntersectionsTest(); 74 75 /** Tests PathCoord and SplitPathCoord for a non-trivial zero-length path. */ 76 void atypicalPathTest(); 77 78 }; 79 80 #endif 81