Functions
test_testing.cxx File Reference
#include "WireCellUtil/Testing.h"
#include "WireCellUtil/Exceptions.h"
#include <iostream>

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 12 of file test_testing.cxx.

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 }
#define errstr(e)
Definition: Exceptions.h:26
#define Assert
Definition: Testing.h:7
const double e
#define AssertMsg
Definition: Testing.h:8
Thrown when an assertion fails.
Definition: Exceptions.h:52
QTextStream & endl(QTextStream &s)