ifw-daq
2.1.0-pre1
IFW Data Acquisition modules
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Functions
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
w
Variables
a
c
e
h
i
k
l
m
n
p
r
s
t
v
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
w
~
Variables
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
v
w
Typedefs
a
c
d
e
h
k
m
p
r
s
t
v
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
b
c
d
e
g
j
m
o
p
s
t
Functions
c
m
o
p
s
t
Variables
Typedefs
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
common
daqifSupport
test
testUri.cpp
Go to the documentation of this file.
1
/**
2
* @file
3
* @ingroup daq_ocm_daqifsupport
4
* @copyright 2022 ESO - European Southern Observatory
5
*
6
* @brief daqif:: uri helper test
7
*/
8
#include <gtest/gtest.h>
9
10
#include <
daqif/uri.hpp
>
11
12
using namespace
::testing;
13
14
TEST
(Uri,
MakeServerUri
) {
15
EXPECT_EQ(
daqif::MakeServerUri
(
"zpb://host"
),
"zpb://host/"
);
16
EXPECT_EQ(
daqif::MakeServerUri
(
"zpb://host/"
),
"zpb://host/"
);
17
EXPECT_EQ(
daqif::MakeServerUri
(
"zpb://host//"
),
"zpb://host/"
);
18
}
19
20
TEST
(Uri,
MakeServiceUri
) {
21
EXPECT_EQ(
daqif::MakeServiceUri
(
"zpb://host"
,
"service"
),
"zpb://host/service"
);
22
EXPECT_EQ(
daqif::MakeServiceUri
(
"zpb://host/"
,
"service"
),
"zpb://host/service"
);
23
EXPECT_EQ(
daqif::MakeServiceUri
(
"zpb://host//"
,
"service"
),
"zpb://host/service"
);
24
EXPECT_EQ(
daqif::MakeServiceUri
(
"zpb://host"
,
"/service"
),
"zpb://host/service"
);
25
EXPECT_EQ(
daqif::MakeServiceUri
(
"zpb://host"
,
"//service"
),
"zpb://host/service"
);
26
EXPECT_EQ(
daqif::MakeServiceUri
(
"zpb://host/"
,
"//service"
),
"zpb://host/service"
);
27
EXPECT_EQ(
daqif::MakeServiceUri
(
"zpb://host//"
,
"//service"
),
"zpb://host/service"
);
28
29
EXPECT_THROW(
daqif::MakeServiceUri
(
""
,
""
), std::invalid_argument);
30
EXPECT_THROW(
daqif::MakeServiceUri
(
"////"
,
"///"
), std::invalid_argument);
31
EXPECT_THROW(
daqif::MakeServiceUri
(
"/"
,
"/"
), std::invalid_argument);
32
EXPECT_THROW(
daqif::MakeServiceUri
(
"uri/"
,
"/"
), std::invalid_argument);
33
EXPECT_THROW(
daqif::MakeServiceUri
(
"/"
,
"/service"
), std::invalid_argument);
34
}
35
daqif::MakeServiceUri
network::uri MakeServiceUri(std::string base_uri, std::string_view service_path)
Creates a service URI of the form <baseuri>/<service>.
Definition:
uri.cpp:19
TEST
TEST(Uri, MakeServerUri)
Definition:
testUri.cpp:14
daqif::MakeServerUri
network::uri MakeServerUri(std::string uri)
Creates a server URI.
Definition:
uri.cpp:13
uri.hpp
Contains URI support functions for daqif.
Generated by
1.8.20