Project
Loading...
Searching...
No Matches
test_Cluster.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 DataFormatsITSMFT
13
#define BOOST_TEST_MAIN
14
#define BOOST_TEST_DYN_LINK
15
#include <boost/test/unit_test.hpp>
16
#include "
DataFormatsITSMFT/Cluster.h
"
17
18
namespace
o2::itsmft
19
{
20
21
// we explicitly declare o2::itsmft::Cluster as messageable and have to make
22
// sure that this is fulfilled
23
BOOST_AUTO_TEST_CASE
(Cluster_messageable)
24
{
25
using
ElementType =
Cluster
;
26
static_assert
(
o2::framework::is_messageable<ElementType>::value
==
true
);
27
std::vector<ElementType>
clusters
(10);
28
auto
makeElement = [](
size_t
idx) {
29
return
ElementType{};
30
};
31
size_t
idx = 0;
32
for
(
auto
& cluster :
clusters
) {
33
cluster.setXYZ(idx, idx + 10, idx + 20);
34
idx++;
35
}
36
37
size_t
memsize =
sizeof
(ElementType) *
clusters
.size();
38
auto
buffer
= std::make_unique<char[]>(memsize);
39
memcpy(
buffer
.get(), (
char
*)
clusters
.data(), memsize);
40
auto
* pclone =
reinterpret_cast<
ElementType*
>
(
buffer
.get());
41
42
for
(
auto
const
& cluster :
clusters
) {
43
BOOST_REQUIRE(cluster.getXYZ() == pclone->getXYZ());
44
++pclone;
45
}
46
}
47
48
}
// namespace o2::itsmft
Cluster.h
Definition of the ITSMFT cluster.
o2::itsmft::Cluster
Cluster class for the ITSMFT.
Definition
Cluster.h:34
buffer
GLuint buffer
Definition
glcorearb.h:655
o2::itsmft
Definition
SimTraits.h:123
o2::itsmft::BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(Cluster_messageable)
Definition
test_Cluster.cxx:23
o2::framework::is_messageable
Definition
TypeTraits.h:49
clusters
std::vector< Cluster > clusters
Definition
test_ctf_io_cpv.cxx:41
DataFormats
Detectors
ITSMFT
common
test
test_Cluster.cxx
Generated on Tue Feb 25 2025 17:02:52 for Project by
1.9.8