LCOV - code coverage report
Current view: top level - src/test/util - str.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: 11 14 78.6 %

           Branch data     Line data    Source code
#       1                 :            : // Copyright (c) 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 <test/util/str.h>
#       6                 :            : 
#       7                 :            : #include <cstdint>
#       8                 :            : #include <string>
#       9                 :            : 
#      10                 :            : bool CaseInsensitiveEqual(const std::string& s1, const std::string& s2)
#      11                 :         28 : {
#      12         [ -  + ]:         28 :     if (s1.size() != s2.size()) return false;
#      13         [ +  + ]:       1264 :     for (size_t i = 0; i < s1.size(); ++i) {
#      14                 :       1236 :         char c1 = s1[i];
#      15 [ +  + ][ +  + ]:       1236 :         if (c1 >= 'A' && c1 <= 'Z') c1 -= ('A' - 'a');
#      16                 :       1236 :         char c2 = s2[i];
#      17 [ +  + ][ -  + ]:       1236 :         if (c2 >= 'A' && c2 <= 'Z') c2 -= ('A' - 'a');
#      18         [ -  + ]:       1236 :         if (c1 != c2) return false;
#      19                 :       1236 :     }
#      20                 :         28 :     return true;
#      21                 :         28 : }

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