Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
test
test_persist_files.cxx
Go to the documentation of this file.
1
#include "
WireCellUtil/Persist.h
"
2
#include "
WireCellUtil/Testing.h
"
3
4
#include <cstdlib>
5
#include <string>
6
#include <iostream>
7
8
using namespace
WireCell
;
9
10
11
12
int
main
()
13
{
14
Assert
(
Persist::exists
(
"/etc"
));
15
Assert
(
Persist::exists
(
"/etc/hosts"
));
16
17
setenv(
"WIRECELL_PATH"
,
"/etc:/usr:/var"
, 1);
18
std::string
etchosts =
Persist::resolve
(
"hosts"
);
19
//std::cerr << etchosts << std::endl;
20
Assert
(etchosts ==
"/etc/hosts"
);
21
22
std::string
dne =
Persist::resolve
(
"this_file-really_should-not_exist"
);
23
Assert
(dne.empty());
24
25
return
0;
26
}
string
std::string string
Definition:
nybbler.cc:12
Assert
#define Assert
Definition:
Testing.h:7
Testing.h
WireCell::Persist::exists
bool exists(const std::string &filename)
Return true file exists (no file resolution performed).
Definition:
Persist.cxx:79
WireCell
Definition:
Main.h:22
Persist.h
main
int main()
Definition:
test_persist_files.cxx:12
WireCell::Persist::resolve
std::string resolve(const std::string &filename)
Definition:
Persist.cxx:99
Generated by
1.8.11