PNBNavDataFactory_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 "PNBNavDataFactory.hpp"
40 #include "TestUtil.hpp"
41 
42 namespace gnsstk
43 {
44  std::ostream& operator<<(std::ostream& s, gnsstk::NavValidityType e)
45  {
46  s << StringUtils::asString(e);
47  return s;
48  }
49 }
50 
51 
54 {
55 private:
56  friend class PNBNavDataFactory_T;
57  bool addData(const gnsstk::PackedNavBitsPtr& navIn,
58  gnsstk::NavDataPtrList& navOut, double cadence = -1)
59  override
60  { return false; }
61  void resetState() override {}
62 };
63 
65 {
66 public:
67  unsigned constructorTest();
68  unsigned setValidityFilterTest();
69  unsigned setTypeFilterTest();
70 };
71 
72 
75 {
76  TUDEF("PNBNavDataFactory", "PNBNavDataFactory()");
77  TestClass uut;
79  uut.navValidity);
80  TUASSERTE(bool, true, uut.processEph);
81  TUASSERTE(bool, true, uut.processAlm);
82  TUASSERTE(bool, true, uut.processHea);
83  TUASSERTE(bool, true, uut.processTim);
84  TUASSERTE(bool, true, uut.processIono);
85  TURETURN();
86 }
87 
88 
91 {
92  TUDEF("PNBNavDataFactory", "satValidityFilter()");
93  TestClass uut;
95  uut.navValidity);
97  {
98  uut.setValidityFilter(i);
99  TUASSERTE(gnsstk::NavValidityType, i, uut.navValidity);
100  }
101  TURETURN();
102 }
103 
104 
105 unsigned PNBNavDataFactory_T ::
107 {
108  TUDEF("PNBNavDataFactory", "setTypeFilter()");
109  TestClass uut;
110  TUASSERTE(bool, true, uut.processEph);
111  TUASSERTE(bool, true, uut.processAlm);
112  TUASSERTE(bool, true, uut.processHea);
113  TUASSERTE(bool, true, uut.processTim);
114  TUASSERTE(bool, true, uut.processIono);
115  uut.setTypeFilter({gnsstk::NavMessageType::Almanac});
116  TUASSERTE(bool, false, uut.processEph);
117  TUASSERTE(bool, true, uut.processAlm);
118  TUASSERTE(bool, false, uut.processHea);
119  TUASSERTE(bool, false, uut.processTim);
120  TUASSERTE(bool, false, uut.processIono);
121  uut.setTypeFilter({gnsstk::NavMessageType::Ephemeris,
123  TUASSERTE(bool, true, uut.processEph);
124  TUASSERTE(bool, false, uut.processAlm);
125  TUASSERTE(bool, false, uut.processHea);
126  TUASSERTE(bool, true, uut.processTim);
127  TUASSERTE(bool, false, uut.processIono);
128  uut.setTypeFilter({gnsstk::NavMessageType::Health,
130  TUASSERTE(bool, false, uut.processEph);
131  TUASSERTE(bool, false, uut.processAlm);
132  TUASSERTE(bool, true, uut.processHea);
133  TUASSERTE(bool, false, uut.processTim);
134  TUASSERTE(bool, false, uut.processIono);
135  uut.setTypeFilter({gnsstk::NavMessageType::Clock});
136  TUASSERTE(bool, false, uut.processEph);
137  TUASSERTE(bool, false, uut.processAlm);
138  TUASSERTE(bool, false, uut.processHea);
139  TUASSERTE(bool, false, uut.processTim);
140  TUASSERTE(bool, false, uut.processIono);
141  uut.setTypeFilter({gnsstk::NavMessageType::Iono});
142  TUASSERTE(bool, false, uut.processEph);
143  TUASSERTE(bool, false, uut.processAlm);
144  TUASSERTE(bool, false, uut.processHea);
145  TUASSERTE(bool, false, uut.processTim);
146  TUASSERTE(bool, true, uut.processIono);
147  TURETURN();
148 }
149 
150 
151 int main()
152 {
153  PNBNavDataFactory_T testClass;
154  unsigned errorTotal = 0;
155 
156  errorTotal += testClass.constructorTest();
157  errorTotal += testClass.setValidityFilterTest();
158  errorTotal += testClass.setTypeFilterTest();
159 
160  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
161  << std::endl;
162 
163  return errorTotal;
164 }
gnsstk::NavMessageType::Clock
@ Clock
SV Clock offset data. Currently only used by SP3.
gnsstk::PackedNavBitsPtr
std::shared_ptr< PackedNavBits > PackedNavBitsPtr
Managed pointer for passing PackedNavBits around.
Definition: PackedNavBits.hpp:66
TestClass::resetState
void resetState() override
Definition: PNBNavDataFactory_T.cpp:61
PNBNavDataFactory_T::setValidityFilterTest
unsigned setValidityFilterTest()
Definition: PNBNavDataFactory_T.cpp:90
PNBNavDataFactory_T::constructorTest
unsigned constructorTest()
Definition: PNBNavDataFactory_T.cpp:74
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
main
int main()
Definition: PNBNavDataFactory_T.cpp:151
gnsstk::NavMessageType::Health
@ Health
SV health status information message.
gnsstk::NavDataPtrList
std::list< NavDataPtr > NavDataPtrList
Definition: NavData.hpp:75
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::NavValidityType
NavValidityType
Definition: NavValidityType.hpp:53
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
PNBNavDataFactory_T
Definition: PNBNavDataFactory_T.cpp:64
TestUtil.hpp
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
PNBNavDataFactory.hpp
TestClass::addData
bool addData(const gnsstk::PackedNavBitsPtr &navIn, gnsstk::NavDataPtrList &navOut, double cadence=-1) override
Definition: PNBNavDataFactory_T.cpp:57
gnsstk::NavMessageType::Iono
@ Iono
Ionospheric correction data.
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::NavValidityType::Any
@ Any
Load/find nav messages regardless of validity checks.
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
gnsstk::NavMessageType::TimeOffset
@ TimeOffset
Message containing information about time system offsets.
gnsstk::EnumIterator
Definition: EnumIterator.hpp:68
gnsstk::NavMessageType::Ephemeris
@ Ephemeris
Precision orbits for the transmitting SV.
TestClass
Make GroupPathCorrector instantiatable for testing.
Definition: GroupPathCorrector_T.cpp:56
PNBNavDataFactory_T::setTypeFilterTest
unsigned setTypeFilterTest()
Definition: PNBNavDataFactory_T.cpp:106
gnsstk::NavMessageType::Almanac
@ Almanac
Low-precision orbits for other than the transmitting SV.
gnsstk::PNBNavDataFactory
Definition: PNBNavDataFactory.hpp:61


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