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


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