Project
Loading...
Searching...
No Matches
BBox.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
14
15#define BOOST_TEST_MODULE Test MCHContour BBox
16#define BOOST_TEST_MAIN
17
18#define BOOST_TEST_DYN_LINK
19
20#include <boost/test/unit_test.hpp>
21#include <boost/test/data/test_case.hpp>
22#include <iostream>
23#include "../include/MCHContour/BBox.h"
24
25using namespace o2::mch::contour;
26
27BOOST_AUTO_TEST_SUITE(o2_mch_contour)
28
29BOOST_AUTO_TEST_SUITE(bbox)
30
31BOOST_AUTO_TEST_CASE(BBoxMustBeCreatedValid) { BOOST_CHECK_THROW(BBox<int>(2, 2, 0, 0), std::invalid_argument); }
32
33BOOST_AUTO_TEST_CASE(CheckBBoxBoundaries)
34{
35 BBox<double> test{-15.0, -10.0, 5.0, 20.0};
36 BOOST_TEST(test.xmin() == -15.0);
37 BOOST_TEST(test.xmax() == 5.0);
38 BOOST_TEST(test.ymin() == -10.0);
39 BOOST_TEST(test.ymax() == 20.0);
40}
41
42BOOST_AUTO_TEST_CASE(CheckBBoxCenter)
43{
44 BBox<double> test{-15.0, -10.0, 5.0, 20.0};
45 BOOST_TEST(test.xcenter() == -5.0);
46 BOOST_TEST(test.ycenter() == 5.0);
47}
48
50{
51 BBox<double> one{0.0, 0.0, 4.0, 2.0};
52 BBox<double> two{2.0, -1.0, 5.0, 1.0};
53 BBox<double> expected{2.0, 0.0, 4.0, 1.0};
55}
56
57BOOST_AUTO_TEST_SUITE_END()
58BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(BBoxMustBeCreatedValid)
Definition BBox.cxx:31
uint32_t one
Definition RawData.h:4
BBox< T > intersect(const BBox< T > &a, const BBox< T > &b)
Definition BBox.h:90
FIXME: do not use data model tables.
std::map< std::string, ID > expected
BOOST_TEST(digits==digitsD, boost::test_tools::per_element())