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