GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 10 / 0 / 10
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 4 / 0 / 4

libs/url/src/rfc/uri_reference_rule.cpp
Line Branch Exec Source
1 //
2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/url
8 //
9
10
11 #include <boost/url/detail/config.hpp>
12 #include <boost/url/rfc/uri_reference_rule.hpp>
13 #include <boost/url/rfc/uri_rule.hpp>
14 #include <boost/url/rfc/relative_ref_rule.hpp>
15 #include <boost/url/grammar/parse.hpp>
16 #include <boost/url/grammar/variant_rule.hpp>
17 #include <boost/variant2/variant.hpp>
18
19 namespace boost {
20 namespace urls {
21
22 auto
23 2535 implementation_defined::uri_reference_rule_t::
24 parse(
25 char const*& it,
26 char const* const end
27 ) const noexcept ->
28 system::result<value_type>
29 {
30 auto rv = grammar::parse(
31 it, end,
32 2535 grammar::variant_rule(
33 uri_rule,
34 2535 relative_ref_rule));
35
2/2
✓ Branch 1 taken 40 times.
✓ Branch 2 taken 2495 times.
2535 if(! rv)
36 40 return rv.error();
37
2/2
✓ Branch 2 taken 1336 times.
✓ Branch 3 taken 1159 times.
2495 switch(rv->index())
38 {
39 1336 default:
40 case 0:
41 1336 return boost::variant2::get<0>(*rv);
42 1159 case 1:
43 1159 return boost::variant2::get<1>(*rv);
44 }
45 }
46
47 } // urls
48 } // boost
49
50