ATLAS Offline Software
Loading...
Searching...
No Matches
expect_exception.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
12
13
14#ifndef TESTTOOLS_EXPECT_EXCEPTION_H
15#define TESTTOOLS_EXPECT_EXCEPTION_H
16
17
18#include <cassert>
19
20
33#define EXPECT_EXCEPTION(EXC, CODE) do { \
34 bool caught = false; \
35 try { \
36 CODE; \
37 } \
38 catch (const EXC&) { \
39 caught = true; \
40 } \
41 assert (caught); \
42} while(0)
43
44
45#endif // not TESTTOOLS_EXPECT_EXCEPTION_H