Source
config->um_cache = step->cache = um_cache_sync(config->um_cache, 0, &gmacros, &hmacros, &htmpls,
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
ZBX_VECTOR_DECL(kv, zbx_dc_kv_t)
ZBX_VECTOR_IMPL(kv, zbx_dc_kv_t)
typedef struct
{
zbx_um_cache_t *cache;
zbx_vector_kv_t macros;
zbx_vector_uint64_t hostids;
zbx_um_mock_cache_t mock_cache;
}
zbx_mock_step_t;
ZBX_PTR_VECTOR_DECL(mock_step, zbx_mock_step_t *)
ZBX_PTR_VECTOR_IMPL(mock_step, zbx_mock_step_t *)
static void mock_step_free(zbx_mock_step_t *step)
{
int i;
for (i = step->cache->refcount; i != 0; i--)
um_cache_release(step->cache);
zbx_vector_kv_destroy(&step->macros);
zbx_vector_uint64_destroy(&step->hostids);
zbx_free(step);
}
static void mock_step_validate(zbx_mock_step_t *step)
{
int i;
for (i = 0; i < step->macros.values_num; i++)