Project
Loading...
Searching...
No Matches
testPayloadEncoder.cxx File Reference
#include "MCHRawElecMap/Mapper.h"
#include <boost/test/unit_test.hpp>
#include "BareElinkEncoder.h"
#include "BareElinkEncoderMerger.h"
#include "EncoderImplHelper.h"
#include "GBTEncoder.h"
#include "MCHRawCommon/DataFormats.h"
#include "MCHRawEncoderPayload/DataBlock.h"
#include "MCHRawEncoderPayload/PayloadEncoder.h"
#include "UserLogicElinkEncoder.h"
#include "UserLogicElinkEncoderMerger.h"
#include <boost/mpl/list.hpp>
#include <cstdint>
#include <fmt/printf.h>
#include <vector>

Go to the source code of this file.

Classes

struct  BareGen
 
struct  UserLogicGen
 
struct  UserLogicGen1
 
struct  BareDummy
 
struct  UserLogicDummy
 
struct  UserLogicDummy1
 

Macros

#define BOOST_TEST_MODULE   Test MCHRaw Encoder
 
#define BOOST_TEST_MAIN
 
#define BOOST_TEST_DYN_LINK
 

Typedefs

typedef boost::mpl::list< BareGen, UserLogicGen, UserLogicGen1, BareDummy, UserLogicDummy, UserLogicDummy1testTypes
 

Functions

template<typename ELECMAP , typename FORMAT , int VERSION = 0>
std::vector< std::byte > makeBuffer (int norbit=1, uint32_t firstOrbit=12345, uint16_t firstBC=678, bool withHB=false)
 
template<typename ELECMAP , typename FORMAT >
std::unique_ptr< PayloadEncoderdefaultEncoder ()
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (StartHBFrameBunchCrossingMustBe12Bits, T, testTypes)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (EmptyEncoderHasEmptyBufferIfPhaseIsZero, T, testTypes)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (MultipleOrbitsWithNoDataIsAnEmptyBufferIfPhaseIsZero, T, testTypes)
 
int estimateUserLogicSize (int nofDS, int maxNofChPerDS)
 
int estimateBareSize (int nofDS, int maxNofChPerGBT)
 
template<typename FORMAT >
int estimateSize (bool withHB=false)
 
template<>
int estimateSize< BareFormat > (bool withHB)
 
template<>
int estimateSize< UserLogicFormat > (bool withHB)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (CheckNumberOfPayloadHeaders, T, testTypes)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (CheckSize, T, testTypes)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (CheckSizeWithHB, T, testTypes)
 
std::string asBinary (uint64_t value)
 
std::string binaryRule (bool top, std::vector< int > stops)
 
void dump (uint64_t value, std::vector< int > stops={63, 47, 31, 15, 0})
 
 BOOST_AUTO_TEST_CASE (Prefix)
 
 BOOST_AUTO_TEST_CASE (Binary)
 

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 21 of file testPayloadEncoder.cxx.

◆ BOOST_TEST_MAIN

#define BOOST_TEST_MAIN

Definition at line 20 of file testPayloadEncoder.cxx.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Test MCHRaw Encoder
Author
Laurent Aphecetche

In those tests we are mainly concerned about testinng whether the payloads are actually properly simulated.

Definition at line 19 of file testPayloadEncoder.cxx.

Typedef Documentation

◆ testTypes

Function Documentation

◆ asBinary()

std::string asBinary ( uint64_t  value)

Definition at line 265 of file testPayloadEncoder.cxx.

◆ binaryRule()

std::string binaryRule ( bool  top,
std::vector< int stops 
)

Definition at line 283 of file testPayloadEncoder.cxx.

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( Binary  )

Definition at line 316 of file testPayloadEncoder.cxx.

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( Prefix  )

Definition at line 306 of file testPayloadEncoder.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [1/6]

BOOST_AUTO_TEST_CASE_TEMPLATE ( CheckNumberOfPayloadHeaders  ,
,
testTypes   
)

Definition at line 244 of file testPayloadEncoder.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [2/6]

BOOST_AUTO_TEST_CASE_TEMPLATE ( CheckSize  ,
,
testTypes   
)

Definition at line 251 of file testPayloadEncoder.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [3/6]

BOOST_AUTO_TEST_CASE_TEMPLATE ( CheckSizeWithHB  ,
,
testTypes   
)

Definition at line 258 of file testPayloadEncoder.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [4/6]

BOOST_AUTO_TEST_CASE_TEMPLATE ( EmptyEncoderHasEmptyBufferIfPhaseIsZero  ,
,
testTypes   
)

Definition at line 169 of file testPayloadEncoder.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [5/6]

BOOST_AUTO_TEST_CASE_TEMPLATE ( MultipleOrbitsWithNoDataIsAnEmptyBufferIfPhaseIsZero  ,
,
testTypes   
)

Definition at line 179 of file testPayloadEncoder.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [6/6]

BOOST_AUTO_TEST_CASE_TEMPLATE ( StartHBFrameBunchCrossingMustBe12Bits  ,
,
testTypes   
)

Definition at line 162 of file testPayloadEncoder.cxx.

◆ defaultEncoder()

template<typename ELECMAP , typename FORMAT >
std::unique_ptr< PayloadEncoder > defaultEncoder ( )

Definition at line 112 of file testPayloadEncoder.cxx.

◆ dump()

void dump ( uint64_t  value,
std::vector< int stops = {63, 47, 31, 15, 0} 
)

Definition at line 299 of file testPayloadEncoder.cxx.

◆ estimateBareSize()

int estimateBareSize ( int  nofDS,
int  maxNofChPerGBT 
)

Definition at line 207 of file testPayloadEncoder.cxx.

◆ estimateSize()

template<typename FORMAT >
int estimateSize ( bool  withHB = false)

◆ estimateSize< BareFormat >()

template<>
int estimateSize< BareFormat > ( bool  withHB)

Definition at line 220 of file testPayloadEncoder.cxx.

◆ estimateSize< UserLogicFormat >()

template<>
int estimateSize< UserLogicFormat > ( bool  withHB)

Definition at line 232 of file testPayloadEncoder.cxx.

◆ estimateUserLogicSize()

int estimateUserLogicSize ( int  nofDS,
int  maxNofChPerDS 
)

Definition at line 191 of file testPayloadEncoder.cxx.

◆ makeBuffer()

template<typename ELECMAP , typename FORMAT , int VERSION = 0>
std::vector< std::byte > makeBuffer ( int  norbit = 1,
uint32_t  firstOrbit = 12345,
uint16_t  firstBC = 678,
bool  withHB = false 
)

Definition at line 41 of file testPayloadEncoder.cxx.