OSDN Git Service

*** empty log message ***
[lha/lha.git] / tests / lha-test10
index 4807e8a..94c08f2 100644 (file)
 # -*- shell-script -*-
-message testing header level 0, 1 and 2
+FILENAME=lha-test10
+message testing header level 0, 1, 2 and each generic headers
 $lha c0  test-tmp-h0.lzh test-1
-                                                       check $?
+                                                       check $? $LINENO
 $lha c1  test-tmp-h1.lzh test-1
-                                                       check $?
+                                                       check $? $LINENO
 $lha c2  test-tmp-h2.lzh test-1
-                                                       check $?
+                                                       check $? $LINENO
 $lha xw=test-tmp-h0  test-tmp-h0.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha xw=test-tmp-h1  test-tmp-h1.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha xw=test-tmp-h2  test-tmp-h2.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha vv test-tmp-h0.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha vv test-tmp-h1.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha vv test-tmp-h2.lzh
-                                                       check $?
-$lha vv test-tmp-h0.lzh | grep '\[0\]$'
-                                                       check $?
-$lha vv test-tmp-h1.lzh | grep '\[1\]$'
-                                                       check $?
-$lha vv test-tmp-h2.lzh | grep '\[2\]$'
-                                                       check $?
+                                                       check $? $LINENO
+$lha vv test-tmp-h0.lzh | egrep '\[0\].?$'
+                                                       check $? $LINENO
+$lha vv test-tmp-h1.lzh | egrep '\[1\].?$'
+                                                       check $? $LINENO
+$lha vv test-tmp-h2.lzh | egrep '\[2\].?$'
+                                                       check $? $LINENO
 diff -r test-1 test-tmp-h0/test-1
-                                                       check $?
+                                                       check $? $LINENO
 diff -r test-1 test-tmp-h1/test-1
-                                                       check $?
+                                                       check $? $LINENO
 diff -r test-1 test-tmp-h2/test-1
-                                                       check $?
+                                                       check $? $LINENO
+# contains directory header (-lhd-)
 mkdir test-tmp-d1 &&
 cp test-a test-tmp-d1 &&
 mkdir test-tmp-d1/d2 &&
 cp test-b test-tmp-d1/d2 &&
 mkdir test-tmp-d1/d2/d3 &&
 cp test-c test-tmp-d1/d2/d3 &&
-                                                       check $?
-
+                                                       check $? $LINENO
 $lha c0  test-tmp2-h0.lzh test-tmp-d1
-                                                       check $?
+                                                       check $? $LINENO
 $lha c1  test-tmp2-h1.lzh test-tmp-d1
-                                                       check $?
+                                                       check $? $LINENO
 $lha c2  test-tmp2-h2.lzh test-tmp-d1
-                                                       check $?
+                                                       check $? $LINENO
 $lha xw=test-tmp2-h0  test-tmp2-h0.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha xw=test-tmp2-h1  test-tmp2-h1.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha xw=test-tmp2-h2  test-tmp2-h2.lzh
-                                                       check $?
-# for logging
+                                                       check $? $LINENO
 $lha vv test-tmp2-h0.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha vv test-tmp2-h1.lzh
-                                                       check $?
+                                                       check $? $LINENO
 $lha vv test-tmp2-h2.lzh
-                                                       check $?
-$lha vv test-tmp2-h0.lzh | grep '\[0\]$'
-                                                       check $?
-$lha vv test-tmp2-h1.lzh | grep '\[1\]$'
-                                                       check $?
-$lha vv test-tmp2-h2.lzh | grep '\[2\]$'
-                                                       check $?
+                                                       check $? $LINENO
+$lha vv test-tmp2-h0.lzh | egrep '\[0\].?$'
+                                                       check $? $LINENO
+$lha vv test-tmp2-h1.lzh | egrep '\[1\].?$'
+                                                       check $? $LINENO
+$lha vv test-tmp2-h2.lzh | egrep '\[2\].?$'
+                                                       check $? $LINENO
 diff test-a test-tmp2-h0/test-tmp-d1/test-a
-                                                       check $?
+                                                       check $? $LINENO
 diff test-b test-tmp2-h0/test-tmp-d1/d2/test-b
-                                                       check $?
+                                                       check $? $LINENO
 diff test-c test-tmp2-h0/test-tmp-d1/d2/d3/test-c
-                                                       check $?
+                                                       check $? $LINENO
 diff test-a test-tmp2-h1/test-tmp-d1/test-a
-                                                       check $?
+                                                       check $? $LINENO
 diff test-b test-tmp2-h1/test-tmp-d1/d2/test-b
-                                                       check $?
+                                                       check $? $LINENO
 diff test-c test-tmp2-h1/test-tmp-d1/d2/d3/test-c
-                                                       check $?
+                                                       check $? $LINENO
 diff test-a test-tmp2-h2/test-tmp-d1/test-a
-                                                       check $?
+                                                       check $? $LINENO
 diff test-b test-tmp2-h2/test-tmp-d1/d2/test-b
-                                                       check $?
+                                                       check $? $LINENO
 diff test-c test-tmp2-h2/test-tmp-d1/d2/d3/test-c
-                                                       check $?
-# long long filename
-# assume that we are allowed to create 255 bytes filename (not path name).
-# the _POSIX_PATH_MAX (the maximam length of relative path name) value may
-# be 255.
-#
-# Note that on Cygwin/MinGW, on NTFS, the maximam length of whole path
-# name (contain the drive letter) seems to be 259.
-#
-mkdir test-tmp3
-case $(uname) in
-CYGWIN*)
-  # 200 bytes
-  file=12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 ;;
-*)
-  # 255 bytes
-  file=123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 ;;
-esac
-(cd test-tmp3 && touch $file)
-                                                       check $?
-$lha cg  test-tmp3-hg.lzh test-tmp3 2> test-stderr
-                                                       check $?
-test -s test-stderr
-                                                       check $?
-$lha c0  test-tmp3-h0.lzh test-tmp3 2> test-stderr
-                                                       check $?
-test -s test-stderr
-                                                       check $?
-$lha c1  test-tmp3-h1.lzh test-tmp3
-                                                       check $?
-$lha c2  test-tmp3-h2.lzh test-tmp3
-                                                       check $?
-$lha xw=test-tmp3-hg  test-tmp3-hg.lzh
-                                                       check $?
-$lha xw=test-tmp3-h0  test-tmp3-h0.lzh
-                                                       check $?
-$lha xw=test-tmp3-h1  test-tmp3-h1.lzh
-                                                       check $?
-$lha xw=test-tmp3-h2  test-tmp3-h2.lzh
-                                                       check $?
-# for logging
-$lha vv test-tmp3-hg.lzh
-                                                       check $?
-$lha vv test-tmp3-h0.lzh
-                                                       check $?
-$lha vv test-tmp3-h1.lzh
-                                                       check $?
-$lha vv test-tmp3-h2.lzh
-                                                       check $?
-$lha vv test-tmp3-hg.lzh | grep '\[0\]$'
-                                                       check $?
-$lha vv test-tmp3-h0.lzh | grep '\[0\]$'
-                                                       check $?
-$lha vv test-tmp3-h1.lzh | grep '\[1\]$'
-                                                       check $?
-$lha vv test-tmp3-h2.lzh | grep '\[2\]$'
-                                                       check $?
-test -f test-tmp3-hg/$(echo test-tmp3/$file | cut -c-233)
-                                                       check $?
-test -f test-tmp3-h0/$(echo test-tmp3/$file | cut -c-221)
-                                                       check $?
-test -f test-tmp3-h1/test-tmp3/$file
-                                                       check $?
-test -f test-tmp3-h2/test-tmp3/$file
-                                                       check $?
-# the header size is 0x101 instead of 0x100 on level 2 header
-file=test-tmp9012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
-touch $file
-                                                       check $?
-$lha c2 test-tmp4-h2.lzh $file
-                                                       check $?
-$lha vv test-tmp4-h2.lzh
-                                                       check $?
-$lha vv test-tmp4-h2.lzh | grep '\[2\]$'
-                                                       check $?
-$lha xw=test-tmp4 test-tmp4-h2.lzh
-                                                       check $?
-test x"`/bin/ls -l test-tmp4-h2.lzh | awk '{print $5}'`" = x258
-                                                       check $?
-test -f test-tmp4/$file
-                                                       check $?
+                                                       check $? $LINENO
+
+# generic archive
+
+$lha cg0 test-tmp-hg0.lzh test-1
+                                                       check $? $LINENO
+$lha cg1 test-tmp-hg1.lzh test-1
+                                                       check $? $LINENO
+$lha cg2 test-tmp-hg2.lzh test-1
+                                                       check $? $LINENO
+$lha xw=test-tmp-hg0  test-tmp-hg0.lzh
+                                                       check $? $LINENO
+$lha xw=test-tmp-hg1  test-tmp-hg1.lzh
+                                                       check $? $LINENO
+$lha xw=test-tmp-hg2  test-tmp-hg2.lzh
+                                                       check $? $LINENO
+$lha vv test-tmp-hg0.lzh
+                                                       check $? $LINENO
+$lha vv test-tmp-hg1.lzh
+                                                       check $? $LINENO
+$lha vv test-tmp-hg2.lzh
+                                                       check $? $LINENO
+$lha vv test-tmp-hg0.lzh | egrep '\[0\].?$'
+                                                       check $? $LINENO
+$lha vv test-tmp-hg1.lzh | egrep '\[1\].?$'
+                                                       check $? $LINENO
+$lha vv test-tmp-hg2.lzh | egrep '\[2\].?$'
+                                                       check $? $LINENO
+diff -r test-1 test-tmp-hg0/test-1
+                                                       check $? $LINENO
+diff -r test-1 test-tmp-hg1/test-1
+                                                       check $? $LINENO
+diff -r test-1 test-tmp-hg2/test-1
+                                                       check $? $LINENO
+# contains directory header (-lhd-)
+mkdir test-tmp-gd1 &&
+cp test-a test-tmp-gd1 &&
+mkdir test-tmp-gd1/d2 &&
+cp test-b test-tmp-gd1/d2 &&
+mkdir test-tmp-gd1/d2/d3 &&
+cp test-c test-tmp-gd1/d2/d3 &&
+                                                       check $? $LINENO
+
+$lha cg0 test-tmp2-hg0.lzh test-tmp-gd1
+                                                       check $? $LINENO
+$lha cg1 test-tmp2-hg1.lzh test-tmp-gd1
+                                                       check $? $LINENO
+$lha cg2 test-tmp2-hg2.lzh test-tmp-gd1
+                                                       check $? $LINENO
+$lha xw=test-tmp2-hg0  test-tmp2-hg0.lzh
+                                                       check $? $LINENO
+$lha xw=test-tmp2-hg1  test-tmp2-hg1.lzh
+                                                       check $? $LINENO
+$lha xw=test-tmp2-hg2  test-tmp2-hg2.lzh
+                                                       check $? $LINENO
+$lha vv test-tmp2-hg0.lzh
+                                                       check $? $LINENO
+$lha vv test-tmp2-hg1.lzh
+                                                       check $? $LINENO
+$lha vv test-tmp2-hg2.lzh
+                                                       check $? $LINENO
+$lha vv test-tmp2-hg0.lzh | egrep '\[0\].?$'
+                                                       check $? $LINENO
+$lha vv test-tmp2-hg1.lzh | egrep '\[1\].?$'
+                                                       check $? $LINENO
+$lha vv test-tmp2-hg2.lzh | egrep '\[2\].?$'
+                                                       check $? $LINENO
+diff test-a test-tmp2-hg0/test-tmp-gd1/test-a
+                                                       check $? $LINENO
+diff test-b test-tmp2-hg0/test-tmp-gd1/d2/test-b
+                                                       check $? $LINENO
+diff test-c test-tmp2-hg0/test-tmp-gd1/d2/d3/test-c
+                                                       check $? $LINENO
+diff test-a test-tmp2-hg1/test-tmp-gd1/test-a
+                                                       check $? $LINENO
+diff test-b test-tmp2-hg1/test-tmp-gd1/d2/test-b
+                                                       check $? $LINENO
+diff test-c test-tmp2-hg1/test-tmp-gd1/d2/d3/test-c
+                                                       check $? $LINENO
+diff test-a test-tmp2-hg2/test-tmp-gd1/test-a
+                                                       check $? $LINENO
+diff test-b test-tmp2-hg2/test-tmp-gd1/d2/test-b
+                                                       check $? $LINENO
+diff test-c test-tmp2-hg2/test-tmp-gd1/d2/d3/test-c
+                                                       check $? $LINENO