Functions | Variables
testlib.cc File Reference
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <map>
#include <sys/stat.h>
#include <TPRegexp.h>
#include <TString.h>
#include <cmath>
#include <TVector3.h>
#include "testlib.h"

Go to the source code of this file.

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)
 
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)
 
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 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 isEpsDiag (const TVector3 &a, const TVector3 &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)
 
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

static double eps = 1.e-10
 
static unsigned int gCurToDoMarker = 0
 
static Planner gPlanner
 
static unsigned int gPrecision = 12
 
static std::map< int, ToDo * > gToDoMarkers
 
static unsigned int iTest = 1
 
static unsigned int nTests = 0
 

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().

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().

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 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 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 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().

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 = 1.e-10
static

Definition at line 20 of file testlib.cc.

Referenced by is(), isDiag(), and isnot().

unsigned int gCurToDoMarker = 0
static

Definition at line 22 of file testlib.cc.

Referenced by ToDo::ToDo().

Planner gPlanner
static

Definition at line 31 of file testlib.cc.

Referenced by noplan(), and plan().

unsigned int gPrecision = 12
static

Definition at line 18 of file testlib.cc.

Referenced by GetFieldWidth(), and GetPrecision().

std::map<int, ToDo*> gToDoMarkers
static

Definition at line 23 of file testlib.cc.

Referenced by ToDo::ToDo(), todoMsg(), and ToDo::~ToDo().

unsigned int iTest = 1
static

Definition at line 17 of file testlib.cc.

Referenced by fail(), fexists(), GetTestNo(), is(), isEps(), isEpsDiag(), isnot(), ok(), pass(), and Planner::~Planner().

unsigned int nTests = 0
static

Definition at line 19 of file testlib.cc.

Referenced by plan().


, generated on Tue Sep 26 2023.