LCOV - code coverage report
Current view: top level - src/util - url.cpp (source / functions) Hit Total Coverage
Test: coverage.lcov Lines: 11 11 100.0 %
Date: 2022-04-21 14:51:19 Functions: 1 1 100.0 %
Legend: Modified by patch:
Lines: hit not hit | Branches: + taken - not taken # not executed

Not modified by patch:
Lines: hit not hit | Branches: + taken - not taken # not executed
Branches: 3 4 75.0 %

           Branch data     Line data    Source code
#       1                 :            : // Copyright (c) 2015-2019 The Bitcoin Core developers
#       2                 :            : // Distributed under the MIT software license, see the accompanying
#       3                 :            : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#       4                 :            : 
#       5                 :            : #include <util/url.h>
#       6                 :            : 
#       7                 :            : #include <event2/http.h>
#       8                 :            : #include <stdlib.h>
#       9                 :            : #include <string>
#      10                 :            : 
#      11                 :       8664 : std::string urlDecode(const std::string &urlEncoded) {
#      12                 :       8664 :     std::string res;
#      13         [ +  + ]:       8664 :     if (!urlEncoded.empty()) {
#      14                 :       8159 :         char *decoded = evhttp_uridecode(urlEncoded.c_str(), false, nullptr);
#      15         [ +  - ]:       8159 :         if (decoded) {
#      16                 :       8159 :             res = std::string(decoded);
#      17                 :       8159 :             free(decoded);
#      18                 :       8159 :         }
#      19                 :       8159 :     }
#      20                 :       8664 :     return res;
#      21                 :       8664 : }

Generated by: LCOV version 0-eol-96201-ge66f56f4af6a