TriggerUnitTest.cpp
Go to the documentation of this file.
1 /*
2  * File: TriggerUnitTest.cpp
3  * Author: denis
4  *
5  * Created on September 24, 2012, 10:18 AM
6  */
7 #include <DAQDataFormats/RawTrigger.h>
8 
9 //#include "DAQDataFormats/../unittest/RawDAQDataUnitTest.h"
10 //#include "DAQDataFormats/../unittest/TriggerConstructor.h"
11 #include "RawDAQDataUnitTest.h"
12 #include "TriggerConstructor.h"
13 
14 namespace daqdataformats {
15 
19  CPPUNIT_TEST(testReadDataIntoSameVersion);
20  CPPUNIT_TEST(testReadDataIntoUnknownVersion);
24 public:
27 
32 
33 private:
35 
36 private:
38 };
39 
40 //------------------------------------------------------------------------------
43  ,_mainDFConstructor((TriggerConstructor*)_dataFormatConstructor)
44 {
45 }
46 
47 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
52 
54 
55  CPPUNIT_ASSERT(version == (version_t) df->getTriggerHeader()->getVersion());
56 
57  CPPUNIT_ASSERT(compareDataFormats(df, df->getTriggerHeader()) == FIRST_CONTAINS_SECOND);
58  CPPUNIT_ASSERT(compareDataFormats(df, df->getTriggerRange()) == FIRST_CONTAINS_SECOND);
59  CPPUNIT_ASSERT(compareDataFormats(df, df->getTriggerMask()) == FIRST_CONTAINS_SECOND);
60  CPPUNIT_ASSERT(compareDataFormats(df, df->getTriggerTime()) == FIRST_CONTAINS_SECOND);
61  CPPUNIT_ASSERT(compareDataFormats(df, df->getTriggerTimingMarker()) == FIRST_CONTAINS_SECOND);
62 
64 
65 
66  delete df;
67 }
68 
69 //CPPUNIT_TEST_SUITE_REGISTRATION(TriggerUnitTest);
71 CPPUNIT_REGISTRY_ADD_TO_DEFAULT("DAQDataFormats");
72 
73 }; // end of class
#define DEFINE_testReadDataIntoSameVersion
#define DEFINE_testReadDataIntoUnknownVersion
virtual DATAFORMAT_COMPARE_RESULTS compareDataFormats(const RawDAQData *, const RawDAQData *) const
Are the two data formats the same?
daqdataformats::RawDAQData * getEmptyDataFormat(const daqdataformats::version_t) const
method to create an empty dataformat with a given version
#define ASSERT_PRINT_IS_NOT_UNKNOWN
virtual void basicFieldGetAndSetChecks()
Check all field gets and sets for all versions.
#define DEFINE_checkShallowCopyConstructor(CLASS)
Standard function that checks Shallow Copy Constructor.
virtual void checkShallowCopyConstructor()
Check Shallow Copy Constructors for all versions.
Base class for RawDAQData unittest.
Class to hold the data from the global trigger in the correct format.
Definition: RawTrigger.h:40
virtual void basicFieldGetAndSetChecksForGivenVersion(const version_t)
Check all field gets and sets for a given version.
RawDAQDataConstructor * _dataFormatConstructor
Pointer to RawDAQDataConstructor.
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(ConfigurationBlockUnitTest,"DAQDataFormats")
#define DEFINE_checkDeepCopyConstructor(CLASS)
Standard function that checks Deep Copy Constructor.
const XML_Char * version
Definition: expat.h:187
virtual void checkDeepCopyConstructor()
Check Deep Copy Constructors for all versions.
int32_t version_t
Definition: RawDAQData.h:72
CPPUNIT_TEST_SUITE(TriggerUnitTest)
Class to hold the data from the FEBs in correct formats.
CPPUNIT_TEST(basicFieldGetAndSetChecks)
TriggerConstructor * _mainDFConstructor
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("DAQDataFormats")