From 19b910775eb6eb0d0722fcdf4abe28e968e9f52f Mon Sep 17 00:00:00 2001 From: PortreeKid Date: Mon, 22 Feb 2021 20:31:40 +0100 Subject: [PATCH] Runway Tests --- test_suite/unit_tests/AI/test_traffic.cxx | 2 +- test_suite/unit_tests/Airports/CMakeLists.txt | 13 +++ test_suite/unit_tests/Airports/TestSuite.cxx | 22 +++++ .../unit_tests/Airports/test_runway.cxx | 81 +++++++++++++++++++ .../unit_tests/Airports/test_runway.hxx | 51 ++++++++++++ test_suite/unit_tests/CMakeLists.txt | 1 + 6 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 test_suite/unit_tests/Airports/CMakeLists.txt create mode 100644 test_suite/unit_tests/Airports/TestSuite.cxx create mode 100644 test_suite/unit_tests/Airports/test_runway.cxx create mode 100644 test_suite/unit_tests/Airports/test_runway.hxx diff --git a/test_suite/unit_tests/AI/test_traffic.cxx b/test_suite/unit_tests/AI/test_traffic.cxx index 0fb3a68be..7e447dbe0 100644 --- a/test_suite/unit_tests/AI/test_traffic.cxx +++ b/test_suite/unit_tests/AI/test_traffic.cxx @@ -605,5 +605,5 @@ void TrafficTests::dump(FGAIAircraft* aiAircraft) { std::cout << "********************\n"; std::cout << "Geod " << aiAircraft->getGeodPos() << "\t Speed : " << aiAircraft->getSpeed() << "\n"; std::cout << "WP " << aiAircraft->GetFlightPlan()->getCurrentWaypoint()->getName() << "\t" << aiAircraft->GetFlightPlan()->getCurrentWaypoint()->getPos() << "\r\n"; - std::cout << "Heading " << aiAircraft->getTrueHeadingDeg() << "\t VSpeed : " << aiAircraft->getVerticalSpeed() << "\n"; + std::cout << "Heading " << aiAircraft->getTrueHeadingDeg() << "\t VSpeed : " << aiAircraft->getVerticalSpeedFPM() << "\n"; } diff --git a/test_suite/unit_tests/Airports/CMakeLists.txt b/test_suite/unit_tests/Airports/CMakeLists.txt new file mode 100644 index 000000000..bd55a8216 --- /dev/null +++ b/test_suite/unit_tests/Airports/CMakeLists.txt @@ -0,0 +1,13 @@ + +set(TESTSUITE_SOURCES + ${TESTSUITE_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/TestSuite.cxx + ${CMAKE_CURRENT_SOURCE_DIR}/test_runway.cxx + PARENT_SCOPE +) + +set(TESTSUITE_HEADERS + ${TESTSUITE_HEADERS} + ${CMAKE_CURRENT_SOURCE_DIR}/test_runway.hxx + PARENT_SCOPE +) diff --git a/test_suite/unit_tests/Airports/TestSuite.cxx b/test_suite/unit_tests/Airports/TestSuite.cxx new file mode 100644 index 000000000..0c70af3db --- /dev/null +++ b/test_suite/unit_tests/Airports/TestSuite.cxx @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2020 James Turner + * + * This file is part of the program FlightGear. + * + * 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) any later version. + * + * 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 "test_runway.hxx" + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(RunwayTests, "Unit tests"); diff --git a/test_suite/unit_tests/Airports/test_runway.cxx b/test_suite/unit_tests/Airports/test_runway.cxx new file mode 100644 index 000000000..9923dcc8e --- /dev/null +++ b/test_suite/unit_tests/Airports/test_runway.cxx @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2021 Keith Paterson + * + * This file is part of the program FlightGear. + * + * 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) any later version. + * + * 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 "config.h" + +#include "test_runway.hxx" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include