lib/util:tests/time.c - "test_timestring" - fix it on Solaris

Matthieu Patou mat at
Mon Dec 6 01:38:34 MST 2010


I guess you have to introduce a test in  lib/util/wscript_configure to 
HAVE_CORRECT_STRFTIME by testing the output of strftime() and if the 
output is not ok then we should use asctime (at least on sun8 it seems ok).

Have a look at changeset 4ea7d4694a8353fc55ecd12cb09b9c91ffde7b3f
On 06/12/2010 05:59, Andrew Bartlett wrote:

> On Sun, 2010-12-05 at 23:10 +0100, Matthias Dieter Wallnöfer wrote:
>> The branch, master has been updated
>>         via  654e010 lib/util:tests/time.c - "test_timestring" - fix it on Solaris
>>        from  55dba7b s4:cluster/cluster.h - fix another gcc 3.4 "struct" warning
>> - Log -----------------------------------------------------------------
>> commit 654e0102ddb0acaaf45fb55c15818722235fcc9f
>> Author: Matthias Dieter Wallnöfer<mdw at>
>> Date:   Sun Dec 5 22:20:06 2010 +0100
>>      lib/util:tests/time.c - "test_timestring" - fix it on Solaris
>>      Solaris returns "Thu Jan 01" and not "Thu Jan  1" - therefore proof for
>>      both.
> I'm not sure that this patch is correct.
> Given we had a test for a particular value, and we carefully build the
> value with strftime() if available, why does this patch accept different
> values, rather than fix the the timestring() function?
> In general, I'm suspicious of patches that fix tests by changing the
> test result rather than fixing the original function.
> Perhaps none of the callers care, as long as it's clear to human readers
> of the string, but there are rather a lot of callers to this function.
> Andrew Bartlett

More information about the samba-technical mailing list