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
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
22using namespace o2::framework;
23using namespace o2::header;
24using namespace o2::framework::data_matcher;
25
26TEST_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}
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
O2 data header classes and API, v0.1.
Definition DetID.h:49
static std::vector< InputSpec > parse(const char *s="")
static bool match(InputSpec const &spec, ConcreteDataMatcher const &target)
the main header struct
Definition DataHeader.h:618
TEST_CASE("TestQueryBuilder")