test_testing.cxx
Go to the documentation of this file.
1 /** Test the WireCellUtil/Testing helpers.
2  */
3 
4 #include "WireCellUtil/Testing.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 }
STL namespace.
#define errstr(e)
Definition: Exceptions.h:26
#define Assert
Definition: Testing.h:7
const double e
Definition: Main.h:22
#define AssertMsg
Definition: Testing.h:8
Thrown when an assertion fails.
Definition: Exceptions.h:52
int main(int argc, char **argv)
QTextStream & endl(QTextStream &s)