![]() |
Project
|
#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, UserLogicDummy1 > | testTypes |
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< PayloadEncoder > | defaultEncoder () |
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) | |
#define BOOST_TEST_DYN_LINK |
Definition at line 21 of file testPayloadEncoder.cxx.
#define BOOST_TEST_MAIN |
Definition at line 20 of file testPayloadEncoder.cxx.
#define BOOST_TEST_MODULE Test MCHRaw Encoder |
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 boost::mpl::list<BareGen, UserLogicGen, UserLogicGen1, BareDummy, UserLogicDummy, UserLogicDummy1> testTypes |
Definition at line 156 of file testPayloadEncoder.cxx.
std::string asBinary | ( | uint64_t | value | ) |
Definition at line 265 of file testPayloadEncoder.cxx.
std::string binaryRule | ( | bool | top, |
std::vector< int > | stops | ||
) |
Definition at line 283 of file testPayloadEncoder.cxx.
BOOST_AUTO_TEST_CASE | ( | Binary | ) |
Definition at line 316 of file testPayloadEncoder.cxx.
BOOST_AUTO_TEST_CASE | ( | Prefix | ) |
Definition at line 306 of file testPayloadEncoder.cxx.
BOOST_AUTO_TEST_CASE_TEMPLATE | ( | CheckNumberOfPayloadHeaders | , |
T | , | ||
testTypes | |||
) |
Definition at line 244 of file testPayloadEncoder.cxx.
BOOST_AUTO_TEST_CASE_TEMPLATE | ( | CheckSize | , |
T | , | ||
testTypes | |||
) |
Definition at line 251 of file testPayloadEncoder.cxx.
BOOST_AUTO_TEST_CASE_TEMPLATE | ( | CheckSizeWithHB | , |
T | , | ||
testTypes | |||
) |
Definition at line 258 of file testPayloadEncoder.cxx.
BOOST_AUTO_TEST_CASE_TEMPLATE | ( | EmptyEncoderHasEmptyBufferIfPhaseIsZero | , |
T | , | ||
testTypes | |||
) |
Definition at line 169 of file testPayloadEncoder.cxx.
BOOST_AUTO_TEST_CASE_TEMPLATE | ( | MultipleOrbitsWithNoDataIsAnEmptyBufferIfPhaseIsZero | , |
T | , | ||
testTypes | |||
) |
Definition at line 179 of file testPayloadEncoder.cxx.
BOOST_AUTO_TEST_CASE_TEMPLATE | ( | StartHBFrameBunchCrossingMustBe12Bits | , |
T | , | ||
testTypes | |||
) |
Definition at line 162 of file testPayloadEncoder.cxx.
std::unique_ptr< PayloadEncoder > defaultEncoder | ( | ) |
Definition at line 112 of file testPayloadEncoder.cxx.
Definition at line 299 of file testPayloadEncoder.cxx.
Definition at line 207 of file testPayloadEncoder.cxx.
int estimateSize | ( | bool | withHB = false | ) |
int estimateSize< BareFormat > | ( | bool | withHB | ) |
Definition at line 220 of file testPayloadEncoder.cxx.
int estimateSize< UserLogicFormat > | ( | bool | withHB | ) |
Definition at line 232 of file testPayloadEncoder.cxx.
Definition at line 191 of file testPayloadEncoder.cxx.
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.