it s should be possible to do it in unit tests  we should be able to mock out any part of the architecture  eg  involved parts are lib archive  mocked out as fake lib archive volumearchivelibarchive volumereader  mocked out as fakevolumereader however  the mocking here could be done better  custom callbacks in volumearchivelibarchive are not tested  and they have significant and critical logic  they should be tested  well designed tests should be able to test everything  imho  fake libarchive implementation should invoke the custom callbacks  so all functionality of volumearchivelibarchive is tested  fakevolumereader would be then non trivial and could return fake data  as a result of code in volumearchivelibarchive would be tested  wdyt 