This is one of those questions that's really just trying to see if you understand the issues involved. There's no "one right answer". From the question, it's not even clear what it is you're supposed to be testing. If the program relies on the system clock to be correct, then it should fail if the system clock is incorrect. If the program relies on the system clock being monotonic, it should fail if the system clock jumps backwards.
Basically, you need to test two categories of things. In the cases where the program is supposed to work, does it? (For example, if it's supposed to tolerate backwards clock jumps without fail, what happens if there's a backwards clock jump?) And in the cases where the program is supposed to fail, does it fail the way it's supposed to? (If it's supposed to refuse to authenticate if the clock is too far off, does it in fact do so?)
One issue is how you give it incorrect clock information. One way is the way you suggested -- add a call to intercept the program's "get the current time" function and give it different time. The downside of this approach is that the program might, somewhere deep in its code, get the time some other way that you failed to hook.
But the real problem with this approach is that it will likely cause the system to see inconsistent times. For example, say the program creates a file and then later calls stat
to get the file's last modified time, which it compares to the, hooked, system time. The program will get the wrong age for the file unless you hook and offset all calls that return times.
The other way is to actually set the system clock incorrectly in the test harness.