[libvirt PATCH 5/5] tests: Allow expansion of mocked stat symbols

Daniel P. Berrangé berrange at redhat.com
Mon Mar 7 10:01:40 UTC 2022

On Mon, Mar 07, 2022 at 10:04:06AM +0100, Martin Kletzander wrote:
> 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.

This doesn't sound right to me.

If we're implementing a mock for 'stat64', we should not be looking
up 'stat'.  We should  be implmenting a mock for 'stat' instead.

It sounds more like we got MOCK_STAT and MOCK_STAT64 incorrectly
defined surely.

|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

More information about the libvir-list mailing list