Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libs')
-rw-r--r--tests/libs/zbxcommon/parse_key.c3
-rw-r--r--tests/libs/zbxcommon/zbx_function_find.c36
-rw-r--r--tests/libs/zbxcomms/zbx_tcp_check_allowed_peers.c3
-rw-r--r--tests/libs/zbxdbcache/Makefile.am29
-rw-r--r--tests/libs/zbxhistory/Makefile.am4
-rwxr-xr-xtests/libs/zbxserver/Makefile.am5
-rw-r--r--tests/libs/zbxserver/evaluate_function.c2
-rw-r--r--tests/libs/zbxsysinfo/Makefile.am4
-rw-r--r--tests/libs/zbxsysinfo/common/Makefile.am8
9 files changed, 51 insertions, 43 deletions
diff --git a/tests/libs/zbxcommon/parse_key.c b/tests/libs/zbxcommon/parse_key.c
index 09808c035b4..087c389548b 100644
--- a/tests/libs/zbxcommon/parse_key.c
+++ b/tests/libs/zbxcommon/parse_key.c
@@ -37,6 +37,7 @@ void zbx_mock_test_entry(void **state)
ZBX_MOCK_SUCCESS != (error = zbx_mock_string(mh, &key)))
{
fail_msg("Cannot get 'key' from test case data: %s", zbx_mock_error_string(error));
+ goto out;
}
/* mandatory output parameter "return" */
@@ -108,4 +109,6 @@ void zbx_mock_test_entry(void **state)
if (0 != strcmp(expected_invalid_part, key_moving_pointer))
fail_msg("Got '%s' instead of '%s' as the invalid_part.", key_moving_pointer, expected_invalid_part);
+out:
+ return;
}
diff --git a/tests/libs/zbxcommon/zbx_function_find.c b/tests/libs/zbxcommon/zbx_function_find.c
index 18531b1e6d5..3223eb8fe3a 100644
--- a/tests/libs/zbxcommon/zbx_function_find.c
+++ b/tests/libs/zbxcommon/zbx_function_find.c
@@ -63,47 +63,53 @@ void zbx_mock_test_entry(void **state)
zbx_uint32_t num;
if (ZBX_MOCK_SUCCESS != (error = zbx_mock_out_parameter("func_pos", &param_handle)) ||
- ZBX_MOCK_SUCCESS != (error = zbx_mock_string(param_handle, &tmp)))
+ ZBX_MOCK_SUCCESS != (error = zbx_mock_string(param_handle, &tmp)))
{
fail_msg("Cannot get expected 'func_pos' parameter from test case data: %s",
zbx_mock_error_string(error));
+ goto out;
}
- else if(SUCCEED != is_uint32(tmp, &num))
+ else if (SUCCEED != is_uint32(tmp, &num))
{
fail_msg("func_pos parameter \"%s\" is not numeric.", tmp);
+ goto out;
}
func_pos_exp = num;
if (ZBX_MOCK_SUCCESS != (error = zbx_mock_out_parameter("par_l", &param_handle)) ||
- ZBX_MOCK_SUCCESS != (error = zbx_mock_string(param_handle, &tmp)))
+ ZBX_MOCK_SUCCESS != (error = zbx_mock_string(param_handle, &tmp)))
{
fail_msg("Cannot get expected 'par_l' parameter from test case data: %s",
- zbx_mock_error_string(error));
+ zbx_mock_error_string(error));
+ goto out;
}
- else if(SUCCEED != is_uint32(tmp, &num))
+ else if (SUCCEED != is_uint32(tmp, &num))
{
fail_msg("par_l parameter \"%s\" is not numeric.", tmp);
+ goto out;
}
par_l_exp = num;
if (ZBX_MOCK_SUCCESS != (error = zbx_mock_out_parameter("par_r", &param_handle)) ||
- ZBX_MOCK_SUCCESS != (error = zbx_mock_string(param_handle, &tmp)))
+ ZBX_MOCK_SUCCESS != (error = zbx_mock_string(param_handle, &tmp)))
{
fail_msg("Cannot get expected 'par_r' parameter from test case data: %s",
- zbx_mock_error_string(error));
+ zbx_mock_error_string(error));
+ goto out;
}
- else if(SUCCEED != is_uint32(tmp, &num))
+ else if (SUCCEED != is_uint32(tmp, &num))
{
fail_msg("par_r parameter \"%s\" is not numeric.", tmp);
+ goto out;
}
par_r_exp = num;
}
if (FAIL == expected_result && (ZBX_MOCK_SUCCESS != (error = zbx_mock_out_parameter("error", &param_handle)) ||
- ZBX_MOCK_SUCCESS != (error = zbx_mock_string(param_handle, &expected_param_value_string))))
+ ZBX_MOCK_SUCCESS != (error = zbx_mock_string(param_handle, &expected_param_value_string))))
{
fail_msg("Cannot get expected 'error' parameters from test case data: %s",
zbx_mock_error_string(error));
@@ -113,7 +119,7 @@ void zbx_mock_test_entry(void **state)
max_error_len)))
{
fail_msg("Got %s instead of %s as a result. Error: %s", zbx_result_string(actual_result),
- zbx_result_string(expected_result), error_text);
+ zbx_result_string(expected_result), error_text);
}
if (SUCCEED == expected_result)
@@ -121,27 +127,29 @@ void zbx_mock_test_entry(void **state)
if (func_pos != func_pos_exp)
{
fail_msg("Position "ZBX_FS_SIZE_T" of 'function' not equal expected "ZBX_FS_SIZE_T". Error:%s",
- (zbx_fs_size_t)func_pos, (zbx_fs_size_t)func_pos_exp, error_text);
+ (zbx_fs_size_t)func_pos, (zbx_fs_size_t)func_pos_exp, error_text);
}
if (par_l != par_l_exp)
{
fail_msg("Position "ZBX_FS_SIZE_T" of left '(' not equal expected "ZBX_FS_SIZE_T". Error:%s",
- (zbx_fs_size_t)par_l, (zbx_fs_size_t)par_l_exp, error_text);
+ (zbx_fs_size_t)par_l, (zbx_fs_size_t)par_l_exp, error_text);
}
if (par_r != par_r_exp)
{
fail_msg("Position "ZBX_FS_SIZE_T" of right ')' not equal expected "ZBX_FS_SIZE_T". Error:%s",
- (zbx_fs_size_t)par_r, (zbx_fs_size_t)par_r_exp, error_text);
+ (zbx_fs_size_t)par_r, (zbx_fs_size_t)par_r_exp, error_text);
}
}
else /* FAIL == expected_result */
{
if (0 != strcmp(expected_param_value_string, error_text))
{
- fail_msg("Got\n'%s' instead of\n'%s' as a value.", error_text,
+ fail_msg("Got\n'%s' instead of\n'%s' as a value.", error_text,
expected_param_value_string);
}
}
+out:
+ return;
}
diff --git a/tests/libs/zbxcomms/zbx_tcp_check_allowed_peers.c b/tests/libs/zbxcomms/zbx_tcp_check_allowed_peers.c
index fb1706560fd..b42cdf81456 100644
--- a/tests/libs/zbxcomms/zbx_tcp_check_allowed_peers.c
+++ b/tests/libs/zbxcomms/zbx_tcp_check_allowed_peers.c
@@ -41,12 +41,15 @@ static void mock_accept(zbx_socket_t *s)
break;
default:
fail_msg("Unexpected family");
+ goto out;
}
if (1 != inet_pton(s->peer_info.ss_family, (peer = zbx_mock_get_parameter_string("in.peer")), buf))
fail_msg("failed converting address '%s' from textual to binary", zbx_mock_get_parameter_string("in.peer"));
zbx_strlcpy(s->peer, peer, sizeof(s->peer));
+out:
+ return;
}
void zbx_mock_test_entry(void **state)
diff --git a/tests/libs/zbxdbcache/Makefile.am b/tests/libs/zbxdbcache/Makefile.am
index 45db92a1921..72435065925 100644
--- a/tests/libs/zbxdbcache/Makefile.am
+++ b/tests/libs/zbxdbcache/Makefile.am
@@ -87,10 +87,9 @@ zbx_vc_get_values_SOURCES = \
../../zbxmocktest.h
zbx_vc_get_values_LDADD = $(VALUECACHE_LIBS) @SERVER_LIBS@
-zbx_vc_get_values_LDFLAGS = @SERVER_LDFLAGS@
+zbx_vc_get_values_LDFLAGS = @SERVER_LDFLAGS@ $(COMMON_WRAP_FUNCS)
zbx_vc_get_values_CFLAGS = \
- $(COMMON_WRAP_FUNCS) \
-I@top_srcdir@/src/libs/zbxalgo \
-I@top_srcdir@/src/libs/zbxdbcache \
-I@top_srcdir@/src/libs/zbxhistory \
@@ -103,10 +102,9 @@ zbx_vc_add_values_SOURCES = \
../../zbxmocktest.h
zbx_vc_add_values_LDADD = $(VALUECACHE_LIBS) @SERVER_LIBS@
-zbx_vc_add_values_LDFLAGS = @SERVER_LDFLAGS@
+zbx_vc_add_values_LDFLAGS = @SERVER_LDFLAGS@ $(COMMON_WRAP_FUNCS)
zbx_vc_add_values_CFLAGS = \
- $(COMMON_WRAP_FUNCS) \
-I@top_srcdir@/src/libs/zbxalgo \
-I@top_srcdir@/src/libs/zbxdbcache \
-I@top_srcdir@/src/libs/zbxhistory \
@@ -119,10 +117,9 @@ zbx_vc_get_value_SOURCES = \
../../zbxmocktest.h
zbx_vc_get_value_LDADD = $(VALUECACHE_LIBS) @SERVER_LIBS@
-zbx_vc_get_value_LDFLAGS = @SERVER_LDFLAGS@
+zbx_vc_get_value_LDFLAGS = @SERVER_LDFLAGS@ $(COMMON_WRAP_FUNCS)
zbx_vc_get_value_CFLAGS = \
- $(COMMON_WRAP_FUNCS) \
-I@top_srcdir@/src/libs/zbxalgo \
-I@top_srcdir@/src/libs/zbxdbcache \
-I@top_srcdir@/src/libs/zbxhistory \
@@ -157,37 +154,35 @@ dc_item_poller_type_update_CFLAGS = -I@top_srcdir@/tests -I@top_srcdir@/src/libs
dc_expand_user_macros_in_expression_CFLAGS = \
-I@top_srcdir@/tests \
-I@top_srcdir@/tests/mocks/configcache \
- -I@top_srcdir@/src/libs/zbxdbcache \
- -Wl,--wrap=zbx_hashset_search
+ -I@top_srcdir@/src/libs/zbxdbcache
dc_expand_user_macros_in_expression_SOURCES = \
dc_expand_user_macros_in_expression.c
dc_expand_user_macros_in_expression_LDADD = \
$(top_srcdir)/tests/mocks/configcache/libconfigcachemock.a \
$(CACHE_LIBS) @SERVER_LIBS@
-dc_expand_user_macros_in_expression_LDFLAGS = @SERVER_LDFLAGS@
-
+dc_expand_user_macros_in_expression_LDFLAGS = @SERVER_LDFLAGS@ \
+ -Wl,--wrap=zbx_hashset_search
dc_expand_user_macros_in_func_params_CFLAGS = \
-I@top_srcdir@/tests \
-I@top_srcdir@/tests/mocks/configcache \
- -I@top_srcdir@/src/libs/zbxdbcache \
- -Wl,--wrap=zbx_hashset_search
+ -I@top_srcdir@/src/libs/zbxdbcache
dc_expand_user_macros_in_func_params_SOURCES = \
dc_expand_user_macros_in_func_params.c
dc_expand_user_macros_in_func_params_LDADD = \
$(top_srcdir)/tests/mocks/configcache/libconfigcachemock.a \
$(CACHE_LIBS) @SERVER_LIBS@
-dc_expand_user_macros_in_func_params_LDFLAGS = @SERVER_LDFLAGS@
-
+dc_expand_user_macros_in_func_params_LDFLAGS = @SERVER_LDFLAGS@ \
+ -Wl,--wrap=zbx_hashset_search
dc_expand_user_macros_in_calcitem_CFLAGS = \
-I@top_srcdir@/tests \
-I@top_srcdir@/tests/mocks/configcache \
- -I@top_srcdir@/src/libs/zbxdbcache \
- -Wl,--wrap=zbx_hashset_search
+ -I@top_srcdir@/src/libs/zbxdbcache
dc_expand_user_macros_in_calcitem_SOURCES = \
dc_expand_user_macros_in_calcitem.c
dc_expand_user_macros_in_calcitem_LDADD = \
$(top_srcdir)/tests/mocks/configcache/libconfigcachemock.a \
$(CACHE_LIBS) @SERVER_LIBS@
-dc_expand_user_macros_in_calcitem_LDFLAGS = @SERVER_LDFLAGS@
+dc_expand_user_macros_in_calcitem_LDFLAGS = @SERVER_LDFLAGS@ \
+ -Wl,--wrap=zbx_hashset_search
endif
diff --git a/tests/libs/zbxhistory/Makefile.am b/tests/libs/zbxhistory/Makefile.am
index 503b2b0f39d..c1908706c59 100644
--- a/tests/libs/zbxhistory/Makefile.am
+++ b/tests/libs/zbxhistory/Makefile.am
@@ -37,10 +37,10 @@ zbx_history_get_values_WRAP = \
zbx_history_get_values_LDADD = $(HISTORY_LIBS) @SERVER_LIBS@
-zbx_history_get_values_LDFLAGS = @SERVER_LDFLAGS@
+zbx_history_get_values_LDFLAGS = @SERVER_LDFLAGS@ \
+ $(zbx_history_get_values_WRAP)
zbx_history_get_values_CFLAGS = \
- $(zbx_history_get_values_WRAP) \
-I@top_srcdir@/src/libs/zbxalgo \
-I@top_srcdir@/tests
endif
diff --git a/tests/libs/zbxserver/Makefile.am b/tests/libs/zbxserver/Makefile.am
index f030a8e5181..d316271b156 100755
--- a/tests/libs/zbxserver/Makefile.am
+++ b/tests/libs/zbxserver/Makefile.am
@@ -115,7 +115,7 @@ evaluate_function_LDADD += $(COMMON_LIB_FILES)
evaluate_function_LDADD += @SERVER_LIBS@
-evaluate_function_LDFLAGS = @SERVER_LDFLAGS@
+evaluate_function_LDFLAGS = @SERVER_LDFLAGS@ $(VALUECACHE_WRAP_FUNCS)
VALUECACHE_WRAP_FUNCS = \
-Wl,--wrap=zbx_mutex_create \
@@ -137,7 +137,6 @@ VALUECACHE_WRAP_FUNCS = \
evaluate_function_CFLAGS = $(COMMON_COMPILER_FLAGS) \
-I@top_srcdir@/src/libs/zbxalgo \
-I@top_srcdir@/src/libs/zbxdbcache \
- -I@top_srcdir@/src/libs/zbxhistory \
- $(VALUECACHE_WRAP_FUNCS)
+ -I@top_srcdir@/src/libs/zbxhistory
endif
diff --git a/tests/libs/zbxserver/evaluate_function.c b/tests/libs/zbxserver/evaluate_function.c
index f7edf171ebc..2d95e6afb55 100644
--- a/tests/libs/zbxserver/evaluate_function.c
+++ b/tests/libs/zbxserver/evaluate_function.c
@@ -43,6 +43,7 @@ int __wrap_substitute_simple_macros(zbx_uint64_t *actionid, const DB_EVENT *even
ZBX_UNUSED(dc_item);
ZBX_UNUSED(alert);
ZBX_UNUSED(ack);
+ ZBX_UNUSED(tz);
ZBX_UNUSED(data);
ZBX_UNUSED(macro_type);
ZBX_UNUSED(error);
@@ -96,7 +97,6 @@ void zbx_mock_test_entry(void **state)
if (SUCCEED == expected_ret)
{
- zbx_mock_handle_t handle;
const char *expected_value;
char *ptr;
double expected_dbl;
diff --git a/tests/libs/zbxsysinfo/Makefile.am b/tests/libs/zbxsysinfo/Makefile.am
index 5bb83ebfa8e..a721aa4bbcb 100644
--- a/tests/libs/zbxsysinfo/Makefile.am
+++ b/tests/libs/zbxsysinfo/Makefile.am
@@ -140,9 +140,9 @@ process_WRAP_FUNCS = \
process_LDADD += @AGENT_LIBS@
-process_LDFLAGS = @AGENT_LDFLAGS@
+process_LDFLAGS = @AGENT_LDFLAGS@ $(process_WRAP_FUNCS)
-process_CFLAGS = $(process_WRAP_FUNCS) -DZABBIX_DAEMON -I@top_srcdir@/tests
+process_CFLAGS = -DZABBIX_DAEMON -I@top_srcdir@/tests
# check_key_access_rules
diff --git a/tests/libs/zbxsysinfo/common/Makefile.am b/tests/libs/zbxsysinfo/common/Makefile.am
index 2c0e9e7075c..a887f4e37c3 100644
--- a/tests/libs/zbxsysinfo/common/Makefile.am
+++ b/tests/libs/zbxsysinfo/common/Makefile.am
@@ -53,9 +53,9 @@ SYSTEM_LOCALTIME_LDADD = \
SYSTEM_LOCALTIME_LDADD += @AGENT_LIBS@
-SYSTEM_LOCALTIME_LDFLAGS = @AGENT_LDFLAGS@
+SYSTEM_LOCALTIME_LDFLAGS = @AGENT_LDFLAGS@ $(SYSTEM_LOCALTIME_WRAP_FUNCS)
-SYSTEM_LOCALTIME_CFLAGS = $(SYSTEM_LOCALTIME_WRAP_FUNCS) $(COMMON_COMPILER_FLAGS)
+SYSTEM_LOCALTIME_CFLAGS = $(COMMON_COMPILER_FLAGS)
WEB_PAGE_GET_SOURCES = \
WEB_PAGE_GET.c \
@@ -80,9 +80,9 @@ WEB_PAGE_GET_LDADD = \
WEB_PAGE_GET_LDADD += @AGENT_LIBS@
-WEB_PAGE_GET_LDFLAGS = @AGENT_LDFLAGS@
+WEB_PAGE_GET_LDFLAGS = @AGENT_LDFLAGS@ $(WEB_PAGE_GET_WRAP_FUNCS)
-WEB_PAGE_GET_CFLAGS = $(WEB_PAGE_GET_WRAP_FUNCS) $(COMMON_COMPILER_FLAGS)
+WEB_PAGE_GET_CFLAGS = $(COMMON_COMPILER_FLAGS)
VFS_FILE_EXISTS_SOURCES = \
VFS_FILE_EXISTS.c \