Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
test
test_testing.cxx
Go to the documentation of this file.
1
/** Test the WireCellUtil/Testing helpers.
2
*/
3
4
#include "
WireCellUtil/Testing.h
"
5
#include "
WireCellUtil/Exceptions.h
"
6
7
#include <iostream>
8
9
using namespace
WireCell
;
10
using namespace
std
;
11
12
int
main
(
int
argc
,
char
**
argv
)
13
{
14
AssertMsg
(argc == 1,
"In general, tests should not be called with arguments."
);
15
Assert
(argc == 1);
16
17
try
{
// normally, one wouldn't catch assertion errors in tests.
18
AssertMsg
(
false
,
"this assert should be caught"
);
19
}
20
catch
(
AssertionError
&
e
) {
21
cerr <<
"Caught:\n"
<<
errstr
(e) <<
endl
;
22
}
23
return
0;
24
}
Exceptions.h
std
STL namespace.
freeze_graph.argv
argv
Definition:
freeze_graph.py:218
errstr
#define errstr(e)
Definition:
Exceptions.h:26
Assert
#define Assert
Definition:
Testing.h:7
e
const double e
Definition:
gUpMuFluxGen.cxx:165
Testing.h
WireCell
Definition:
Main.h:22
AssertMsg
#define AssertMsg
Definition:
Testing.h:8
WireCell::AssertionError
Thrown when an assertion fails.
Definition:
Exceptions.h:52
main
int main(int argc, char **argv)
Definition:
test_testing.cxx:12
test_gen_rays_pdsp.argc
argc
Definition:
test_gen_rays_pdsp.py:6
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11