LCOV - code coverage report
Current view: top level - test - test-web-util.c (source / functions) Hit Total Coverage
Test: systemd_full.info Lines: 15 15 100.0 %
Date: 2019-08-23 13:36:53 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 10 20 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: LGPL-2.1+ */
       2                 :            : 
       3                 :            : #include "macro.h"
       4                 :            : #include "web-util.h"
       5                 :            : 
       6                 :          4 : static void test_is_valid_documentation_url(void) {
       7         [ -  + ]:          4 :         assert_se(documentation_url_is_valid("http://www.freedesktop.org/wiki/Software/systemd"));
       8         [ -  + ]:          4 :         assert_se(documentation_url_is_valid("https://www.kernel.org/doc/Documentation/binfmt_misc.txt"));  /* dead */
       9         [ -  + ]:          4 :         assert_se(documentation_url_is_valid("https://www.kernel.org/doc/Documentation/admin-guide/binfmt-misc.rst"));
      10         [ -  + ]:          4 :         assert_se(documentation_url_is_valid("https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html"));
      11         [ -  + ]:          4 :         assert_se(documentation_url_is_valid("file:/foo/foo"));
      12         [ -  + ]:          4 :         assert_se(documentation_url_is_valid("man:systemd.special(7)"));
      13         [ -  + ]:          4 :         assert_se(documentation_url_is_valid("info:bar"));
      14                 :            : 
      15         [ -  + ]:          4 :         assert_se(!documentation_url_is_valid("foo:"));
      16         [ -  + ]:          4 :         assert_se(!documentation_url_is_valid("info:"));
      17         [ -  + ]:          4 :         assert_se(!documentation_url_is_valid(""));
      18                 :          4 : }
      19                 :            : 
      20                 :          4 : int main(int argc, char *argv[]) {
      21                 :          4 :         test_is_valid_documentation_url();
      22                 :            : 
      23                 :          4 :         return 0;
      24                 :            : }

Generated by: LCOV version 1.14