<div dir="ltr"><div style>If you need a small number of small files, it&#39;s not going to be very slow - maybe you just actually use real files.  testresources will let you reuse the files across multiple tests.  That may be simpler than mocking things, and as you say it reduces the need for the test to know *how* the function works - for example the test would probably keep passing even if the implementation was moved to non-mockable C.</div>

<div style><br></div><div style>If you are going to mock some IO functions then you can reduce (if not entirely avoid) the test knowing about the implementations by using mocks that just set the return values rather than making any assertions or assumptions about which order things are called.</div>

</div>