lib/util:tests/time.c - "test_timestring" - fix it on Solaris
jelmer at vernstok.nl
Mon Dec 6 02:32:20 MST 2010
On Mon, 2010-12-06 at 11:38 +0300, Matthieu Patou wrote:
> 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).
I think we should rather try to keep all platform-specific workarounds
in lib/replace. So if the strftime() doesn't do what we expect it to I
think we should add a strftime() replacement to lib/replace.
> 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
> >> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> >> - Log -----------------------------------------------------------------
> >> commit 654e0102ddb0acaaf45fb55c15818722235fcc9f
> >> Author: Matthias Dieter WallnÃ¶fer<mdw at samba.org>
> >> 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