Project
Loading...
Searching...
No Matches
testDAQID.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 DAQID class
13
#define BOOST_TEST_MAIN
14
#define BOOST_TEST_DYN_LINK
15
16
#include "
Headers/DAQID.h
"
17
#include <boost/test/unit_test.hpp>
18
#include <iostream>
19
20
// @brief consistency test for O2 origin <-> DAQ Source ID mapping
21
// @author ruben.shahoyan@cern.ch
22
23
using namespace
o2::header
;
24
25
BOOST_AUTO_TEST_CASE
(DAQIDTEST)
26
{
27
28
for
(
int
i
= 0;
i
<
DAQID::MAXDAQ
+ 5;
i
++) {
29
auto
vo2 =
DAQID::DAQtoO2
(
i
);
30
auto
daq =
DAQID::O2toDAQ
(vo2);
31
if
(vo2 !=
DAQID::DAQtoO2
(
DAQID::INVALID
)) {
32
std::cout <<
"DAQ SourceID "
<<
i
<<
" <-> "
<< vo2.str << std::endl;
33
}
34
BOOST_CHECK
(
i
== daq || vo2 ==
DAQID::DAQtoO2
(
DAQID::INVALID
));
35
}
36
std::cout <<
"DAQ INVALID "
<<
int
(
DAQID::INVALID
) <<
" <-> "
<<
DAQID::DAQtoO2
(
DAQID::INVALID
).
str
<< std::endl;
37
std::cout <<
"DAQ UNLOADED "
<<
int
(
DAQID::UNLOADED
) <<
" <-> "
<<
DAQID::DAQtoO2
(
DAQID::UNLOADED
).
str
<< std::endl;
38
BOOST_CHECK
(
DAQID::DAQtoO2
(
DAQID::UNLOADED
) ==
o2::header::gDataOriginUnloaded
);
39
BOOST_CHECK
(
DAQID::O2toDAQ
(
o2::header::gDataOriginUnloaded
) ==
DAQID::UNLOADED
);
40
}
DAQID.h
i
int32_t i
Definition
GPUCommonAlgorithm.h:443
int
o2::header::DAQID::DAQtoO2
static constexpr o2::header::DataOrigin DAQtoO2(ID daq)
Definition
DAQID.h:65
o2::header::DAQID::INVALID
static constexpr ID INVALID
Definition
DAQID.h:40
o2::header::DAQID::MAXDAQ
static constexpr ID MAXDAQ
Definition
DAQID.h:56
o2::header::DAQID::UNLOADED
static constexpr ID UNLOADED
Definition
DAQID.h:54
o2::header::DAQID::O2toDAQ
static constexpr ID O2toDAQ(o2::header::DataOrigin o2orig)
Definition
DAQID.h:70
o2::header
O2 data header classes and API, v0.1.
Definition
DetID.h:49
o2::header::gDataOriginUnloaded
constexpr o2::header::DataOrigin gDataOriginUnloaded
Source IDs used by DAQ.
Definition
DAQID.h:26
o2::header::Descriptor::str
char str[N]
Definition
DataHeader.h:217
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(DAQIDTEST)
Definition
testDAQID.cxx:25
BOOST_CHECK
BOOST_CHECK(tree)
DataFormats
Headers
test
testDAQID.cxx
Generated on Tue Feb 25 2025 23:16:11 for Project by
1.9.8