Gromacs  2021.2
 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:
+ This graph shows which files directly or indirectly include this file:


Exception classes for errors in tests.

Teemu Murtola


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


#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.

[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:

// some code that may throw a GromacsException
catch (const GromacsException &ex)