Classes | Namespaces | Macros
RawDAQDataConstructor.h File Reference
#include "DAQDataFormats/RawDAQData.h"
#include "UnitTestTrace.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include <boost/lexical_cast.hpp>

Go to the source code of this file.

Classes

class  daqdataformats::RawDAQDataConstructor
 

Namespaces

 daqdataformats
 Class to hold the data from the FEBs in correct formats.
 

Macros

#define CHECK_FIELD(FIELD_NAME)
 
#define DEFINE_TESTVALUE_CUSTOM(FIELD_NAME, TYPE)
 
#define DEFINE_TESTVALUE(FIELD_NAME)    DEFINE_TESTVALUE_CUSTOM(FIELD_NAME, uint32_t)
 
#define DEFINE_TESTVALUE_BOOL(FIELD_NAME)   DEFINE_TESTVALUE_CUSTOM(FIELD_NAME, bool)
 
#define DEFINE_TESTVALUE_64(FIELD_NAME)    DEFINE_TESTVALUE_CUSTOM(FIELD_NAME, uint64_t)
 
#define DEFINE_TESTVALUE_IS(FIELD_NAME)
 
#define ASSERT_CHECK_FIELD(FIELD_NAME)   CPPUNIT_ASSERT(_mainDFConstructor->checkField_##FIELD_NAME(df));
 Assert checking get/set of the the field is good. More...
 
#define ASSERT_PRINT_IS_NOT_UNKNOWN   CPPUNIT_ASSERT(!isPrintDataFormatUnknownVersion(df));
 
#define ASSERT_GET_IS_NOT_ALLOWED(FIELD_NAME)
 Assert that the get method for a field is not allowed. More...
 
#define ASSERT_SET_IS_NOT_ALLOWED(FIELD_NAME)
 Assert that the set method for a field is not allowed. More...
 
#define ASSERT_GETANDSET_IS_NOT_ALLOWED(FIELD_NAME)
 Assert that both get and set methods for a field are not allowed. More...
 

Macro Definition Documentation

#define ASSERT_CHECK_FIELD (   FIELD_NAME)    CPPUNIT_ASSERT(_mainDFConstructor->checkField_##FIELD_NAME(df));
#define ASSERT_GET_IS_NOT_ALLOWED (   FIELD_NAME)
Value:
{ \
bool succeed = true; \
try{ \
_mainDFConstructor->getFieldValue_##FIELD_NAME(df); \
} \
succeed = false; \
} \
if(succeed){ \
LOG_ERROR("UNITTEST")<<"Getting " \
<<#FIELD_NAME \
<<" succeded." \
<<"Should have failed\n"; \
} \
CPPUNIT_ASSERT(!succeed); \
}
Float_t e
Definition: plot.C:35

Assert that the get method for a field is not allowed.

Definition at line 90 of file RawDAQDataConstructor.h.

#define ASSERT_GETANDSET_IS_NOT_ALLOWED (   FIELD_NAME)
Value:
ASSERT_SET_IS_NOT_ALLOWED(FIELD_NAME)
#define ASSERT_GET_IS_NOT_ALLOWED(FIELD_NAME)
Assert that the get method for a field is not allowed.

Assert that both get and set methods for a field are not allowed.

Definition at line 128 of file RawDAQDataConstructor.h.

#define ASSERT_PRINT_IS_NOT_UNKNOWN   CPPUNIT_ASSERT(!isPrintDataFormatUnknownVersion(df));

Definition at line 87 of file RawDAQDataConstructor.h.

Referenced by daqdataformats::ConfigurationBlockUnitTest::~ConfigurationBlockUnitTest(), daqdataformats::ConfigurationHeaderUnitTest::~ConfigurationHeaderUnitTest(), daqdataformats::ConfigurationNameUnitTest::~ConfigurationNameUnitTest(), daqdataformats::ConfigurationSystemIDUnitTest::~ConfigurationSystemIDUnitTest(), daqdataformats::ConfigurationTailUnitTest::~ConfigurationTailUnitTest(), daqdataformats::DataBlockHeaderUnitTest::~DataBlockHeaderUnitTest(), daqdataformats::DataBlockUnitTest::~DataBlockUnitTest(), daqdataformats::EventHeaderUnitTest::~EventHeaderUnitTest(), daqdataformats::EventTailUnitTest::~EventTailUnitTest(), daqdataformats::EventUnitTest::~EventUnitTest(), daqdataformats::MicroBlockHeaderUnitTest::~MicroBlockHeaderUnitTest(), daqdataformats::MicroSliceHeaderUnitTest::~MicroSliceHeaderUnitTest(), daqdataformats::MilliSliceHeaderUnitTest::~MilliSliceHeaderUnitTest(), daqdataformats::NanoSliceHeaderUnitTest::~NanoSliceHeaderUnitTest(), daqdataformats::NanoSliceUnitTest::~NanoSliceUnitTest(), daqdataformats::RunHeaderUnitTest::~RunHeaderUnitTest(), daqdataformats::TimingMarkerUnitTest::~TimingMarkerUnitTest(), daqdataformats::TriggerHeaderUnitTest::~TriggerHeaderUnitTest(), daqdataformats::TriggerMaskUnitTest::~TriggerMaskUnitTest(), daqdataformats::TriggerRangeUnitTest::~TriggerRangeUnitTest(), daqdataformats::TriggerTimeUnitTest::~TriggerTimeUnitTest(), daqdataformats::TriggerTimingMarkerUnitTest::~TriggerTimingMarkerUnitTest(), and daqdataformats::TriggerUnitTest::~TriggerUnitTest().

#define ASSERT_SET_IS_NOT_ALLOWED (   FIELD_NAME)
Value:
{ \
bool succeed = true; \
try{ \
_mainDFConstructor->setFieldToTestValue_##FIELD_NAME(df); \
} \
succeed = false; \
} \
if(succeed){ \
LOG_ERROR("UNITTEST")<<"Setting " \
<<#FIELD_NAME \
<<" succeded." \
<<"Should have failed\n"; \
} \
CPPUNIT_ASSERT(!succeed); \
}
Float_t e
Definition: plot.C:35

Assert that the set method for a field is not allowed.

Definition at line 109 of file RawDAQDataConstructor.h.

#define CHECK_FIELD (   FIELD_NAME)
#define DEFINE_TESTVALUE (   FIELD_NAME)    DEFINE_TESTVALUE_CUSTOM(FIELD_NAME, uint32_t)

Definition at line 73 of file RawDAQDataConstructor.h.

#define DEFINE_TESTVALUE_64 (   FIELD_NAME)    DEFINE_TESTVALUE_CUSTOM(FIELD_NAME, uint64_t)

Definition at line 75 of file RawDAQDataConstructor.h.

#define DEFINE_TESTVALUE_BOOL (   FIELD_NAME)    DEFINE_TESTVALUE_CUSTOM(FIELD_NAME, bool)

Definition at line 74 of file RawDAQDataConstructor.h.

#define DEFINE_TESTVALUE_CUSTOM (   FIELD_NAME,
  TYPE 
)
Value:
bool setFieldToTestValue_##FIELD_NAME(daqdataformats::CURRENT_CLASS* dataformat) const {return dataformat->set##FIELD_NAME(boost::lexical_cast< TYPE >(TEST_VALUE_##FIELD_NAME));} \
bool setFieldToZeroValue_##FIELD_NAME(daqdataformats::CURRENT_CLASS* dataformat) const {return dataformat->set##FIELD_NAME(boost::lexical_cast< TYPE >(0));} \
uint64_t getFieldValue_##FIELD_NAME(const daqdataformats::CURRENT_CLASS* dataformat) const {return boost::lexical_cast<uint64_t> (dataformat->get##FIELD_NAME());} \
CHECK_FIELD(FIELD_NAME)
#define CURRENT_CLASS

Definition at line 67 of file RawDAQDataConstructor.h.

#define DEFINE_TESTVALUE_IS (   FIELD_NAME)
Value:
bool setFieldToTestValue_##FIELD_NAME(daqdataformats::CURRENT_CLASS* dataformat) const {return dataformat->set##FIELD_NAME(boost::lexical_cast<bool>(TEST_VALUE_##FIELD_NAME));} \
bool setFieldToZeroValue_##FIELD_NAME(daqdataformats::CURRENT_CLASS* dataformat) const {return dataformat->set##FIELD_NAME(boost::lexical_cast<bool>(0));} \
uint64_t getFieldValue_##FIELD_NAME(const daqdataformats::CURRENT_CLASS* dataformat) const {return boost::lexical_cast<uint64_t> (dataformat->is##FIELD_NAME());} \
CHECK_FIELD(FIELD_NAME)
#define CURRENT_CLASS

Definition at line 77 of file RawDAQDataConstructor.h.