util:tests: Correct time tests for negative UTC offsets.
authorAndrew Kroeger <andrew@id10ts.net>
Fri, 4 Sep 2009 21:45:01 +0000 (16:45 -0500)
committerAndrew Tridgell <tridge@samba.org>
Sat, 5 Sep 2009 00:06:29 +0000 (10:06 +1000)
commita32f4dd3cfd43022ab3224366e026664b238429e
treeee8b7ac490ca181e830a62bd05e6542f7d1c15a6
parent5afa115f2ad150563fdf8ba978e5f165d75eba4b
util:tests: Correct time tests for negative UTC offsets.

All:

Please find attached a patch to fix the timestring and http_timestring
tests on hosts that have a negative UTC offset (west of the Prime Meridian).

Sincerely,
Andrew Kroeger

>From 8a8ca35edccf64aa98f2f3ae1469c4c27db8215e Mon Sep 17 00:00:00 2001
From: Andrew Kroeger <andrew@id10ts.net>
Date: Fri, 4 Sep 2009 01:31:50 -0500
Subject: [PATCH] util:tests: Correct time tests for negative UTC offsets.

The timestring and http_timestring tests were failing on hosts with negative
offsets from UTC.  Due to the timezone offset, the returned values were back in
the year 1969 (before the epoch) and did not match the test patterns.

The correction computes the offset from UTC, and if it is negative that offset
is added onto the value given to the timestring() and http_timestring() calls so
that the returned values fall on 01-Jan-1970 and match the test pattern.
lib/util/tests/time.c