Source
um_cache_resolve(cache, hostids.values, hostids.values_num, zbx_mock_get_parameter_string("in.macro"),
/*
** 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.
**/
static void mock_get_hostids(zbx_vector_uint64_t *hostids, zbx_mock_handle_t handle)
{
zbx_mock_error_t err;
zbx_mock_handle_t hhostid;
const char *hostid_s;
zbx_uint64_t hostid;
while (ZBX_MOCK_END_OF_VECTOR != (err = (zbx_mock_vector_element(handle, &hhostid))))
{
if (ZBX_MOCK_SUCCESS != (err = zbx_mock_string(hhostid, &hostid_s)))
fail_msg("Cannot read hostid: %s", zbx_mock_error_string(err));
if (SUCCEED != zbx_is_uint64(hostid_s, &hostid))
fail_msg("Invalid hostid: %s", hostid_s);
zbx_vector_uint64_append(hostids, hostid);
}
}
void zbx_mock_test_entry(void **state)
{
zbx_um_mock_cache_t mock_cache0, mock_cache;
zbx_dbsync_t gmacros, hmacros, htmpls;
zbx_um_cache_t *cache;
char *value = NULL;
zbx_vector_uint64_t hostids;
int ret;
zbx_config_vault_t config_vault = {NULL, NULL, NULL, NULL, NULL, NULL};
ZBX_UNUSED(state);
zbx_vector_uint64_create(&hostids);
um_mock_config_init();