Completed test for random writing, truncation and expansion of files