mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
tests: Allow expansion of mocked stat symbols
When libc uses a define to rewrite stat64 to stat our mocks do not work if they are chained because the symbol that we are looking up is being stringified and therefore preventing the stat64->stat expansion per C-preprocessor rules. One stringification macro is just enough to make it work. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
822be8d652
commit
3c61c9bea6
@ -296,12 +296,14 @@
|
||||
do {} while (0)
|
||||
#endif
|
||||
|
||||
#define VIR_MOCK_STRINGIFY_SYMBOL(name) #name
|
||||
|
||||
#define VIR_MOCK_REAL_INIT(name) \
|
||||
do { \
|
||||
VIR_MOCK_REAL_INIT_MAIN(name, #name); \
|
||||
if (real_##name == NULL && \
|
||||
!(real_##name = dlsym(RTLD_NEXT, \
|
||||
#name))) { \
|
||||
VIR_MOCK_STRINGIFY_SYMBOL(name)))) { \
|
||||
fprintf(stderr, "Missing symbol '" #name "'\n"); \
|
||||
abort(); \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user