Project
Loading...
Searching...
No Matches
testTriggerSTUErrorCounter.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 EMCAL Calib
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
17
18#include <algorithm>
19
20namespace o2
21{
22
23namespace emcal
24{
25
26BOOST_AUTO_TEST_CASE(TriggerSTUErrorCounter_test)
27{
28
30 TriggerSTUErrorCounter testobject1, testobject2;
31
32 std::pair<int, unsigned long> TimeAndError(123, 10);
33 int Time = 123;
34 unsigned long Error = 10;
35
36 testobject1.setValue(TimeAndError);
37 testobject2.setValue(Time, Error);
38
39 BOOST_CHECK_EQUAL(testobject1.getTime(), TimeAndError.first);
40 BOOST_CHECK_EQUAL(testobject1.getErrorCount(), TimeAndError.second);
41 BOOST_CHECK_EQUAL(testobject2.getTime(), Time);
42 BOOST_CHECK_EQUAL(testobject2.getErrorCount(), Error);
43
47 BOOST_CHECK_EQUAL(testobject1 == testobject1, true);
48
52 BOOST_CHECK_EQUAL(testobject1 == testobject2, true);
53
55 TriggerSTUErrorCounter testobject3(testobject1);
56 BOOST_CHECK_EQUAL(testobject3 == testobject1, true);
57
59 TriggerSTUErrorCounter testobject4 = testobject1;
60 BOOST_CHECK_EQUAL(testobject4 == testobject1, true);
61
68 ref.setValue(std::make_pair(2, 77));
69 BOOST_CHECK_EQUAL(ref == testobject1, false);
70 ref.setValue(2, 51);
71 BOOST_CHECK_EQUAL(ref == testobject1, false);
72}
73
74} // namespace emcal
75
76} // namespace o2
CCDB container for STU error counts.
void setValue(int time, unsigned long errorcount)
GLint ref
Definition glcorearb.h:291
BOOST_AUTO_TEST_CASE(asynch_schedule_test)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())