OSDN Git Service

* tests/lha-test.in, tests/lha-test12, tests/lha-test13:
[lha/lha.git] / tests / lha-test11
1 # -*- shell-script -*-
2 message testing the long filename support
3 # long long filename
4 # assume that we are allowed to create 255 bytes filename (not path name).
5 # the _POSIX_PATH_MAX (the maximam length of relative path name) value may
6 # be 255.
7 #
8 # Note that on Cygwin/MinGW, on NTFS, the maximam length of whole path
9 # name (contain the drive letter) is limited probably. it seems to be 259 (?)
10 #
11 mkdir test-tmp1
12 case $(uname) in
13 CYGWIN*)
14   # 190 bytes
15   file=1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 ;;
16 *)
17   # 255 bytes
18   file=123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 ;;
19 esac
20 (cd test-tmp1 && touch $file)
21                                                         check $? $LINENO
22 $lha cg  test-tmp1-hg.lzh test-tmp1 2> test-stderr
23                                                         check $? $LINENO
24 # on Cygwin/MinGW, skip this test.
25 # the length of pathname does not amount to the limit of level 0 header.
26 case $(uname) in
27 CYGWIN*) true ;;
28 *) test -s test-stderr ;;
29 esac
30                                                         check $? $LINENO
31 $lha c0  test-tmp1-h0.lzh test-tmp1 2> test-stderr
32                                                         check $? $LINENO
33 # on Cygwin/MinGW, skip this test.
34 # the length of pathname does not amount to the limit of level 0 header.
35 case $(uname) in
36 CYGWIN*) true ;;
37 *) test -s test-stderr ;;
38 esac
39                                                         check $? $LINENO
40 $lha c1  test-tmp1-h1.lzh test-tmp1
41                                                         check $? $LINENO
42 $lha c2  test-tmp1-h2.lzh test-tmp1
43                                                         check $? $LINENO
44 $lha xw=test-tmp1-hg  test-tmp1-hg.lzh
45                                                         check $? $LINENO
46 $lha xw=test-tmp1-h0  test-tmp1-h0.lzh
47                                                         check $? $LINENO
48 $lha xw=test-tmp1-h1  test-tmp1-h1.lzh
49                                                         check $? $LINENO
50 $lha xw=test-tmp1-h2  test-tmp1-h2.lzh
51                                                         check $? $LINENO
52 # for logging
53 $lha vv test-tmp1-hg.lzh
54                                                         check $? $LINENO
55 $lha vv test-tmp1-h0.lzh
56                                                         check $? $LINENO
57 $lha vv test-tmp1-h1.lzh
58                                                         check $? $LINENO
59 $lha vv test-tmp1-h2.lzh
60                                                         check $? $LINENO
61 $lha vv test-tmp1-hg.lzh | egrep '\[0\].?$'
62                                                         check $? $LINENO
63 $lha vv test-tmp1-h0.lzh | egrep '\[0\].?$'
64                                                         check $? $LINENO
65 $lha vv test-tmp1-h1.lzh | egrep '\[1\].?$'
66                                                         check $? $LINENO
67 $lha vv test-tmp1-h2.lzh | egrep '\[2\].?$'
68                                                         check $? $LINENO
69 test -f test-tmp1-hg/$(echo test-tmp1/$file | cut -c-233)
70                                                         check $? $LINENO
71 test -f test-tmp1-h0/$(echo test-tmp1/$file | cut -c-221)
72                                                         check $? $LINENO
73 test -f test-tmp1-h1/test-tmp1/$file
74                                                         check $? $LINENO
75 test -f test-tmp1-h2/test-tmp1/$file
76                                                         check $? $LINENO
77 # the header size is 0x101 instead of 0x100 on level 2 header
78 file=test-tmp9012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
79 touch $file
80                                                         check $? $LINENO
81 $lha c2 test-tmp4-h2.lzh $file
82                                                         check $? $LINENO
83 $lha vv test-tmp4-h2.lzh
84                                                         check $? $LINENO
85 $lha vv test-tmp4-h2.lzh | egrep '\[2\].?$'
86                                                         check $? $LINENO
87 $lha xw=test-tmp4 test-tmp4-h2.lzh
88                                                         check $? $LINENO
89 test x"`/bin/ls -l test-tmp4-h2.lzh | awk '{print $5}'`" = x258
90                                                         check $? $LINENO
91 test -f test-tmp4/$file
92                                                         check $? $LINENO