Project
Loading...
Searching...
No Matches
test_DataDescriptorQueryBuilder.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
#include "
Framework/DataDescriptorMatcher.h
"
13
#include "
Framework/DataDescriptorQueryBuilder.h
"
14
#include "
Framework/DataSpecUtils.h
"
15
#include "
Framework/Logger.h
"
16
#include "
Framework/InputSpec.h
"
17
#include "
Headers/Stack.h
"
18
19
#include <catch_amalgamated.hpp>
20
#include <variant>
21
22
using namespace
o2::framework
;
23
using namespace
o2::header
;
24
using namespace
o2::framework::data_matcher
;
25
26
TEST_CASE
(
"TestQueryBuilder"
)
27
{
28
VariableContext
context;
29
DataHeader
header0{
"CLUSTERS"
,
"TPC"
, 1};
30
DataHeader
header1{
"CLUSTERS"
,
"TPC"
, 2};
31
DataHeader
header2{
"CLUSTERS"
,
"ITS"
, 1};
32
DataHeader
header3{
"TRACKLET"
,
"TPC"
, 3};
33
34
auto
ispecs =
DataDescriptorQueryBuilder::parse
(
"A:TPC/CLUSTERS/1;B:ITS/CLUSTERS/1"
);
35
REQUIRE(ispecs.size() == 2);
36
REQUIRE(
DataSpecUtils::match
(ispecs[0], header0) ==
true
);
37
REQUIRE(
DataSpecUtils::match
(ispecs[0], header1) ==
false
);
38
REQUIRE(
DataSpecUtils::match
(ispecs[1], header2) ==
true
);
39
40
ispecs =
DataDescriptorQueryBuilder::parse
(
"A:TPC/CLUSTERS/!1;B:ITS/CLUSTERS/1"
);
41
REQUIRE(ispecs.size() == 2);
42
REQUIRE(
DataSpecUtils::match
(ispecs[0], header0) ==
false
);
43
REQUIRE(
DataSpecUtils::match
(ispecs[0], header1) ==
true
);
44
REQUIRE(
DataSpecUtils::match
(ispecs[1], header2) ==
true
);
45
}
DataDescriptorMatcher.h
DataDescriptorQueryBuilder.h
Stack.h
DataSpecUtils.h
InputSpec.h
Logger.h
o2::framework::data_matcher::VariableContext
Definition
DataDescriptorMatcher.h:79
o2::framework::data_matcher
Definition
DataDescriptorMatcher.h:34
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::header
O2 data header classes and API, v0.1.
Definition
DetID.h:49
o2::framework::DataDescriptorQueryBuilder::parse
static std::vector< InputSpec > parse(const char *s="")
Definition
DataDescriptorQueryBuilder.cxx:55
o2::framework::DataSpecUtils::match
static bool match(InputSpec const &spec, ConcreteDataMatcher const &target)
Definition
DataSpecUtils.cxx:232
o2::header::DataHeader
the main header struct
Definition
DataHeader.h:618
TEST_CASE
TEST_CASE("TestQueryBuilder")
Definition
test_DataDescriptorQueryBuilder.cxx:26
Framework
Core
test
test_DataDescriptorQueryBuilder.cxx
Generated on Tue Feb 25 2025 23:16:40 for Project by
1.9.8