LCOV - code coverage report
Current view: top level - fuzz - fuzz-catalog.c (source / functions) Hit Total Coverage
Test: systemd_full.info Lines: 0 12 0.0 %
Date: 2019-08-23 13:36:53 Functions: 0 1 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 8 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: LGPL-2.1+ */
       2                 :            : 
       3                 :            : #include "catalog.h"
       4                 :            : #include "fd-util.h"
       5                 :            : #include "fs-util.h"
       6                 :            : #include "fuzz.h"
       7                 :            : #include "tmpfile-util.h"
       8                 :            : 
       9                 :          0 : int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
      10                 :          0 :         _cleanup_(unlink_tempfilep) char name[] = "/tmp/fuzz-catalog.XXXXXX";
      11                 :          0 :         _cleanup_close_ int fd = -1;
      12                 :          0 :         _cleanup_hashmap_free_free_free_ Hashmap *h = NULL;
      13                 :            : 
      14         [ #  # ]:          0 :         if (!getenv("SYSTEMD_LOG_LEVEL"))
      15                 :          0 :                 log_set_max_level(LOG_CRIT);
      16                 :            : 
      17         [ #  # ]:          0 :         assert_se(h = hashmap_new(&catalog_hash_ops));
      18                 :            : 
      19                 :          0 :         fd = mkostemp_safe(name);
      20         [ #  # ]:          0 :         assert_se(fd >= 0);
      21         [ #  # ]:          0 :         assert_se(write(fd, data, size) == (ssize_t) size);
      22                 :            : 
      23                 :          0 :         (void) catalog_import_file(h, name);
      24                 :            : 
      25                 :          0 :         return 0;
      26                 :            : }

Generated by: LCOV version 1.14