1
0
Fork 0

Test suite: restore cross-platform compatibility by removing unix-specific headers and explicitly casting unsigned ints / unsigned longs

This commit is contained in:
Jonathan Redpath 2022-05-16 12:34:36 +01:00 committed by James Turner
parent 3f670c84b1
commit 564884d27c
5 changed files with 2 additions and 7 deletions

View file

@ -23,7 +23,6 @@
#include <cstring> #include <cstring>
#include <memory> #include <memory>
#include <unistd.h>
#include "test_suite/FGTestApi/NavDataCache.hxx" #include "test_suite/FGTestApi/NavDataCache.hxx"
#include "test_suite/FGTestApi/TestDataLogger.hxx" #include "test_suite/FGTestApi/TestDataLogger.hxx"

View file

@ -24,7 +24,6 @@
#include <iostream> #include <iostream>
#include <cstring> #include <cstring>
#include <memory> #include <memory>
#include <unistd.h>
#include "test_suite/FGTestApi/NavDataCache.hxx" #include "test_suite/FGTestApi/NavDataCache.hxx"
#include "test_suite/FGTestApi/TestDataLogger.hxx" #include "test_suite/FGTestApi/TestDataLogger.hxx"
@ -71,7 +70,7 @@ void AirportTests::testAirport()
{ {
FGAirportRef departureAirport = FGAirport::getByIdent("YSSY"); FGAirportRef departureAirport = FGAirport::getByIdent("YSSY");
CPPUNIT_ASSERT_EQUAL_MESSAGE("Must have correct id", (std::string)"YSSY", departureAirport->getId()); 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")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Must have runway 16R", true, departureAirport->hasRunwayWithIdent("16R"));
int length = 3962; int length = 3962;

View file

@ -24,7 +24,6 @@
#include <iostream> #include <iostream>
#include <cstring> #include <cstring>
#include <memory> #include <memory>
#include <unistd.h>
#include <simgear/math/sg_geodesy.hxx> #include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/SGGeod.hxx> #include <simgear/math/SGGeod.hxx>

View file

@ -13,8 +13,6 @@
#include <simgear/math/sg_random.hxx> #include <simgear/math/sg_random.hxx>
#include <simgear/props/props_io.hxx> #include <simgear/props/props_io.hxx>
#include <unistd.h>
// Set up function for each test. // Set up function for each test.
void PidControllerTests::setUp() void PidControllerTests::setUp()
{ {

View file

@ -147,7 +147,7 @@ void NasalSysTests::testCommands()
CPPUNIT_ASSERT(ok); CPPUNIT_ASSERT(ok);
errors = nasalSys->getAndClearErrorList(); errors = nasalSys->getAndClearErrorList();
CPPUNIT_ASSERT_EQUAL(0UL, errors.size()); CPPUNIT_ASSERT_EQUAL(0UL, (unsigned long) errors.size());
// should fail, command is removed // should fail, command is removed
ok = globals->get_commands()->execute("do-foo", args); ok = globals->get_commands()->execute("do-foo", args);