Improved cache unit test.