lsst.pex.exceptions  8.0.0.0-23-g68b96ed
Defines
include/lsst/pex/exceptions/asserts.h File Reference
#include "boost/format.hpp"
#include "lsst/pex/exceptions/Exception.h"

Go to the source code of this file.

Defines

#define LSST_THROW_IF_NE(N1, N2, EXC_CLASS, MSG)   if ((N1) != (N2)) throw LSST_EXCEPT(EXC_CLASS, (boost::format(MSG) % (N1) % (N2)).str())

Define Documentation

#define LSST_THROW_IF_NE (   N1,
  N2,
  EXC_CLASS,
  MSG 
)    if ((N1) != (N2)) throw LSST_EXCEPT(EXC_CLASS, (boost::format(MSG) % (N1) % (N2)).str())

Check whether the given values are equal, and throw an LSST Exception with the given message (which must include two Boost.Format placeholders for the two numbers) if they are not.

For example:

  LSST_ASSERT_EQUAL(3, 4, "size of foo (%d) is not equal to size of bar (%d)", LengthError);
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines