GPSWeekZcount_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 "GPSWeekZcount.hpp"
40 #include "TimeTag.hpp"
41 #include "TestUtil.hpp"
42 #include <iostream>
43 #include <fstream>
44 #include <string>
45 #include <iomanip>
46 #include <sstream>
47 
48 using namespace gnsstk;
49 using namespace std;
50 
52 {
53 public:
55  GPSWeekZcount_T(){eps = 1e-12;}
58 
60  unsigned initializationTest()
61  {
62  TUDEF("GPSWeekZcount", "GPSWeekZcount(w,z,ts)");
63 
64  GPSWeekZcount compare(1300,13500.,TimeSystem(2)); //Initialize an object
65  //---------------------------------------------------------------------
66  //Were the attributes set to expectation with the explicit constructor?
67  //---------------------------------------------------------------------
68  TUASSERTE(int, 1300, compare.week);
69  TUASSERTE(unsigned int, 13500, compare.zcount);
71 
72  TUCSM("GPSWeekZcount(GPSWeekZcount)");
73  GPSWeekZcount copy(compare); // Initialize with copy constructor
74 
75  //---------------------------------------------------------------------
76  //Were the attributes set to expectation with the copy constructor?
77  //---------------------------------------------------------------------
78  TUASSERTE(int, 1300, copy.week);
79  TUASSERTE(unsigned int, 13500, copy.zcount);
81 
82  TUCSM("operator=");
83  GPSWeekZcount assigned;
84  assigned = compare;
85 
86  //---------------------------------------------------------------------
87  //Were the attributes set to expectation with the Set operator?
88  //---------------------------------------------------------------------
89  TUASSERTE(int, 1300, assigned.week);
90  TUASSERTE(unsigned int, 13500, assigned.zcount);
92 
93  TURETURN();
94  }
95 
96 
99  unsigned setFromInfoTest ()
100  {
101  TUDEF("GPSWeekZcount", "setFromInfo");
102 
103  GPSWeekZcount setFromInfo1;
104  GPSWeekZcount setFromInfo2;
105  GPSWeekZcount setFromInfo3;
107  id['F'] = "1300";
108  id['z'] = "13500";
109  id['P'] = "GPS";
110 
111  GPSWeekZcount compare(1300,13500.,TimeSystem(2)); //Initialize an object
112  //---------------------------------------------------------------------
113  //Does a proper setFromInfo work with all information provided?
114  //---------------------------------------------------------------------
115  TUASSERT(setFromInfo1.setFromInfo(id));
116  TUASSERTE(GPSWeekZcount, compare, setFromInfo1);
117 
118  id.erase('z');
119  id['w'] = "3";
120  GPSWeekZcount compare2(1300,3*57600L,TimeSystem(2));
121  //---------------------------------------------------------------------
122  //Does a proper setFromInfo work with different data type?
123  //---------------------------------------------------------------------
124  TUASSERT(setFromInfo2.setFromInfo(id));
125  TUASSERTE(GPSWeekZcount, compare2, setFromInfo2);
126 
127  id.erase('F');
128  GPSWeekZcount compare3(0,3*57600L,TimeSystem(2));
129  //---------------------------------------------------------------------
130  //Does a proper setFromInfo work with missing information?
131  //---------------------------------------------------------------------
132  TUASSERT(setFromInfo3.setFromInfo(id));
133  TUASSERTE(GPSWeekZcount, compare3, setFromInfo3);
134 
135  TURETURN();
136  }
137 
138 
142  unsigned operatorTest()
143  {
144  TUDEF("GPSWeekZCount", "operator==");
145 
146  GPSWeekZcount compare(1300,13500);
147  GPSWeekZcount lessThanWeek(1299,13500);
148  GPSWeekZcount lessThanZcount(1300,13400);
149  GPSWeekZcount compareCopy(compare); // Initialize with copy constructor
150 
151  //---------------------------------------------------------------------
152  //Does the == Operator function?
153  //---------------------------------------------------------------------
154  TUASSERT(compare == compareCopy);
155  TUASSERT(!(compare == lessThanWeek));
156  TUASSERT(!(compare == lessThanZcount));
157 
158  TUCSM("operator!=");
159  //---------------------------------------------------------------------
160  //Does the != Operator function?
161  //---------------------------------------------------------------------
162  TUASSERT(compare != lessThanWeek);
163  TUASSERT(compare != lessThanZcount);
164  TUASSERT(!(compare != compare));
165 
166  TUCSM("operator<");
167  //---------------------------------------------------------------------
168  //Does the < Operator function?
169  //---------------------------------------------------------------------
170  TUASSERT(lessThanWeek < compare);
171  TUASSERT(lessThanZcount < compare);
172  TUASSERT(!(compare < lessThanWeek));
173  TUASSERT(!(compare < lessThanZcount));
174  TUASSERT(!(compare < compareCopy));
175 
176  TUCSM("operator>");
177  //---------------------------------------------------------------------
178  //Does the > Operator function?
179  //---------------------------------------------------------------------
180  TUASSERT(!(lessThanWeek > compare));
181  TUASSERT(!(lessThanZcount > compare));
182  TUASSERT(compare > lessThanWeek);
183  TUASSERT(compare > lessThanZcount);
184  TUASSERT(!(compare > compareCopy));
185 
186  TUCSM("operator<=");
187  //---------------------------------------------------------------------
188  //Does the <= Operator function?
189  //---------------------------------------------------------------------
190  TUASSERT(lessThanWeek <= compare);
191  TUASSERT(lessThanZcount <= compare);
192  TUASSERT(!(compare <= lessThanWeek));
193  TUASSERT(!(compare <= lessThanZcount));
194  TUASSERT(compare <= compareCopy);
195 
196  TUCSM("operator>=");
197  //---------------------------------------------------------------------
198  //Does the >= Operator function?
199  //---------------------------------------------------------------------
200  TUASSERT(!(lessThanWeek >= compare));
201  TUASSERT(!(lessThanZcount >= compare));
202  TUASSERT(compare >= lessThanWeek);
203  TUASSERT(compare >= lessThanZcount);
204  TUASSERT(compare >= compareCopy);
205 
206  TURETURN();
207  }
208 
209 
211  unsigned resetTest()
212  {
213  TUDEF("GPSWeekZcount", "reset");
214 
215  GPSWeekZcount compare(1300,13500.,TimeSystem::GPS); //Initialize an object
216 
217  compare.reset(); // Reset it
218 
219  //---------------------------------------------------------------------
220  //Were the attributes reset to expectation?
221  //---------------------------------------------------------------------
222  TUASSERTE(int, 0, compare.week);
223  TUASSERTE(unsigned int, 0, compare.zcount);
225 
226  TURETURN();
227  }
228 
229 
232  {
233  TUDEF("GPSWeekZcount", "isValid");
234 
235  GPSWeekZcount compare(1300,13500.,TimeSystem(2)); //Initialize an object
236 
237  //---------------------------------------------------------------------
238  //Is the time after the BEGINNING_OF_TIME?
239  //---------------------------------------------------------------------
241 
242  //---------------------------------------------------------------------
243  //Is the set object valid?
244  //---------------------------------------------------------------------
245  TUASSERT(compare.isValid());
246 
247  CommonTime test = compare.convertToCommonTime(); //Convert to
248 
249  GPSWeekZcount test2;
250  test2.convertFromCommonTime(test); //Convert From
251 
252  TUCSM("CommonTimeConversion");
253  //---------------------------------------------------------------------
254  //Is the result of conversion the same?
255  //---------------------------------------------------------------------
256  TUASSERTE(TimeSystem, compare.getTimeSystem(), test2.getTimeSystem());
257  TUASSERTE(int, compare.week, test2.week);
258  TUASSERTE(unsigned int, compare.zcount, test2.zcount);
259 
260  TURETURN();
261  }
262 
263 
266  unsigned timeSystemTest()
267  {
268  TUDEF("GPSWeekZcount", "operator==");
269 
270  GPSWeekZcount gps1(1300,13500.,TimeSystem(2));
271  GPSWeekZcount gps2(1200,13500.,TimeSystem(2));
272  GPSWeekZcount utc1(1300,13500.,TimeSystem(5));
273  GPSWeekZcount unknown(1300,13500.,TimeSystem(0));
274  GPSWeekZcount any(1300,13500.,TimeSystem(1));
275  GPSWeekZcount any2(1200,13500.,TimeSystem(1));
276 
277  //---------------------------------------------------------------------
278  //Verify differing TimeSystem sets equivalence operator to false
279  //Note that the operator test checks for == in ALL members
280  //---------------------------------------------------------------------
281  TUASSERT(!(gps1 == utc1));
282  TUASSERT(gps1 == any);
283  TUASSERT(utc1 == any);
284  TUASSERT(unknown == any);
285 
286  //---------------------------------------------------------------------
287  //Verify different Time System but same time inequality
288  //---------------------------------------------------------------------
289  TUASSERT(gps1 != utc1);
290  TUASSERT(gps1 != unknown);
291  TUASSERT(!(gps1 != any));
292 
293  TUCSM("operator<");
294  //---------------------------------------------------------------------
295  //Verify TimeSystem=ANY does not matter in other operator comparisons
296  //---------------------------------------------------------------------
297  TUASSERT(any2 < gps1);
298  TUASSERT(gps2 < any);
299 
300  TUCSM("setTimeSystem");
301  unknown.setTimeSystem(TimeSystem(2)); //Set the Unknown TimeSystem
302  //---------------------------------------------------------------------
303  //Ensure resetting a Time System changes it
304  //---------------------------------------------------------------------
306 
307  TURETURN();
308  }
309 
310 
312  unsigned printfTest()
313  {
314  TUDEF("GPSWeekZCount", "printf");
315 
316  GPSWeekZcount gps1(1300,13500.,TimeSystem::GPS);
317  GPSWeekZcount utc1(1300,13500.,TimeSystem::UTC);
318 
319  //---------------------------------------------------------------------
320  //Verify printed output matches expectation
321  //---------------------------------------------------------------------
322  TUASSERTE(std::string, (std::string)"1300 13500 GPS",
323  gps1.printf("%04F %05z %02P"));
324  TUASSERTE(std::string, (std::string)"1300 13500 UTC",
325  utc1.printf("%04F %05z %02P"));
326 
327  TUCSM("printError");
328  //---------------------------------------------------------------------
329  //Verify printed error message matches expectation
330  //---------------------------------------------------------------------
331  TUASSERTE(std::string,
332  (std::string)"ErrorBadTime ErrorBadTime ErrorBadTime",
333  gps1.printError("%04F %05z %02P"));
334  TUASSERTE(std::string,
335  (std::string)"ErrorBadTime ErrorBadTime ErrorBadTime",
336  utc1.printError("%04F %05z %02P"));
337 
338  TURETURN();
339  }
340 
341 
343  unsigned mathTest()
344  {
345  TUDEF("GPSWeekZcount", "getTotalZcounts");
346  GPSWeekZcount orig(1024, 0), copy, diff1(1024,1), diff2(1023,403199),
347  diff3(1025,0);
348  long expDiff1 = 1, expDiff2(-1), expDiff3(403200);
349 
350  TUASSERTE(unsigned long, 412876800, orig.getTotalZcounts());
351 
352  TUCSM("addWeeks");
353  try
354  {
355  copy = orig;
356  GPSWeekZcount &ref1 = copy.addWeeks(1);
357  // ref1 and copy should both have the updated week number, and
358  // ref1 should be a reference to copy
359  TUASSERTE(int, 1025, copy.week);
360  TUASSERTE(int, 1025, ref1.week);
361  TUASSERTE(GPSWeekZcount*, &copy, &ref1);
362  }
363  catch (...)
364  {
365  TUFAIL("Caught an exception");
366  }
367 
368  try
369  {
370  copy = orig;
371  GPSWeekZcount &ref2 = copy.addWeeks(-1);
372  // ref2 and copy should both have the updated week number, and
373  // ref2 should be a reference to copy
374  TUASSERTE(int, 1023, copy.week);
375  TUASSERTE(int, 1023, ref2.week);
376  TUASSERTE(GPSWeekZcount*, &copy, &ref2);
377  }
378  catch (...)
379  {
380  TUFAIL("Caught an exception");
381  }
382  // invalid week
383  try
384  {
385  copy = orig;
386  copy.addWeeks(-1025);
387  TUFAIL("addWeeks(invalid)");
388  }
389  catch (gnsstk::InvalidRequest)
390  {
391  TUPASS("addWeeks(invalid)");
392  }
393  catch (...)
394  {
395  TUFAIL("addWeeks(invalid)");
396  }
397 
398 
399  TUCSM("addZcounts");
400  // simple add
401  copy = orig;
402  TUCATCH(copy.addZcounts(27));
403  TUASSERTE(int, 1024, copy.week);
404  TUASSERTE(unsigned int, 27, copy.zcount);
405  // simple subtract
406  TUCATCH(copy.addZcounts(-27));
407  TUASSERTE(int, 1024, copy.week);
408  TUASSERTE(unsigned int, 0, copy.zcount);
409  // subtract with week roll-over
410  TUCATCH(copy.addZcounts(-43));
411  TUASSERTE(int, 1023, copy.week);
412  TUASSERTE(unsigned int, 403157, copy.zcount);
413  // add with week roll-over
414  TUCATCH(copy.addZcounts(71));
415  TUASSERTE(int, 1024, copy.week);
416  TUASSERTE(unsigned int, 28, copy.zcount);
417  // invalid week
418  try
419  {
420  copy = orig;
421  copy.addZcounts(-413280000);
422  TUFAIL("addZcounts(invalid)");
423  }
424  catch (gnsstk::InvalidRequest)
425  {
426  TUPASS("addZcounts(invalid)");
427  }
428  catch (...)
429  {
430  TUFAIL("addZcounts(invalid)");
431  }
432 
433  TUCSM("operator++ (postfix)");
434  copy = orig;
435  // zcount should not be modified until AFTER this statement
436  TUASSERTE(unsigned int, 0, (copy++).zcount);
437  TUASSERTE(unsigned int, 1, copy.zcount);
438  TUASSERTE(int, 1024, copy.week);
439 
440  TUCSM("operator++ (prefix)");
441  copy = orig;
442  // zcount should be modified at the start of this statement
443  TUASSERTE(unsigned int, 1, (++copy).zcount);
444  TUASSERTE(unsigned int, 1, copy.zcount);
445  TUASSERTE(int, 1024, copy.week);
446  // prefix should return reference to copy
447  TUASSERTE(GPSWeekZcount*, &copy, &(++copy));
448 
449  TUCSM("operator-- (postfix)");
450  copy = orig;
451  // zcount should not be modified until AFTER this statement
452  TUASSERTE(unsigned int, 0, (copy--).zcount);
453  TUASSERTE(unsigned int, 403199, copy.zcount);
454  TUASSERTE(int, 1023, copy.week);
455 
456  TUCSM("operator-- (prefix)");
457  copy = orig;
458  // zcount should be modified at the start of this statement
459  TUASSERTE(unsigned int, 403199, (--copy).zcount);
460  TUASSERTE(unsigned int, 403199, copy.zcount);
461  TUASSERTE(int, 1023, copy.week);
462  // prefix should return reference to copy
463  TUASSERTE(GPSWeekZcount*, &copy, &(--copy));
464 
465  TUCSM("operator+");
466  try
467  {
468  copy = orig;
469  GPSWeekZcount added = copy + 1;
470  // copy should not have changed
471  TUASSERTE(GPSWeekZcount, orig, copy);
472  TUASSERTE(int, 1024, added.week);
473  TUASSERTE(unsigned int, 1, added.zcount);
474  }
475  catch (...)
476  {
477  TUFAIL("Caught an exception");
478  }
479  // add a negative
480  try
481  {
482  copy = orig;
483  long counts = -1;
484  GPSWeekZcount added = copy + counts;
485  // copy should not have changed
486  TUASSERTE(GPSWeekZcount, orig, copy);
487  TUASSERTE(int, 1023, added.week);
488  TUASSERTE(unsigned int, 403199, added.zcount);
489  }
490  catch (...)
491  {
492  TUFAIL("Caught an exception");
493  }
494  // invalid week
495  try
496  {
497  copy = orig;
498  long counts = -413280000;
499  GPSWeekZcount added = copy + counts;
500  TUFAIL("operator+(invalid)");
501  }
502  catch (gnsstk::InvalidRequest)
503  {
504  TUPASS("operator+(invalid)");
505  }
506  catch (...)
507  {
508  TUFAIL("operator+(invalid)");
509  }
510 
511  TUCSM("operator-(long)");
512  try
513  {
514  copy = orig;
515  GPSWeekZcount added = copy - 1;
516  // copy should not have changed
517  TUASSERTE(GPSWeekZcount, orig, copy);
518  TUASSERTE(int, 1023, added.week);
519  TUASSERTE(unsigned int, 403199, added.zcount);
520  }
521  catch (...)
522  {
523  TUFAIL("Caught an exception");
524  }
525  // add a negative
526  try
527  {
528  copy = orig;
529  long counts = -1;
530  GPSWeekZcount added = copy - counts;
531  // copy should not have changed
532  TUASSERTE(GPSWeekZcount, orig, copy);
533  TUASSERTE(int, 1024, added.week);
534  TUASSERTE(unsigned int, 1, added.zcount);
535  }
536  catch (...)
537  {
538  TUFAIL("Caught an exception");
539  }
540  // invalid week
541  try
542  {
543  copy = orig;
544  long counts = 413280000;
545  GPSWeekZcount added = copy - counts;
546  TUFAIL("operator-(invalid)");
547  }
548  catch (gnsstk::InvalidRequest)
549  {
550  TUPASS("operator-(invalid)");
551  }
552  catch (...)
553  {
554  TUFAIL("operator-(invalid)");
555  }
556 
557  // difference two GPSWeekZcount objects
558  TUCSM("operator-(GPSWeekZcount)");
559  copy = orig;
560  TUASSERTE(long, 0, (orig - copy));
561  TUASSERTE(long, expDiff1, diff1-copy);
562  TUASSERTE(long, expDiff2, diff2-copy);
563  TUASSERTE(long, expDiff3, diff3-copy);
564 
565  TUCSM("operator+=");
566  copy = orig;
567  TUASSERTE(unsigned int, 27, (copy += 27).zcount);
568  TUASSERTE(unsigned int, 27, copy.zcount);
569  TUASSERTE(int, 1024, copy.week);
570  // += should return reference to copy
571  TUASSERTE(GPSWeekZcount*, &copy, &(copy += 99));
572  // add a negative
573  try
574  {
575  copy = orig;
576  long counts = -1;
577  TUASSERTE(unsigned int, 403199, (copy += counts).zcount);
578  TUASSERTE(int, 1023, copy.week);
579  }
580  catch (...)
581  {
582  TUFAIL("Caught an exception");
583  }
584  // invalid week
585  try
586  {
587  copy = orig;
588  long counts = -413280000;
589  copy += counts;
590  TUFAIL("operator+(invalid)");
591  }
592  catch (gnsstk::InvalidRequest)
593  {
594  TUPASS("operator+(invalid)");
595  }
596  catch (...)
597  {
598  TUFAIL("operator+(invalid)");
599  }
600 
601  TUCSM("operator-=");
602  copy = orig;
603  TUASSERTE(unsigned int, 403199, (copy -= 1).zcount);
604  TUASSERTE(unsigned int, 403199, copy.zcount);
605  TUASSERTE(int, 1023, copy.week);
606  // -= should return reference to copy
607  TUASSERTE(GPSWeekZcount*, &copy, &(copy -= 99));
608  // subtract a negative
609  try
610  {
611  copy = orig;
612  long counts = -1;
613  TUASSERTE(unsigned int, 1, (copy -= counts).zcount);
614  TUASSERTE(int, 1024, copy.week);
615  }
616  catch (...)
617  {
618  TUFAIL("Caught an exception");
619  }
620  // invalid week
621  try
622  {
623  copy = orig;
624  long counts = 413280000;
625  copy -= counts;
626  TUFAIL("operator-(invalid)");
627  }
628  catch (gnsstk::InvalidRequest)
629  {
630  TUPASS("operator-(invalid)");
631  }
632  catch (...)
633  {
634  TUFAIL("operator-(invalid)");
635  }
636 
637  TURETURN();
638  }
639 
640 
641  unsigned testTimeBlock()
642  {
643  TUDEF("GPSWeekZcount", "inSameTimeBlock");
645  t0(1024, 10),
646  sameMinute(1024,39),
647  sameHour(1024, 2399),
648  sameWeek(1024,403199),
649  sameWeekOffset(1025, 9),
650  notSameWeek(1023,403199);
651 
652  TUASSERT(t0.inSameTimeBlock(sameMinute, ZCOUNT_PER_MINUTE));
653  TUASSERT(t0.inSameTimeBlock(sameMinute, ZCOUNT_PER_HOUR));
654  TUASSERT(t0.inSameTimeBlock(sameMinute, ZCOUNT_PER_WEEK));
655 
656  TUASSERT(!t0.inSameTimeBlock(sameHour, ZCOUNT_PER_MINUTE));
657  TUASSERT(t0.inSameTimeBlock(sameHour, ZCOUNT_PER_HOUR));
658  TUASSERT(t0.inSameTimeBlock(sameHour, ZCOUNT_PER_WEEK));
659 
660  TUASSERT(!t0.inSameTimeBlock(sameWeek, ZCOUNT_PER_MINUTE));
661  TUASSERT(!t0.inSameTimeBlock(sameWeek, ZCOUNT_PER_HOUR));
662  TUASSERT(t0.inSameTimeBlock(sameWeek, ZCOUNT_PER_WEEK));
663 
664  TUASSERT(!t0.inSameTimeBlock(sameWeekOffset, ZCOUNT_PER_MINUTE));
665  TUASSERT(!t0.inSameTimeBlock(sameWeekOffset, ZCOUNT_PER_HOUR));
666  TUASSERT(!t0.inSameTimeBlock(sameWeekOffset, ZCOUNT_PER_WEEK));
667 
668  TUASSERT(!t0.inSameTimeBlock(notSameWeek, ZCOUNT_PER_MINUTE));
669  TUASSERT(!t0.inSameTimeBlock(notSameWeek, ZCOUNT_PER_HOUR));
670  TUASSERT(!t0.inSameTimeBlock(notSameWeek, ZCOUNT_PER_WEEK));
671 
672  TUASSERT(!t0.inSameTimeBlock(notSameWeek, ZCOUNT_PER_MINUTE, 10));
673  TUASSERT(!t0.inSameTimeBlock(notSameWeek, ZCOUNT_PER_HOUR, 10));
674  TUASSERT(!t0.inSameTimeBlock(notSameWeek, ZCOUNT_PER_WEEK, 10));
675 
676  TUASSERT(!t0.inSameTimeBlock(sameWeekOffset, ZCOUNT_PER_MINUTE, 10));
677  TUASSERT(!t0.inSameTimeBlock(sameWeekOffset, ZCOUNT_PER_HOUR, 10));
678  TUASSERT(t0.inSameTimeBlock(sameWeekOffset, ZCOUNT_PER_WEEK, 10));
679 
680  TURETURN();
681  }
682 
683 
684 private:
685  double eps;
686 };
687 
688 
689 int main() //Main function to initialize and run all tests above
690 {
691  unsigned errorCounter = 0;
692  GPSWeekZcount_T testClass;
693 
694  errorCounter += testClass.initializationTest();
695  errorCounter += testClass.operatorTest();
696  errorCounter += testClass.setFromInfoTest();
697  errorCounter += testClass.resetTest();
698  errorCounter += testClass.timeSystemTest();
699  errorCounter += testClass.toFromCommonTimeTest();
700  errorCounter += testClass.printfTest();
701  errorCounter += testClass.mathTest();
702  errorCounter += testClass.testTimeBlock();
703 
704  std::cout << "Total Failures for " << __FILE__ << ": " << errorCounter
705  << std::endl;
706 
707  return errorCounter; //Return the total number of errors
708 }
GPSWeekZcount_T::eps
double eps
Definition: GPSWeekZcount_T.cpp:685
GPSWeekZcount.hpp
TUCSM
#define TUCSM(METHOD)
Definition: TestUtil.hpp:59
gnsstk::GPSWeekZcount::addWeeks
GPSWeekZcount & addWeeks(short inWeeks)
Definition: GPSWeekZcount.cpp:245
GPSWeekZcount_T::setFromInfoTest
unsigned setFromInfoTest()
Definition: GPSWeekZcount_T.cpp:99
gnsstk::TimeTag::setTimeSystem
void setTimeSystem(const TimeSystem &timeSys)
Set method for internal variable timeSystem (enum).
Definition: TimeTag.hpp:165
gnsstk::GPSWeekZcount::zcount
unsigned int zcount
Definition: GPSWeekZcount.hpp:371
GPSWeekZcount_T
Definition: GPSWeekZcount_T.cpp:51
TUCATCH
#define TUCATCH(STATEMENT)
Definition: TestUtil.hpp:193
gnsstk::TimeTag::IdToValue
std::map< char, std::string > IdToValue
Definition: TimeTag.hpp:103
gnsstk::GPSWeekZcount::reset
virtual void reset()
Reset this object to the default state.
Definition: GPSWeekZcount.hpp:158
gnsstk::GPSWeekZcount::convertFromCommonTime
virtual void convertFromCommonTime(const CommonTime &ct)
Definition: GPSWeekZcount.cpp:88
GPSWeekZcount_T::printfTest
unsigned printfTest()
Test for the formatted printing of GPSWeekZcount objects.
Definition: GPSWeekZcount_T.cpp:312
GPSWeekZcount_T::mathTest
unsigned mathTest()
Check the various math methods.
Definition: GPSWeekZcount_T.cpp:343
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
TUFAIL
#define TUFAIL(MSG)
Definition: TestUtil.hpp:228
gnsstk::ZCOUNT_PER_HOUR
const long ZCOUNT_PER_HOUR
Z-counts per hour.
Definition: TimeConstants.hpp:98
GPSWeekZcount_T::testTimeBlock
unsigned testTimeBlock()
Definition: GPSWeekZcount_T.cpp:641
GPSWeekZcount_T::resetTest
unsigned resetTest()
Test will check the reset method.
Definition: GPSWeekZcount_T.cpp:211
gnsstk::CommonTime::BEGINNING_OF_TIME
static const GNSSTK_EXPORT CommonTime BEGINNING_OF_TIME
earliest representable CommonTime
Definition: CommonTime.hpp:102
GPSWeekZcount_T::initializationTest
unsigned initializationTest()
initializationTest ensures the constructors set the values properly
Definition: GPSWeekZcount_T.cpp:60
gnsstk::GPSWeekZcount::convertToCommonTime
virtual CommonTime convertToCommonTime() const
Definition: GPSWeekZcount.cpp:68
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
main
int main()
Definition: GPSWeekZcount_T.cpp:689
gnsstk::GPSWeek::week
int week
Definition: GPSWeek.hpp:271
TUASSERT
#define TUASSERT(EXPR)
Definition: TestUtil.hpp:63
TestUtil.hpp
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::GPSWeekZcount::printf
virtual std::string printf(const std::string &fmt) const
Definition: GPSWeekZcount.cpp:114
TUPASS
#define TUPASS(MSG)
Definition: TestUtil.hpp:230
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition: TimeSystem.hpp:51
TimeTag.hpp
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
gnsstk::GPSWeekZcount
Definition: GPSWeekZcount.hpp:55
GPSWeekZcount_T::toFromCommonTimeTest
unsigned toFromCommonTimeTest()
Test will check converting to/from CommonTime.
Definition: GPSWeekZcount_T.cpp:231
gnsstk::TimeSystem::UTC
@ UTC
Coordinated Universal Time (e.g., from NTP)
gnsstk::GPSWeekZcount::isValid
virtual bool isValid() const
Returns true if this object's members are valid, false otherwise.
Definition: GPSWeekZcount.hpp:153
gnsstk::GPSWeekZcount::setFromInfo
virtual bool setFromInfo(const IdToValue &info)
Definition: GPSWeekZcount.cpp:174
GPSWeekZcount_T::GPSWeekZcount_T
GPSWeekZcount_T()
Default Constructor, set the precision value.
Definition: GPSWeekZcount_T.cpp:55
gnsstk::GPSWeekZcount::printError
virtual std::string printError(const std::string &fmt) const
Definition: GPSWeekZcount.cpp:146
gnsstk::TimeSystem::GPS
@ GPS
GPS system time.
std
Definition: Angle.hpp:142
GPSWeekZcount_T::~GPSWeekZcount_T
~GPSWeekZcount_T()
Default Desructor.
Definition: GPSWeekZcount_T.cpp:57
gnsstk::ZCOUNT_PER_WEEK
const long ZCOUNT_PER_WEEK
Zcounts in a week.
Definition: TimeConstants.hpp:92
gnsstk::GPSWeekZcount::addZcounts
GPSWeekZcount & addZcounts(long inZcounts)
Definition: GPSWeekZcount.cpp:257
GPSWeekZcount_T::operatorTest
unsigned operatorTest()
Definition: GPSWeekZcount_T.cpp:142
gnsstk::ZCOUNT_PER_MINUTE
const long ZCOUNT_PER_MINUTE
Z-counts per minute.
Definition: TimeConstants.hpp:96
gnsstk::TimeTag::getTimeSystem
TimeSystem getTimeSystem() const
Obtain time system info (enum).
Definition: TimeTag.hpp:169
GPSWeekZcount_T::timeSystemTest
unsigned timeSystemTest()
Definition: GPSWeekZcount_T.cpp:266


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