GPSCNavHealth_T.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 
26 //==============================================================================
27 //
28 // This software was developed by Applied Research Laboratories at the
29 // University of Texas at Austin, under contract to an agency or agencies
30 // within the U.S. Department of Defense. The U.S. Government retains all
31 // rights to use, duplicate, distribute, disclose, or release this software.
32 //
33 // Pursuant to DoD Directive 523024
34 //
35 // DISTRIBUTION STATEMENT A: This software has been approved for public
36 // release, distribution is unlimited.
37 //
38 //==============================================================================
39 #include "GPSCNavHealth.hpp"
40 #include "TestUtil.hpp"
41 #include "GPSWeekSecond.hpp"
42 
43 namespace gnsstk
44 {
45  std::ostream& operator<<(std::ostream& s, gnsstk::NavMessageType e)
46  {
47  s << StringUtils::asString(e);
48  return s;
49  }
50  std::ostream& operator<<(std::ostream& s, gnsstk::SVHealth e)
51  {
52  s << StringUtils::asString(e);
53  return s;
54  }
55 }
56 
58 {
59 public:
61  unsigned constructorTest();
62  unsigned getUserTimeTest();
63  unsigned getHealthTest();
64 };
65 
66 
67 unsigned GPSCNavHealth_T ::
69 {
70  TUDEF("GPSCNavHealth", "GPSCNavHealth");
72  TUASSERTE(bool, true, uut.health);
74  uut.signal.messageType);
75  TURETURN();
76 }
77 
78 
79 unsigned GPSCNavHealth_T ::
81 {
82  TUDEF("GPSCNavHealth", "getUserTime");
84  // L2 has a 12s cadence, L5 has a 6s cadence
85  gnsstk::CommonTime expL2(gnsstk::GPSWeekSecond(2100,147.0));
86  gnsstk::CommonTime expL5(gnsstk::GPSWeekSecond(2100,141.0));
87  uut.timeStamp = gnsstk::GPSWeekSecond(2100,135.0);
100  TURETURN();
101 }
102 
103 
104 unsigned GPSCNavHealth_T ::
106 {
107  TUDEF("GPSCNavHealth", "getHealth");
109  // default should be unhealthy
111  // the one condition that should result in healthy
112  uut.health = false;
114  TURETURN();
115 }
116 
117 
118 int main()
119 {
120  GPSCNavHealth_T testClass;
121  unsigned errorTotal = 0;
122 
123  errorTotal += testClass.constructorTest();
124  errorTotal += testClass.getUserTimeTest();
125  errorTotal += testClass.getHealthTest();
126 
127  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
128  << std::endl;
129 
130  return errorTotal;
131 }
GPSCNavHealth_T::getHealthTest
unsigned getHealthTest()
Definition: GPSCNavHealth_T.cpp:105
GPSCNavHealth_T
Definition: GPSCNavHealth_T.cpp:57
gnsstk::NavMessageID
Class used to identify/categorize navigation message data.
Definition: NavMessageID.hpp:52
gnsstk::GPSCNavHealth::health
bool health
1-bit health.
Definition: GPSCNavHealth.hpp:95
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
gnsstk::NavSatelliteID
Definition: NavSatelliteID.hpp:57
gnsstk::TrackingCode::L5I
@ L5I
Modernized GPS L5 civil in-phase.
gnsstk::NavMessageType::Health
@ Health
SV health status information message.
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
main
int main()
Definition: GPSCNavHealth_T.cpp:118
gnsstk::SVHealth
SVHealth
Identify different types of SV health states.
Definition: SVHealth.hpp:52
gnsstk::NavData::signal
NavMessageID signal
Source signal identification for this navigation message data.
Definition: NavData.hpp:175
GPSCNavHealth.hpp
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::CarrierBand::L2
@ L2
GPS L2, QZSS L2.
gnsstk::GPSWeekSecond
Definition: GPSWeekSecond.hpp:56
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
gnsstk::SatelliteSystem::GPS
@ GPS
gnsstk::GPSCNavHealth
Definition: GPSCNavHealth.hpp:54
TestUtil.hpp
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
GPSCNavHealth_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: GPSCNavHealth_T.cpp:68
gnsstk::NavType::GPSCNAVL2
@ GPSCNAVL2
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::CommonTime
Definition: CommonTime.hpp:84
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
GPSCNavHealth_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: GPSCNavHealth_T.cpp:80
gnsstk::GPSCNavHealth::getUserTime
CommonTime getUserTime() const override
Definition: GPSCNavHealth.cpp:46
GPSWeekSecond.hpp
gnsstk::GPSCNavHealth::getHealth
SVHealth getHealth() const override
Definition: GPSCNavHealth.hpp:91
gnsstk::TrackingCode::L2CM
@ L2CM
Modernized GPS L2 civil M code.
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
gnsstk::SVHealth::Unhealthy
@ Unhealthy
Satellite is unhealthy and should not be used.
gnsstk::NavType::GPSCNAVL5
@ GPSCNAVL5
gnsstk::CarrierBand::L5
@ L5
GPS L5, Galileo E5a, SBAS L5, QZSS L5, BeiDou B2a, NavIC L5.


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39