Debian Codegraph @

test_suite/simgear_tests/timing/test_SGTime.cxx

raw symbols SCIP
1 /*
2 * SPDX-FileCopyrightText: (C) 2022 James Turner <[email protected]>
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
6
7
8 #include <algorithm>
9 #include <memory>
10
11 #include "test_SGTime.hxx"
12 #include "test_suite/dataStore.hxx"
13
14 #include <simgear/math/SGGeod.hxx>
15
16 using namespace std;
17
18 // Set up function for each test.
19 void SimgearTimingTests::setUp()
20 {
21 }
22
23 // Clean up after each test.
24 void SimgearTimingTests::tearDown()
25 {
26
27 }
28
29
30 void SimgearTimingTests::testBadZoneDetectPosition()
31 {
32 DataStore &data = DataStore::get();
33 const SGPath rootPath{data.getFGRoot()};
34 if (rootPath.isNull()) {
35 return;
36 }
37
38 std::unique_ptr<SGTime> t(new SGTime{rootPath});
39
40 const auto goodPos = SGGeod::fromDeg(-69.5, 12.0);
41 CPPUNIT_ASSERT(t->updateLocal(goodPos, rootPath / "Timezone"));
42
43 // discovered while flying with the Shuttle, but actually
44 // can happen at sea level.
45 // https://sourceforge.net/p/flightgear/codetickets/2780/
46
47 // this was fixed by updating the timezone data from
48 // https://github.com/BertoldVdb/ZoneDetect into FGData/Timezone/timezone16.bin
49 const auto pos = SGGeod::fromDeg(-69.0, 12.0);
50 CPPUNIT_ASSERT(t->updateLocal(pos, rootPath / "Timezone"));
51 }