LCOV - code coverage report
Current view: top level - spdk/test/unit/lib - json_mock.c (source / functions) Hit Total Coverage
Test: Combined Lines: 8 34 23.5 %
Date: 2024-07-15 09:31:40 Functions: 8 34 23.5 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /*   SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  *   Copyright (C) 2018 Intel Corporation.
       3                 :            :  *   All rights reserved.
       4                 :            :  *   Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
       5                 :            :  */
       6                 :            : 
       7                 :            : #include "spdk/json.h"
       8                 :            : #include "spdk_internal/mock.h"
       9                 :            : 
      10                 :          0 : DEFINE_STUB(spdk_json_write_begin, struct spdk_json_write_ctx *, (spdk_json_write_cb write_cb,
      11                 :            :                 void *cb_ctx, uint32_t flags), NULL);
      12                 :            : 
      13                 :          0 : DEFINE_STUB(spdk_json_write_end, int, (struct spdk_json_write_ctx *w), 0);
      14                 :          0 : DEFINE_STUB(spdk_json_write_null, int, (struct spdk_json_write_ctx *w), 0);
      15                 :          0 : DEFINE_STUB(spdk_json_write_bool, int, (struct spdk_json_write_ctx *w, bool val), 0);
      16                 :          0 : DEFINE_STUB(spdk_json_write_uint8, int, (struct spdk_json_write_ctx *w, uint8_t val), 0);
      17                 :          0 : DEFINE_STUB(spdk_json_write_uint16, int, (struct spdk_json_write_ctx *w, uint16_t val), 0);
      18                 :          0 : DEFINE_STUB(spdk_json_write_int32, int, (struct spdk_json_write_ctx *w, int32_t val), 0);
      19                 :          0 : DEFINE_STUB(spdk_json_write_uint32, int, (struct spdk_json_write_ctx *w, uint32_t val), 0);
      20                 :          0 : DEFINE_STUB(spdk_json_write_int64, int, (struct spdk_json_write_ctx *w, int64_t val), 0);
      21                 :          0 : DEFINE_STUB(spdk_json_write_uint64, int, (struct spdk_json_write_ctx *w, uint64_t val), 0);
      22                 :         12 : DEFINE_STUB(spdk_json_write_string, int, (struct spdk_json_write_ctx *w, const char *val), 0);
      23                 :          0 : DEFINE_STUB(spdk_json_write_string_raw, int, (struct spdk_json_write_ctx *w, const char *val,
      24                 :            :                 size_t len), 0);
      25                 :          0 : DEFINE_STUB(spdk_json_write_string_fmt, int, (struct spdk_json_write_ctx *w, const char *fmt, ...),
      26                 :            :             0);
      27                 :            : 
      28                 :          4 : DEFINE_STUB(spdk_json_write_array_begin, int, (struct spdk_json_write_ctx *w), 0);
      29                 :          4 : DEFINE_STUB(spdk_json_write_array_end, int, (struct spdk_json_write_ctx *w), 0);
      30                 :          4 : DEFINE_STUB(spdk_json_write_object_begin, int, (struct spdk_json_write_ctx *w), 0);
      31                 :          8 : DEFINE_STUB(spdk_json_write_object_end, int, (struct spdk_json_write_ctx *w), 0);
      32                 :          0 : DEFINE_STUB(spdk_json_write_name, int, (struct spdk_json_write_ctx *w, const char *name), 0);
      33                 :          0 : DEFINE_STUB(spdk_json_write_name_raw, int, (struct spdk_json_write_ctx *w, const char *name,
      34                 :            :                 size_t len), 0);
      35                 :            : 
      36                 :            : /* Utility functions */
      37                 :          0 : DEFINE_STUB(spdk_json_write_named_null, int, (struct spdk_json_write_ctx *w, const char *name), 0);
      38                 :          0 : DEFINE_STUB(spdk_json_write_named_bool, int, (struct spdk_json_write_ctx *w, const char *name,
      39                 :            :                 bool val), 0);
      40                 :          0 : DEFINE_STUB(spdk_json_write_named_uint8, int, (struct spdk_json_write_ctx *w, const char *name,
      41                 :            :                 uint8_t val), 0);
      42                 :          0 : DEFINE_STUB(spdk_json_write_named_uint16, int, (struct spdk_json_write_ctx *w, const char *name,
      43                 :            :                 uint16_t val), 0);
      44                 :          0 : DEFINE_STUB(spdk_json_write_named_int32, int, (struct spdk_json_write_ctx *w, const char *name,
      45                 :            :                 int32_t val), 0);
      46                 :         12 : DEFINE_STUB(spdk_json_write_named_uint32, int, (struct spdk_json_write_ctx *w, const char *name,
      47                 :            :                 uint32_t val), 0);
      48                 :          0 : DEFINE_STUB(spdk_json_write_named_uint64, int, (struct spdk_json_write_ctx *w, const char *name,
      49                 :            :                 uint64_t val), 0);
      50                 :          0 : DEFINE_STUB(spdk_json_write_named_int64, int, (struct spdk_json_write_ctx *w, const char *name,
      51                 :            :                 int64_t val), 0);
      52                 :          0 : DEFINE_STUB(spdk_json_write_named_uuid, int, (struct spdk_json_write_ctx *w, const char *name,
      53                 :            :                 const struct spdk_uuid *uuid), 0);
      54                 :          0 : DEFINE_STUB(spdk_json_write_named_string, int, (struct spdk_json_write_ctx *w, const char *name,
      55                 :            :                 const char *val), 0);
      56                 :         12 : DEFINE_STUB(spdk_json_write_named_string_fmt, int, (struct spdk_json_write_ctx *w, const char *name,
      57                 :            :                 const char *fmt, ...), 0);
      58                 :          0 : DEFINE_STUB(spdk_json_write_named_string_fmt_v, int, (struct spdk_json_write_ctx *w,
      59                 :            :                 const char *name, const char *fmt, va_list args), 0);
      60                 :            : 
      61                 :          0 : DEFINE_STUB(spdk_json_write_named_array_begin, int, (struct spdk_json_write_ctx *w,
      62                 :            :                 const char *name), 0);
      63                 :          4 : DEFINE_STUB(spdk_json_write_named_object_begin, int, (struct spdk_json_write_ctx *w,
      64                 :            :                 const char *name), 0);
      65                 :            : 
      66                 :          0 : DEFINE_STUB(spdk_json_number_to_uint64, int, (const struct spdk_json_val *val, uint64_t *num), 0);

Generated by: LCOV version 1.14