libarchive / libarchive

Multi-format archive and compression library
http://www.libarchive.org
Other
3.03k stars 768 forks source link

test_option_tnv.stdout.uu is wrong #132

Closed kwrobot closed 9 years ago

kwrobot commented 9 years ago

Original issue 21 created by Google Code user timothy.redaelli on 2009-04-16T10:56:49.000Z:

<b>What steps will reproduce the problem?</b>
1. make check

What is the expected output?
PASS
What do you see instead?
1 of 25 tests reported failures
 Total of 796 assertions checked.
 Total of 1 assertions failed.
 Total of 1 assertions skipped.
FAIL: bsdcpio_test
=====================================
1 of 3 tests failed
Please report to kientzle@freebsd.org
=====================================

<b>What version of the product are you using? On what operating system?</b>
2.6.992a on Linux and FreeBSD

<b>Please provide any additional information below.</b>

See attachment: libarchive-2.6.992a-test_option_t.patch

kwrobot commented 9 years ago

Comment #1 originally posted by kientzle on 2009-04-16T17:21:02.000Z:

What timezone are you in?  <sigh>
kwrobot commented 9 years ago

Comment #2 originally posted by kientzle on 2009-04-16T17:21:44.000Z:

<empty>

kwrobot commented 9 years ago

Comment #3 originally posted by kientzle on 2009-04-16T17:44:10.000Z:

The archive has a timestamp of 1, which is indeed Dec 31, 1969 west of Greenwich but
Jan 1, 1970 east of Greenwich.

< -rw-r--r--   1 1000     1000            0 Dec 31  1969 file
---
> -rw-r--r--   1 1000     1000            0 Jan  1  1970 file

Changing the reference file will just break it in different timezones.
I've disabled this check in r1004 until I can come up with something more robust.
kwrobot commented 9 years ago

Comment #4 originally posted by Google Code user timothy.redaelli on 2009-04-16T18:37:00.000Z:

Why cannot you use TZ=UTC?

See attachment: UTC.patch

kwrobot commented 9 years ago

Comment #5 originally posted by kientzle on 2009-04-16T22:55:05.000Z:

Windows doesn't have /usr/bin/env.
kwrobot commented 9 years ago

Comment #6 originally posted by jsonn on 2009-04-16T22:59:58.000Z:

What about just using setenv()?
kwrobot commented 9 years ago

Comment #7 originally posted by kientzle on 2009-04-17T01:21:50.000Z:

"What about just using setenv()?"

That might work.  Let's try that in trunk and see what happens.  I'd rather not put
this change into 2.7 until we get thorough test coverage of it.
kwrobot commented 9 years ago

Comment #8 originally posted by kientzle on 2009-04-20T18:24:09.000Z:

After thinking about it some, I'm not enthusiastic about setenv():  the code to set
and then restore the TZ value is a little tedious, and I don't want to leave the
timezone set to UTC for every test, since we have seen bugs in the past that only
appeared in certain timezones.

Since we're testing a single line of output that has only two possible values,
I found it easier to just hardcode the two possibilities in the C source.
This should work on all platforms.  Implemented in r1037.