Bug 3053 - strip2.t is flawed ...
Summary: strip2.t is flawed ...
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Regression Tests (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other other
: P2 major
Target Milestone: 2.64
Assignee: Theo Van Dinter
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-16 20:13 UTC by Theo Van Dinter
Modified: 2004-04-24 09:20 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
suggested patch for 2.6x patch None Theo Van Dinter [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Theo Van Dinter 2004-02-16 20:13:02 UTC
I spent a good 2 hours trying to figure out why this test wasn't working...  Come to find out that it 
apparently has never worked, at least in the current incarnation.  Here's what happens right now:

        /usr/bin/perl -T -w ../spamassassin -C log/test_rules_copy  --siteconfigpath log/localrules.tmp 
-p log/test_default.cf  -L -t < data/spam/002 > log/strip2.munged
        /usr/bin/perl -T -w ../spamassassin -C log/test_rules_copy  --siteconfigpath log/localrules.tmp 
-p log/test_default.cf  -d < log/strip2.munged > log/strip2.output
Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin.pm line 906.
Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin.pm line 909.
Use of uninitialized value in pattern match (m//) at ../blib/lib/Mail/SpamAssassin.pm line 912.
Use of uninitialized value in pattern match (m//) at ../blib/lib/Mail/SpamAssassin.pm line 921.
Use of uninitialized value in pattern match (m//) at ../blib/lib/Mail/SpamAssassin.pm line 927.
Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin.pm line 932.
ok 1

The uninitialized value bit is new due to other code I put in ...  That's actually the only reason I noticed 
the problems with the test.

What happens is that the first sarun call tries to create strip2.munged ...  Except that sarun() itself 
redirects to log/<name of test>.<number of test> ...  So strip2.munged becomes a blank file.  The 
second sarun() call tries to strip the markup of a blank message, which results in a blank message.  The 
results are diff'ed and found to be ok (blank == blank), so the test passes.


So we either need to figure out how to get the output another way, we need to use the log/
<testname>.<testnumber> file, or we should have sarun() not redirect if the command we're running 
includes a '>' to redirect the output...
Comment 1 Theo Van Dinter 2004-02-16 21:14:37 UTC
Created attachment 1778 [details]
suggested patch for 2.6x

same as the version applied to HEAD, except 2.6x doesn't have one section of
code that the HEAD patch would modify, so I took that out of this patch.
Comment 2 Theo Van Dinter 2004-02-16 21:16:08 UTC
fix applied to HEAD.  attached patch for 2.6x and resetting milestone to 2.64...
Comment 3 Theo Van Dinter 2004-04-24 17:20:28 UTC
house cleaning, not doing a 2.64 release, so ...