Project
Loading...
Searching...
No Matches
testMinorAltroDecodingError.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#define BOOST_TEST_MODULE Test EMCAL Reconstruction
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
16#include <array>
18
19namespace o2
20{
21namespace emcal
22{
23
24BOOST_AUTO_TEST_CASE(MinorAltroDecodingError_test)
25{
27 std::array<std::string, 8> errornames = {{"ChannelEndPayloadUnexpected",
28 "ChannelPayloadExceed",
29 "ChannelOrderError",
30 "ChannelHeader",
31 "BunchHeaderNull",
32 "BunchLengthExceed",
33 "BunchLengthAllowExceed",
34 "BunchStarttimeExceed"}},
35 errortitles = {{"Channel end unexpected",
36 "Channel exceed",
37 "FEC order",
38 "Channel header invalid",
39 "Bunch header null",
40 "Bunch length exceed",
41 "Bunch length impossible",
42 "Bunch starttime exceed"}},
43 errordescriptions = {{"Unexpected end of payload in altro channel payload!",
44 "Trying to access out-of-bound payload!",
45 "Invalid FEC order",
46 "Invalid channel header",
47 "Bunch header 0 or not configured!",
48 "Bunch length exceeding channel payload size!",
49 "Bunch length exceeding max. possible bunch size!",
50 "Bunch start time outside range!"}};
51 std::array<MinorAltroDecodingError::ErrorType_t, 8> errortypes = {{MinorAltroDecodingError::ErrorType_t::CHANNEL_END_PAYLOAD_UNEXPECT,
59 for (int errortype = 0; errortype < MinorAltroDecodingError::getNumberOfErrorTypes(); errortype++) {
60 BOOST_CHECK_EQUAL(MinorAltroDecodingError::errorTypeToInt(errortypes[errortype]), errortype);
61 BOOST_CHECK_EQUAL(MinorAltroDecodingError::intToErrorType(errortype), errortypes[errortype]);
62 BOOST_CHECK_EQUAL(std::string(MinorAltroDecodingError::getErrorTypeName(errortype)), errornames[errortype]);
63 BOOST_CHECK_EQUAL(std::string(MinorAltroDecodingError::getErrorTypeName(errortypes[errortype])), errornames[errortype]);
64 BOOST_CHECK_EQUAL(std::string(MinorAltroDecodingError::getErrorTypeTitle(errortype)), errortitles[errortype]);
65 BOOST_CHECK_EQUAL(std::string(MinorAltroDecodingError::getErrorTypeTitle(errortypes[errortype])), errortitles[errortype]);
66 BOOST_CHECK_EQUAL(std::string(MinorAltroDecodingError::getErrorTypeDescription(errortype)), errordescriptions[errortype]);
67 BOOST_CHECK_EQUAL(std::string(MinorAltroDecodingError::getErrorTypeDescription(errortypes[errortype])), errordescriptions[errortype]);
68 }
69}
70
71} // namespace emcal
72} // namespace o2
static const char * getErrorTypeTitle(ErrorType_t errortype)
Get the title connected to the error type.
@ CHANNEL_HEADER
Channel header corruption.
@ CHANNEL_ORDER
Channels not in increasing order.
@ BUNCH_LENGTH_ALLOW_EXCEED
Exceeds maximum allowed bunch length.
@ BUNCH_STARTTIME
Bunch start time exceeding.
@ BUNCH_LENGTH_EXCEED
Bunch length exceeding channel payload size.
@ CHANNEL_END_PAYLOAD_UNEXPECT
Unexpected end of payload (channel or trailer word in bunch words)
@ CHANNEL_PAYLOAD_EXCEED
Exceeding channel payload block.
static ErrorType_t intToErrorType(int errornumber)
convert the error from number into a type (symbolic constant)
static int errorTypeToInt(ErrorType_t errortype)
convert the error type from symoblic constant into int
static const char * getErrorTypeDescription(ErrorType_t errortype)
Get the description connected to the error type.
static const char * getErrorTypeName(ErrorType_t errortype)
Get the name connected to the error type.
static constexpr int getNumberOfErrorTypes() noexcept
Get the number of error types handled by the AltroDecoderError.
BOOST_AUTO_TEST_CASE(asynch_schedule_test)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())