Ionex_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 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
39 #include "IonexStream.hpp"
40 #include "IonexHeader.hpp"
41 #include "IonexData.hpp"
42 #include "TestUtil.hpp"
43 #include <iostream>
44 #include <string>
45 
46 using namespace std;
47 
48 class Ionex_T
49 {
50 public:
52  unsigned roundTrip10Test();
53 };
54 
55 
56 unsigned Ionex_T ::
58 {
59  TUDEF("IonexStream", "open");
60  gnsstk::IonexStream is, os;
63  string ps(gnsstk::getFileSep());
64  string pd(gnsstk::getPathData());
65  string tp(gnsstk::getPathTestTemp());
66  string reffn(pd + ps + "igrg2680.20i");
67  string outfn(tp + ps + "igrg2680.20i");
68  TUCATCH(is.open(reffn.c_str(), ios::in));
69  TUCATCH(os.open(outfn.c_str(), ios::out));
70  TUCSM("reallyGetRecord");
71  TUCATCH(is >> header);
72  if (!is)
73  {
74  TUFAIL("Unable to read input stream");
75  }
76  TUCSM("reallyPutRecord");
77  TUCATCH(os << header);
78  if (!os)
79  {
80  TUFAIL("Unable to write to output stream");
81  }
82  TUCSM("close");
83  while (is)
84  {
85  TUCSM("reallyGetRecord");
86  TUCATCH(is >> data);
87  TUCSM("reallyPutRecord");
88  TUCATCH(os << data);
89  }
90  TUCATCH(is.close());
91  TUCATCH(os.close());
92  TUCMPFILE(reffn, outfn, 0);
93  TURETURN();
94 }
95 
96 
97 int main()
98 {
99  unsigned errorTotal = 0;
100  Ionex_T testClass;
101 
102  errorTotal += testClass.roundTrip10Test();
103  cout << "Total Failures for " << __FILE__ << ": " << errorTotal << endl;
104  return errorTotal;
105 }
TUCSM
#define TUCSM(METHOD)
Definition: TestUtil.hpp:59
gnsstk::IonexHeader
Definition: IonexHeader.hpp:70
example3.header
header
Definition: example3.py:22
main
int main()
Definition: Ionex_T.cpp:97
TUCATCH
#define TUCATCH(STATEMENT)
Definition: TestUtil.hpp:193
IonexData.hpp
IonexHeader.hpp
TUFAIL
#define TUFAIL(MSG)
Definition: TestUtil.hpp:228
IonexStream.hpp
gnsstk::IonexStream
Definition: IonexStream.hpp:61
TestUtil.hpp
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::IonexData
Definition: IonexData.hpp:70
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
Ionex_T::roundTrip10Test
unsigned roundTrip10Test()
Do a round-trip test on an Ionex 1.0 file.
Definition: Ionex_T.cpp:57
TUCMPFILE
#define TUCMPFILE(F1, F2, SKIP)
Definition: TestUtil.hpp:170
example3.data
data
Definition: example3.py:22
std
Definition: Angle.hpp:142
Ionex_T
Definition: Ionex_T.cpp:48
gnsstk::IonexStream::open
virtual void open(const char *fn, std::ios::openmode mode)
Overrides open to reset the header.
Definition: IonexStream.hpp:83


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