---------- Forwarded message ----------
From: CAI Qian <[email protected]>
Date: Wed, May 13, 2009 at 8:05 PM
Subject: Re: Patch for [LTP] :Unzip01 Test Not Working Correctly
To: [email protected]


From: rohit verma <[email protected]>
Subject: Re: Patch for [LTP] :Unzip01 Test Not Working Correctly
Date: Tue, 12 May 2009 17:10:36 +0530

> Hi Qian,
>
> Yes you are correct. We cannot predict the output order of unzip. So I
> have sorted the
> actual and expected output and attached the updated patch with this mail.
>
> I request you to apply this patch and let me know if any issues.
>
> Regards,
> Rohit
>

Works fine. Please submit to the mailing list.

Acked-by: CAI Qian <[email protected]>

Thanks,
CAI Qian
diff -ruxB ltp-full-20090430_original/testcases/commands/unzip/unzip_tests.sh 
ltp-full-20090430/testcases/commands/unzip/unzip_tests.sh
--- ltp-full-20090430_original/testcases/commands/unzip/unzip_tests.sh  
2009-02-26 18:40:54.000000000 +0530
+++ ltp-full-20090430/testcases/commands/unzip/unzip_tests.sh   2009-05-12 
03:41:50.000000000 +0530
@@ -44,7 +44,7 @@
 chk_ifexists()
 {
        RC=0
-       which $2 > "$LTPTMP/tst_unzip.err" || RC=$?
+       which $2 > "$PWD/tst_unzip.err" || RC=$?
        if [ $? -ne 0 ]
        then
                tst_brkm TBROK NULL "$1: command $2 not found."
@@ -98,8 +98,8 @@
        chk_ifexists INIT awk       || return $RC
 
        # create expected output files. tst_unzip.exp
-       cat > $LTPTMP/tst_unzip.out.exp <<-EOF
-       Archive:  $TMP/tst_unzip_file.zip
+       cat > $PWD/tst_unzip.out.exp <<-EOF
+       Archive:  $1
     creating: tst_unzip.dir/
     creating: tst_unzip.dir/d.0/
     extracting: tst_unzip.dir/d.0/f.0
@@ -140,17 +140,19 @@
 
        tst_resm TINFO "Test #1: unzip command un-compresses a .zip file."
 
-       unzip "${zipfile}" > "$LTPTMP/tst_unzip.out" || RC=$?
+       unzip "${zipfile}" > "$PWD/tst_unzip.out" || RC=$?
        if [ $RC -ne 0 ]
        then
-               tst_res TFAIL "$LTPTMP/tst_unzip.out" \
+               tst_res TFAIL "$PWD/tst_unzip.out" \
                        "Test #1: unzip command failed. Return value = $RC. 
Details:"
                return $RC
        else
-               diff -iwB "$LTPTMP/tst_unzip.out" "$LTPTMP/tst_unzip.out.exp" > 
"$LTPTMP/tst_unzip.out.err" || RC=$?
+               sort -o "$PWD/tst_unzip.out" "$PWD/tst_unzip.out"
+               sort -o "$PWD/tst_unzip.out.exp" "$PWD/tst_unzip.out.exp"
+               diff -iwB "$PWD/tst_unzip.out" "$PWD/tst_unzip.out.exp" > 
"$PWD/tst_unzip.out.err" || RC=$?
                if [ $RC -ne 0 ]
                then
-                       tst_res TFAIL "$LTPTMP/tst_unzip.out.err" \
+                       tst_res TFAIL "$PWD/tst_unzip.out.err" \
                                "Test #1: unzip output differs from expected 
output. Details"
                else
                        tst_resm TINFO "Test #1: check if 
\"$PWD/tst_unzip.dir\" exits."
@@ -180,7 +182,7 @@
 
 RC=0
 stat "$1" || exit $?
-init || exit $?
+init "$1" || exit $?
 
 test01 "$1" || RC=$?
 
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to