Gromacs  2016.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros
testexceptions.h File Reference
#include <string>
#include "gromacs/utility/exceptions.h"
+ Include dependency graph for testexceptions.h:

Description

Exception classes for errors in tests.

Author
Teemu Murtola teemu.nosp@m..mur.nosp@m.tola@.nosp@m.gmai.nosp@m.l.com

Classes

class  gmx::test::TestException
 Exception class for reporting errors in tests. More...
 

Macros

#define GMX_THROW_WRAPPER_TESTEXCEPTION(e)   throw ::gmx::test::TestException(e)
 Macro for throwing a TestException that wraps another exception. More...
 

Macro Definition Documentation

#define GMX_THROW_WRAPPER_TESTEXCEPTION (   e)    throw ::gmx::test::TestException(e)

Macro for throwing a TestException that wraps another exception.

Parameters
[in]eException object to wrap.

This macro is intended for wrapping exceptions thrown by Gromacs methods that are called from a test for the test's internal purposes. It wraps the exception in a TestException to make it possible to tell from the type of the exception whether the exception was thrown by the code under test, or by the test code itself.

e should evaluate to an instance of an object derived from GromacsException.

Typical usage in test code:

try
{
// some code that may throw a GromacsException
}
catch (const GromacsException &ex)
{
}
*