LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Macros
asserts.h File Reference
#include "boost/format.hpp"
#include "lsst/pex/exceptions/Exception.h"

Go to the source code of this file.

Macros

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

Macro Definition 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);
*

Definition at line 37 of file asserts.h.