#include "zbxmockassert.h"
#include "zbxcacheconfig/user_macro.h"
#include "um_cache_mock.h"
char *um_mock_format_macro(const char *name, const char *context);
void *__wrap___zbx_shmem_malloc(const char *file, int line, zbx_shmem_info_t *info, const void *old, size_t size);
void *__wrap___zbx_shmem_realloc(const char *file, int line, zbx_shmem_info_t *info, void *old, size_t size);
void __wrap___zbx_shmem_free(const char *file, int line, zbx_shmem_info_t *info, void *ptr);
ZBX_PTR_VECTOR_IMPL(um_mock_macro, zbx_um_mock_macro_t *)
ZBX_PTR_VECTOR_DECL(um_mock_host, zbx_um_mock_host_t *)
ZBX_PTR_VECTOR_IMPL(um_mock_host, zbx_um_mock_host_t *)
ZBX_PTR_VECTOR_IMPL(um_mock_kv, zbx_um_mock_kv_t *)
ZBX_PTR_VECTOR_IMPL(um_mock_kvset, zbx_um_mock_kvset_t *)
static void um_mock_macro_free(zbx_um_mock_macro_t *macro)
static void um_mock_macro_init(zbx_um_mock_macro_t *macro, zbx_uint64_t hostid, zbx_mock_handle_t hmacro)
zbx_mock_handle_t handle;
macro->macroid = zbx_mock_get_object_member_uint64(hmacro, "macroid");
macro->macro = zbx_strdup(NULL, zbx_mock_get_object_member_string(hmacro, "macro"));
if (ZBX_MOCK_SUCCESS == zbx_mock_object_member(hmacro, "value", &handle))
if (ZBX_MOCK_SUCCESS != (err = zbx_mock_string(handle, &str)))
fail_msg("Cannot read macro value: %s", zbx_mock_error_string(err));
macro->value = zbx_strdup(NULL, str);