GLOCNavHealth_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 "TestUtil.hpp"
40 #include "GLOCNavHealth.hpp"
41 #include "CivilTime.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:
60  unsigned constructorTest();
61  unsigned getUserTimeTest();
62  unsigned getHealthTest();
63 };
64 
65 
66 unsigned GLOCNavHealth_T ::
68 {
69  TUDEF("GLOCNavHealth", "GLOCNavHealth");
71  TUASSERTE(bool, true, uut.Hj);
72  TUASSERTE(bool, true, uut.lj);
74  uut.signal.messageType);
75  TURETURN();
76 }
77 
78 
79 unsigned GLOCNavHealth_T ::
81 {
82  TUDEF("GLOCNavHealth", "getUserTime");
84  uut.timeStamp = gnsstk::CivilTime(2006, 10, 01, 0, 15, 0,
86  // 1x 2s string
87  gnsstk::CommonTime exp(uut.timeStamp + 3.0);
89  TURETURN();
90 }
91 
92 
93 unsigned GLOCNavHealth_T ::
95 {
96  TUDEF("GLOCNavHealth", "getHealth");
98  // default should be unhealthy
100  uut.Hj = false;
102  uut.lj = false;
104  uut.Hj = true;
106  TURETURN();
107 }
108 
109 
110 int main()
111 {
112  GLOCNavHealth_T testClass;
113  unsigned errorTotal = 0;
114 
115  errorTotal += testClass.constructorTest();
116  errorTotal += testClass.getUserTimeTest();
117  errorTotal += testClass.getHealthTest();
118 
119  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
120  << std::endl;
121 
122  return errorTotal;
123 }
gnsstk::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
GLOCNavHealth_T
Definition: GLOCNavHealth_T.cpp:57
main
int main()
Definition: GLOCNavHealth_T.cpp:110
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
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
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
gnsstk::GLOCNavHealth::getHealth
SVHealth getHealth() const override
Definition: GLOCNavHealth.cpp:115
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
GLOCNavHealth_T::getHealthTest
unsigned getHealthTest()
Definition: GLOCNavHealth_T.cpp:94
TestUtil.hpp
gnsstk::SVHealth::Healthy
@ Healthy
Satellite is in a healthy and useable state.
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::GLOCNavHealth::Hj
bool Hj
The H^j health bit (SV health).
Definition: GLOCNavHealth.hpp:78
CivilTime.hpp
GLOCNavHealth_T::constructorTest
unsigned constructorTest()
Definition: GLOCNavHealth_T.cpp:67
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
gnsstk::TimeSystem::GLO
@ GLO
GLONASS system time (aka UTC(SU))
gnsstk::CivilTime
Definition: CivilTime.hpp:55
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
GLOCNavHealth.hpp
gnsstk::GLOCNavHealth::lj
bool lj
The l^j health bit (validity indicator).
Definition: GLOCNavHealth.hpp:79
gnsstk::SVHealth::Unhealthy
@ Unhealthy
Satellite is unhealthy and should not be used.
GLOCNavHealth_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: GLOCNavHealth_T.cpp:80
gnsstk::GLOCNavHealth
Definition: GLOCNavHealth.hpp:52


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