Project
Loading...
Searching...
No Matches
test_CCDBHelpers.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 Framework CCDBHelpers
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15
16#include <boost/test/unit_test.hpp>
17#include "../src/CCDBHelpers.h"
18
19using namespace o2::framework;
20
22{
24 BOOST_CHECK_EQUAL(result.error, ""); // not an error
25
27 BOOST_CHECK_EQUAL(result.error, "URL should start with either http:// or https:// or file://");
28
29 result = CCDBHelpers::parseRemappings("https://alice.cern.ch:8000");
30 BOOST_CHECK_EQUAL(result.error, "Expecting at least one target path, missing `='?");
31
32 result = CCDBHelpers::parseRemappings("https://alice.cern.ch:8000=");
33 BOOST_CHECK_EQUAL(result.error, "Empty target");
34
35 result = CCDBHelpers::parseRemappings("https://alice.cern.ch:8000=/foo/bar,");
36 BOOST_CHECK_EQUAL(result.error, "Empty target");
37
38 result = CCDBHelpers::parseRemappings("https://alice.cern.ch:8000=/foo/bar,/foo/bar;");
39 BOOST_CHECK_EQUAL(result.error, "URL should start with either http:// or https:// or file://");
40
41 result = CCDBHelpers::parseRemappings("https://alice.cern.ch:8000=/foo/bar,/foo/barbar;file://user/test=/foo/barr");
42 BOOST_CHECK_EQUAL(result.error, "");
43 BOOST_CHECK_EQUAL(result.remappings.size(), 3);
44 BOOST_CHECK_EQUAL(result.remappings["/foo/bar"], "https://alice.cern.ch:8000");
45 BOOST_CHECK_EQUAL(result.remappings["/foo/barbar"], "https://alice.cern.ch:8000");
46 BOOST_CHECK_EQUAL(result.remappings["/foo/barr"], "file://user/test");
47
48 result = CCDBHelpers::parseRemappings("https://alice.cern.ch:8000=/foo/bar;file://user/test=/foo/bar");
49 BOOST_CHECK_EQUAL(result.remappings.size(), 1);
50 BOOST_CHECK_EQUAL(result.error, "Path /foo/bar requested more than once.");
51}
GLuint64EXT * result
Definition glcorearb.h:5662
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
static ParserResult parseRemappings(char const *)
BOOST_AUTO_TEST_CASE(TestSorting)
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())