From 564884d27ca59ed00d6fa5808cb8afe94dd361ee Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Mon, 16 May 2022 12:34:36 +0100 Subject: [PATCH] Test suite: restore cross-platform compatibility by removing unix-specific headers and explicitly casting unsigned ints / unsigned longs --- test_suite/unit_tests/AI/test_TrafficMgr.cxx | 1 - test_suite/unit_tests/Airports/test_airport.cxx | 3 +-- test_suite/unit_tests/Airports/test_runway.cxx | 1 - test_suite/unit_tests/Autopilot/testPidController.cxx | 2 -- test_suite/unit_tests/Scripting/testNasalSys.cxx | 2 +- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/test_suite/unit_tests/AI/test_TrafficMgr.cxx b/test_suite/unit_tests/AI/test_TrafficMgr.cxx index 36ff0b8aa..3f7893abc 100644 --- a/test_suite/unit_tests/AI/test_TrafficMgr.cxx +++ b/test_suite/unit_tests/AI/test_TrafficMgr.cxx @@ -23,7 +23,6 @@ #include #include -#include #include "test_suite/FGTestApi/NavDataCache.hxx" #include "test_suite/FGTestApi/TestDataLogger.hxx" diff --git a/test_suite/unit_tests/Airports/test_airport.cxx b/test_suite/unit_tests/Airports/test_airport.cxx index d31d321f4..c693bb980 100644 --- a/test_suite/unit_tests/Airports/test_airport.cxx +++ b/test_suite/unit_tests/Airports/test_airport.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include "test_suite/FGTestApi/NavDataCache.hxx" #include "test_suite/FGTestApi/TestDataLogger.hxx" @@ -71,7 +70,7 @@ void AirportTests::testAirport() { FGAirportRef departureAirport = FGAirport::getByIdent("YSSY"); CPPUNIT_ASSERT_EQUAL_MESSAGE("Must have correct id", (std::string)"YSSY", departureAirport->getId()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Must have runways", (uint)6, departureAirport->numRunways()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Must have runways", (unsigned int) 6, departureAirport->numRunways()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Must have runway 16R", true, departureAirport->hasRunwayWithIdent("16R")); int length = 3962; diff --git a/test_suite/unit_tests/Airports/test_runway.cxx b/test_suite/unit_tests/Airports/test_runway.cxx index 9923dcc8e..d8371f131 100644 --- a/test_suite/unit_tests/Airports/test_runway.cxx +++ b/test_suite/unit_tests/Airports/test_runway.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/test_suite/unit_tests/Autopilot/testPidController.cxx b/test_suite/unit_tests/Autopilot/testPidController.cxx index 14161ef0d..5ff3ae4a6 100644 --- a/test_suite/unit_tests/Autopilot/testPidController.cxx +++ b/test_suite/unit_tests/Autopilot/testPidController.cxx @@ -13,8 +13,6 @@ #include #include -#include - // Set up function for each test. void PidControllerTests::setUp() { diff --git a/test_suite/unit_tests/Scripting/testNasalSys.cxx b/test_suite/unit_tests/Scripting/testNasalSys.cxx index cd6a109cc..cf8552197 100644 --- a/test_suite/unit_tests/Scripting/testNasalSys.cxx +++ b/test_suite/unit_tests/Scripting/testNasalSys.cxx @@ -147,7 +147,7 @@ void NasalSysTests::testCommands() CPPUNIT_ASSERT(ok); errors = nasalSys->getAndClearErrorList(); - CPPUNIT_ASSERT_EQUAL(0UL, errors.size()); + CPPUNIT_ASSERT_EQUAL(0UL, (unsigned long) errors.size()); // should fail, command is removed ok = globals->get_commands()->execute("do-foo", args);