Project
Loading...
Searching...
No Matches
testError.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 error test
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
16#include "MCHBase/Error.h"
17#include <map>
18
19using o2::mch::Error;
22
24// this needs to be updated every time a new group is added
25// changing the IDs of existing groups will break the backward compatibility
26const std::map<ErrorGroup, uint8_t> errorGroupIds = {
27 {ErrorGroup::Unassigned, 0U},
28 {ErrorGroup::Decoding, 1U},
29 {ErrorGroup::Filtering, 2U},
30 {ErrorGroup::TimeClustering, 3U},
31 {ErrorGroup::PreClustering, 4U},
32 {ErrorGroup::Clustering, 5U},
33 {ErrorGroup::Tracking, 6U}};
34
36// this needs to be updated every time a new type is added
37// changing the IDs of existing types will break the backward compatibility
38const std::map<ErrorType, uint32_t> errorTypeIds = {
39 {ErrorType::PreClustering_MultipleDigitsInSamePad, 67108864U},
40 {ErrorType::PreClustering_LostDigit, 67108865U},
41 {ErrorType::Clustering_TooManyLocalMaxima, 83886080U},
42 {ErrorType::Tracking_TooManyCandidates, 100663296U},
43 {ErrorType::Tracking_TooLong, 100663297U}};
44
45BOOST_AUTO_TEST_CASE(ErrorGroupConsistency)
46{
48 for (auto [group, id] : errorGroupIds) {
49 BOOST_CHECK_EQUAL(static_cast<uint8_t>(group), id);
51 }
52}
53
definition of the MCH processing errors
GLint GLsizei count
Definition glcorearb.h:399
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
GLboolean GLuint group
Definition glcorearb.h:3991
constexpr ErrorGroup errorGroup(ErrorType error)
Definition Error.h:66
ErrorGroup
Definition Error.h:31
ErrorType
Definition Error.h:54
static const std::map< ErrorType, std::string > typeNames
names of known error type
Definition Error.h:71
static const std::map< ErrorType, std::string > typeDescriptions
descriptions of known error type
Definition Error.h:72
static const std::map< ErrorGroup, std::string > groupNames
names of known error group
Definition Error.h:70
BOOST_AUTO_TEST_CASE(ErrorGroupConsistency)
Definition testError.cxx:45
const std::map< ErrorType, uint32_t > errorTypeIds
expected ID of each error type
Definition testError.cxx:38
const std::map< ErrorGroup, uint8_t > errorGroupIds
expected ID of each error group
Definition testError.cxx:26
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())