Source
static void test_queue_ptr_remove_value(zbx_queue_ptr_t *queue, void **values, int values_num, void *value)
/*
** Zabbix
** Copyright (C) 2001-2025 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_read_values(zbx_mock_handle_t hdata, zbx_vector_ptr_t *values)
{
zbx_mock_error_t err;
zbx_mock_handle_t hvalue;
while (ZBX_MOCK_END_OF_VECTOR != (err = (zbx_mock_vector_element(hdata, &hvalue))))
{
zbx_uint64_t value;
if (ZBX_MOCK_SUCCESS != (err = zbx_mock_uint64(hvalue, &value)))
{
fail_msg("Cannot read vector member: %s", zbx_mock_error_string(err));
}
zbx_vector_ptr_append(values, (void *)value);
}
}
static void test_queue_range_values(int iterations, zbx_vector_ptr_t *values)
{
zbx_queue_ptr_t queue;
void *ptr;
int i, j;
zbx_queue_ptr_create(&queue);
/* Test pushing/popping values from queue. Queue buffer size is always larger than the number */
/* of stored values, therefore pushing and popping N values from the queue will have different */