File indexing completed on 2024-04-06 12:04:07
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <cppunit/extensions/HelperMacros.h>
0010 #include <DataFormats/FEDRawData/interface/FEDRawData.h>
0011 #include <DataFormats/FEDRawData/interface/FEDRawDataCollection.h>
0012
0013 class testFEDRawDataProduct : public CppUnit::TestFixture {
0014 CPPUNIT_TEST_SUITE(testFEDRawDataProduct);
0015
0016 CPPUNIT_TEST(testInsertAndReadBack);
0017
0018 CPPUNIT_TEST_SUITE_END();
0019
0020 public:
0021 void setUp() {}
0022 void tearDown() {}
0023 void testInsertAndReadBack();
0024 };
0025
0026
0027 CPPUNIT_TEST_SUITE_REGISTRATION(testFEDRawDataProduct);
0028
0029 void testFEDRawDataProduct::testInsertAndReadBack() {
0030 FEDRawData f1(16);
0031 f1.data()[0] = 'a';
0032 f1.data()[1] = 'b';
0033
0034 FEDRawData f2(24);
0035 f2.data()[0] = 'd';
0036 f2.data()[1] = 'e';
0037
0038 FEDRawDataCollection fp;
0039 fp.FEDData(12) = f1;
0040 fp.FEDData(121) = f2;
0041
0042 CPPUNIT_ASSERT(fp.FEDData(12).data()[0] == 'a');
0043 CPPUNIT_ASSERT(fp.FEDData(12).data()[1] == 'b');
0044
0045 CPPUNIT_ASSERT(fp.FEDData(121).data()[0] == 'd');
0046 CPPUNIT_ASSERT(fp.FEDData(121).data()[1] == 'e');
0047 }