Go to the documentation of this file.
43 #include <sys/types.h>
67 unsigned findTestsAbs();
69 unsigned findTestsRel();
71 unsigned findTestsRelDot();
73 unsigned findTestsRelDotDot();
75 unsigned findSimpleFileName();
79 unsigned findTests(
const std::string& tld,
const std::string& testName);
81 bool openable(
const list<string>&
files);
91 for (
const auto& i :
files)
93 ifstream f(i.c_str());
96 cerr <<
"Can't open \"" << i <<
"\"" << endl;
107 string tld = gnsstk::getPathData() + fs +
"FileSpecFind";
108 return findTests(tld,
"Abs");
115 string tld =
"FileSpecFind";
116 return findTests(tld,
"Rel");
123 string tld =
"." + fs +
"FileSpecFind";
124 return findTests(tld,
"RelDot");
131 string tld =
".." + fs +
"data" + fs +
"FileSpecFind";
132 return findTests(tld,
"RelDotDot");
137 findTests(
const std::string& tld,
const std::string& testName)
139 TUDEF(
"FileSpecFind",
"find("+testName+
")");
141 string searchSpec = tld + fs +
"%04Y" + fs +
"%05n" + fs +
"%03j" + fs +
142 "nsh-%x-%5n-%1r-%04Y-%03j-%02H%02M%02S.xml";
148 using ListSize = list<string>::size_type;
155 TUCSM(
"find(" + testName +
") no results");
167 TUFAIL(
"Unexpected exception");
169 catch (std::exception& exc)
171 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
175 TUFAIL(
"Unexpected exception");
179 TUCSM(
"find(" + testName +
") single epoch");
191 TUFAIL(
"Unexpected exception");
193 catch (std::exception& exc)
195 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
199 TUFAIL(
"Unexpected exception");
205 TUCSM(
"find(" + testName +
") single epoch via span");
217 TUFAIL(
"Unexpected exception");
219 catch (std::exception& exc)
221 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
225 TUFAIL(
"Unexpected exception");
231 TUCSM(
"find(" + testName +
") multiple epochs");
243 TUFAIL(
"Unexpected exception");
245 catch (std::exception& exc)
247 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
251 TUFAIL(
"Unexpected exception");
258 searchSpec = tld + fs +
"%04Y" + fs +
"%05n" + fs +
"%03j" + fs +
259 "nsh-%3x-%5n-%1r-%04Y-%03j-%02H%02M%02S.xml";
260 TUCSM(
"find(" + testName +
") multiple epochs with filter");
264 filter.insert(gnsstk::FileSpecFind::Filter::value_type(
275 TUFAIL(
"Unexpected exception");
277 catch (std::exception& exc)
279 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
283 TUFAIL(
"Unexpected exception");
292 filter.insert(gnsstk::FileSpecFind::Filter::value_type(
294 filter.insert(gnsstk::FileSpecFind::Filter::value_type(
305 TUFAIL(
"Unexpected exception");
307 catch (std::exception& exc)
309 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
313 TUFAIL(
"Unexpected exception");
322 filter.insert(gnsstk::FileSpecFind::Filter::value_type(
324 filter.insert(gnsstk::FileSpecFind::Filter::value_type(
335 TUFAIL(
"Unexpected exception");
337 catch (std::exception& exc)
339 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
343 TUFAIL(
"Unexpected exception");
352 filter.insert(gnsstk::FileSpecFind::Filter::value_type(
354 filter.insert(gnsstk::FileSpecFind::Filter::value_type(
365 TUFAIL(
"Unexpected exception");
367 catch (std::exception& exc)
369 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
373 TUFAIL(
"Unexpected exception");
379 searchSpec = tld + fs +
"2018" + fs +
"10000" + fs +
"211" + fs +
380 "nsh-FOO-10000-1-2018-211-184500.xml";
381 TUCSM(
"find(" + testName +
") exact file name");
394 TUFAIL(
"Unexpected exception");
396 catch (std::exception& exc)
398 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
402 TUFAIL(
"Unexpected exception");
415 TUDEF(
"FileSpecFind",
"find(simple file name)");
417 using ListSize = list<string>::size_type;
425 "TropModel_Zero.exp",
432 TUFAIL(
"Unexpected exception");
434 catch (std::exception& exc)
436 TUFAIL(
"Unexpected exception " + std::string(exc.what()));
440 TUFAIL(
"Unexpected exception");
450 int main(
int argc,
char *argv[])
452 unsigned errorTotal = 0;
459 cout <<
"Total Failures for " << __FILE__ <<
": " << errorTotal << endl;
std::map< FileSpecType, std::string > FSTStringMap
bool openable(const list< string > &files)
Return true if all paths in files can be opened for read.
std::multimap< FileSpec::FileSpecType, std::string > Filter
Data type for storing desired FileSpec values.
static std::string transToken(const std::string &token)
#define TUASSERTE(TYPE, EXP, GOT)
static const GNSSTK_EXPORT CommonTime BEGINNING_OF_TIME
earliest representable CommonTime
static std::list< std::string > find(const std::string &fileSpec, const CommonTime &start, const CommonTime &end, const FileSpec::FSTStringMap &fsts=FileSpec::FSTStringMap())
static const GNSSTK_EXPORT CommonTime END_OF_TIME
latest representable CommonTime
std::string fs
File separator, but short.
unsigned findTestsRelDotDot()
test find with relative paths that include ..
unsigned findTestsRel()
test find with relative paths, no . or ..
unsigned findSimpleFileName()
test find with a simple file name with no wildcards and no path
page HOWTO subpage DoxygenGuide Documenting Your Code page DoxygenGuide Documenting Your Code todo Flesh out this document section doctips Tips for Documenting When defining make sure that the prototype is identical between the cpp and hpp including both the namespaces and the parameter names for you have std::string as the return type in the hpp file and string as the return type in the cpp Doxygen may get confused and autolink to the cpp version with no documentation If you don t use the same parameter names between the cpp and hpp files
@ receiver
'r' A field for the receiver number
unsigned findTestsAbs()
test find with absolute paths
#define TUDEF(CLASS, METHOD)
@ station
'n' A field for station numbers
unsigned findTestsRelDot()
test find with relative paths that include .
int main(int argc, char *argv[])
unsigned findTests(const std::string &tld, const std::string &testName)
generic version of above tests
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39