Project
Loading...
Searching...
No Matches
test_InputSpec.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/InputSpec.h"
14#include "Headers/DataHeader.h"
15#include <catch_amalgamated.hpp>
16#include <algorithm>
17#include <vector>
18#include <fmt/format.h>
20#include <fmt/ostream.h>
21
22using namespace o2::framework;
23using namespace o2::framework::data_matcher;
24
25TEST_CASE("TestSorting")
26{
27 // At some point
28 std::vector<InputSpec> inputs{
29 InputSpec{"foo", {"TST", "B"}},
30 InputSpec{"bar", {"TST", "A"}}};
31 std::swap(inputs[0], inputs[1]);
32 auto sorter = [](InputSpec const& a, InputSpec const& b) {
33 return a.binding < b.binding;
34 };
35 std::stable_sort(inputs.begin(), inputs.end(), sorter);
36}
37
38TEST_CASE("TestInputSpecCreation")
39{
40 // At some point
41 std::vector<InputSpec> inputs{
42 InputSpec{"everything", "TST", "B", 0},
43 InputSpec{"0-subspec", "TST", "B"},
44 InputSpec{"wildcard-subspec", {"TST", "A"}},
45 InputSpec{"wildcard-desc-and-subspec", o2::header::DataOrigin{"TST"}},
46 InputSpec{"everything-again", {"TST", "B", 0}}};
47 std::swap(inputs[0], inputs[1]);
48 auto sorter = [](InputSpec const& a, InputSpec const& b) {
49 return a.binding < b.binding;
50 };
51 std::stable_sort(inputs.begin(), inputs.end(), sorter);
52}
53
54TEST_CASE("TestFormattersLifetime")
55{
56 CHECK(fmt::format("{}", Lifetime::Timeframe) == "timeframe");
57}
#define CHECK
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
TEST_CASE("test_prepareArguments")