DataBlockUnitTest.cpp
Go to the documentation of this file.
1 /*
2  * File: DataBlockUnitTest.cpp
3  * Author: denis
4  *
5  * Created on September 24, 2012, 10:18 AM
6  */
7 #include <DAQDataFormats/RawDataBlock.h>
8 
9 //#include "DAQDataFormats/../unittest/RawDAQDataUnitTest.h"
10 //#include "DAQDataFormats/../unittest/DataBlockConstructor.h"
11 #include "RawDAQDataUnitTest.h"
12 #include "DataBlockConstructor.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((DataBlockConstructor*)_dataFormatConstructor)
44 {
45 }
46 
47 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
52 
54 
55  CPPUNIT_ASSERT(version == (version_t) df->getHeader()->getVersion());
56 
57  CPPUNIT_ASSERT(compareDataFormats(df, df->getHeader()) == FIRST_CONTAINS_SECOND);
58 
60 
61 
62  delete df;
63 }
64 
65 //CPPUNIT_TEST_SUITE_REGISTRATION(DataBlockUnitTest);
67 CPPUNIT_REGISTRY_ADD_TO_DEFAULT("DAQDataFormats");
68 
69 }; // 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.
CPPUNIT_TEST(basicFieldGetAndSetChecks)
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
CPPUNIT_TEST_SUITE(DataBlockUnitTest)
virtual void checkDeepCopyConstructor()
Check Deep Copy Constructors for all versions.
int32_t version_t
Definition: RawDAQData.h:72
DataBlockConstructor * _mainDFConstructor
Class to hold the data from the FEBs in correct formats.
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("DAQDataFormats")