[PATCH] selftest: Account for 0-based months in date parsing and printing.
Andrew Kroeger
andrew at id10ts.net
Fri Sep 4 00:24:00 MDT 2009
---
selftest/Subunit.pm | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/selftest/Subunit.pm b/selftest/Subunit.pm
index ecd712a..8641180 100644
--- a/selftest/Subunit.pm
+++ b/selftest/Subunit.pm
@@ -37,7 +37,7 @@ sub parse_results($$$)
$msg_ops->start_test($1);
push (@$open_tests, $1);
} elsif (/^time: (\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)Z\n/) {
- $msg_ops->report_time(mktime($6, $5, $4, $3, $2, $1-1900));
+ $msg_ops->report_time(mktime($6, $5, $4, $3, $2-1, $1-1900));
} elsif (/^(success|successful|failure|fail|skip|knownfail|error|xfail|skip-testsuite|testsuite-failure|testsuite-xfail|testsuite-success|testsuite-error): (.*?)( \[)?([ \t]*)\n/) {
$msg_ops->control_msg($_);
my $result = $1;
@@ -170,7 +170,7 @@ sub report_time($)
{
my ($time) = @_;
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time);
- printf "time: %04d-%02d-%02d %02d:%02d:%02dZ\n", $year+1900, $mon, $mday, $hour, $min, $sec;
+ printf "time: %04d-%02d-%02d %02d:%02d:%02dZ\n", $year+1900, $mon+1, $mday, $hour, $min, $sec;
}
# The following are Samba extensions:
--
1.6.0.6
--------------060607080001010206010404
Content-Type: text/plain;
name="0002-selftest-Times-are-local-not-UTC.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="0002-selftest-Times-are-local-not-UTC.patch"
More information about the samba-technical
mailing list