Subject | Re: [firebird-support] How do I test date manipulation code |
---|---|
Author | Tim Ward |
Post date | 2013-10-29T16:22:48Z |
Thanks ... in fact I got away with it by fiddling with the system clock, on an isolated system on which it turned out to be easier to turn off ntpd than I had been expecting.On 29/10/13 12:05, Tim Ward wrote:
> I've got a stored procedure which does some sums on dates, which are
> passed in as parameters.
...
> **BUT** the stored procedure I want to test does different things
> depending on what the date is today, which it determines using the 'NOW'
> pre-defined date literal.
>
> So how do I test this procedure? How do I get 'NOW', used within the
> procedure, to produce different timestamps as needed for the various
> test cases? (Without, of course, typing different things into the
> procedure itself, thus introducing the risk of getting it wrong and
> introducing bugs when I later remove the test code.)
Short answer: You can't (and shouldn't try by fiddling with the system
clock)
-- Tim Ward