GPSLNavData_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 "GPSLNavData.hpp"
40 #include "TestUtil.hpp"
41 
43 class TestClass : public gnsstk::GPSLNavData
44 {
45 public:
48  gnsstk::NavDataPtr clone() const override
49  { return std::make_shared<TestClass>(*this); }
50 };
51 
52 
54 {
55 public:
57  unsigned constructorTest();
58  unsigned validateTest();
59 };
60 
61 
62 unsigned GPSLNavData_T ::
64 {
65  TUDEF("GPSLNavData", "GPSLNavData");
66  TestClass obj;
67  TUASSERTE(uint32_t, 0, obj.pre);
68  TUASSERTE(uint32_t, 0, obj.tlm);
69  TUASSERTE(bool, false, obj.isf);
70  TUASSERTE(bool, false, obj.asFlag);
71  TUASSERTE(bool, false, obj.alert);
72  TURETURN();
73 }
74 
75 
76 unsigned GPSLNavData_T ::
78 {
79  TUDEF("GPSLNavData", "validate");
80  TestClass obj;
81  TUASSERTE(bool, true, obj.validate());
82  obj.pre = 0x22c; // no this is not valid
83  TUASSERTE(bool, false, obj.validate());
84  obj.pre = 0x8b; // but this is
85  TUASSERTE(bool, true, obj.validate());
86  TURETURN();
87 }
88 
89 
90 int main()
91 {
92  GPSLNavData_T testClass;
93  unsigned errorTotal = 0;
94 
95  errorTotal += testClass.constructorTest();
96  errorTotal += testClass.validateTest();
97 
98  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
99  << std::endl;
100 
101  return errorTotal;
102 }
gnsstk::NavDataPtr
std::shared_ptr< NavData > NavDataPtr
Factories instantiate these in response to find() requests.
Definition: NavData.hpp:62
GPSLNavData_T
Definition: GPSLNavData_T.cpp:53
TestClass::getUserTime
gnsstk::CommonTime getUserTime() const override
Definition: GPSLNavData_T.cpp:46
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
TestClass::clone
gnsstk::NavDataPtr clone() const override
Definition: GPSLNavData_T.cpp:48
gnsstk::CommonTime::BEGINNING_OF_TIME
static const GNSSTK_EXPORT CommonTime BEGINNING_OF_TIME
earliest representable CommonTime
Definition: CommonTime.hpp:102
TestClass::validate
bool validate() const override
Definition: InterSigCorr_T.cpp:64
TestUtil.hpp
main
int main()
Definition: GPSLNavData_T.cpp:90
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::CommonTime
Definition: CommonTime.hpp:84
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
GPSLNavData.hpp
gnsstk::GPSLNavData
Definition: GPSLNavData.hpp:56
GPSLNavData_T::constructorTest
unsigned constructorTest()
Make sure constructor behavior remains unchanged.
Definition: GPSLNavData_T.cpp:63
TestClass
Make GroupPathCorrector instantiatable for testing.
Definition: GroupPathCorrector_T.cpp:56
GPSLNavData_T::validateTest
unsigned validateTest()
Definition: GPSLNavData_T.cpp:77


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