Classes | Macros | Functions | Variables
testlib.h File Reference
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
#include <map>

Go to the source code of this file.

Classes

class  Planner
 
class  ToDo
 

Macros

#define BOTHFINITE(a, b)   (isfinite(a) && isfinite(b))
 
#define BOTHFINITE_OREQ(a, b)   (BOTHNAN(a,b) || BOTHINFINITY(a,b) || BOTHFINITE(a,b))
 
#define BOTHINFINITY(a, b)   (isinf(a) == isinf(b) && isinf(a))
 
#define BOTHNAN(a, b)   (std::isnan(a) && std::isnan(b))
 
#define SAMENONFINITE(a, b)   (BOTHNAN(a,b) || BOTHINFINITY(a,b))
 

Functions

void diag (const std::string &msg)
 
void diag (const std::ostringstream &msg)
 
void fail (const std::string &name)
 
bool fexists (const std::string &filename)
 
int GetFieldWidth ()
 
int GetPrecision ()
 
unsigned int & GetTestNo ()
 
bool is (const double a, const double b)
 
bool is (const double a, const double b, const std::string &name)
 
bool is (const float a, const float b)
 
bool is (const float a, const float b, const std::string &name)
 
template<class T >
bool is (const T &a, const T &b)
 
template<class T >
bool is (const T &a, const T &b, const std::string &name)
 
template<class T >
bool is (const std::vector< T > &a, const std::vector< T > &b, const std::string &name)
 
bool is (const std::vector< double > &a, const std::vector< double > &b, const std::string &name)
 
bool isDiag (const double a, const double b, const std::string &name)
 
bool isDiag (const double a, const double b)
 
template<class T >
bool isDiag (const T &a, const T &b)
 
template<class T >
bool isDiag (const T &a, const T &b, const std::string &name)
 
template<class T >
bool isDiag (const std::vector< T > &a, const std::vector< T > &b, const std::string &name)
 
bool isDiag (const std::vector< double > &a, const std::vector< double > &b, const std::string &name)
 
bool isEps (const double a, const double b, const double thisEps, const std::string &name)
 
bool isEpsDiag (const TVector3 &a, const TVector3 &b, const double thisEps, const std::string &name)
 
bool isEpsDiag (const double a, const double b, const double thisEps, const std::string &name)
 
bool isEpsDiag (const std::vector< double > &a, const std::vector< double > &b, const double thisEps, const std::string &name)
 
bool isnot (const double a, const double b)
 
bool isnot (const double a, const double b, const std::string &name)
 
bool isnot (const float a, const float b)
 
bool isnot (const float a, const float b, const std::string &name)
 
template<class T >
bool isnot (const T &a, const T &b)
 
template<class T >
bool isnot (const T &a, const T &b, const std::string name)
 
template<class T >
bool isnotDiag (const T &a, const T &b)
 
template<class T >
bool isnotDiag (const T &a, const T &b, const std::string &name)
 
bool isRelEpsDiag (const double a, const double b, const double thisEps, const std::string &name)
 
bool isRelEpsDiag (const std::vector< double > &a, const std::vector< double > &b, const double thisEps, const std::string &name)
 
void noplan ()
 
bool ok (bool okay)
 
bool ok (bool okay, const std::string &name)
 
void pass (const std::string &name)
 
void plan (int n)
 
std::string todoMsg (const std::string &name)
 
std::string todoMsg ()
 

Variables

double eps
 
unsigned int iTest
 

Macro Definition Documentation

#define BOTHFINITE (   a,
 
)    (isfinite(a) && isfinite(b))

Definition at line 51 of file testlib.h.

#define BOTHFINITE_OREQ (   a,
 
)    (BOTHNAN(a,b) || BOTHINFINITY(a,b) || BOTHFINITE(a,b))

Definition at line 54 of file testlib.h.

#define BOTHINFINITY (   a,
 
)    (isinf(a) == isinf(b) && isinf(a))

Definition at line 53 of file testlib.h.

Referenced by isnot().

#define BOTHNAN (   a,
 
)    (std::isnan(a) && std::isnan(b))

Definition at line 52 of file testlib.h.

Referenced by isnot().

#define SAMENONFINITE (   a,
 
)    (BOTHNAN(a,b) || BOTHINFINITY(a,b))

Definition at line 55 of file testlib.h.

Referenced by is(), isEps(), isEpsDiag(), and isRelEpsDiag().

Function Documentation

void diag ( const std::string &  msg)
void diag ( const std::ostringstream &  msg)

Definition at line 71 of file testlib.cc.

References diag().

void fail ( const std::string &  name)

Definition at line 83 of file testlib.cc.

References iTest, and todoMsg().

Referenced by io::SELFASFile::from_string(), and readDetectorGeometry().

bool fexists ( const std::string &  filename)

Definition at line 393 of file testlib.cc.

References iTest, and todoMsg().

int GetFieldWidth ( )

Definition at line 29 of file testlib.cc.

References gPrecision.

Referenced by is(), isDiag(), isEps(), isEpsDiag(), isnot(), isnotDiag(), and isRelEpsDiag().

int GetPrecision ( )

Definition at line 28 of file testlib.cc.

References gPrecision.

Referenced by is(), isDiag(), isEps(), isEpsDiag(), isnot(), isnotDiag(), and isRelEpsDiag().

unsigned int& GetTestNo ( )

Definition at line 408 of file testlib.cc.

References iTest.

Referenced by is(), isDiag(), isEpsDiag(), isnot(), isnotDiag(), and isRelEpsDiag().

bool is ( const double  a,
const double  b 
)

Definition at line 113 of file testlib.cc.

References is().

Referenced by fwk::CentralConfig::CheckFingerprints(), cmpDetectorGeometry(), cmpFDEvent(), cmpFDRecGeometry(), TopDownSelectorNS::TopDownSelector::CorrectTimeAltitude(), SdTopDownSignalSelectorUGR::SdTopDownSignalSelectorUGR::CorrectTimeAltitude(), TopDownSelectorNS::TopDownSelector::CorrectTimeAltitudeCurv(), SdTopDownSignalSelectorUGR::SdTopDownSignalSelectorUGR::CorrectTimeAltitudeCurv(), TopDownSelectorNS::TopDownSelector::EstimateCore(), SdTopDownSignalSelectorUGR::SdTopDownSignalSelectorUGR::EstimateCore(), det::XXMLManager< Info >::FindMatchingBranch(), mdet::Module::GetArea(), fdet::FTelescopeListXMLManager::GetFullEyeTelescopeList(), mdet::Module::GetNumberOfScintillators(), FdProfileReconstructorKG::FdProfileReconstructor::Init(), is(), TopDownSelectorNS::TopDownSelector::IsAligned(), SdTopDownSignalSelectorUGR::SdTopDownSignalSelectorUGR::IsAligned(), TopDownSelectorNS::TopDownSelector::IsGoodTimeConfig(), SdTopDownSignalSelectorUGR::SdTopDownSignalSelectorUGR::IsGoodTimeConfig(), sdet::Station::IsInAcquisition(), utl::make_split(), det::XXMLManager< Info >::IdMatcher::operator()(), utl::operator>>(), tst::Validatrix::operator>>(), Validatrix::operator>>(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::OptoElectronics(), io::EventFileChain::Parse(), utl::UTCDateTime::Parse(), utl::UTCDate::Parse(), TopDownSelectorNS::TopDownSelector::PatternRecovering(), SdTopDownSignalSelectorUGR::SdTopDownSignalSelectorUGR::PatternRecovering(), EdepSimulatorAG::EdepSimulator::Run(), MuonCounterViewerAG::MuonCounterViewer::Run(), MdCounterSimulatorAG::MdCounterSimulator::RunFromMEvent(), MdCounterSimulatorAG::MdCounterSimulator::RunFromMEventScintillatorSimulated(), sevt::PMTRecData::SetIsUsedInGlobalMPD(), sevt::PMTRecData::SetIsVEMChargeFromHistogram(), sevt::PMTRecData::SetIsVEMPeakFromHistogram(), utl::ReadStream::SetStream(), fevt::EyeTriggerData::SetT3Accepted(), fevt::TelescopeTriggerData::SetTLTAccepted(), tst::Validatrix::Unpack::Tag(), testMd5Sum::testMd5OnFile(), testReadStream::TestVectorData(), testReadStream::TestVectorString(), testReadStream::TestVectorStringNoStripping(), TopDownSelectorNS::TopDownSelector::TryRemovingStations(), SdTopDownSignalSelectorUGR::SdTopDownSignalSelectorUGR::TryRemovingStations(), rdet::RDetector::Update(), sdet::SDetector::Update(), and rdet::RDetector::~RDetector().

bool is ( const double  a,
const double  b,
const std::string &  name 
)
bool is ( const float  a,
const float  b 
)

Definition at line 172 of file testlib.cc.

References is().

bool is ( const float  a,
const float  b,
const std::string &  name 
)

Definition at line 176 of file testlib.cc.

References is().

template<class T >
bool is ( const T &  a,
const T &  b 
)

Definition at line 59 of file testlib.h.

References is().

template<class T >
bool is ( const T &  a,
const T &  b,
const std::string &  name 
)

Definition at line 66 of file testlib.h.

References GetTestNo(), and todoMsg().

template<class T >
bool is ( const std::vector< T > &  a,
const std::vector< T > &  b,
const std::string &  name 
)

Definition at line 110 of file testlib.h.

References GetTestNo(), is(), and todoMsg().

bool is ( const std::vector< double > &  a,
const std::vector< double > &  b,
const std::string &  name 
)

Definition at line 334 of file testlib.cc.

References eps, GetTestNo(), is(), SAMENONFINITE, and todoMsg().

bool isDiag ( const double  a,
const double  b,
const std::string &  name 
)
bool isDiag ( const double  a,
const double  b 
)

Definition at line 236 of file testlib.cc.

References eps, and isEpsDiag().

template<class T >
bool isDiag ( const T &  a,
const T &  b 
)

Definition at line 80 of file testlib.h.

References isDiag().

template<class T >
bool isDiag ( const T &  a,
const T &  b,
const std::string &  name 
)
template<class T >
bool isDiag ( const std::vector< T > &  a,
const std::vector< T > &  b,
const std::string &  name 
)

Definition at line 137 of file testlib.h.

References diag(), GetFieldWidth(), GetPrecision(), GetTestNo(), isDiag(), utl::s, and todoMsg().

bool isDiag ( const std::vector< double > &  a,
const std::vector< double > &  b,
const std::string &  name 
)

Definition at line 246 of file testlib.cc.

References eps, and isEpsDiag().

bool isEps ( const double  a,
const double  b,
const double  thisEps,
const std::string &  name 
)
bool isEpsDiag ( const TVector3 &  a,
const TVector3 &  b,
const double  thisEps,
const std::string &  name 
)

Definition at line 414 of file testlib.cc.

References diag(), GetTestNo(), utl::s, and todoMsg().

bool isEpsDiag ( const double  a,
const double  b,
const double  thisEps,
const std::string &  name 
)
bool isEpsDiag ( const std::vector< double > &  a,
const std::vector< double > &  b,
const double  thisEps,
const std::string &  name 
)
bool isnot ( const double  a,
const double  b 
)

Definition at line 142 of file testlib.cc.

References isnot().

Referenced by isnot().

bool isnot ( const double  a,
const double  b,
const std::string &  name 
)
bool isnot ( const float  a,
const float  b 
)

Definition at line 180 of file testlib.cc.

References isnot().

bool isnot ( const float  a,
const float  b,
const std::string &  name 
)

Definition at line 184 of file testlib.cc.

References isnot().

template<class T >
bool isnot ( const T &  a,
const T &  b 
)

Definition at line 184 of file testlib.h.

References isnot().

template<class T >
bool isnot ( const T &  a,
const T &  b,
const std::string  name 
)

Definition at line 191 of file testlib.h.

References GetTestNo(), and todoMsg().

template<class T >
bool isnotDiag ( const T &  a,
const T &  b 
)

Definition at line 204 of file testlib.h.

template<class T >
bool isnotDiag ( const T &  a,
const T &  b,
const std::string &  name 
)

Definition at line 211 of file testlib.h.

References diag(), GetFieldWidth(), GetPrecision(), GetTestNo(), utl::s, and todoMsg().

bool isRelEpsDiag ( const double  a,
const double  b,
const double  thisEps,
const std::string &  name 
)

Definition at line 240 of file testlib.cc.

References isEpsDiag().

Referenced by cmpFDRecGeometry(), cmpFDRecShower(), and cmpSDEvent().

bool isRelEpsDiag ( const std::vector< double > &  a,
const std::vector< double > &  b,
const double  thisEps,
const std::string &  name 
)
void noplan ( )

Definition at line 53 of file testlib.cc.

References gPlanner, and Planner::SetDoPrint().

bool ok ( bool  okay)

Definition at line 89 of file testlib.cc.

References iTest, and todoMsg().

Referenced by cmpDetectorGeometry(), cmpEvent(), cmpFDEvent(), cmpFDRecPixel(), cmpFileInfo(), cmpRecEventFile(), tst::Validatrix::Compare(), TabulatedTankSimulatorNS::DetectorResponse::DetectorResponse(), RdStationSignalInterpolator::RdStationSignalInterpolator::FindIndexOfSurroundingNN(), EventGeneratorOG::EventGenerator::GetCoreShiftForRadioSimulation(), UnivRecNS::UnivRec::GetErrors(), UnivParamTimeNS::UnivParamTime::GetFraction(), UnivParamTimeNS::UnivParamTime::GetTime(), sdet::SStationListXMLManager::Init(), rdet::RStationListXMLManager::Init(), cdet::CStationListXMLManager::Init(), rdet::RSimulationStationListManager::Init(), main(), readDetectorGeometry(), readFileInfo(), fwk::RandomEngineRegistry::RegisterOne(), utl::ReferenceEllipsoid::RegisterOneEllipsoid(), RdStationAssociator::RdStationAssociator::Run(), RdStationInterpolator::RdStationInterpolator::Run(), RdStationInterpolatorStarShape::RdStationInterpolatorStarShape::Run(), UnivRecNS::UnivRec::SetFitStage(), sevt::PMTQuality::SetHasAnode(), sevt::PMTCalibData::SetIsLowGainOk(), sevt::PMTQuality::SetIsRaining(), sevt::SmallPMTData::SetIsTubeOk(), sevt::PMTQuality::SetIsTubeOk(), sevt::SmallPMTCalibData::SetIsTubeOk(), sevt::PMTCalibData::SetIsTubeOk(), testEVAFile::testRead(), testZHAireSFile::testRead(), testREASFile::testRead(), UnivParamTimeNS::UnivParamTime::tQuantilePDF(), UnivParamTimeNS::UnivParamTime::UnivParamTime(), and rdet::RStationListSQLManager::Update().

bool ok ( bool  okay,
const std::string &  name 
)

Definition at line 101 of file testlib.cc.

References iTest, and todoMsg().

void pass ( const std::string &  name)

Definition at line 77 of file testlib.cc.

References iTest, and todoMsg().

void plan ( int  n)

Definition at line 41 of file testlib.cc.

References gPlanner, nTests, and Planner::SetDoPrint().

Referenced by fftwpp::Planner().

std::string todoMsg ( const std::string &  name)

Definition at line 362 of file testlib.cc.

References gToDoMarkers.

Referenced by fail(), fexists(), is(), isDiag(), isEps(), isEpsDiag(), isnot(), isnotDiag(), isRelEpsDiag(), ok(), pass(), and todoMsg().

std::string todoMsg ( )

Definition at line 374 of file testlib.cc.

References todoMsg().

Variable Documentation

double eps
unsigned int iTest

, generated on Tue Sep 26 2023.