~~created a minor cpp unit test which replicated the desired behavior in the code. that being insufficient, as soon as my node syncs I'll prune it, set a breakpoint and verify correct behavior~~
edit: To check for correct behavior, wrote a test that creates empty blk000xx.dat and rev000xx.dat files from 0 to 28, with contiguous and non-contiguous segments, and runs the CleanupBlockRevFiles() function. then, this test will be run with clang's address, memory and undefined sanitizers, in turn.