BDSD1NavData_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 "BDSD1NavData.hpp"
40 #include "TestUtil.hpp"
41 
43 class TestClass : public gnsstk::BDSD1NavData
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 BDSD1NavData_T ::
64 {
65  TUDEF("BDSD1NavData", "BDSD1NavData");
66  TestClass obj;
67  TUASSERTE(uint32_t, 0, obj.pre);
68  TUASSERTE(uint32_t, 0, obj.rev);
69  TUASSERTE(uint8_t, 0, obj.fraID);
70  TUASSERTE(uint32_t, 0, obj.sow);
71  TURETURN();
72 }
73 
74 
75 unsigned BDSD1NavData_T ::
77 {
78  TUDEF("BDSD1NavData", "validate");
79  TestClass obj;
80  obj.fraID = 1;
81  TUASSERTE(bool, true, obj.validate());
82  obj.pre = 0x22c; // no this is not valid
83  TUASSERTE(bool, false, obj.validate());
84  obj.pre = 0x712; // this is
85  TUASSERTE(bool, true, obj.validate());
86  obj.fraID = 0;
87  TUASSERTE(bool, false, obj.validate());
88  obj.fraID = 6;
89  TUASSERTE(bool, false, obj.validate());
90  TURETURN();
91 }
92 
93 
94 int main()
95 {
96  BDSD1NavData_T testClass;
97  unsigned errorTotal = 0;
98 
99  errorTotal += testClass.constructorTest();
100  errorTotal += testClass.validateTest();
101 
102  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
103  << std::endl;
104 
105  return errorTotal;
106 }
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: BDSD1NavData_T.cpp:46
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
TestClass::clone
gnsstk::NavDataPtr clone() const override
Definition: BDSD1NavData_T.cpp:48
gnsstk::CommonTime::BEGINNING_OF_TIME
static const GNSSTK_EXPORT CommonTime BEGINNING_OF_TIME
earliest representable CommonTime
Definition: CommonTime.hpp:102
BDSD1NavData.hpp
TestClass::validate
bool validate() const override
Definition: InterSigCorr_T.cpp:64
BDSD1NavData_T
Definition: BDSD1NavData_T.cpp:53
gnsstk::BDSD1NavData
Definition: BDSD1NavData.hpp:55
TestUtil.hpp
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::CommonTime
Definition: CommonTime.hpp:84
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
main
int main()
Definition: BDSD1NavData_T.cpp:94
BDSD1NavData_T::validateTest
unsigned validateTest()
Definition: BDSD1NavData_T.cpp:76
TestClass
Make GroupPathCorrector instantiatable for testing.
Definition: GroupPathCorrector_T.cpp:56
BDSD1NavData_T::constructorTest
unsigned constructorTest()
Make sure constructor behavior remains unchanged.
Definition: BDSD1NavData_T.cpp:63


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