On (20/11/14 11:25), Lukas Slebodnik wrote:
ehlo,
I was not able to mock functions with linker flang -wrap when
they was called indirectly by another function from dynamic library.
(It works with dirrect invocation of function)
mc_client_tests_LDFLAGS = \
-Wl,-wrap,sss_nss_check_header \
-Wl,-wrap,sss_open_cloexec \
$(NULL)
This is a reason why I wrote mocked function in unit test
e.g.
__real_sss_open_cloexec
__wrap_sss_open_cloexec
sss_open_cloexec
If you know better way how to mock functions I will be glad to change test.
LS
Attached are patches which fix warning caused by change in structure
"struct sss_cli_mc_ctx"
src/tests/cmocka/test_mc_client.c:49:41: error: missing initializer for field
‘active_threads’ of ‘struct sss_cli_mc_ctx’ [-Werror=missing-field-initializers]
0 };
^
In file included from ../sssd/src/tests/cmocka/test_mc_client.c:36:0:
src/sss_client/nss_mc.h:58:14: note: ‘active_threads’ declared here
uint32_t active_threads; /* count of threads which use memory cache */
^
cc1: all warnings being treated as errors