cached-function.hh: fix reset(), improve test.

Now test can be used to test issue #72.