Go to the documentation of this file.
66 void dump(std::ostream& os = std::cout)
const { os << value << endl; }
72 void dump(
const vector<string>& strs);
80 TestUtil initTester(
"FileStore",
"initialization", __FILE__, __LINE__ );
81 TestUtil sizeTester(
"FileStore",
"size", __FILE__, __LINE__ );
82 TestUtil nfilesTester(
"FileStore",
"nfiles", __FILE__, __LINE__ );
83 TestUtil clearTester(
"FileStore",
"clear", __FILE__, __LINE__ );
84 TestUtil getTester(
"FileStore",
"getFilenames", __FILE__, __LINE__ );
85 TestUtil addTester(
"FileStore",
"addFile", __FILE__, __LINE__ );
86 TestUtil headerTester(
"FileStore",
"getHeader", __FILE__, __LINE__ );
91 initTester.
assert(
true,
"unexpected exception", __LINE__ );
95 initTester.
assert(
false,
"unexpected exception", __LINE__ );
102 sizeTester.
assert( (0 == store.
size() ),
"empty store expected", __LINE__ );
106 sizeTester.
assert(
false,
"unexpected exception", __LINE__ );
111 nfilesTester.
assert( (0 == store.
nfiles() ),
"empty store expected", __LINE__ );
115 nfilesTester.
assert(
false,
"unexpected exception", __LINE__ );
120 getTester.
assert( (0 == store.
getFileNames().size() ),
"empty store expected", __LINE__ );
124 getTester.
assert(
false,
"unexpected exception", __LINE__ );
130 clearTester.
assert(
true,
"unexpected exception", __LINE__ );
134 clearTester.
assert(
false,
"unexpected exception", __LINE__ );
140 headerTester.
assert(
false,
"expected exception", __LINE__ );
142 catch (InvalidRequest& ire)
144 headerTester.
assert(
true,
"expected exception", __LINE__ );
148 headerTester.
assert(
false,
"unexpected exception", __LINE__ );
156 addTester.
assert(
true,
"unexpected exception", __LINE__ );
157 sizeTester.
assert( (1 == store.
size() ),
"single file expected", __LINE__ );
158 nfilesTester.
assert( (1 == store.
nfiles() ),
"single file expected", __LINE__ );
160 std::vector<std::string> filenames = store.
getFileNames();
161 getTester.
assert( (1 == filenames.size() ),
"single file expected", __LINE__ );
162 if (filenames.size() > 0)
164 getTester.
assert( (0 == filenames[0].compare(
"testfile1") ),
"unexpected filename", __LINE__ );
169 addTester.
assert(
false,
"unexpected exception", __LINE__ );
175 headerTester.
assert(
true,
"unexpected exception", __LINE__ );
176 headerTester.
assert( (1 ==
header.value),
"unexpected header", __LINE__ );
180 headerTester.
assert(
false,
"unexpected exception", __LINE__ );
186 headerTester.
assert(
false,
"expected exception", __LINE__ );
188 catch (InvalidRequest& ire)
190 headerTester.
assert(
true,
"expected exception", __LINE__ );
194 headerTester.
assert(
false,
"unexpected exception", __LINE__ );
202 addTester.
assert(
true,
"unexpected exception", __LINE__ );
203 sizeTester.
assert( (2 == store.
size() ),
"two files expected", __LINE__ );
204 nfilesTester.
assert( (2 == store.
nfiles() ),
"two files expected", __LINE__ );
206 std::vector<std::string> filenames = store.
getFileNames();
207 getTester.
assert( (2 == filenames.size() ),
"two files expected", __LINE__ );
211 addTester.
assert(
false,
"unexpected exception", __LINE__ );
217 headerTester.
assert(
true,
"unexpected exception", __LINE__ );
218 headerTester.
assert( (2 ==
header.value),
"unexpected header", __LINE__ );
222 headerTester.
assert(
false,
"unexpected exception", __LINE__ );
228 clearTester.
assert(
true,
"unexpected exception", __LINE__ );
229 sizeTester.
assert( (0 == store.
size() ),
"empty store expected", __LINE__ );
230 nfilesTester.
assert( (0 == store.
nfiles() ),
"empty store expected", __LINE__ );
231 getTester.
assert( (0 == store.
getFileNames().size() ),
"empty store expected", __LINE__ );
235 clearTester.
assert(
false,
"unexpected exception", __LINE__ );
252 int main(
int argc,
char *argv[])
260 cout <<
"Total Failures for " << __FILE__ <<
": " << errorTotal << endl;
void dump(vector< SatPass > &SatPassList, ostream &os, bool rev, bool dbug)
void addFile(const std::string &fn, HeaderType &header)
void assert(bool testExpression, const std::string &testMsg, const int lineNumber)
std::vector< std::string > getFileNames() const
Get a list of all the file names in the store, as a vector<string>
void clear() noexcept
Clear the contents of the (filename, header) map.
int main(int argc, char *argv[])
unsigned nfiles() const noexcept
const HeaderType & getHeader(const std::string &fn) const
unsigned size() const noexcept
Return the size of the (filename,header) map.
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39